Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
For the "Votes for deletion" page. Used to show "close" and "delete". Also, for the show/hide feature, as well as the show/hide all one. By: [[User:KettleMeetPot|KettleMeetPot]]
function closeAppear() { if ( wgPageName == "Emperor Jarjarkine_Wiki:Votes_for_deletion" && $(".discussions").length > 0 && wgAction != "edit" ) { var sAll = 0; var modeAll = 2; $(".discussions.cls-discuss").hide(); $(".show-a").html('<a href="javascript:void(0)">[show]</a>'); $(".hide-a").html('<a href="javascript:void(0)">[hide]</a>'); $(".s-all").html('<a href="javascript:void(0)">show/hide</a>'); $(".mode-all").html('(<a href="javascript:void(0)">all</a>)'); $(".show-a, .hide-a").click(function() { var IDa = $(this).attr("id"); var ClassA = $(this).attr("class").slice(0,6); var ClassB = $(this).attr("class").slice(6); var dID = "d-" + IDa.slice(-IDa.length + 2); if ( IDa.indexOf(".") != -1 || IDa.indexOf(":") != -1) { IDa = IDa.replace(/\./g,"").replace(/:/g,""); $(this).attr("id",IDa); dID = dID.replace(/\./g,"\\.").replace(/:/g,"\\:"); $("#" + dID).attr("id","d-" + IDa.slice(-IDa.length + 2)); dID = "d-" + IDa.slice(-IDa.length + 2); } if ( ClassA == "show-a" ) { $("#" + IDa).html('<a href="javascript:void(0)">[hide]</a>'); $("#" + IDa).attr("class","hide-a" + ClassB); $("#" + dID).show(); } if ( ClassA == "hide-a" ) { $("#" + IDa).html('<a href="javascript:void(0)">[show]</a>'); $("#" + IDa).attr("class","show-a" + ClassB); $("#" + dID).hide(); } }); $(".s-all").click(function() { if ( modeAll == 0 ) { if ( sAll == 0 ) { $(".show-a.open-d").html('<a href="javascript:void(0)">[hide]</a>'); $(".show-a.open-d").attr("class","hide-a open-d"); $(".discussions.o-discuss").show(); sAll = 1; } else if ( sAll == 1 ) { $(".hide-a.open-d").html('<a href="javascript:void(0)">[show]</a>'); $(".hide-a.open-d").attr("class","show-a open-d"); $(".discussions.o-discuss").hide(); sAll = 0; } } if ( modeAll == 1 ) { if ( sAll == 0 ) { $(".show-a.closed-d").html('<a href="javascript:void(0)">[hide]</a>'); $(".show-a.closed-d").attr("class","hide-a closed-d"); $(".discussions.cls-discuss").show(); sAll = 1; } else if ( sAll == 1 ) { $(".hide-a.closed-d").html('<a href="javascript:void(0)">[show]</a>'); $(".hide-a.closed-d").attr("class","show-a closed-d"); $(".discussions.cls-discuss").hide(); sAll = 0; } } if ( modeAll == 2 ) { if ( sAll == 0 ) { $(".show-a").html('<a href="javascript:void(0)">[hide]</a>'); $(".show-a.open-d").attr("class","hide-a open-d"); $(".show-a.closed-d").attr("class","hide-a closed-d"); $(".discussions").show(); sAll = 1; } else if ( sAll == 1 ) { $(".hide-a").html('<a href="javascript:void(0)">[show]</a>'); $(".hide-a.open-d").attr("class","show-a open-d"); $(".hide-a.closed-d").attr("class","show-a closed-d"); $(".discussions").hide(); sAll = 0; } } }); $(".mode-all").click(function() { if ( modeAll == 0 ) { $(".mode-all").html('(<a href="javascript:void(0)">closed</a>)'); modeAll = 1; } else if ( modeAll == 1 ) { $(".mode-all").html('(<a href="javascript:void(0)">all</a>)'); modeAll = 2; } else if ( modeAll == 2 ) { $(".mode-all").html('(<a href="javascript:void(0)">open</a>)'); modeAll = 0; } }); if ( $.inArray("sysop", wgUserGroups) != -1) { $(".Dates").replaceWith(' • <span class="cDelete"><a href="javascript:void(0)">delete</a></span>'); $(".cDiscuss").html('<a href="javascript:void(0)">close</a>'); $(".tool-descriptor").html("Administrator toolbar"); $(".sys-tool").html('<b><a href="javascript:void(0)">archive all</a></b>'); $(".sys-tool").prepend('<span class="close-select"><b><a href="javascript:void(0)">close select</a></b></span> • '); closeApprove = true; archiveClick(); } if ( $(".AJAXRefresh").length > 0 ) { $(".AJAXRefresh").html('<a href="javascript:void(0)">Refresh</a>'); $(".AJAXRefresh").click(function() { $(".archive").html('<div style="text-align:center; padding:8px"><img src="https://images.wikia.nocookie.net/__cb61992/common/skins/common/images/ajax.gif"/></div>'); $.ajax({ type: "GET", url: "http://emperor-jarjarkine.wikia.com/index.php", data: { action:'render', title:'Avatar Wiki:Votes for deletion' }, success: function( data ) { var startChar = data.indexOf('<div class="FRow archive" id="Demarc0">'); var finishChar = data.lastIndexOf('</div>'); var processedData = data.slice(startChar,finishChar); $(".archive").html( processedData ); closeAppear(); closeClick(); } }); }); } } else if ( wgPageName == "Emperor Jarjarkine_Wiki:Votes_for_deletion" ) { $(".AJAXRefresh").html('<a href="javascript:void(0)">Refresh</a>'); $(".AJAXRefresh").click(function() { $(".archive").html('<div style="text-align:center; padding:8px"><img src="https://images.wikia.nocookie.net/__cb61992/common/skins/common/images/ajax.gif"/></div>'); $.ajax({ type: "GET", url: "http://emperor-jarjarkine.wikia.com/index.php", data: { action:'render', title:'Emperor Jarjarkine:Votes for deletion' }, success: function( data ) { var startChar = data.indexOf('<div class="FRow archive" id="Demarc0">'); var finishChar = data.lastIndexOf('</div>'); var processedData = data.slice(startChar,finishChar); $(".archive").html( processedData ); closeAppear(); closeClick(); } }); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteVotes(id, offerid){\n\t\n\t\tbootbox.confirm(__(\"Are you sure you want to delete this vote?\"),__('No'),__('Yes'),function(r){\n\t\n\t\n\t\tif(!r){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tdeleteVote(id, offerid);\n\t\t}\n\t\t\n\t});\n}", "function handlenoteDelete() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n deletenote(currentnote);\n }", "renderDeletedPreface() {\n if (!this.isEditable() || !this.activity.deleted_by) {\n return nothing;\n }\n return html`<div style=\"color: darkred\">[Deleted] (comment hidden for other users)\n </div>`;\n }", "function hiddenButton() {\n\t// detail page\n\tif (selected.length < 1) {\n\t\t$('#deletes').attr(\"style\",\n\t\t\t\t\"pointer-events: none; cursor: default; opacity:0.5; margin-bottom: 10px; width: 100px\");\n\t} else {\n\t\t$('#deletes').attr(\"style\", \"margin-bottom: 10px; width: 100px\");\n\t}\n}", "_onDeleteClicked() {\n $('<p>')\n .text(_`\n This integration will be permanently removed. This cannot\n be undone.\n `)\n .modalBox({\n buttons: [\n $('<button>')\n .text(_`Cancel`),\n $('<button class=\"danger\">')\n .text(_`Delete Integration`)\n .click(() => this.model.destroy({\n beforeSend: xhr => {\n xhr.setRequestHeader(\n 'X-CSRFToken',\n this.model.collection.options.csrfToken);\n },\n })),\n ],\n title: _`Are you sure you want to delete this integration?`,\n });\n }", "function closeDelete() {\n results.style.display = \"none\";\n}", "function showVotes() {\r\n var coverFlagItems = document.getElementsByClassName(\"coverflagitem\");\r\n for (var k=0; k<coverFlagItems.length; k++) {\r\n coverFlagItems[k].style.display = 'table';\r\n }\r\n localStorage.LThideVoted = toggleVoted = \"show\";\r\n setToggle();\r\n}", "function hideVotes(reset) {\r\n var publicVotes = document.querySelectorAll(\".publicvotes a\");\r\n for (var j=0; j<publicVotes.length; j++) {\r\n var pv = publicVotes[j];\r\n if (pv.href == userlink) {\r\n while (pv = pv.parentNode) {\r\n if ((\" \" + pv.className + \" \").indexOf(\" coverflagitem \") > -1) {\r\n pv.style.display = 'none';\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (reset) {\r\n localStorage.LThideVoted = toggleVoted = \"hide\";\r\n setToggle();\r\n }\r\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 }", "function closeClick() {\n if ( wgPageName == \"Emperor Jarjarkine_Wiki:Votes_for_deletion\" && closeApprove == true) {\n $(\".cDiscuss\").click(function() {\n var ID = $(this).attr(\"id\").replace(/_/g,\" \");\n globalID = $(this).attr(\"id\");\n demarcationID = $(\".FRow:last\").attr(\"id\");\n $.ajax({\n type: \"POST\",\n url: \"http://emperor-jarjarkine.wikia.com/api.php\",\n data: { action:'query', prop:'revisions', titles:'Emperor Jarjarkine_Wiki:Votes_for_deletion', rvprop:'content' },\n success: function (data) {\n var fsplit = data.split(\"{{Discussion navigation}}\");\n var secsplit = fsplit[1].split(\"&amp;lt;/dpl&amp;gt;\");\n var content = secsplit[0].replace(/&amp;lt;/g,\"<\").replace(/&amp;quot;/g,'\"').replace(/&amp;gt;/g,\">\").replace(/&amp;amp;/g,\"&\").replace(/<a href=\\\"/g,\"\").replace(/\\\">http:\\/\\/emperor-jarjarkine.wikia.com\\/wiki\\/.*<\\/a>/g,\"\");\n var Sliced = content.split(\"<!-- Demarcation: Do NOT remove this notice -->\");\n var demarcation = parseInt(demarcationID.slice(6),10) + 1;\n var edittoken = mw.user.tokens.get( 'editToken' );\n var consensus;\n importArticles({\n type: \"style\",\n article: \"MediaWiki:Communitydiscussionpages.css\"\n });\n $('<div id=\"dialog-confirm\" title=\"Measure of consensus\">What was the outcome of the discussion?</div>').appendTo('body');\n mw.loader.using( ['jquery.ui.dialog', 'jquery.ui.core', 'jquery.ui.position', 'jquery.ui.button', 'jquery.ui.widget'], function () {\n if ( $.attrFn ) { $.attrFn.text = true; }\n $(\"#dialog-confirm\").dialog({\n resizable: false,\n draggable: false,\n height: \"auto\",\n closeOnEscape: true,\n modal: true,\n buttons: [ {\n text:\"Keep\", \n click: function () {\n consensus = \"Page kept.\";\n $(this).dialog(\"close\");\n } },\n {\n text:\"Merge\",\n id:\"merge-button\",\n click: function () {\n $(\"#merge-button\").prop(\"disabled\", true);\n $(\"#dialog-confirm\").html(\"What was the outcome of the discussion?<br><br>\")\n $('<div id=\"dialog-input\" style=\"width: auto; height: auto;\">Merge into: <input type=\"text\" name=\"title\" id=\"pagename-input\" placeholder=\"fullpagename\" style=\"width:40%; margin-right:8px\"><button type=\"button\" class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\" role=\"button\" aria-disabled=\"false\" id=\"Ok-widget-button\" style=\"margin-bottom:4px\"><span class=\"ui-button-text\">Ok</span></button></div>').appendTo(\"#dialog-confirm\");\n $(\"#Ok-widget-button\").click(function() {\n boxInput = $(\"#pagename-input\").val();\n consensus = \"Page will be merged with [[\" + boxInput + \"]].\";\n $(\"#dialog-confirm\").dialog(\"close\");\n });\n } },\n {\n text:\"Delete\", click: function () {\n consensus = \"Page deleted.\";\n $(this).dialog(\"close\");\n } },\n ],\n close: function(event, ui) {\n content = \"{{Discussion navigation}}\" + Sliced[0] + \"| T\" + demarcation + \" = \" + ID + \" |\\n{{Discussion Closed|\" + consensus + \"}}\\n{{subst:Emperor Jarjarkine_Wiki:Votes for deletion/\" + ID + \"}}\" + \"\\n<!-- Demarcation: Do NOT remove this notice -->\" + Sliced[1] + \"</dpl>\";\n $.ajax({\n type: \"POST\",\n url: \"http://emperor-jarjarkine.wikia.com/api.php\",\n data: { action:'edit', title:'Emperor Jarjarkine_Wiki:Votes_for_deletion', text: content, summary:'Archiving discussion.', token: edittoken },\n });\n $.ajax({\n type: \"POST\",\n url: \"http://emperor-jarjarkine.wikia.com/api.php\",\n data: { action:'delete', title:'Emperor Jarjarkine_Wiki:Votes_for_deletion/' + globalID, reason:'Closing discussion.', token: edittoken },\n });\n window.location.reload();\n }\n });\n });\n }\n });\n });\n $(\".cDelete\").click(function() {\n var ID = $(this).parent().children(\".cDiscuss\").attr(\"id\");\n window.open(\"http://emperor-jarjarkine.wikia.com/wiki/Emperor Jarjarkine_Wiki:Votes_for_deletion/\" + ID +\"?action=delete&wpReason=Deleting%20irrelevant%20discussion\");\n });\n }\n}", "function showDeleteDiv() {\n\tshowActionDiv('delete');\n}", "function hideDeletedItems() {\n var parent = document.getElementById(TODOS_DELETED_ID);\n if (parent.style.display === 'none') {\n parent.style.display = 'block';\n } else {\n parent.style.display = 'none';\n }\n}", "_onShowDeletedClicked(e) {\n e.preventDefault();\n e.stopPropagation();\n\n /*\n * Replace the current contents (\"This file was deleted ... \") with a\n * spinner. This will be automatically replaced with the file contents\n * once loaded from the server.\n */\n $(e.target).parent()\n .html('<span class=\"djblets-o-spinner\"></span>');\n\n this.trigger('showDeletedClicked');\n }", "watch_delete_button ( ) {\n let _that = this;\n $('[class$=\"deletePost\"]').click(function(){\n let user = $( $(this).attr('class').split('-') )\n window.setTimeout(function(){\n pb.window.dialog('pre-delete-warn', {\n title: 'The Pentawarn',\n html: 'Make please make sure you delete this post from the users profile page as well.<br><br><div id=\"thepentashelf\"></div>',\n buttons: [\n {\n text: \"Ok\",\n click: function(){\n $(this).dialog('close');\n }\n }\n ]\n })\n }, 500);\n });\n }", "function confirmDeletion(){\n vex.dialog.open({\n message: \"Comment Has Been Deleted\",\n buttons:[\n $.extend({},vex.dialog.buttons.Yes,{text: \"OK\"})\n ],\n callback: function (data) {\n $(location).attr(\"href\", \"/\"); \n }\n });\n }", "function hideDelete(e) {\n let myTarget = e.target.parentElement.parentElement.parentElement;\n let deleteOption = myTarget.querySelector('.notes-list-item-delete');\n deleteOption.style.display = 'none';\n}", "function deleteVM(val) {\n var toDelete = \"#vm-\" + val; // id-tag of to-be-deleted VM card\n $(\".tooltip\").tooltip(\"hide\");\n $(toDelete).remove();\n setBottomline();\n}", "function deleteAnswer(deleteButton) {\n $(deleteButton).closest(\"span\").closest(\"div\").closest(\"span\").remove();\n\n if (newCommandIsOpen) {\n setCommitButton(true);\n } else {\n checkCommandInEditMode();\n setCommitButton(false);\n }\n}", "function hideDeleteButtons(){\n $('li').find('.delmark').hide();\n }", "function showVoted(candName, pref, postid){\n $(\"#post\"+postid+\" #heading\").html(\"Preferences : <a href='#' onclick='reloadPost(\"+postid+\"); return false;' class='badge badge-danger badge-pill'>Reset Preferences</a>\");\n $(\"#post\"+postid+\" .list-group\").append(\"<li id='pref\"+pref+\"' class='list-group-item'>\"+pref+\") \"+candName+\"</li>\");\n}", "function show_delete_node(annotation) {\n modal_obj = annotation;\n\n $(\"#delete-modal-body\").html(\"アノテーション : <span style=\\\"color:red\\\">\" + annotation.hypothesis_text + \"</span>&nbspを削除しますか?\");\n $('#delete-node').modal();\n}", "function doDelete(item_id) {\n document.getElementById(\"post\" + item_id).style.display = \"none\";\n closeDelete();\n document.getElementById(item_id).classList.remove(\"trash\");\n}", "function promptDelete(id) {\n\n if (confirm(\"Are you sure you want to delete this DVD from your collection?\")) {\n\n $.ajax({\n type: 'DELETE',\n url: 'http://localhost:8080/dvd/' + id,\n });\n $(`#row${id}`).hide();\n };\n}", "resetDeleteButtons() {\n const buttonsDelete = this.elements.content.getElementsByClassName('button-delete');\n\n buttonsDelete.forEach((e) => {\n e.style.display = 'block';\n });\n\n const buttonsReallyDelete = this.elements.content.getElementsByClassName('button-really-delete');\n\n buttonsReallyDelete.forEach((e) => {\n e.style.display = 'none';\n });\n }", "function viewsEvents()\n { $('#tree .b-delete-view').attr('title', T('DELETE_VIEW'));\n }", "function trashOption() {\n let posts = document.getElementsByClassName(\"trash\");\n let delButton = document.getElementById(\"delete\");\n let change = \"none\";\n if (delButton.textContent == \"Delete one of your Posts\") {\n delButton.textContent = \"Go back to Posting Mode\";\n change = \"block\";\n document.getElementById(\"add\").disabled = true;\n document.getElementById(\"upload\").disabled = true;\n }\n else {\n delButton.textContent = \"Delete one of your Posts\";\n document.getElementById(\"add\").disabled = false;\n document.getElementById(\"upload\").disabled = false;\n }\n for (let i = 0; i < posts.length; i++) {\n posts.item(i).style.display = change;\n }\n}", "function makeDeleteable(){\n\t\t$('.badge-remove').click(function(){\n\t\t\t$('#delete-modal-page').html($(this).parent().text());\n\t\t\t$('#delete-modal').modal('show');\n\t\t\t$('#delete-modal').data( \"dps-wall-id\", $(this).parent().data('dps-wall-id') );\n\t\t});\n\t}", "function deleteTubeDialog(tubeId) {\n var element = $('#delete_tube_' + tubeId);\n element.prev().addClass('hidden');\n element.removeClass('hidden');\n}", "function confirmDelete(){\r\n\t\tvar links = find(\"//img[contains(@src, 'del.gif')]\", XPList);\r\n\t\tfor (var i = 0; i < links.snapshotLength; i++){\r\n\t\t\tlinks.snapshotItem(i).setAttribute('onClick', 'javascript:return confirm(\"' + T('SEGURO') + '\");');\r\n\t\t}\r\n\t}", "function confirmVotes(){\n $(\"#confirmVotes .modal-body\").html(\"\");\n allPosts.forEach(function(post, ind, all){\n var pname = post[\"PostName\"];\n var pid = parseInt(post[\"PostID\"]);\n var noOfCandidatesVotedFor = votesCandidateNames[pid] && votesCandidateNames[pid]!=0 ? votesCandidateNames[pid].length-1 : 0;\n if(pid>10 && noOfCandidatesVotedFor<Math.min(3, numCandsPerPost[post.PostID])){\n $(\"#badVotes\").modal('show');\n return;\n }\n $(\"#confirmVotes .modal-body\").append(\"<dl id='votes\"+pid+\"'><dt>\"+pname+\"</dt></dl>\");\n if(votesCandidateNames[pid]==undefined || votesCandidateNames[pid].length==0){\n $(\"#votes\"+pid).append(\"<dd>NOTA</dd>\");\n }else{\n votesCandidateNames[pid].forEach(function(cand, indC, allC){\n $(\"#votes\"+pid).append(\"<dd>\"+indC+\") \"+cand+\"</dd>\");\n });\n }\n if(ind==all.length-1) $(\"#confirmVotes\").modal('show');\n });\n}", "static get DELETE() {\n return \"mg_delete_selected_page\";\n }", "function confirmDelete(uniqueId, isDeleteClicked) {\n var deleteSpan = 'deleteSpan_' + uniqueId;\n var confirmDeleteSpan = 'confirmDeleteSpan_' + uniqueId;\n\n if (isDeleteClicked) {\n $('#' + deleteSpan).hide();\n $('#' + confirmDeleteSpan).show();\n\n }\n else {\n $('#' + deleteSpan).show();\n $('#' + confirmDeleteSpan).hide();\n }\n}", "function confirmDelete(uniqueId, isDeleteClicked) {\n var deleteSpan = 'deleteSpan_' + uniqueId;\n var confirmDeleteSpan = 'confirmDeleteSpan_' + uniqueId;\n\n if (isDeleteClicked) {\n $('#' + deleteSpan).hide();\n $('#' + confirmDeleteSpan).show();\n } else {\n $('#' + deleteSpan).show();\n $('#' + confirmDeleteSpan).hide();\n }\n}", "function DeleteAnswer(id, idq, type) {\n $('#answer_' + id).remove();\n $('#hid_' + id).val(type);\n if (type === 1) {\n document.getElementById('sp_' + idq).style.display = \"inline-block\";\n document.getElementById('taga_' + idq).style.display = \"inline-block\";\n }\n}", "function deleteUsed (){\n\tif(Questions.length > 0) {\n\t\tQuestions.splice(Questions.indexOf(question),1);\n\t} else {\n\t\tdocument.getElementById('answerT').style.display=\"none\";\n\t\tdocument.getElementById('answerF').style.display=\"none\";\n\t\tdocument.getElementById('questions').style.display=\"none\";\n\t\tdocument.getElementById('looser').style.display=\"\";\n\t\tdocument.getElementById('reset').style.display=\"\";\n\t}\n}", "function promptDelete() {\n $('#teams').on('click', '.delete', function showdelete() {\n const teamid = $(this).attr('data-id');\n if ($(`.${teamid}`).is(':visible')) {\n $(`.${teamid}`).addClass('hidden');\n } else {\n $(`.${teamid}`).removeClass('hidden'); // make if statement to turn off here\n }\n });\n}", "function DeleteFromDialogOpen(){\n\t\n\tvar dlg = document.querySelector('div[jscontroller=\"N5Lqpc\"]');\n\tif(!dlg) { return; }\n\tvar btns = dlg.querySelectorAll('div[role=\"button\"]');\n\tfor(i=0; i<btns.length;i++){\n\n\t\tif (btns[i].textContent == \"Delete\") {\n\t\t\tbtns[i].click();\n\t\t\twait_time = _DEFAULT_WAIT_TIME;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function view_note_button(c_id, q_id){\n $(\".alert-notice\").hide();\n $('.view_comment_class').hide();\n $('.edit_comment_class').hide();\n $('.archive_comment_class').hide();\n $('#lastet_comment_div_'+ q_id).hide();\n $('#edit_comment_div_'+ c_id).hide();\n $('#archive_comment_div_'+ c_id).hide();\n $('#add_comment_block_div_'+ q_id).hide();\n $('#view_comment_div_'+ c_id).show();\n $('#add_comment_button_top_div_'+ q_id).show();\n}", "function handleDelete() {\n setDialogDelete(true);\n setDialog(false);\n }", "function deleteVersion(versionId) {\n $('#version-delete-' + versionId).removeClass('hidden');\n $('#version-info-' + versionId).addClass('hidden');\n}", "function cancelDeleteVersion(versionId) {\n $('#version-delete-' + versionId).addClass('hidden');\n $('#version-info-' + versionId).removeClass('hidden');\n}", "function note_delete()\n {\n // grab the .data element of note to delete\n var axe_it = $(this).data(\"_id\");\n $.ajax(\n {\n url: \"/api/notes/\" + axe_it,\n method: \"DELETE\"\n }).then(function()\n {\n // on success, hide the modal\n bootbox.hideAll();\n });\n }", "displayDeleteAll() {\n const deleteAllBtn = document.querySelector('.deleteAll');\n // add button if guest array bigger than zero and no deleteAllButton\n if (party.guests.length && !deleteAllBtn) {\n const tableContainer = document.querySelector('#tableContainer');\n tableContainer.appendChild(this.createDeleteButton());\n // remove button if guest array zero and deleteAllButton exists\n } else if (!party.guests.length && deleteAllBtn) {\n deleteAllBtn.remove();\n }\n }", "function showDelete(e) {\n let deleteOption = e.target.parentElement.parentElement.querySelector('.notes-list-item-delete');\n let myTarget = e.target.parentElement.parentElement; \n\n \n // make sure clicking the icon\n if (myTarget.classList.contains('notes-list-item')) {\n let deleteOption = myTarget.querySelector('.notes-list-item-delete');\n deleteOption.style.display = 'flex';\n\n // yes and no option\n let yesOption = myTarget.querySelector('.notes-list-item-delete-yes');\n let noOption = myTarget.querySelector('.notes-list-item-delete-no');\n \n // option event listeners\n noOption.addEventListener('click', hideDelete);\n yesOption.addEventListener('click', deleteListItem);\n }\n}", "function deleted() {\n operatorCount = 0;\n operand = false;\n $('.equation').show();\n if (del == false) {\n $('.equation').html('');\n $('.result').html('');\n $('.delete').find('span').text('DEL');\n del = true;\n }\n else {\n var text = $('.equation').html().split('');\n text.pop();\n $('.equation').html('').append(text);\n if (text.length == 0) {\n $('.result').text('');\n }\n operand=true;\n evaluateExpression();\n }\n\n $('.result').css('font-size', 'medium');\n }", "function deleteItem() {\n SidebarActions.deleteItem('Content', $scope.data.thisContent);\n}", "function confirmDeletionModal(ne) {\n\t$.modal(\"<div id='modalConfirmNEDelectionDialog' class='rembrandt-modal' style='height:100px;width:300px;'>\"+\n \"<div class='rembrandt-modal-escape'>\"+i18n['pressescape'][lang]+\"</div>\"+\n\t \"<div style='text-align:center; padding:10px;'>\"+i18n['areyousuredeleteNE'][lang]+\"'\"+\n\t\t\"<div id='NEterms' style='display:inline; font-weight:bold;'></div>', \"+i18n['withclass'][lang]+\" \"+\n\t\t\"<div id='NEclass' style='display:inline; font-weight:italic;'></div> ?</div>\"+\n\t \"<div style='text-align:center;'\"+\n\t\t\"<form><input type='button' id='YesButton' value='\"+i18n[\"yes\"][lang]+', '+i18n[\"delete\"][lang]+\"'>\"+\n\t\t\t\"<input type='button' id='NoButton' value='\"+i18n[\"no\"][lang]+\", \"+i18n[\"keep\"][lang]+\"'>\"+\n\t\t\"</form>\"+\n \"</div>\"+\n\t\"</div>\",{\n\tonShow: function (dialog) {\n\t\t// get all terms (ie, li entities with t attribute) to show\n\t\tdialog.data.find(\"#NEterms\").append(getTermsFromNE(ne));\t\n\t\tdialog.data.find(\"#NEclass\").append(getClassificationsFromNE(ne));\t\n\t\t\t// Yes button clicked\n\t\tdialog.data.find(\"#YesButton\").click(function(ev) {\n\t\t\tev.preventDefault();\n\t\t\t$.modal.close();\n\t\t\t// first, remove the NE tag_edit \n\t\t\tdestroyNE(ne)\n \t\t});\n\t\tdialog.data.find(\"#NoButton\").click(function(ev) {\n\t\t\tev.preventDefault();\n\t\t\t$.modal.close();\n \t\t})\n\t},\n\toverlayCss:{backgroundColor: '#888', cursor: 'wait'}\n//\tcontainerCss: {height:parseInt($(\"#modalConfirmNEDelectionDialog\").css('height'))+6, \n//\t\twidth:parseInt($(\"#modalConfirmNEDelectionDialog\").css('width'))+6\t}\n\t});\n}", "function delete_all() {\r\n\t$('#drag_resize').css({\"display\":\"none\"});\r\n\t$('.note').css({\"display\":\"none\"});\r\n}", "function deleteNode(e, object) {\n swal({\n title: \"確定要刪除?\",\n type: \"warning\",\n showCancelButton: true,\n cancelButtonText: \"取消\",\n confirmButtonClass: \"btn-danger\",\n confirmButtonText: \"確定\",\n closeOnConfirm: true\n },\n\n function (isConfirm) {\n if (isConfirm) {\n var currentObjectKey = object.part.data.key;\n var currentObjectCategory = object.part.data.category\n\n if (currentObjectCategory === \"CareMale\" || currentObjectCategory === \"CareFemale\" || currentObjectCategory === \"FreehandDrawing\" || currentObjectCategory === \"CommentBox\") {\n mainDiagram.commandHandler.deleteSelection();\n commentBoxKey = -1;\n return\n }\n\n var newNode;\n //delete parentTree's Node\n var previousNode = searchParentTreeNodePreviousNode(globalLogicData.parentTree, currentObjectKey)\n if (previousNode != null) {\n previousNode.left = null;\n previousNode.right = null;\n reRender(previousNode.id);\n return;\n }\n\n // delete node on childrenList\n var currentNodeArrayData = searchNodeCurrentArray(globalLogicData.childrenList, currentObjectKey);\n var NodeCurrentIndex = currentNodeArrayData.index;\n var NodeCurrentchildrenList = currentNodeArrayData.childrenList;\n if (NodeCurrentchildrenList[NodeCurrentIndex].parentTree) {\n var mainNodePosition = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.linkNode\n // check weather the node that want to be deleted is child or partner, if it is not partner delete the node, else delete the partner\n if ((mainNodePosition === \"left\" && NodeCurrentchildrenList[NodeCurrentIndex].parentTree.left.id === currentObjectKey) ||\n (mainNodePosition === \"right\" && NodeCurrentchildrenList[NodeCurrentIndex].parentTree.right.id === currentObjectKey)) {\n\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n reRender(currentObjectKey);\n return;\n } else if (mainNodePosition === \"left\") {\n newNode = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.left;\n } else if (mainNodePosition === \"right\") {\n newNode = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.right;\n }\n\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 0, newNode);\n reRender(currentObjectKey);\n return;\n } else {\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n reRender(currentObjectKey);\n return;\n }\n } else {\n return false;\n }\n }\n );\n}", "function tag_delete_confirm(response){\n\ttag_id = JSON.parse(response);//deserialise the data rturned from the view\n\tif (tag_id > 0) {\n\t\tconsole.log(\"we get the id\")\n\t\t$('#tag_' + tag_id).remove();\n\t\t$('#tag_button_' + tag_id).remove();\n\t}\n}", "function showRecentlyDeleted(){\r\n todos.classList.add(\"remove\");\r\n sideBar.classList.remove(\"openSidebar\");\r\n deleteCont.classList.add(\"pop\")\r\n completedCont.classList.remove(\"pop\");\r\n QuotesText.classList.remove(\"pop\");\r\n errorMsg.classList.remove(\"errorPop\");\r\n\r\n if(deleteCont.children.length > 1){\r\n const notDeleted = document.querySelector(\".notDeleted\");\r\n notDeleted.classList.add(\"remove\");\r\n }\r\n \r\n\r\n}", "delete(post) {\n if (confirm('Are you sure?')) {\n this.sendAction('destroyPost', post);\n }\n }", "function ocultarBotones(id) {\n $('#titleDonant').text('Informació donant');\n $('.btn-donant').hide();\n $('#' + id + 'Delete').show();\n}", "function handleReviewDelete() {\n var currentReview = $(this)\n .parent()\n .parent()\n .data(\"review\");\n deletePost(currentReview.id);\n }", "function hideDeleteFilm() {\n\t$(\"#delete-film-result\").empty();\n\t$(\"#delete-film-success\").empty();\n\t$(\"#delete-film-boxes\").toggle(\"slow\");\n}", "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"review\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/reviews/\" + id\n }).then(getReviews);\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 handleDeleteQuiz() {\n\t/* finds out the quiz name by traversing DOM tree */\n\tvar deletedQuizName = $(this).siblings().html();\n\tconsole.log(deletedQuizName);\n\n\t/* finds the to be deleted quiz index */\n\tvar deletedQuizIdx = getIndexQuiz(deletedQuizName);\n\n\t/* gets the number of quizes */\n\tvar nbrQuizes = getNumberOfQuizes();\n\n\t/* marks the quiz as deleted */\n\tlocalStorage.removeItem(\"quiz\" + deletedQuizIdx);\n\n\t/* for each checkbox, makes it invisible again */\n\tfor (i = 1; i < (nbrQuizes + 1); i++) {\n\t\tif (!isDeletedQuiz(i))\n\t\t\tsetDeleteQuizBoxesVisibility(\"false\");\n\t}\n\n\t/* automatically reloads the page */\n\tlocation.reload();\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 okToDelete(tagIds)\n {\n var title;\n var msg;\n var deleteBtn;\n var cancelBtn;\n var suppress;\n\n if (BookmarkTags.Util.prefs.getBoolPref(\"warnOnTagDelete\"))\n {\n let str= BookmarkTags.Util.getStrings(\"commands.properties\");\n\n let tagNames= tagIds.map(function (tid)\n {\n return BookmarkTags.Util.bmServ.getItemTitle(tid);\n });\n\n if (tagIds.length <= 1)\n {\n title= str.GetStringFromName(\"deleteTagWarning.titleSingle\");\n msg= str.GetStringFromName(\"deleteTagWarning.messageSingle\");\n deleteBtn=\n str.GetStringFromName(\n \"deleteTagWarning.deleteSingleButtonLabel\");\n }\n else\n {\n title= str.GetStringFromName(\"deleteTagWarning.titleMultiple\");\n msg= str.GetStringFromName(\"deleteTagWarning.messageMultiple\");\n deleteBtn=\n str.GetStringFromName(\n \"deleteTagWarning.deleteMultipleButtonLabel\");\n }\n\n msg= msg.replace(\"**TAG**\", tagNames.join(\", \"));\n cancelBtn=\n str.GetStringFromName(\"deleteTagWarning.cancelButtonLabel\");\n suppress= str.GetStringFromName(\"deleteTagWarning.suppressLabel\");\n\n let checkState= { value: false };\n let buttonFlags=\n Components.interfaces.nsIPromptService.BUTTON_TITLE_IS_STRING *\n (Components.interfaces.nsIPromptService.BUTTON_POS_0 +\n Components.interfaces.nsIPromptService.BUTTON_POS_1);\n let buttonPress=\n Components.classes[\"@mozilla.org/embedcomp/prompt-service;1\"].\n getService(Components.interfaces.nsIPromptService).\n confirmEx(null, title, msg, buttonFlags, deleteBtn, cancelBtn,\n null, suppress, checkState);\n\n if (buttonPress === 0)\n {\n if (checkState.value)\n {\n BookmarkTags.Util.prefs.setBoolPref(\n \"warnOnTagDelete\", false);\n }\n return true;\n }\n return false;\n }\n return true;\n }", "delete() {\n $(`comment-${this.config['id']}`).remove();\n }", "function deleteButtonClick(){\n\t\tdisplayNotes();\n\t\tvar h = prompt(\"Wich one you want to delete? Example: 1, 2, 3\");\n\t\tstorage.splice(0,1);\n\t\t\n\t\tdisplayNotes();\t\n\t}", "function deleteVisibilityToggle() {\n var content = document.getElementById(DELETE_TODO_ID);\n if(content.style.display == 'none')\n content.style.display = 'block';\n else\n content.style.display = 'none';\n}", "function clear_voting() {\n initialize_spreadsheet();\n SetupResultsSheet();\n SetupFilteredVotesSheet();\n clear_rounds();\n clear_vote_highlights();\n}", "function closeTagsDisplay() {\n popParamFromURL('tag');\n popParamFromURL('category');\n savedNavURL = false;\n document.getElementById('tags').style.display = 'none';\n document.getElementById('close_tags').style.display = 'none';\n displayTen();\n}", "@action closeDeletingCategoryDialog() {\n this.isDeletingCategory = false;\n this.deletingCategoryData = {\n name: '',\n id: null,\n };\n }", "'click .js-video-delete-button'( e, t ){\n e.preventDefault();\n let cur = $( '#cb-current' ).val()\n , page_no = t.page.get()\n , idx = P.indexOf( cur );\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\nconsole.log( pp.find({}).fetch() );\n P.print();\n $('#fb-template').css( 'border', '' );\n $( '#fb-template iframe' ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-video-toolbar' ).hide();\n//---------------------------------------------------------\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 editAllTags(){\n var counter = 0\n $('#all-tags-button').on('click', function(e){\n if(counter == 0){\n $('.tags').show();\n $('.del').show()\n counter = 1\n }else{\n $('.tags').hide();\n $('.del').hide();\n counter = 0\n };\n })\n}", "showModalDeleteSelected() {\n this.template.querySelector('.modal-selected-delete').show();\n }", "function subtaskWasDeleted(data) {\n s.header.siblings('.container').html(data.partial);\n }", "function hideRecommended() {\n $('.recommended-products .browse, .recommended-products .indicator').detach();\n}", "function confirmDelete() {\n\tconfirm('Are you sure you want to delete this post?');\n}", "function handleDeleteButtons() {\n $('button[data-action=\"delete\"]').click(function () {\n const target = this.dataset.target;\n $(target).remove();\n });\n}", "get deleted() {\n return (this.delInfo & DEL_SIDE) > 0;\n }", "function deleteComment($objComment){\n\n var selectorstring = $objComment.attr(\"name\").split(\"rlc-id-LiveUpdate_\")[1];\n\n var $liveupdateEl = $('a[href$=\"'+selectorstring+'\"]').parent();\n\n if ($liveupdateEl.has(\".buttonrow\").length>0){\n\n var $button = $liveupdateEl.find(\".delete\").find(\"button\");\n $button.click();\n\n var $button2 = $liveupdateEl.find(\".delete\").find(\".yes\");\n $button2.click();\n }\n }", "function postDelete(response) {\n\tif (response == \"OK\") {\n\t\t$(\"h3#h\" + $(\"#expiddel\").val()).remove();\n\t\t$(\"div#h\" + $(\"#expiddel\").val()).remove();\n\t\t$(\"#dialog\").dialog('close');\n\t} else\n\t\talert(\"Action failed\");\n}", "function handleDeleteButtons() {\n $('a[data-action=\"delete\"]').click(function (event) {\n event.preventDefault();\n const target = this.dataset.target;\n $(target).remove();\n })\n}", "function deleteQuote() {\n deleteBtn.parentElement.remove();\n showFav();\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 }", "function votedown(){\n unsafeWindow.vote(getItem(\"voteDown\"));\n}", "function showDeleteButton() {\n if (deleteButton.classList.contains('invisible')) {\n deleteButton.classList.remove('invisible');\n }\n}", "function initDelete() {\n\t\t\t$list.find('[aria-click=\"delete\"]').on('click', function () {\n\t\t\t\tvar $item = $(this).closest('.item');\n\n\t\t\t\tpopupPrompt({\n\t\t\t\t\ttitle: _t.form.confirm_title,\n\t\t\t\t\tcontent: _t.investor.view.manager.delete_confirm,\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tbuttons: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: _t.form.yes,\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\thandle: function () {\n\t\t\t\t\t\t\t\ttoggleLoadStatus(true);\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\turl: '/investors/delete/' + $item.data('value'),\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\tcontentType: 'JSON'\n\t\t\t\t\t\t\t\t}).always(function () {\n\t\t\t\t\t\t\t\t\ttoggleLoadStatus(false);\n\t\t\t\t\t\t\t\t}).done(function (data) {\n\t\t\t\t\t\t\t\t\tif (data.status == 0) {\n\t\t\t\t\t\t\t\t\t\t$item.parent().remove();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tpopupPrompt({\n\t\t\t\t\t\t\t\t\t\t\ttitle: _t.form.error_title,\n\t\t\t\t\t\t\t\t\t\t\tcontent: _t.form.error_content,\n\t\t\t\t\t\t\t\t\t\t\ttype: 'danger'\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}).fail(function () {\n\t\t\t\t\t\t\t\t\tpopupPrompt({\n\t\t\t\t\t\t\t\t\t\ttitle: _t.form.error_title,\n\t\t\t\t\t\t\t\t\t\tcontent: _t.form.error_content,\n\t\t\t\t\t\t\t\t\t\ttype: 'danger'\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: _t.form.no\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}", "function feedback(index) {\n document.getElementById('vote-feedback' + index).style.display = 'none';\n document.getElementById('tak-feedback' + index).style.display = 'block';\n}", "function deleteSession(index){\n \n\t$('#delete-modal')\n\t\t.modal({\n\t\t\tonApprove : function() {\n\t\t\t\tdeleteSessionAndChildren(index);\n\t\t\t}\n\t\t})\n\t\t.modal('show')\n\t;\n}", "function closeDelete() {\n document.getElementById(\"deleteForm\").style.display = \"none\";\n}", "function discussionWasDeleted(data) {\n $('.header').siblings('.container').html(data.partial);\n }", "function hide(clickedDelete) {\n if (isOpen()) {\n $descriptionTextBox.blur(); // Force the blur event before the ContextMenu close event.\n svl.tracker.push('ContextMenu_Close');\n }\n\n $menuWindow.css('visibility', 'hidden');\n $connector.css('visibility', 'hidden');\n _setBorderColor('black');\n setStatus('visibility', 'hidden');\n\n // Check if we should try to predict label correctness. It's experimental, so show only on crowdstudy server.\n // No need to predict correctness if the user is in the tutorial or if it's already been done for this label.\n if (svl.usingPredictionModel()\n && !svl.isOnboarding()\n && status.targetLabel\n && !status.targetLabel.getProperty('predictionMade')\n && !clickedDelete\n && svl.predictionModel.isPredictionSupported(status.targetLabel.getLabelType())) {\n status.targetLabel.setProperty('predictionMade', true);\n predictLabelCorrectnessAndShowUI();\n }\n\n return this;\n }", "function changeDeleteButtonVisibility() {\n if (checkedCheckboxes.length > 0) {\n showDeleteButton();\n } else {\n hideDeleteButton();\n }\n}", "close() {\n this.$store.commit(HIDE_CONFIRM_DELETE_MODAL);\n }", "function deleteQuote() {\n deleteBtn.parentElement.remove();\n\n if (!favQuotes.hasChildNodes()) {\n favBtn.textContent = 'Show Favs';\n favQuotesTitle.classList.toggle('show');\n favQuotes.classList.toggle('show');\n }\n // Remove from LS\n removeQuoteFromLS(deleteBtn.parentElement);\n }", "function toggleDeleteRevertChildren($item) {\n var $childContainer = $item.find('.js-browse__item .page__container'),\n isDeleting = $item.children('.page__container').hasClass('deleted');\n\n if (isDeleting) {\n $childContainer.addClass('deleted');\n } else {\n $childContainer.removeClass('deleted');\n\n // If a child item has previously been deleted but is being shown by a parent then undo the toggle buttons\n if ($childContainer.find('.btn-browse-delete-revert').length) {\n // toggleDeleteRevertButton($childContainer.find('.btn-browse-delete-revert'));\n toggleDeleteRevertButton($childContainer);\n }\n }\n\n $childContainer.find('.page__buttons').toggleClass('deleted');\n}", "function deletePost(id){\n \n pointerRef=document.getElementsByName(\"pointerRef\");\n\tfor(let item of pointerRef){\n\t\titem.style.pointerEvents=\"none\";\n\t}; \n newNode.innerHTML=id;\n var delModal=document.getElementById('deleteModal');\n delModal.style.display=\"block\"; \n}", "function deleteSlide() {\n var slideToDelete = $('.to-delete');\n slideToDelete.remove();\n }", "function do_vote(o) {\n if(!o.parent().hasClass('on')) {\n return;\n }\n \n\t// make sure we can't vote again\n\t$(\"#votelinks a\").unbind();\t\t\t// remove click event\n\n\tvote = o.attr(\"id\");\t\t\t\t\n\timageid = o.attr(\"name\");\t\t\t// we've added the image id as an attribute to the votelinks div\n\n\tdisable_voting();\n\tif(vote == \"good\") {\n\t\thandle_comment_post(imageid, \"\", \"this is good\", \"\", \"0\", \"0\", \"0\");\n\t\tincrease_count(\"#count_good\");\n\t} else {\n\t\thandle_comment_post(imageid, \"\", \"this is bad\", \"\", \"0\", \"0\", \"0\");\n\t\tincrease_count(\"#count_bad\");\n\t}\n}", "function deleteMySeries(){ //remove all series in quickView from users MySeries\n //$quickViewRows array is only filled when previewing MySeries\n var obj;\n dialogShow(\"confirm deletion\",\n dialogues.deleteMySeries,\n [\n {text: 'delete',id:'btn-delete',\n click: function() {\n for(var i=0;i<qvControls.$quickViewRows.length;i++){\n obj = $dtMyData.fnGetData(qvControls.$quickViewRows.get(i));\n if(account.loggedIn()){\n updateMySeries(obj, 'D'); //delete from DB\n }\n delete oMySets[obj.handle()];\n delete oMySets[obj.setHandle()];\n $dtMyData.fnDeleteRow(qvControls.$quickViewRows.get(i));\n }\n $(this).dialog('close');\n }\n },\n {text: 'cancel',id:'btn-cancel',click: function() {$(this).dialog('close');}}\n ]\n );\n}", "function handleDeleteButtonPress() {\n var listItemData = $(this)\n .parent(\"td\")\n .parent(\"tr\")\n .data(\"reviewer\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/reviewer/\" + id\n }).then(getReviewers);\n }", "function escondeExibeDetalhes(e) {\n var icone = e.target;\n var detalhes = $(icone).parent().find(\".ObjectDetailsNotes:first\");\n\n if ($(detalhes).is(\":hidden\")) {\n $(detalhes).show();\n $(icone).text(\"remove\");\n }\n else {\n $(detalhes).hide();\n $(icone).text(\"add\");\n }\n }", "function deleteTermModal(e) {\n const modal = document.querySelector(\".delete-term-modal\");\n const closeBtn = document.querySelector(\".close-modal\");\n const confirmDeleteBtn = document.querySelector(\".modal-delete-btn\");\n const term = e.target.dataset.id;\n modal.classList.remove(\"hidden\");\n confirmDeleteBtn.setAttribute(\"href\", \"delete_definition/\" + term);\n closeBtn.addEventListener(\"click\", function () {\n modal.classList.add(\"hidden\");\n });\n}", "async handleDeleteToggle(isUndelete) {\n let resp;\n if (isUndelete) {\n resp = await window.csClient.undeleteComment(\n this.featureId, this.activity.comment_id);\n } else {\n resp = await window.csClient.deleteComment(\n this.featureId, this.activity.comment_id);\n }\n if (resp && resp.message === 'Done') {\n this.activity.deleted_by = (isUndelete) ? null : this.user.email;\n this.toggleMenu();\n this.requestUpdate();\n }\n }" ]
[ "0.600304", "0.5923789", "0.58830684", "0.5774274", "0.5767797", "0.57634306", "0.573743", "0.57075894", "0.5693932", "0.5690193", "0.5656177", "0.56561273", "0.5627948", "0.5617466", "0.5590266", "0.55696195", "0.55671084", "0.55466986", "0.55384266", "0.5527482", "0.55113894", "0.550348", "0.5495583", "0.5488072", "0.5480369", "0.5477916", "0.5472354", "0.5437483", "0.5434162", "0.5414986", "0.54128325", "0.5400764", "0.539376", "0.53919685", "0.53699005", "0.5365723", "0.5364715", "0.5359843", "0.53562796", "0.53532946", "0.5350219", "0.5342776", "0.5335829", "0.53185785", "0.53052115", "0.53038454", "0.5303054", "0.5302408", "0.53008085", "0.5300446", "0.52912873", "0.52897084", "0.52560055", "0.5243407", "0.52393574", "0.5221147", "0.52137005", "0.52055", "0.52003103", "0.51982325", "0.5196626", "0.5182852", "0.5180444", "0.5178183", "0.51662403", "0.51601666", "0.515879", "0.51579446", "0.51523054", "0.5145044", "0.5143776", "0.51387006", "0.51386625", "0.5138051", "0.5137226", "0.5135584", "0.5130765", "0.5130314", "0.51247036", "0.5123706", "0.5115988", "0.51140046", "0.51027846", "0.5097659", "0.5091386", "0.50856286", "0.50737417", "0.5071049", "0.50617594", "0.5061251", "0.5059931", "0.50497615", "0.50491774", "0.5048288", "0.5047479", "0.5031598", "0.5027511", "0.5025709", "0.5025456", "0.5024496" ]
0.5816133
3
For the "close" and "delete" functions. By [[User:KettleMeetPot|KettleMeetPot]]
function closeClick() { if ( wgPageName == "Emperor Jarjarkine_Wiki:Votes_for_deletion" && closeApprove == true) { $(".cDiscuss").click(function() { var ID = $(this).attr("id").replace(/_/g," "); globalID = $(this).attr("id"); demarcationID = $(".FRow:last").attr("id"); $.ajax({ type: "POST", url: "http://emperor-jarjarkine.wikia.com/api.php", data: { action:'query', prop:'revisions', titles:'Emperor Jarjarkine_Wiki:Votes_for_deletion', rvprop:'content' }, success: function (data) { var fsplit = data.split("{{Discussion navigation}}"); var secsplit = fsplit[1].split("&amp;lt;/dpl&amp;gt;"); var content = secsplit[0].replace(/&amp;lt;/g,"<").replace(/&amp;quot;/g,'"').replace(/&amp;gt;/g,">").replace(/&amp;amp;/g,"&").replace(/<a href=\"/g,"").replace(/\">http:\/\/emperor-jarjarkine.wikia.com\/wiki\/.*<\/a>/g,""); var Sliced = content.split("<!-- Demarcation: Do NOT remove this notice -->"); var demarcation = parseInt(demarcationID.slice(6),10) + 1; var edittoken = mw.user.tokens.get( 'editToken' ); var consensus; importArticles({ type: "style", article: "MediaWiki:Communitydiscussionpages.css" }); $('<div id="dialog-confirm" title="Measure of consensus">What was the outcome of the discussion?</div>').appendTo('body'); mw.loader.using( ['jquery.ui.dialog', 'jquery.ui.core', 'jquery.ui.position', 'jquery.ui.button', 'jquery.ui.widget'], function () { if ( $.attrFn ) { $.attrFn.text = true; } $("#dialog-confirm").dialog({ resizable: false, draggable: false, height: "auto", closeOnEscape: true, modal: true, buttons: [ { text:"Keep", click: function () { consensus = "Page kept."; $(this).dialog("close"); } }, { text:"Merge", id:"merge-button", click: function () { $("#merge-button").prop("disabled", true); $("#dialog-confirm").html("What was the outcome of the discussion?<br><br>") $('<div id="dialog-input" style="width: auto; height: auto;">Merge into: <input type="text" name="title" id="pagename-input" placeholder="fullpagename" style="width:40%; margin-right:8px"><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false" id="Ok-widget-button" style="margin-bottom:4px"><span class="ui-button-text">Ok</span></button></div>').appendTo("#dialog-confirm"); $("#Ok-widget-button").click(function() { boxInput = $("#pagename-input").val(); consensus = "Page will be merged with [[" + boxInput + "]]."; $("#dialog-confirm").dialog("close"); }); } }, { text:"Delete", click: function () { consensus = "Page deleted."; $(this).dialog("close"); } }, ], close: function(event, ui) { content = "{{Discussion navigation}}" + Sliced[0] + "| T" + demarcation + " = " + ID + " |\n{{Discussion Closed|" + consensus + "}}\n{{subst:Emperor Jarjarkine_Wiki:Votes for deletion/" + ID + "}}" + "\n<!-- Demarcation: Do NOT remove this notice -->" + Sliced[1] + "</dpl>"; $.ajax({ type: "POST", url: "http://emperor-jarjarkine.wikia.com/api.php", data: { action:'edit', title:'Emperor Jarjarkine_Wiki:Votes_for_deletion', text: content, summary:'Archiving discussion.', token: edittoken }, }); $.ajax({ type: "POST", url: "http://emperor-jarjarkine.wikia.com/api.php", data: { action:'delete', title:'Emperor Jarjarkine_Wiki:Votes_for_deletion/' + globalID, reason:'Closing discussion.', token: edittoken }, }); window.location.reload(); } }); }); } }); }); $(".cDelete").click(function() { var ID = $(this).parent().children(".cDiscuss").attr("id"); window.open("http://emperor-jarjarkine.wikia.com/wiki/Emperor Jarjarkine_Wiki:Votes_for_deletion/" + ID +"?action=delete&wpReason=Deleting%20irrelevant%20discussion"); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Close() {\n\n }", "function Close() {\n } // Close", "function onOpenClose(){if(typeof this.fd==='number'){// actually close down the fd\nthis.close();}}", "onClose(removed) {}", "close() {\n this.sendAction('close');\n }", "function del_current_fifter(close){\n $close = $(close);\n $close.parent().remove();\n}", "deleteTattoo () {\n\n }", "beforeClose() {\n\t\t}", "onClose() {\n\t\t}", "get Delete() {}", "onClose() {}", "onClose() {}", "function CloseEvent() {}", "[kDestroy](code, family, silent, statelessReset) {\n const state = this[kInternalState];\n state.closeCode = code;\n state.closeFamily = family;\n state.silentClose = silent;\n state.statelessReset = statelessReset;\n this.destroy();\n }", "async close() {\r\n this.setOpenAmount(0, true);\r\n }", "_close() {\n // mark ourselves inactive without doing any work.\n this._active = false;\n }", "openDeleteBucket(name, id) {\n\t\tlet message = \"Are you sure you want to delete \" + name + \"?\"\n\n\t\tthis.setState({\n\t\t\tmodel_message: message,\n\t\t\tbucket_id: id,\n\t\t\tbucket_name: name,\n\t\t\tmodel_title: \"Delete Bucket!\"\n\t\t})\n\t}", "close() {\n if(!this.opened){\n return;\n }\n this.opened = false;\n }", "ondelete(deltas) { /* ?? */}", "delete() {\n\n }", "onClose(){}", "function delete_stock(id,p_t) \n\t{\n\t\t//alert(p_t);\n\t\tvar conf = confirm(\"Do you really want to delete Stock Quantity?\");\n\t\tif (conf == true) {\n\t\t\t$.post(\"stock_details/delete_stock_details.php\", {id: id},\n\t\t\t\tfunction (data) {\n\t\t\t\t\t\talert(data)\n\t\t\t\t\t\t// reload Users by using read_contact_message\n\t\t\t\t\t\tread_stock_details(stock_type);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "function ForceClose() {\r\n}", "function DELETE(){\n\n}", "@action closeDeletingCategoryDialog() {\n this.isDeletingCategory = false;\n this.deletingCategoryData = {\n name: '',\n id: null,\n };\n }", "close() {\n if (this.isClosable) {\n // If we are allowed to close, fire the deny result with the default value.\n this.deny(this.closeResult);\n }\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "function handleClose() {\n setOpen(false)\n }", "close() {\n this.$store.commit(HIDE_CONFIRM_DELETE_MODAL);\n }", "function onclose(id) {\n\tthis.db.chsUnsub(id);\n}", "close() {\n close(internalSlots.get(this));\n }", "close()\n {\n this.makeUntouchable();\n Notif.closeByObject(this.object);\n }", "function Cerrar()\n{\n self.close()\n}", "function Close_Instruction() {\r\n}", "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "close() {\n return this[kInternalState].closePromise || this[kClose]();\n }", "close() {\n return this[kInternalState].closePromise || this[kClose]();\n }", "function onOpenClose () {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose () {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function quitFunction() {\n self.close();\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close();\n }\n}", "close () {\n this.opened = false;\n }", "onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n }", "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n super.emit(\"disconnect\", reason);\n }", "close() {\n this.opened = false;\n }", "function closeOnOpen(fd) {\n this.close();\n}", "close() {\n const that = this;\n\n if (!that.opened) {\n return;\n }\n\n that._close();\n }", "close() {\n\t\tif (!this.open) throw \"la encuesta ya está cerrada.\"\n\t\tthis.open = false;\n\t\tthis.save();\n\t}", "close() {\n console.log(`disconnected from ${this.address}`)\n Connection.all.delete(this.address)\n if (this.name != null && Connection.waiting.has(this.name)) {\n Connection.waiting.delete(this.name)\n }\n this.endGame(this.gameID)\n }", "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n super.emit(\"disconnect\", reason);\n }", "close() {\n const method = 'close';\n LOG.entry(method);\n this.db.close();\n LOG.exit(method);\n }", "function onOpenClose() {\n\t if (typeof this.fd === 'number') {\n\t // actually close down the fd\n\t this.close()\n\t }\n\t}", "function closeNote(id) {\n var dragstart = ($('#' + id).attr('ondragstart') == 'drag(event)') ? 'dragStop(event)' : 'drag(event)';\n $('#' + id).attr('ondragstart', dragstart);\n var dragover = ($('#' + id).attr('ondragover') == 'allowDrop(event)') ? 'event.stopPropagation()' : 'allowDrop(event)';\n $('#' + id).attr('ondragover', dragover);\n var noteClose = JSON.stringify($('#close' + id).val());\n id = $('#link' + id).val();\n var updateString = '[{\"op\": \"add\",\"path\": \"/postit_Closed\",\"value\": ' + noteClose + '}]';\n patchNote('https://localhost:44382/api/notes/', updateString, colId, colNo, noteId, id, desc);\n\n //$('#delete_Note' + id.substring(4, 9)).toggleClass('disable-menu-items');\n\n\n}", "close() {\n\t\tthis.save().then(()=>this.db.close())\n\t\tif (this.menubar) {\n\t\t\tthis.menubar.unsubscribe('undo', this.undo)\n\t\t\tthis.menubar.unsubscribe('redo', this.redo)\n\t\t}\n\t}", "delete() {\n this.afterDelete();\n Fiber.yield(true)\n }", "function handleClose() {\n setOpen(false)\n setEditItem(null)\n }", "close() {\n this.$emit('close');\n }", "doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }", "closeModal() {\n this.uploadFileModal = false;\n this.closedModel = false;\n this.reNameModel = false;\n this.deleteModel = false;\n }", "countClosing() {\n return(Object.keys(tClosers).length)\n }", "function close() {\n main.innerHTML = 'Closed <a href=/>reload</a>';\n let payload = {\n action: 'disconnected'\n };\n ws.send(JSON.stringify(payload));\n\n}", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "handleModalClose() {}", "delete() {\n if (typeof this.ctxPtr !== 'undefined' && this.ctxPtr !== null) {\n Module._vscf_hkdf_delete(this.ctxPtr);\n this.ctxPtr = null;\n }\n }", "function closeCs() {\n tl\n .to(close, .6, {\n height:'0', \n ease: Power3.easeOut\n });\n }", "[kStreamClose](id, code) {\n const stream = this[kInternalState].streams.get(id);\n if (stream === undefined)\n return;\n stream[kDestroy](code);\n }", "function handleCloseClick(){\n handleClose()\n }", "close() {\n console.log(' this is close function');\n this.showAlert = false;\n }", "function clickCloseBtnAfterDeleteHandler(controller) {\n\tlocation.reload();\n}", "delete() {\r\n return super.deleteCore();\r\n }", "delete() {\r\n return super.deleteCore();\r\n }", "delete() {\r\n return super.deleteCore();\r\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "close() {\n /* Disconnect Trueno session */\n process.exit();\n }", "destroy() { }", "destroy() { }", "destroy() { }", "close() {\n this._endpointId = null;\n this._deviceModel = null;\n this._onChange = function (arg) {};\n this._onError = function (arg) {};\n }", "function CloseMessage(){\n // should each message key sent as a thing. so message also should have a key means that for each message then you get\n // a key. ok lets do that after this thing gets working. but still requires. still means that we can gossip the message.\n }", "function closeOnOpen(fd) {\n\t this.close();\n\t}", "function deleteDog() {}", "close() {\n this.__internal.close()\n }", "close() {\n this.__internal.close()\n }", "function close() {\n var self = this;\n\n self._close.apply(self, arguments);\n}", "close(evt) {\n this._legacyOnly('close');\n\n let onCloseResult;\n\n if (typeof this.props.onClose === 'function') {\n onCloseResult = this.props.onClose(evt);\n\n if (onCloseResult === false) {\n return onCloseResult;\n }\n }\n\n if (this.props.autoRemove !== false) {\n this.remove();\n } else {\n this.hide();\n }\n\n return onCloseResult;\n }" ]
[ "0.6270113", "0.62539965", "0.61800706", "0.6154612", "0.6146269", "0.6093909", "0.6089339", "0.6038159", "0.59934247", "0.58975345", "0.5876508", "0.5876508", "0.5865882", "0.5865571", "0.58430517", "0.584179", "0.58359295", "0.5829981", "0.5829176", "0.5822879", "0.58216125", "0.5803614", "0.57915", "0.5784555", "0.57766336", "0.57160866", "0.57096183", "0.5701032", "0.5693193", "0.56917226", "0.5677847", "0.5668275", "0.565087", "0.5648591", "0.56409985", "0.56406504", "0.5631196", "0.5631196", "0.5629063", "0.5629063", "0.56126344", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5603111", "0.5602546", "0.55940014", "0.5565935", "0.55581814", "0.5556904", "0.55522585", "0.55464643", "0.5545116", "0.5525395", "0.55227154", "0.55103666", "0.55098844", "0.5507927", "0.5485494", "0.54835385", "0.54802954", "0.5477126", "0.54680985", "0.5465108", "0.5464967", "0.5458557", "0.5452391", "0.5444658", "0.5436424", "0.5429861", "0.5423241", "0.5418824", "0.5417826", "0.54155743", "0.54117304", "0.54117304", "0.54117304", "0.541078", "0.5409863", "0.5409603", "0.5409603", "0.5409603", "0.5408752", "0.53981936", "0.5395197", "0.53931344", "0.539212", "0.539212", "0.53910667", "0.5390011" ]
0.0
-1
For the "archive all" function. By [[User:KettleMeetPot|KettleMeetPot]]
function archiveClick() { if ( wgPageName == "Emperor Jarjarkine_Wiki:Votes_for_deletion" && closeApprove == true ) { $(".sys-tool").click(function() { importArticles({ type: "style", article: "MediaWiki:Communitydiscussionpages.css" }); $('<div id="dialog-confirm" title="archive all">Are you sure you would like to archive all closed discussions?</div>').appendTo('body'); mw.loader.using( ['jquery.ui.dialog', 'jquery.ui.core', 'jquery.ui.position', 'jquery.ui.button', 'jquery.ui.widget'], function () { if ( $.attrFn ) { $.attrFn.text = true; } $("#dialog-confirm").dialog({ resizable: false, draggable: false, height: "auto", closeOnEscape: true, modal: true, buttons: [ { text:"Yes", click: function () { $.ajax({ type: "POST", url: "http://emperor-jarjarkine.wikia.com/api.php", data: { action:'query', prop:'revisions', titles:'Avatar_Wiki:Votes_for_deletion', rvprop:'content' }, success: function (data) { var split = data.split("|}\n{{Format"); var content = split[1].split("&amp;lt;!-- Demarcation: Do NOT remove this notice --&amp;gt;") var edittoken = mw.user.tokens.get( 'editToken' ); var archive = split[0].split("}}") var fsplit = split[0].split("{{Discussion navigation}}"); var archiveNum = fsplit.split("}}"); archiveNum = archiveNum[0].slice(-2).replace(/|/,""); var nextArchive = parseInt(archiveNum) + 1; fsplit = fsplit[1].replace(/\| T\d* =/g,"\n==").replace(/\|\n\{\{/g,"==\n{{").replace(/&amp;lt;/g,"<").replace(/&amp;quot;/g,'"').replace(/&amp;gt;/g,">").replace("|" + archiveNum + "}}","|" + nextArchive + "}}"); var secsplit = content[1].split("&amp;lt;/dpl&amp;gt;"); secsplit = secsplit[0].replace(/\| T\d* =/g,"\n==").replace(/\|\n\{\{/g,"==\n{{").replace(/&amp;lt;/g,"<").replace(/&amp;quot;/g,'"').replace(/&amp;gt;/g,">"); archive = archive[1].slice(-2).replace(/\|/g,""); archive = parseInt(archive) + 1; content = content[0].replace(/\| T\d* =/g,"\n==").replace(/\|\n\{\{/g,"==\n{{").replace(/&amp;lt;/g,"<").replace(/&amp;quot;/g,'"').replace(/&amp;gt;/g,">"); $.ajax({ type: "POST", url: "http://emperor-jarjarkine.wikia.com/api.php", data: { action:'edit', title:'Emperor Jarjarkine_Wiki:Votes_for_deletion/Archive_' + archive, text:"{{talkarchive}}" + content, summary:'Creating new archive', token: edittoken }, }); $.ajax({ type: "POST", url: "http://emperor-jarjarkine.wikia.com/api.php", data: { action:'edit', title:'Emperor Jarjarkine_Wiki:Votes_for_deletion', text: "{{Discussion navigation}}" + fsplit + "|}\n{{Format\n<!-- Demarcation: Do NOT remove this notice -->\n" + secsplit + "</dpl>", summary:'Creating new archive', token: edittoken }, }); } }); $(this).dialog("close"); } }, { text:"Cancel", click: function () { $(this).dialog("close"); $("#dialog-confirm").remove(); } }, ], }); }); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function archive() {\n vm.error = undefined;\n var promises = [];\n vm.todos.filter(function (todo) {\n return todo.completed;\n }).forEach(function (todo) {\n promises.push(_archive(todo));\n });\n\n $q.all(promises).then(function () {\n _fetch();\n }).catch(function () {\n vm.error = 'An error occurred when archiving completed todos';\n });\n }", "function writeToArchive(archive) {\n total++;\n if (total == Object.keys(data).length) {\n fs.writeFile(\"./_data/archive_compiled.yaml\", yaml.safeDump(archive), function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"Archive file generated.\");\n if (job == \"build\" || job == \"update\" || job == \"archive\" || job == false) {\n yaml2json();\n } else {\n finish();\n }\n });\n }\n}", "export() {\n\t //want to bundle up the images, the texts, the tocs and maybe the charts\n\t this.msg.clear();\n\n\t //directories to zip (relative to this.localDir above)\n\t\tvar dirNames = [\n\t\t\t\t\t\t\t'presentationFlows'\n\t\t\t\t\t\t]; \n\n\t\tvar fileNames =[\n\t\t\t\t\t\t\t//'elements/text/someText.mmd' //as example. In this case it just puts the same file in, but want to allow inidvidual files\n\t\t\t\t\t\t];\n\n\t\tvar archive = archiver.create('zip', {});\n\t\tarchive.on('error', function(err){\n\t\t throw err;\n\t\t});\n\n\t\tvar output = jetpack.createWriteStream(this.downloadDir); //path to create .zip file\n\t\toutput.on('close', function() {\n\t\t\tthis.msg.out('presentationFlows.zip has been saved to your downloads folder');\n\t\t console.log('archive complete: ' + archive.pointer() + ' total bytes written to ' + this.downloadDir);\n\t\t}.bind(this));\n\t\tarchive.pipe(output);\n\n\t\tdirNames.forEach(function(dirName) {\n\t\t archive.directory(this.localDir + dirName, dirName);\n\t\t}.bind(this));\n\n\n\t\tfileNames.forEach(function(fileName) {\n\t\t\tvar stream = jetpack.read(path.join(this.localDir, fileName));\n \t\tarchive.append(stream, { name: fileName });\n\t\t}.bind(this));\n\n\t\tarchive.finalize();\n\t}", "function archive() {\r\n\tvar time = dateFormat(new Date(), \"yyyy-mm-dd_HH-MM\");\r\n\tvar pkg = JSON.parse(fs.readFileSync('./package.json'));\r\n\tvar title = pkg.name + '_' + time + '.zip';\r\n\r\n\treturn gulp.src(CONF.PATHS.package)\r\n\t\t.pipe($.zip(title))\r\n\t\t.pipe(gulp.dest('packaged'));\r\n}", "archive(req, res) {\n PetsService.archive(req.params.id)\n .then((result) => {\n res.json(result);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function to_archive() {\n $http.patch('/api/v1/clients/personal/' + vm.uid + '/', vm.ardata\n ).then(to_archiveSuccessFn, to_archiveErrorFn);\n\n /**\n * @name to_archiveSuccessFn\n * @desc Update ClubCard array on view\n */\n function to_archiveSuccessFn(data, status, headers, config) {\n window.location = '/#/archive/personal/' + vm.uid\n }\n\n /**\n * @name to_archiveErrorFn\n * @desc console log error\n */\n function to_archiveErrorFn(data, status, headers, config) {\n console.log(data);\n }\n }", "onArchive(id) {\n this.onArchiveTask.emit(id);\n }", "function archiveWardRoundSheet(){\r\n const currentSpreadSheet = SpreadsheetApp.getActiveSpreadsheet();\r\n const sheet = currentSpreadSheet.getActiveSheet();\r\n const sheetName = sheet.getName();\r\n \r\n const ui = SpreadsheetApp.getUi();\r\n const result = ui.alert(\r\n \"Archiver la tournée\",\r\n \"Voulez-vous archiver la tournée : \" + sheetName,\r\n ui.ButtonSet.OK_CANCEL);\r\n\r\n // Process the user's response.\r\n if (result == ui.Button.CANCEL) {\r\n return;\r\n }\r\n \r\n const folder = DriveApp.getFileById(currentSpreadSheet.getId()).getParents().next();\r\n const archiveFolder = getFoldersByNameOrCreate(getFoldersByNameOrCreate(folder,\"Archives\"),\"Tournées\");\r\n \r\n const pdf = convertSheetToPdf(currentSpreadSheet,sheet,Utilities.formatDate(new Date(), \"GMT+1\", \"yyyy_MM\") + sheetName,\"I\");\r\n archiveFolder.createFile(pdf);\r\n \r\n currentSpreadSheet.deleteSheet(sheet);\r\n \r\n wardRoundSheetArchived();\r\n}", "function buildArchive()\n{\n const body = $(\"body\");\n const spoonTypes = body.data(\"spoonTypes\");\n const spoonEmoji = body.data(\"spoonEmoji\");\n const spoonDifficulties = body.data(\"spoonDifficulties\");\n // create the archive\n const archive = makeTable();\n archive.attr(\"id\", \"archivelist\");\n body.append(archive);\n const headerRow = makeTaskHeaderRow(\"archive\", spoonTypes); // will probably need header emojis later\n archive.append(headerRow);\n const spoons = $(headerRow.children().filter(\".spoonhead\"));\n console.log(spoons);\n const taskList = $(\"#tasklist\");\n spoons.outerWidth(setSpoonWidths(taskList));\n archive.hide();\n}", "async function writeAllChanges() {\n while (delFiles.length > 0) {\n await forceDelete(archive, delFiles.pop())\n }\n\n while (newFiles.length > 0) {\n let nf = newFiles.pop()\n await addWrite(archive, nf.path, nf.data)\n }\n\n let doc = u(document.documentElement).clone()\n let newTitle = doc.find('.tape-title').text()\n let info = await archive.getInfo()\n if (info.title !== newTitle) {\n doc.find('title').text(newTitle + ' on Duxtape')\n archive.configure({title: newTitle})\n }\n\n doc.find('.editor').remove()\n doc.find('.editing').removeClass('editing').\n each((node, i) => node.removeAttribute('contenteditable'))\n await forceWrite(archive, '/index.html', doc.html())\n }", "archiveAndDearchive(){\n this.archived = !this.archived;\n }", "saveAllAsHar() {\n return HarExporter.save(this.getDefaultHarOptions());\n }", "save() {\n this.archive.finalize();\n }", "function _archive(todo) {\n var deferred = $q.defer();\n service.archive(todo, function () {\n return deferred.resolve();\n }, function () {\n return deferred.reject();\n });\n return deferred.promise;\n }", "function contentArchives(oLocation)\n{\n\tvar sContent = '';\n\tvar aLocPathname = oLocation.pathname.split(\"/\");\n\tvar sLocQuery = oLocation.search;\n\tvar sLocName = aLocPathname[aLocPathname.length-1];\n\tvar sQuery = sLocName + sLocQuery;\n\tsContent = \"<span class='archives'>\"+\n\t\t\t\t\"<a title='Archive sites' onclick='infoPopUpArchives(\\\"\"+sQuery+\"\\\")'>Archive sites</a>\"+\n\t\t\t\t\"</span>\";\n\treturn sContent;\n}", "function archiveView()\n{\n const tasklist = $(\"#tasklist\");\n const archivelist = $(\"#archivelist\");\n // first, update the archive with data from the DOM\n const archivedList = getIDList(\"archivelist\");\n const tasks = $(\"body\").data(\"tasks\");\n const archive = tasks[\"archive\"];\n const archiveKeys = Object.keys(archive);\n if (archivedList.length > 0) // there are already entries in the table\n {\n for (let i = 0; i < archiveKeys.length; i++)\n {\n if (!archivedList.find(element => element === archiveKeys[i]))\n {\n // write the task to the table\n addArchiveTask(archiveKeys[i], archive[archiveKeys[i]]);\n }\n }\n }\n else\n {\n for (let j = 0; j < archiveKeys.length; j++)\n {\n // write the task to the table probably by calling addTask\n addArchiveTask(archiveKeys[j], archive[archiveKeys[j]]);\n }\n }\n // hide the tasklist\n tasklist.hide();\n // show the archive\n archivelist.show();\n // switch our links around\n switchViewLinks(\"tasks\");\n}", "function Archiver() {\n\n /**\n * Add a file to be archived. Target filepath is <pre>{options.directory}/{options.file.name}</pre> or just\n * <pre>{options.file.name}</pre> (root directory) if <pre>options.directory</pre> is not specified.\n * @restriction Server SuiteScript only\n * @governance none\n *\n * @param {Object} options\n * @param {file} options.file - file to be archived\n * @param {String} [options.directory] - target directory in the archive\n *\n * @throws {SuiteScriptError} COMPRESS_API_DUPLICATE_PATH if a file has already been added on the same target path\n *\n * @since 2020.2\n */\n this.add = function (options) { };\n\n /**\n * Create an archive with the added files and return it as a temporary file object.\n *\n * The <pre>options.type</pre> doesn't need to be specified if the archive file name (<pre>options.name</pre>) has one\n * of the following extensions: .cpio, .tar, .tar.gz, .tar.bz2, .tgz, .tbz2, .zip.\n * @restriction Server SuiteScript only\n * @governance none\n *\n * @param {Object} options\n * @param {string} options.name - name of the archive file\n * @param {string} options.type - see archive.Type enum\n *\n * @returns {file} - temporary file object representing the archive\n *\n * @throws {SuiteScriptError} COMPRESS_API_UNSUPPORTED_ARCHIVE_TYPE if options.type is an invalid archive type\n * @throws {SuiteScriptError} COMPRESS_API_UNRECOGNIZED_ARCHIVE_FILE_EXTENSION if options.type is not specified\n * and archive type cannot be determined from the file extension\n * @throws {SuiteScriptError} COMPRESS_API_UNABLE_TO_RETRIEVE_FILE_CONTENTS if the contents cannot be retrieved\n * for any of the files to be archived\n *\n * @since 2020.2\n */\n this.archive = function (options) { };\n\n /**\n * Return the object type name (compress.Archiver).\n * @restriction Server SuiteScript only\n * @governance none\n * @return {string}\n *\n * @since 2020.2\n */\n this.toString = function () { };\n\n /**\n * get JSON format of the object\n * @restriction Server SuiteScript only\n * @governance none\n * @return {Object}\n *\n * @since 2020.2\n */\n this.toJSON = function () { };\n }", "function exportAllTramites() {\n for (var tramite in vm.tramitesProceso) {\n vm.allTramitesForExport.push({\n 'Docente': vm.tramitesProceso[tramite].usuario,\n 'RFC': vm.tramitesProceso[tramite].rfc,\n 'Tramite': vm.tramitesProceso[tramite].tramite,\n 'Fecha': vm.tramitesProceso[tramite].fecha,\n 'Estatus': vm.tramitesProceso[tramite].estatus\n });\n }\n alasql('SELECT * INTO XLSX(\"ReporteTramites.xlsx\",{headers:true}) FROM ?', [vm.allTramitesForExport]);\n }", "_onArchiveClicked(ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.model.updateVisibility('archive');\n }", "function ZipArchive() {\n if (CRC32TABLE.length === 0) {\n ZipArchive.initCrc32Table();\n }\n this.files = [];\n this.level = 'Normal';\n _syncfusion_ej2_file_utils__WEBPACK_IMPORTED_MODULE_1__[\"Save\"].isMicrosoftBrowser = !(!navigator.msSaveBlob);\n }", "async exportData() {\n let exportJobs = [];\n this.exportPre.extVersion = gManifestData.version;\n await bgPanda.getAllPanda(false);\n for (const key of Object.keys(bgPanda.info)) { let data = await bgPanda.dataObj(key); exportJobs.push(data); }\n this.exportPre.jobs = exportJobs.length;\n saveToFile({'pre':this.exportPre, 'jobs':exportJobs});\n bgPanda.nullData(false);\n }", "function archiveButtonHandler(obj)\n{\n // grab spoon data\n // note: this is all super messy, because I have backend stuff to fix\n const row = getGrandparent($(obj));\n const taskID = getSavedTaskID(row);\n const tasks = $(\"body\").data(\"tasks\");\n const task = tasks.active[taskID];\n // set the task to not done\n task.done = 0;\n // remove the task from the active tasks in the DOM\n removeTaskData(\"tasklist\", taskID);\n // save the task into the archive\n saveArchiveData(taskID, task);\n // get rid of the task row\n row.remove();\n}", "function ZipArchive() {\n _classCallCheck(this, ZipArchive);\n\n this.files = [];\n this.level = 'Normal';\n Save.isMicrosoftBrowser = !!navigator.msSaveBlob;\n }", "function writeArchive(map, source) {\n let archive = [];\n if (source) {\n for (const records of map.values()) {\n records.forEach(record => {\n archive.push(source[record]);\n });\n }\n }\n return archive;\n }", "function clearArchive() {\n //5a delete archive's LI elements from DOM\n let archiveLis = Array.from(document.querySelectorAll('#archive ul li'));\n archiveLis.forEach(el => el.remove());\n }", "function AbExportAll() {\n for (let directory of MailServices.ab.directories) {\n // Do not export LDAP ABs.\n if (!directory.URI.startsWith(kLdapUrlPrefix)) {\n AbExport(directory.URI);\n }\n }\n}", "function getArchive() {\n var source = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('record');\n var target = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('archive');\n if (source.getLastRow() > 1) {\n for (var i = 2; i < source.getLastRow()+1; ++i) {\n if (source.getRange(i,5).getValue()) {\n source.getRange(i,1,1,5).copyTo(target.getRange(target.getLastRow()+1,1,1,5),{contentsOnly:true});\n source.deleteRow(i);\n i = i-1;\n }\n }\n }\n}", "function addCheckinToArchive_(arcPack, package) {\n //var arcPack = getSheetPackage_(\"transaction_archive\");\n var baseDisplace = 10;\n var UIDRows = findRowsWithValue_(arcPack[2], package[1], 1);\n var arrayRow = -1;\n var sheetRow = -1;\n for(var i = UIDRows.length - 1; i >= 0; i--) {\n if(arcPack[3][UIDRows[i] - 2][4] == package[3]) {\n sheetRow = UIDRows[i];\n arrayRow = UIDRows[i] - 2;\n break;\n }\n }\n \n if(arrayRow == -1 || arrayRow >= arcPack[3].length) {\n var err = \"Error! Add Checkin to Archive cannot find suitable row.\\n\" + package;\n throw new Error(err); \n }\n \n var emailBack = false;\n \n var newRow = \n [[new Date(), sheetRow, baseDisplace + 0], // in date\n [package[0], sheetRow, baseDisplace + 1], // empname\n ['', sheetRow, baseDisplace + 2],\n ['', sheetRow, baseDisplace + 3]];\n if(package[5] === \"\") {\n newRow[2][0] = \"No\"; // Broken Flag\n } else {\n newRow[2][0] = \"Yes\"; // Broken flag\n newRow[3][0] = package[5]; // Damage Notes\n }\n \n replaceValues_(arcPack[2], newRow);\n \n if(arcPack[3][arrayRow][14]) {\n emailBack = true;\n }\n \n return emailBack;\n}", "function Export_All(){\n //data_export.Export_User_Annotation_Data()\n tagging_data_export.Export_User_Annotation_Data()\n}", "function AbExportAll()\n{\n let directories = MailServices.ab.directories;\n\n while (directories.hasMoreElements()) {\n let directory = directories.getNext();\n // Do not export LDAP ABs.\n if (directory.URI.startsWith(kLdapUrlPrefix))\n continue;\n\n AbExport(directory.URI);\n }\n}", "copyAllAsHar() {\n return HarExporter.copy(this.getDefaultHarOptions());\n }", "serializeImagesRelations(images, writer) {\n if (images.length > 0) {\n let imagePath = '';\n let base64ImageString;\n let keys = images.keys;\n for (let i = 0; i < keys.length; i++) {\n let mImage = images.get(keys[i]);\n base64ImageString = mImage.imageString;\n if (isNullOrUndefined(base64ImageString)) {\n imagePath = this.imagePath + '/0.jpeg';\n this.serializeRelationShip(writer, keys[i], this.imageRelType, imagePath.replace('word/', ''));\n }\n else {\n let imageInfo = HelperMethods.formatClippedString(base64ImageString);\n let extension = imageInfo.extension;\n let formatClippedString = imageInfo.formatClippedString;\n imagePath = this.imagePath + keys[i] + extension;\n this.serializeRelationShip(writer, keys[i], this.imageRelType, imagePath.replace('word/', ''));\n //if (m_archive.Find(imagePath.Replace('\\\\', '/')) === -1)\n // {\n let imageBlob = new Blob([this.encodedString(formatClippedString)]);\n let zipArchiveItem = new ZipArchiveItem(imageBlob, imagePath);\n // let TestArchive = new ZipArchive();\n this.mArchive.addItem(zipArchiveItem);\n // TestArchive.save('image.zip').then(function (): void {\n // TestArchive.destroy();\n // });\n // }\n }\n }\n }\n }", "function archive(mailId, arch) {\n fetch(`/emails/${mailId}`, {\n method: 'PUT',\n body: JSON.stringify({\n archived: arch\n })\n })\n\n setTimeout(function () {\n load_mailbox('inbox')\n }, 100);\n\n return false;\n }", "function zipAll(project) {\n return function (source) { return source.lift(new zip/* ZipOperator */.mx(project)); };\n}", "toggleArchive() {\n MemberActions.updateArichiveStatus(this.props.archived, this.props.memberID);\n this.props.unselect();\n }", "function publishZipFiles(conf,inputs,outputs){\n var schema=\"cmdii_tmp\";\n var schemaf=\"cmdii\";\n var produced_dirs=[];\n var dbUser=conf[conf[\"main\"][\"dbuserName\"]];\n if(!inputs[\"zip\"][\"length\"])\n\tinputs[\"zip\"][\"length\"]=1;\n for(var i=0;i<inputs[\"zip\"][\"length\"];i++){\n\tvar cFile;\n\tif(i==0){\n\t cFile=inputs[\"zip\"][\"cache_file\"];\n\t alert(i+\" \"+inputs[\"zip\"][\"cache_file\"]);\n\t}\n\telse{\n\t cFile=inputs[\"zip\"][\"cache_file_\"+i];\n\t alert(i+\" \"+inputs[\"zip\"][\"cache_file_\"+i]);\n\t}\n var sqlQuery=\"INSERT INTO \"+schemaf+\".zip_files (name,mail) VALUES ('\"+cFile+\"','\"+inputs[\"mail\"][\"value\"]+\"') RETURNING id;\" ;\n var myOutputs= {\"Result\":{ type: 'RawDataOutput', \"mimeType\": \"application/json\" }};\n \tvar myInputs={\n \t\"dsoName\": {\"value\": \"\",\"type\":\"string\"},\n \t\"dstName\": {\"value\": \"PG:dbname=\"+conf[\"mmdb\"][\"dbname\"]+\" port=\"+conf[\"mmdb\"][\"port\"]+\" host=\"+conf[\"mmdb\"][\"host\"]+\" user=\"+conf[\"mmdb\"][\"user\"]+(conf[\"mmdb\"][\"password\"]?\" password=\"+conf[\"mmdb\"][\"password\"]:\"\"),\"type\":\"string\"},\n \t\"q\": {\"value\": sqlQuery,\"mimeType\":\"application/json\"},\n \t};\n\tvar myProcess = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-tools.vectInfo');\n\tvar myExecuteResult=myProcess.Execute(myInputs,myOutputs);\n\talert(myExecuteResult);\n\tvar currentId=eval(myExecuteResult);\n\tcurrentId=currentId[0][\"id\"];\n\tvar inputs00={\n\t \"zip\": {\"mimeType\":\"application/zip\", \"type\":\"reference\", \"value\": \"file://\"+cFile}\n\t}\n\tvar myOutputs00= {Result: { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\tvar myProcess00 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'np.unzip');\n\tvar myExecuteResult00=myProcess00.Execute(inputs00,myOutputs00);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\talert(myExecuteResult00);\n\tproduced_dirs.push(myExecuteResult00);\n\talert(myExecuteResult00+\"/\"+cFile.replace(/\\/var\\/www\\/html\\//g,\"\").replace(/.zip/g,\".xls\"));\n\tcFile=inputs[\"ozip\"][\"cache_file\"];\n var myInputs01={\n\t\t\"path\": {\"value\": myExecuteResult00+\"/\"+cFile.replace(/\\/var\\/www\\/html\\/tmp/g,\"\").replace(/\\./g,\"_\").replace(/_zip/g,\".xls\").replace(/-/g,\"_\"), \"type\": \"string\" },\n\t\t\"ext\": {\"value\": \"xls\", \"type\": \"string\" }\n\t};\n var myOutputs01= {Result: { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n var myProcess01 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],localModulePath+'.fixName');\n var myExecuteResult01=myProcess01.Execute(myInputs01,myOutputs01);\n alert(\"******************************\",myExecuteResult01,\"***********************************\");\n\tvar xlsFile=myExecuteResult01;//myExecuteResult00+\"/\"+cFile.replace(/\\/var\\/www\\/html\\/tmp/g,\"\").replace(/\\./g,\"_\").replace(/_zip/g,\".xls\").replace(/-/g,\"_\");\n\tvar kmlFile=myExecuteResult01.replace(/xls/g,\"kml\")//myExecuteResult00+\"/\"+cFile.replace(/\\/var\\/www\\/html\\/tmp/g,\"\").replace(/\\./g,\"_\").replace(/_zip/g,\".kml\").replace(/-/g,\"_\");\n /**\n * Import kml file in PG database to set proper comb_sub value\n */\n\t var inputs02={\n\t\t\"skipfailure\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t\t\"append\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t\t\"f\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PostgreSQL\"},\n\t\t\"nln\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": schema+\".kml_\"+conf[\"lenv\"][\"usid\"]},\n\t\t//\"lco\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SPATILALITE=YES\"},\n\t\t\"OutputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PG:dbname=\"+dbUser[\"dbname\"]+\" port=\"+dbUser[\"port\"]+\" user=\"+dbUser[\"user\"]+\"\"+(dbUser[\"password\"]?\" password=\"+dbUser[\"password\"]:\"\")},\n\t\t\"InputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": kmlFile}\n\t }\n\t var myOutputs02= {\"OutputedDataSourceName\": { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\t var myProcess02 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-converter.Ogr2Ogr');\n\t var myExecuteResult02=myProcess02.Execute(inputs02,myOutputs02);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\t alert(myExecuteResult02);\n /**\n * Create a table with correct relationship defined between plot name and comb-sub\n */\n\t var inputs02={\n\t\t\"skipfailure\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t\t//\"update\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t\t\"f\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SQLite\"},\n\t\t\"nln\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"kml_origin\"},\n\t\t//\"lco\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SPATILALITE=YES\"},\n\t\t\"InputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PG:dbname=\"+dbUser[\"dbname\"]+\" port=\"+dbUser[\"port\"]+\" user=\"+dbUser[\"user\"]+\"\"+(dbUser[\"password\"]?\" password=\"+dbUser[\"password\"]:\"\")},\n\t\t\"OutputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"postThin\"+/**/conf[\"lenv\"][\"usid\"]+\"_\"+i+/**/\".db\"},\n \"sql\": {\"mimeType\":\"text/plain\", \"type\":\"complex\", \"value\": \"SELECT *,\"+currentId+\" as zid,(select compartmen||''||subid as cuid from cmdii.scdb where ST_Intersects(\"+schema+\".kml_\"+(conf[\"lenv\"][\"usid\"].replace(/-/g,\"_\"))+\".wkb_geometry,cmdii.scdb.wkb_geometry)) as com_sub_real from \"+schema+\".kml_\"+(conf[\"lenv\"][\"usid\"].replace(/-/g,\"_\"))}\n\t }\n\t var myOutputs02= {\"OutputedDataSourceName\": { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\t var myProcess02 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-converter.Ogr2Ogr');\n\t var myExecuteResult02=myProcess02.Execute(inputs02,myOutputs02);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\t alert(myExecuteResult02);\n /**\n * Invoke R Service\n */\n\tvar inputs01={\n\t \"db\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": conf[\"main\"][\"tmpPath\"]+\"/postThin\"+/**/conf[\"lenv\"][\"usid\"]+\"_\"+i+/**/\".db\"},\n\t \"data\": {\"mimeType\":\"application/zip\", \"type\":\"reference\", \"value\": \"file://\"+xlsFile }\n\t}\n\tvar myOutputs01= {Result: { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\tvar myProcess01 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],localModulePath+'.analyze');\n\tvar myExecuteResult01=myProcess01.Execute(inputs01,myOutputs01);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\talert(localModulePath+\".analyze \"+myExecuteResult01);\n if(myExecuteResult01.indexOf(\"Exception\")>=0){\n data = myExecuteResult01.replace(/^<\\?xml\\s+version\\s*=\\s*([\"'])[^\\1]+\\1[^?]*\\?>/, \"\");\n data = new XML(data);\n alert(data);\n conf[\"lenv\"][\"message\"]=data.*::Exception.*::ExceptionText[0];\n return {result: ZOO.SERVICE_FAILED, conf: conf, outputs: {Result: {\"value\": \"Data successfully published\"}}};;\n\t}\n\n\tvar inputs02={\n\t \"skipfailure\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t \"append\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t \"f\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SQLite\"},\n\t \"nln\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"plot_locations\"},\n\t \"lco\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SPATILALITE=YES\"},\n\t \"OutputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"postThin\"/**/+conf[\"lenv\"][\"usid\"]+\"_0\"+i/**/+\".db\"},\n\t \"InputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": kmlFile}/*,\n\t \"t_srs\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"epsg:4326\"},\n\t \"sql\": {\"mimeType\":\"text/plain\", \"type\":\"complex\", \"value\": \"SELECT \\\"Name\\\",\\\"Description\\\" from \\\"Layer #0\\\"\"}*/\n\t}\n\tvar myOutputs02= {\"OutputedDataSourceName\": { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\tvar myProcess02 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-converter.Ogr2Ogr');\n\tvar myExecuteResult02=myProcess02.Execute(inputs02,myOutputs02);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\talert(myExecuteResult02);\n\n\tvar inputs02={\n\t \"skipfailure\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t \"append\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t \"f\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PostgreSQL\"},\n\t \"nln\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": schema+\".plot_locations\"},\n\t \"lco\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SPATILALITE=YES\"},\n\t \"OutputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PG:dbname=\"+dbUser[\"dbname\"]+\" port=\"+dbUser[\"port\"]+\" user=\"+dbUser[\"user\"]+\"\"+(dbUser[\"password\"]?\" password=\"+dbUser[\"password\"]:\"\")},\n\t \"InputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": conf[\"main\"][\"tmpPath\"]+\"/postThin\"/**/+conf[\"lenv\"][\"usid\"]+\"_0\"+i/**/+\".db\"},/*\n\t \"t_srs\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"epsg:4326\"},*/\n\t \"sql\": {\"mimeType\":\"text/plain\", \"type\":\"complex\", \"value\": \"SELECT *,\"+currentId+\" as zid from plot_locations\"}\n\t}\n\tvar myOutputs02= {\"OutputedDataSourceName\": { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\tvar myProcess02 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-converter.Ogr2Ogr');\n\tvar myExecuteResult02=myProcess02.Execute(inputs02,myOutputs02);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\talert(myExecuteResult02);\n\n\tvar _tables=[\"plotestimates\",\"comsubestimates\"];\n\tfor(var j=0;j<_tables.length;j++){\n\t var inputs02={\n\t\t\"skipfailure\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t\t\"append\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"true\"},\n\t\t\"f\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PostgreSQL\"},\n\t\t\"nln\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": schema+\".\"+_tables[j]},\n\t\t\"lco\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"SPATILALITE=YES\"},\n\t\t\"OutputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": \"PG:dbname=\"+dbUser[\"dbname\"]+\" port=\"+dbUser[\"port\"]+\" user=\"+dbUser[\"user\"]+\"\"+(dbUser[\"password\"]?\" password=\"+dbUser[\"password\"]:\"\")},\n\t\t\"InputDSN\": {\"dataType\":\"string\", \"type\":\"literal\", \"value\": conf[\"main\"][\"tmpPath\"]+\"/postThin\"/**/+conf[\"lenv\"][\"usid\"]+\"_\"+i/**/+\".db\"},\n\t\t\"sql\": {\"mimeType\":\"text/plain\", \"type\":\"complex\", \"value\": 'SELECT *,'+currentId+' as zid from '+_tables[j]+''}\n\t }\n\t var myOutputs02= {\"OutputedDataSourceName\": { type: 'RawDataOutput', \"mimeType\": \"plain/text\" }};\n\t var myProcess02 = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-converter.Ogr2Ogr');\n\t var myExecuteResult02=myProcess02.Execute(inputs02,myOutputs02);//,\"Cookie: MMID=\"+conf[\"senv\"][\"MMID\"]);\n\t alert(myExecuteResult02);\n\t}\n\n\tvar fields=[\n\t\t[\"rowid,name,description,zid,wkb_geometry\",\"mmid, name, description,zid, wkb_geometry\"],\n\t\t[\"hu_id,com_sub_real,plotname,speciesname,m_dbh,max_dbh,min_dbh,n_stems,stemsha,basalha,zid,mean_height,wkb_geometry\"],\n\t\t[\"hu_id,com_sub_real,speciesname,m_dbh,m_stemsha,m_basalha,zid,m_height,wkb_geometry\"]\n\t];\n\tvar sqlQuery=\"INSERT INTO \"+schemaf+\".plot_locations (\"+fields[0][0]+\") (SELECT \"+fields[0][1]+\" from \"+schema+\".plot_locations);\";\n\tsqlQuery+=\"INSERT INTO \"+schemaf+\".plotestimates (\"+fields[1][0]+\") (SELECT \"+fields[1][0]+\" from \"+schema+\".plotestimates);\";\n\tsqlQuery+=\"INSERT INTO \"+schemaf+\".comsubestimates (\"+fields[2][0]+\") (SELECT \"+fields[2][0]+\" from \"+schema+\".comsubestimates);\";\n sqlQuery+=\"UPDATE \"+schemaf+\".zip_files set wkb_geometry=(select ST_Multi(ST_Union(\"+schema+\".plot_locations.wkb_geometry)) from \"+schema+\".plot_locations) where id=\"+currentId+\";\";\n\tsqlQuery+=\"DELETE FROM \"+schema+\".plot_locations;\";\n\tsqlQuery+=\"DELETE FROM \"+schema+\".plotestimates;\";\n\tsqlQuery+=\"DELETE FROM \"+schema+\".comsubestimates;\";\n\tsqlQuery+=\"SELECT count(*) from \"+schema+\".comsubestimates;\";\n\n var myOutputs= {\"Result\":{ type: 'RawDataOutput', \"mimeType\": \"application/json\" }};\n var myInputs={\n \"dsoName\": {\"value\": \"\",\"type\":\"string\"},\n \"dstName\": {\"value\": \"PG:dbname=\"+conf[\"mmdb\"][\"dbname\"]+\" port=\"+conf[\"mmdb\"][\"port\"]+\" host=\"+conf[\"mmdb\"][\"host\"]+\" user=\"+conf[\"mmdb\"][\"user\"]+(conf[\"mmdb\"][\"password\"]?\" password=\"+conf[\"mmdb\"][\"password\"]:\"\"),\"type\":\"string\"},\n \"q\": {\"value\": sqlQuery,\"mimeType\":\"application/json\"},\n };\n var myProcess = new ZOO.Process(conf[\"main\"][\"serverAddress\"],'vector-tools.vectInfo');\n var myExecuteResult=myProcess.Execute(myInputs,myOutputs);\n alert(myExecuteResult);\n\t\n }\n return {result: ZOO.SERVICE_SUCCEEDED, conf: conf, outputs: {Result: {\"value\": \"Data successfully published\"}}};\n}", "function hideOldArchives() {\n var oldArchiveLinks = document.getElementsByClassName(\"lwOldArchives\");\n for(i = 0; i < oldArchiveLinks.length; i++) {\n oldArchiveLinks[i].style.display=\"none\";\n var showOldAText = document.createTextNode(\"show all\");\n var showOldASpan = document.createElement(\"span\");\n showOldASpan.setAttribute(\"class\",\"showOldArchives\");\n showOldASpan.appendChild(showOldAText);\n oldArchiveLinks[i].parentNode.appendChild(showOldASpan);\n\t\tEvent.observe(showOldASpan, 'click', showOldArchives);\n }\n}", "function saveAllTranscriptEntries () {\n saveTranscriptEntries([1, 2, 3, 4]);\n}", "addMeshes(meshes) {\n\n // Iterate through each of the lists of meshes\n for (const key of Object.keys(meshes)) {\n\n // Check if the meshes is a single mesh\n if (meshes[key].species == 'Mesh') {\n\n // Add the mesh to the zip\n this.addMesh(meshes[key]);\n\n // Continue to the next list of meshes\n continue;\n }\n\n // Add the folder to the zip\n const folder = this.zip.folder(key);\n\n // Iterate through each of the meshes for the key\n for (const mesh of meshes[key]) {\n\n // Add the mesh to the folder\n this.addMesh(mesh, folder);\n }\n }\n\n // Return the exporter\n return this;\n }", "function updatePollArchive() {\n log.info('[archive]', 'Updating poll archive.');\n\n request(URL_ARCHIVE, (error, response, html) => {\n if (error)\n log.error(error.message);\n else {\n let $ = cheerio.load(html);\n let years = $('div.archiveYears p').text().match(/[0-9]+/g);\n for (let i = 0; i < years.length; i++) {\n request(URL_BASE_ARCHIVE_BY_YEAR + years[i], (error, response, html) => {\n if (error)\n log.error(error.message);\n else {\n let $ = cheerio.load(html);\n let pollCount = $('.widescroll-content table tr').length;\n\n let polls = [];\n\n for (let j = 0; j < pollCount; j++) {\n let poll = [\n $('.widescroll-content table tr .td80percent a').eq(j).attr('href').replace('results.ws?id=', ''), // id\n $('.widescroll-content table tr .td80percent a').eq(j).text().replace('\\uFFFD', '-'), // title\n dateStringToISO($('.widescroll-content table tr .td20percent').eq(j).text()) // date\n ];\n\n polls.push(poll);\n }\n\n insertPolls(polls);\n }\n });\n }\n }\n });\n}", "function exportIt() {\n\n\t\talert('The Export-Feature is currently being implemented. When finished, it will give you a handy ZIP file which includes a standalone version of your Hypervideo.');\n\n\t}", "compressFiles_() {\n this.fileIndex_ = 0;\n zip.createWriter(new zip.BlobWriter(), this.writeNextFile_.bind(this), this.reportError.bind(this));\n }", "async function all (req, res) {\n try {\n const archives = await Archives.find()\n res.json(archives)\n } catch (error) {\n res.json({message : error.message})\n }\n}", "function archiveEvent(n) {\n//add ~ to events name\nEvents[n].name=\"~ \"+Events[n].name;\n//archive event\narchive.push(Events[n]);\n//remove it from the register of actual events\nEvents.splice(n,1);\nconsole.log(\"\\nEvent with id = \"+n+\" succesfully archived.\");\n}", "function archiveorg() {\n var timeout = 0;\n console.log(\"Sending all pages to archive.org...\");\n fs.readFile(\"./_site/data/scams.json\", function(err, data) {\n data = shuffle(JSON.parse(data));\n data.forEach(function(val, key) {\n if ('url' in data[key] && 'status' in data[key] && data[key]['status'][0]['status'] == \"Active\") {\n timeout++;\n setTimeout(function() {\n request(\"https://web.archive.org/save/\" + data[key]['url'], function(e, response) {\n if (e) {\n throw e;\n } else {\n console.log(\"Archived \" + data[key]['url']);\n }\n });\n }, timeout * 10000);\n }\n });\n });\n}", "function unArchiveItems() {\n ListService.unArchiveItems();\n }", "function storeAllFiles() {\n return Q.all(\n files.map(function(f) {\n return file_limit(function() {\n return processFile(f, store, stat_cache).then((chunks) => {\n // Return the single element representation of this entry\n if(f.name === '3rd-party-licenses.txt') {\n console.log(f);\n console.log(chunks);\n }\n if(f.stat.size > 0 && chunks && chunks.length === 0) {\n console.log(\"Not possible to have size and no chunks\");\n console.log(f);\n throw(\"ERROR\");\n }\n return chunks ? (f.name + \"*\" + chunks.join(',')) : null;\n })\n })\n })\n ).then((stored_files) => {\n // Filter out null files\n stored_files = stored_files.filter(function(n) {\n return n !== null\n });\n if(dirname === 'C:\\\\jha\\\\nmap-7.00') {\n console.log(stored_files);\n }\n\n return store.storeDirectory(dirname, stored_dirs, stored_files);\n });\n }", "serializeChartExcelData() {\n this.mArchiveExcel = new ZipArchive();\n this.mArchiveExcel.compressionLevel = 'Normal';\n let type = this.chart.chartType;\n let isScatterType = (type === 'Scatter_Markers' || type === 'Bubble');\n this.serializeWorkBook();\n this.serializeSharedString(isScatterType);\n this.serializeExcelContentTypes();\n this.serializeExcelData(isScatterType);\n this.serializeExcelStyles();\n this.serializeExcelRelation();\n this.serializeExcelGeneralRelations();\n this.chartStringCount = 0;\n }", "cache (archive) {\n this.cached = this.staged\n\n if (archive) {\n this.archived = this.cached\n }\n }", "function doExport() {\n\tvar data = [];\n CiteKeys.initialize().forEach(function(item) {\n trLog('.');\n data.push(scrub(item));\n });\n\tZotero.write(JSON.stringify(data, null, \"\\t\"));\n}", "function handleTaskArchiveClick(currentTask) {\n console.log(\"handleTaskArchiveClick\");\n if (currentTask.status === TASK_STATUS_ARCHIVED) {\n if (window.confirm(\"Kill for good?!\")) {\n deleteTask(currentTask);\n notifyTaskDeleted();\n }\n } else {\n setTasks(\n tasks.map((task) => {\n if (task.id === currentTask.id) {\n task.status = TASK_STATUS_ARCHIVED;\n task.archivedAt = +new Date();\n notifyTaskArchived();\n }\n\n return task;\n })\n );\n }\n }", "static zip_folder(path_to_folder_to_zip){\n let zip = new AdmZip();\n zip.addLocalFolder(path_to_folder_to_zip)\n zip.writeZip(path_to_folder_to_zip + \".zip\")\n out(path_to_folder_to_zip + \".zip created.\")\n }", "loadArchived() {\n this.archived = []\n let datas = JSON.parse(localStorage.getItem(this.archivedKey), reviver)\n if (datas !== null) {\n for (let data of datas) {\n this.archived.push(Object.assign(new ListeCourse(), data))\n }\n } else {\n this.archived = []\n }\n }", "function archiveDoneTasks (days) {\n if (tasks.taskList.length) {\n tasks.taskList.forEach((task) => {\n if (task.TaskStack === 'stack-done' && task.StackDate < Date.now() - (86400000 * days)) {\n tasks.archiveTask(task.TaskId)\n }\n })\n }\n}", "unarchive () {\n this.cached = this.archived\n }", "function showAll() {\n\tlocation.href = '?all=1';\n}", "function disableAll(){\n\t\t\tif(exportRoot.btn_receive.visible == true){exportRoot.btn_receive.disabled = true;}\n\t\t\tif(exportRoot.btn_store.visible == true){exportRoot.btn_store.disabled = true;}\n\t\t\tif(exportRoot.btn_prep.visible == true){exportRoot.btn_prep.disabled = true;}\n\t\t\tif(exportRoot.btn_cook.visible == true){exportRoot.btn_cook.disabled = true;}\n\t\t\tif(exportRoot.btn_cool.visible == true){exportRoot.btn_cool.disabled = true;}\n\t\t\tif(exportRoot.btn_reheat.visible == true){exportRoot.btn_reheat.disabled = true;}\n\t\t\tif(exportRoot.btn_hold.visible == true){exportRoot.btn_hold.disabled = true;}\n\t\t\tif(exportRoot.btn_assemble_pack.visible == true){exportRoot.btn_assemble_pack.disabled = true;}\n\t\t\tif(exportRoot.btn_serve_sell.visible == true){exportRoot.btn_serve_sell.disabled = true;}\n\t\t}", "function addLatestArch() {\n if (!globalid)\n return;\n\n watcherSlow.unwatch(retPgn.pgnFile);\n retPgn = checkLatestArchive();\n if (retPgn) {\n touchFile(retPgn.pgnFile);\n LS(retPgn);\n LS(`Monitor pgn file: ${retPgn.pgnFile}`);\n watcherSlow.add(retPgn.pgnFile);\n }\n else\n LS(\"No current file to monitor\");\n}", "function addAll() {}", "serializeNumberings() {\n if (this.document.lists.length === 0) {\n return;\n }\n let writer = new XmlWriter();\n writer.writeStartElement('w', 'numbering', this.wNamespace);\n this.writeCommonAttributeStrings(writer);\n // this.serializePictureBullets(writer, this.mDocument.lists);\n this.serializeAbstractListStyles(writer, this.document.abstractLists);\n this.serializeListInstances(writer, this.document.lists);\n // SerializeListOverrides(writer, this.mDocument.ridesm_document.ListOverrides);\n writer.writeEndElement();\n let zipArchiveItem = new ZipArchiveItem(writer.buffer, this.numberingPath);\n this.mArchive.addItem(zipArchiveItem);\n }", "function createAchive(toArchive){\n \n console.log(toArchive);\n\n var zip = new JSZip();\n\n for(var i = 0; i < toArchive.length; i++ ){\n baseCode = toArchive[i].replace(/^data:image\\/(png|jpg);base64,/, \"\");\n zip.file('frame_' + (i+1) + '.png', baseCode, {base64: true});\n }\n\n zip.generateAsync({\n type: \"base64\"\n }).then(function(content) {\n var link = document.createElement('a');\n link.href = \"data:application/zip;base64,\" + content;\n link.download = \"Frames.zip\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n });\n\n}", "async deleteAll(){\r\n await fs.promises.writeFile(this.nombreArchivo, JSON.stringify([]));\r\n }", "function loadThisArchive(theArchive) {\n\n var thisArchivePosts = [],\n theYear = theArchive.split('.')[0],\n theMonth = theArchive.split('.')[1];\n $.get(\"posts/posts.xml\", function(posts) {\n $(posts).find('post').each(function(i) {\n var this_post = $(this),\n postYear = this_post.find('date').text().split('-')[0],\n postMonth = this_post.find('date').text().split('-')[1];\n // if post has archive being loaded\n if (theYear == postYear && theMonth == postMonth) {\n thisArchivePosts.push( buildPostObj(this_post) );\n }\n }); // end each post\n }).complete(function() {\n $('#main').empty();\n thisArchivePosts.sort(date_sort_asc);\n buildPosts(thisArchivePosts, 0, thisArchivePosts.length);\n\n var fullMonth = convertMonthNum(theArchive.split('.')[1].replace(/^0+/,''));\n var archiveInfo = 'Archive: ' + fullMonth + ', '\n + theArchive.split('.')[0] + ' <span>' + thisArchivePosts.length + ' ';\n archiveInfo+= (thisArchivePosts.length > 1) ? 'Posts' : 'Post';\n var archiveTitle = $('<h4>').html(archiveInfo+'</span>');\n\n\n $(archiveTitle).insertBefore('.post:first-of-type');\n });\n}", "function publish(data) {\n\n let toBeStoredAssets = {},\n toBeStoredEntries = {},\n toBeDeleteddata = {},\n api_key,\n _env;\n\n api_key = Stack.headers.api_key;\n _env = Stack.environment\n let result = data[0].items;\n\n\n if (result && result.length) {\n for (i = 0; i < result.length; i++) {\n if (result[i].type === \"asset_published\") {\n toBeStoredAssets[api_key + \".\" + _env + \".\" + \"Assets\"] = toBeStoredAssets[api_key + \".\" + _env + \".\" + \"Assets\"] || []\n toBeStoredAssets[api_key + \".\" + _env + \".\" + \"Assets\"].push(result[i].data);\n } else if (result[i].type === \"entry_published\") {\n toBeStoredEntries[api_key + \".\" + _env + \".\" + result[i].content_type_uid] = toBeStoredEntries[api_key + \".\" + _env + \".\" + result[i].content_type_uid] || []\n toBeStoredEntries[api_key + \".\" + _env + \".\" + result[i].content_type_uid].push(result[i].data);\n } else {\n toBeDeleteddata[api_key + \".\" + _env + \".\" + result[i].content_type_uid] = toBeDeleteddata[api_key + \".\" + _env + \".\" + result[i].content_type_uid] || []\n toBeDeleteddata[api_key + \".\" + _env + \".\" + result[i].content_type_uid].push(result[i].data);\n }\n }\n }\n\n\n if (Object.keys(toBeStoredEntries).length) {\n for (let contentType in toBeStoredEntries) {\n if (localStorage.getItem(contentType)) {\n let existing_data = JSON.parse(localStorage.getItem(contentType))\n for (i = 0; i < toBeStoredEntries[contentType].length; i++) {\n for (j = 0; j < existing_data.length; j++) {\n if (toBeStoredEntries[contentType][i].uid === existing_data[j].uid && existing_data[j]._version < toBeStoredEntries[contentType][i]._version) {\n const index = j;\n existing_data.splice(index, 1);\n }\n }\n }\n let final_data = existing_data.concat(toBeStoredEntries[contentType])\n localStorage.setItem(contentType, JSON.stringify(final_data));\n } else {\n\n localStorage.setItem(contentType, JSON.stringify(toBeStoredEntries[contentType]))\n }\n }\n }\n\n\n if (Object.keys(toBeStoredAssets).length) {\n for (let assets in toBeStoredAssets) {\n if (localStorage.getItem(assets)) {\n let existing_data = JSON.parse(localStorage.getItem(assets))\n for (i = 0; i < toBeStoredAssets[assets].length; i++) {\n for (j = 0; j < existing_data.length; j++) {\n if (toBeStoredAssets[assets][i].uid === existing_data[j].uid && existing_data[j]._version < toBeStoredAssets[assets][i]._version) {\n const index = j;\n existing_data.splice(index, 1);\n }\n }\n }\n let final_data = existing_data.concat(toBeStoredAssets[assets])\n localStorage.setItem(assets, JSON.stringify(final_data));\n } else {\n localStorage.setItem(assets, JSON.stringify(toBeStoredAssets[assets]))\n }\n }\n }\n\n if (Object.keys(toBeDeleteddata).length) {\n unpublish(toBeDeleteddata)\n }\n\n if (data[0].pagination_token) {\n localStorage.setItem(\"pagination_token\", data[0].pagination_token);\n } else {\n localStorage.setItem(\"sync_token\", data[0].sync_token);\n }\n\n\n if (!location.hash) {\n render_session_lists();\n return \"true\";\n } else {\n return \"true\";\n }\n}", "getAll() {\n let inventoryList = [];\n for(let id in this.warehouse) {\n inventoryList.push(\n Object.assign({}, this.warehouse[id])\n );\n }\n return inventoryList;\n }", "async returnAllArchivedNotes(req, res){\n try{\n const allArchivednotes = await notesModel.find({isArchived: true, isDeleted: false, userID: res.token.id})\n logger.log('info', `Status: 200: Successfully returned all archived notes`)\n res.status(200).json(this.createResponseObject(200, true, \"Successfully returned all archived notes\", allArchivednotes))\n } catch(error){\n logger.log('error', `Status: 500: ${error.message}`)\n res.status(500).json(this.createResponseObject(500, false, \"Server side error\", error.message))\n }\n }", "function exportMyTramites() {\n for (var tramite in vm.listaTramitesProceso) {\n vm.myTramitesForExport.push({\n 'Docente': vm.listaTramitesProceso[tramite].usuario,\n 'RFC': vm.listaTramitesProceso[tramite].rfc,\n 'Tramite': vm.listaTramitesProceso[tramite].tramite,\n 'Fecha': vm.listaTramitesProceso[tramite].fecha,\n 'Estatus': vm.listaTramitesProceso[tramite].estatus\n });\n }\n alasql('SELECT * INTO XLSX(\"ReporteTramites.xlsx\",{headers:true}) FROM ?', [vm.myTramitesForExport]);\n }", "static all() {\n return allDoges\n }", "serialize(viewer) {\n /* tslint:disable:no-any */\n let document = viewer.owner.sfdtExportModule.write();\n this.setDocument(document);\n this.mArchive = new ZipArchive();\n this.mArchive.compressionLevel = 'Normal';\n this.mVerticalMerge = new Dictionary();\n this.mGridSpans = new Dictionary();\n let contenttype;\n //document.xml\n this.serializeDocument();\n //Styles.xml\n this.serializeStyles();\n //numbering.xml\n this.serializeNumberings();\n //theme.xml\n // if (m_document.DocHasThemes && !isNullOrUndefined(m_document.Themes))\n // SerializeThemes();\n // else\n // this.serializeDefaultThemes();\n //settings.xml\n this.serializeSettings();\n //core.xml\n this.serializeCoreProperties();\n //app.xml\n this.serializeAppProperties();\n //fontTable.xml\n this.serializeFontTable(contenttype);\n //custom.xml\n // if (!isNullOrUndefined(this.wordDocument.CustomDocumentProperties) && m_document.CustomDocumentProperties.length > 0) {\n // SerializeCustomProperties();\n // }\n //Settings Relations\n this.serializeSettingsRelation();\n //Numbering relation if the document has picture bullet\n // if (PictureBullets.length > 0) {\n // SerializeNumberingsRelation();\n // }\n this.serializeHeaderFooters();\n //document relations\n this.serializeDocumentRelations();\n // // Add controls to archieve.\n // if (ControlsPathNames.length > 0) {\n // AddControlsToZip(m_document.DocxPackage);\n // }\n // if (!isNullOrUndefined(m_document.CustomUIPartContainer))\n // AddPartContainerToArchive(m_document.CustomUIPartContainer);\n // if (!isNullOrUndefined(m_document.CustomXMLContainer))\n // AddPartContainerToArchive(m_document.CustomXMLContainer);\n //general relations\n this.serializeGeneralRelations();\n //[ContentTypes].xml\n this.serializeContentTypes(contenttype);\n // Clears the internal fields maintained for serializing.\n this.clearDocument();\n }", "function G_MOVE_TO_ARCHIVED(_fileId, _taskid, __sender, __fromStage ){\n // add control for sender\n Logger.log( \"G_MOVE_FROM_FULFILLED_TO_ARCHIVED\" )\n var fromStage = \"fulfilled\";\n if( __fromStage != null){\n fromStage = __fromStage;\n }\n var sheet_fulfilled = F_Get_Sheet_By_Name( _fileId, \"fulfilled\" );\n var sheet_archived = F_Get_Sheet_By_Name( _fileId, \"archived\" );\n // var sheet_active = SpreadsheetApp.getActiveSheet();\n var data_fulfilled = sheet_fulfilled.getDataRange().getValues();\n\n// var data_control = sheet.getDataRange().getValues();\n// Logger.log( )\n for( var ira=0; ira<data_fulfilled.length; ira++ ){\n Logger.log( \"Comp = \" + data_fulfilled[ira][0] + \" == \" + _taskid )\n if(data_fulfilled[ira][0] == _taskid ){\n sheet_archived.appendRow( data_fulfilled[ira] );\n sheet_fulfilled.deleteRow(ira+1);\n var date = new Date(),\n event = \"Archivation\",\n comment = \"Task was archived\",\n stage = \"archived\";\n G_ADD_JOURNAL_EVENT_AND_SAVE(_fileId, _taskid, date, event, comment, __sender, stage );\n }\n }\n \n}", "archiveTask({ patchState, getState }, { payload }) {\n const state = getState().entities;\n const entities = Object.assign(Object.assign({}, state), { [payload]: Object.assign(Object.assign({}, state[payload]), { state: 'TASK_ARCHIVED' }) });\n patchState({\n entities,\n });\n }", "function archivedActivities() {\n $.each(json, function(index, value) {\n\n if (value.eventMonthAndYear == $(\".mthsName\").text()) {\n\n var dropBox = value.boxId;\n var iconClone = $('<div class=\"icon icon-clone\" data-activity=\"' + value.eventIcon + '\"></div>');\n var tooltipBox = $('<span class=\"tooltip\"></span>');\n tooltipBox.text(value.description);\n\n iconClone.append(tooltipBox);\n $(\"#\" + dropBox).append(iconClone); \n }\n });\n }", "function archive(email_id) {\n fetch(`/emails/${email_id}`, {\n method: 'PUT',\n body: JSON.stringify({\n archived: true\n })\n })\n .then(() => load_mailbox('inbox'));\n}", "function registerRouteArchives(app) {\n if (config_1.Config.ARENA_MODE) {\n return;\n }\n const lobby = lobby_1.Lobby.getInstance();\n app.get(\"/archives/:gameName?/:pageStart?/:pageCount?\", async (req, res) => {\n const params = req.params;\n const gameName = String(params.gameName || \"all\");\n let pageStart = Number(params.pageStart);\n if (isNaN(pageStart)) {\n pageStart = 1; // starting page\n }\n let pageCount = Number(params.pageCount);\n if (isNaN(pageCount)) {\n pageCount = DEFAULT_PAGE_COUNT; // starting page\n }\n const { gamelogInfos } = lobby.gamelogManager;\n const startIndex = Math.max(gamelogInfos.length - (pageStart * pageCount), 0);\n const endIndex = startIndex + pageCount;\n // Because logs (all the gamelogs GamelogManager found) is pre-sorted\n // with the newest gamelogs at the END, startIndex starts at the end.\n // We want to first show the NEWEST gamelogs.\n const gamelogs = utils_1.formatGamelogInfos(gamelogInfos\n .slice(startIndex, endIndex)\n .reverse(), req.headers.host);\n const newerUri = endIndex < gamelogInfos.length\n ? (`/archives/${gameName}/${pageStart - 1}`)\n : undefined;\n const olderUri = startIndex > 0\n ? (`/archives/${gameName}/${pageStart + 1}`)\n : undefined;\n res.render(\"archives\", {\n gamelogs,\n newerUri,\n olderUri,\n });\n });\n}", "function writeToArchive(food) {\n firebase.database().ref('foodArchive').push().set({\n food : food\n });\n}", "function archiveMovie(e) {\n //3b Get input values for current movie to archive\n let movieLi = e.target.parentElement.parentElement;\n let ticketsSoldInput = movieLi.querySelector('div input');\n let ticketsSold = ticketsSoldInput.value;\n \n if (ticketsSold.trim() !== '' &&\n !isNaN(Number(ticketsSold))) {\n //3c convert values where needed\n ticketsSold = Number(ticketsSold);\n let priceStrong = movieLi.querySelector('div strong');\n let price = Number(priceStrong.textContent);\n \n //3d create html structure for archived movie\n let hallStrong = movieLi.querySelector('strong');\n let totalPrice = price * ticketsSold;\n hallStrong.textContent = `Total amount: ${totalPrice.toFixed(2)}`;\n \n let rightDiv = movieLi.querySelector('div');\n rightDiv.remove();\n \n let deleteButton = document.createElement('button');\n deleteButton.textContent = 'Delete';\n //4a Attach event listener each movie's delete button\n deleteButton.addEventListener('click', deleteFromArchive);\n movieLi.appendChild(deleteButton);\n \n //3e attach Html structure to movies archive section\n let archiveUl = document.querySelector('#archive ul');\n archiveUl.appendChild(movieLi);\n }\n }", "static getAll(){\n return [...all]\n }", "queryArchives(conn) {\r\n if (!this.hasQueriedArchive) {\r\n // HACK? - I mean technically this is correct but it feels wrong\r\n this.hasQueriedArchive = true;\r\n let archivesStanza = this.xmpp.$iq({ type: 'set', xmlns: EjabberdConstants_1.EjabberdConstants.MessageXMLNS, id: uuidv4() });\r\n archivesStanza.c(\"query\", { queryid: uuidv4(), xmlns: EjabberdConstants_1.EjabberdConstants.archivesXMLNS });\r\n this.sendStanza(conn, archivesStanza);\r\n }\r\n }", "serializeStyles() {\n let writer = new XmlWriter();\n writer.writeStartElement('w', 'styles', this.wNamespace);\n writer.writeAttributeString('xmlns', 'mc', undefined, this.veNamespace);\n writer.writeAttributeString('xmlns', 'r', undefined, this.rNamespace);\n writer.writeAttributeString('xmlns', 'w', undefined, this.wNamespace);\n writer.writeAttributeString('xmlns', 'w14', undefined, this.w14Namespace);\n writer.writeAttributeString('xmlns', 'w15', undefined, this.w15Namespace);\n writer.writeAttributeString('mc', 'Ignorable', undefined, 'w14 w15');\n //writes the document defaults, latent styles and default styles.\n this.serializeDefaultStyles(writer);\n //writes the document styles\n this.serializeDocumentStyles(writer);\n writer.writeEndElement(); //end of styles tag\n let zipArchiveItem = new ZipArchiveItem(writer.buffer, this.stylePath);\n this.mArchive.addItem(zipArchiveItem); //this.stylePath, styleStream, false, FileAttributes.Archive);\n }", "archiveTask(id) {\n this.store.dispatch(new _state_task_state__WEBPACK_IMPORTED_MODULE_3__[\"ArchiveTask\"](id));\n }", "function alldone() {\r\n\t\t// combine and compress modules\r\n\t\tvar module = {\r\n\t\t\t\tcode: results.join(''),\r\n\t\t\t\tmodified: modified\r\n\t\t\t};\r\n\r\n\t\t// no compressing? done.\r\n\t\tif (!compress) { return next(null, module); }\r\n\r\n\t\tcompress(module, function(err, js) {\r\n\t\t\tmodule.code = js.code || js;\r\n\t\t\tnext(err, err ? null : module);\r\n\t\t});\r\n\t}", "function success(id, o) {\n $archive.removeClass(\"processing\");\n Y.log('archives_fetch success');\n var response = null;\n // Filter out any PHP warnings before or after the output.\n var match = o.responseText.match(/\\{\"archiveapi\":{.*\\}}/m);\n if (match === null) {\n // Show general error.\n M.local_rlsiteadmin.show_error('archive_error_general');\n Y.log(\"Unable to discard archive!\");\n return;\n }\n YUI().use('json-parse', function (Y) {\n try {\n response = Y.JSON.parse(match[0]);\n }\n catch (e) {\n Y.log(\"Parsing failed.\");\n }\n });\n if (response.archiveapi.error) {\n // Show archive currently being restored error.\n M.local_rlsiteadmin.show_error('archive_error_restore_in_progress');\n } else if (response.archiveapi.httpcode == 503) {\n // Show archive busy error.\n M.local_rlsiteadmin.show_error('archive_error_api_busy');\n } else {\n // Convert archive to open slot.\n $archive.setAttribute('data-archiveid', '');\n $archive.removeClass('archive');\n $archive.addClass('slot');\n $archive.addClass('slot-open');\n var slothtml = Y.one('.archive-manager .templates .slot').getHTML();\n $archive.set('innerHTML', slothtml);\n // Update the used slot counter.\n M.local_rlsiteadmin.used_slots--;\n Y.one('#rlarchives #numused').setHTML(M.local_rlsiteadmin.used_slots);\n }\n }", "exportToUSFMFile(jsonData) {\n var _this = this;\n\n var ListofLanguage = _this.state.getTargetLanguages;\n var FileNameSlanguage = '';\n var FileNameTlanguage = '';\n if(ListofLanguage != null){\n Object.keys(ListofLanguage).map(function(data, index){\n if(ListofLanguage[data] === _this.state.Sourcelanguage){\n FileNameSlanguage = data;\n }\n if(ListofLanguage[data] === _this.state.Targetlanguage){\n FileNameTlanguage = data;\n }\n return null;\n })\n }\n\n zip = new JSZip();\n $.each(jsonData, function(key, value) {\n zip.file(key + '.usfm', value)\n });\n zip.generateAsync({type:\"blob\"})\n .then(function(content) {\n saveAs(content, FileNameSlanguage + 'To' + FileNameTlanguage + '.zip');\n }, function(err){\n _this.setState({uploaded: 'failure'}) \n })\n }", "function updateArchive(source_id, dest_id) {\r\n var dest_sheet = SpreadsheetApp.openById(dest_id);\r\n var source_data = SpreadsheetApp.openById(source_id).getSheets()[0].getDataRange().offset(1, 0).getValues();\r\n for (i in source_data) {\r\n var row = source_data[i];\r\n if (row[0])//if row[0] == anything\r\n {\r\n dest_sheet.appendRow(row);\r\n }\r\n } \r\n}", "handleArchive(event) {\n event.stopPropagation();\n\n const { id, isPublished, actions: { handleArchiveBlock } } = this.props;\n\n let archiveMessage = i18n._t(\n 'ElementHeader.CONFIRM_DELETE',\n 'Are you sure you want to send this block to the archive?'\n );\n\n if (isPublished) {\n archiveMessage = i18n._t(\n 'ElementHeader.CONFIRM_DELETE_AND_UNPUBLISH',\n 'Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?'\n );\n }\n\n // eslint-disable-next-line no-alert\n if (handleArchiveBlock && confirm(archiveMessage)) {\n handleArchiveBlock(id);\n }\n }", "function getPatchsZip(data){\n const zip = new JSZip();\n const imgFolder = zip.folder(\"images\");\n empty($UI.modalbox.body);\n createPatchList(data.patches);\n $UI.modalbox.open();\n // return;\n data.patches.forEach((p,index)=>{\n // create something\n \n // get image from iip\n if(!p.isPoint) getImage({\n zip:zip,\n images:imgFolder,\n data:data,\n patch:p\n }, getImageCallback);\n })\n\n function check(patches){\n const p = patches.filter(p=>{return !p.isPoint}).find(p=>{return (!p.error)&&(!p.location)});\n if(p) return false;\n return true;\n }\n\n var checkImageIsReady = setInterval(function () {\n if(check(data.patches)) {\n clearInterval(checkImageIsReady);\n $UI.modalbox.body.innerHTML+=`<div style='color:#365f9c;font-size:20px'> Compressing...</div>`\n data.patches.forEach(p=> {\n delete p.label;\n delete p.widthInClient;\n })\n const meta_content = [['name','location'],[data.name,data.location]];\n const patch_cols = ['id','color','note','isPoint','x','y','width','height','loaction'];\n const patches_content = [patch_cols];\n\n data.patches.forEach((p,idx)=>{\n patches_content.push([idx,p['color'],p['note'],p['isPoint'],p['size']['x'],p['size']['y'],p['size']['width'],p['size']['height'],p['location']]);\n });\n \n zip.file(`metadata.csv`, meta_content.map(r=>r.join(\",\")).join(\"\\n\"));\n zip.file(`patches.csv`, patches_content.map(r=>r.join(\",\")).join(\"\\n\"));\n \n zip.generateAsync({type:\"blob\"})\n .then(function(content) {\n // see FileSaver.js\n saveAs(content, `${data.name}-Patches-${new Date().toISOString()}.zip`);\n $UI.modalbox.close();\n });\n }\n }, 500);\n}", "function fn_archive(msgid,id)\n{\n\t\tvar dataparam = \"oper=archivemsg\"+\"&msgid=\"+msgid;\n\t\t$.ajax({\n\t\ttype: 'post',\n\t\turl: 'tools/message/tools-message-message-ajax.php',\n\t\tdata: dataparam,\t\t\n\t\tbeforeSend: function(){\n\t\t\tshowloadingalert(\"Message storing in archive please wait\");\t\n\t\t},\n\t\tsuccess: function (data) {\t\n\t\tsetTimeout('closeloadingalert()',500);\n\t\tshowloadingalert(\"Message stored successfully\");\n\t\tsetTimeout('closeloadingalert()',1000);\n\t\tsetTimeout('removesections(\"#tools-message-message\");',500);\n\t\tsetTimeout('showpageswithpostmethod(\"tools-message\",\"tools/message/tools-message.php\",\"id='+id+'\");',1000);\n\t\t}\n\t});\n}", "function displayBackups() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if (visualizationElements.length > 0) {\n for (let x = 0; x < visualizationElements.length; x++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[x].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[x].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n displayGlobalBackup(visualizationElements[x]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n displayPlaylistBackup(visualizationElements[x], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n displaySongBackup(visualizationElements[x], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistBackup(visualizationElements[x], playlist, song);\n }\n }\n }\n }", "function exportAggregate() {\n\t/*\n\tOnly data element in datasets included. Include config option for \"placeholder\"\n\tdatasets that is only used to get dependencies, but where the actual dataset is not \n\tincluded in the export file. This also includes other data elements used in \n\tindicators, like those for population.\n\t\n\tFavourites and indicator formulas should still be checked for data elements, \n\tcategory option groups, legend sets etc. For legend sets, category option groups etc\n\tthey should be included, but for data elements we should only show a warning that \n\tthey need to be added to a data set to be included.\n\t*/\n\n\tconsole.log(\"1. Downloading metadata\");\n\n\t//Do initial dependency export\n\tvar promises = [\n\t\tdependencyExport(\"dataSet\", currentExport.dataSetIds),\n\t\tdependencyExport(\"dashboard\", currentExport.dashboardIds),\n\t\tlimitedDependencyExport(currentExport.exportDataSetIds),\n\t\tcustomObjects()\n\t];\n\tQ.all(promises).then(function (results) {\n\n\n\t\t//Get indicators and categoryOptionGroupSets from favourites and groups\n\t\t//Get validation rules and groups from conf file\n\t\t//Get data element and indicator groups from conf files\n\t\tpromises = [\n\t\t\tindicators(),\n\t\t\tcategoryOptionGroupSetStructure(),\n\t\t\tvalidationRules(),\n\t\t\tsaveObject(\"dataElementGroups\", currentExport.dataElementGroupIds),\n\t\t\tsaveObject(\"indicatorGroups\", currentExport.indicatorGroupIds),\n\t\t\tuserGroups(),\n\t\t\tusers()\n\t\t];\n\t\tQ.all(promises).then(function (results) {\n\n\t\t\t//Get legends from data elements, indicators and favourites\n\t\t\t//Get indicator types from indicators\n\t\t\t//Get predictors based on data elements\n\t\t\tpromises = [\n\t\t\t\tindicatorTypes(),\n\t\t\t\tlegendSets(),\n\t\t\t\tpredictors()\n\t\t\t];\n\t\t\tQ.all(promises).then(function (results) {\n\n\t\t\t\tprocessAggregate();\n\n\t\t\t});\n\n\t\t});\n\n\t});\n\n}", "function changeArchiveAllIconWhenComplete (iconObj) {\n archivesFinished++\n if (archivesFinished >= 2) {\n $(iconObj).attr('src', chrome.extension.getURL('./images/archives/allListedArchives_success.png'))\n $(iconObj).unbind()\n $(iconObj).removeClass('archiveLogo')\n }\n}", "deployArtifacts() {\n let singleDeploy = {};\n singleDeploy.action = \"deploy\";\n singleDeploy.unitInfo = this.deployFile.unitInfo;\n singleDeploy.unitInfo.path = angular.copy(this.deployFile.targetPath);\n singleDeploy.fileName = this.deployFile.fileName;\n singleDeploy.repoKey = this.deployFile.repoDeploy.repoKey;\n\n if (this.deployFile.unitInfo.Internal && this.deployFile.unitConfigFileContent) {\n singleDeploy.publishUnitConfigFile = true;\n singleDeploy.unitConfigFileContent = this.deployFile.unitConfigFileContent;\n }\n if (!this.deployFile.unitInfo.bundle) {\n this.artifactDeployDao.post(singleDeploy).$promise.then((result)=> {\n if (result.data) {\n this.deploySuccess(result.data);\n }\n });\n }\n else {\n this.artifactDeployDao.postBundle(singleDeploy).$promise.then((result)=> {\n if (result.data) {\n this.deploySuccess(result.data);\n }\n });\n }\n }", "function updateArchivedPolls() {\n log.info('[archive]', 'Updating archived polls.');\n let sql = `\n SELECT poll_ID FROM poll\n WHERE\n poll_ID != ${(LIVE_POLL_ID ? LIVE_POLL_ID : 0)} AND\n poll_ID NOT IN (SELECT DISTINCT poll_ID FROM votes);`;\n\n dbConnection((connection, resolve, reject) => {\n connection.query(sql, (err, rows, fields) => {\n if (err)\n reject(err);\n else {\n for (let i = 0; i < rows.length; i++) {\n setTimeout(function () {\n parsePollQuestions(rows[i].poll_ID)\n .then(() => {\n parsePollResults(rows[i].poll_ID, false);\n })\n .catch(() => { });\n }, i * 200);\n }\n resolve();\n }\n });\n });\n}", "function pruneArchive (days) {\n if (days && days !== 0) {\n tasks.taskList.forEach((task) => {\n if (task.TaskStack === 'stack-archive' && task.UpdateTimestamp < Date.now() - (86400000 * days)) {\n tasks.deleteTask(task.TaskId)\n }\n })\n }\n}", "export() {\r\n return {\r\n name: this.name,\r\n version: this.version,\r\n scrypt: this.scrypt,\r\n accounts: this.accounts.map(acct => acct.export()),\r\n extra: this.extra\r\n };\r\n }", "function zipBuild() {\n\treturn src(build.base.dest + '**/**/*')\n\t\t\t.pipe(zip(build.out))\n\t\t\t.pipe(dest(build.dest));\n}", "uploadAll() {\n const that = this;\n\n if (that.disabled || that._items.length === 0) {\n return;\n }\n\n for (let i = that._items.length - 1; i >= 0; i--) {\n if (!that._items[i].uploading) {\n that.uploadFile(that._items[i].index);\n }\n }\n }", "function getAll() {\n return inventory;\n }", "function buildSidebarArchives(archives) {\n\n var sideArch = $('ul#sidebar_archives').empty();\n archives.sort(archiveDateSort);\n var currDate = new Date();\n for (i = 0; i < archives.length; i++) {\n var archive_item = $('<li>').addClass('hvr-bounce-to-right')\n .append( $('<a>')\n .attr('href','blog.html?archive='+archives[i].year+'.'+archives[i].month)\n .html( convertMonthNum(archives[i].month.replace(/^0+/, '') ) )\n );\n if (archives[i].year != currDate.getFullYear()) {\n archive_item.find('a').append( $('<i>').html(archives[i].year.slice(2,4)) );\n }\n archive_item.find('a').append( $('<span>').html(archives[i].count) );\n sideArch.append(archive_item);\n }\n $('<div>').addClass('load_all').append(\n $('<a>').attr('href','posts/archives.html').html('Full Archives')\n ).insertAfter('ul#sidebar_archives');\n}", "exportPrint() {\n this.sortContests();\n let outputs = [];\n\n // Go through each print sections\n let sections = this.get('print');\n if (!sections) {\n debug('No print sections found');\n return;\n }\n\n _.each(sections, section => {\n let now = moment();\n let subset = this.filterContests(section.where);\n let outputPath = [\n 'print',\n now.format('YYYYMMDD-HHmmss'),\n section.filename\n ? section.filename.toUpperCase() +\n '_' +\n now.format('DDMMYY') +\n '_' +\n now.format('HHmm') +\n '.txt'\n : 'saxo-elections-' +\n utility.urlSafe(utility.makeID(section.title)) +\n '.txt'\n ];\n outputs.push(outputPath);\n\n this.export(print(subset, section), ...outputPath);\n });\n\n return outputs;\n }", "export() {\n\t\treturn {}\n\t}", "saveAll() {\n let all = {\n nextColor: this.managers.colorAssigner.getState(),\n lastZ: this.managers.zAssigner.getState(),\n infoNotePosition: this.infoNote.getPosition(),\n notes: this.notes.map(n => n.getState())\n };\n\n const mainText = JSON.stringify(all);\n const hash = this.hashCode(mainText);\n const lead = 'NOTESAPP1.0-';\n\n return lead + hash + mainText;\n }" ]
[ "0.65388364", "0.6031656", "0.58802557", "0.5793322", "0.5741232", "0.56024027", "0.55449665", "0.5541877", "0.5540081", "0.5515804", "0.5464233", "0.54307604", "0.5352858", "0.53518295", "0.534513", "0.5327826", "0.52628964", "0.5239142", "0.5197979", "0.5191908", "0.5173061", "0.51715165", "0.5163373", "0.5162532", "0.5152249", "0.5136173", "0.5103553", "0.5094651", "0.50594664", "0.5004252", "0.49698046", "0.49491572", "0.49382752", "0.49378583", "0.49282083", "0.4925101", "0.4916502", "0.49103802", "0.4906773", "0.48762384", "0.48754475", "0.4874337", "0.48740315", "0.48710105", "0.48536623", "0.48471296", "0.48440042", "0.483759", "0.483659", "0.48354214", "0.482585", "0.48121378", "0.47942543", "0.47902542", "0.47815004", "0.47744995", "0.47704443", "0.47675532", "0.47649598", "0.4763958", "0.47414678", "0.47307456", "0.47029474", "0.4700671", "0.46992758", "0.46937776", "0.4659317", "0.46495605", "0.46480376", "0.464741", "0.4632097", "0.4621459", "0.46209192", "0.46203497", "0.46187738", "0.46114963", "0.46086535", "0.45953864", "0.45896557", "0.45802507", "0.4578479", "0.4575237", "0.45726305", "0.45662072", "0.4564857", "0.45562717", "0.4546451", "0.4544608", "0.45398584", "0.45334458", "0.45302355", "0.45288888", "0.45265546", "0.45211256", "0.4520544", "0.4518439", "0.45183223", "0.45162526", "0.45109767", "0.45083043", "0.4501368" ]
0.0
-1
Button method close sheet without saving.
closeWithoutSaving() { const sheetName = this.get('closeSheetName') this.get('fdSheetService').rollbackCurrentItem(sheetName); this.confirmClose(sheetName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeWithSaving() {\n const sheetName = this.get('closeSheetName')\n this.get('fdSheetService').saveCurrentItem(sheetName, true);\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "function buttonPoweClicked()\n{\n this.window.close();\n}", "close() {\n this.closeButton.on('click', null);\n this.modal(false);\n this.window.remove();\n }", "function close () {\n\tcMessage.style.cssText = '';\n\theading.style.cssText = '';\n\tscorePanel.style.cssText = '';\n\tdeck.style.cssText = '';\n\tcopyright.style.cssText = '';\n\trestartButton.classList.remove('disable');\n\tcopyright.classList.remove('disable');\n}", "_handleCloseClick() {\n\t\tthis.close();\n\t}", "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "function handleCloseClick(){\n handleClose()\n }", "closeModal() {\n this.close();\n }", "function close() {\n $modalInstance.dismiss();\n }", "willTransition() {\n this.get('fdSheetService').closeSheet(this.get('sheetComponentName'));\n this.get('fdSheetService').closeSheet(this.get('sheetViewName'));\n\n this._super(...arguments);\n }", "_close() {\n set(this, 'isOpen', false);\n set(this, 'isToStep', false);\n\n let action = get(this, 'attrs.closeAction');\n let vals = get(this, '_dates');\n let isRange = get(this, 'range');\n\n if (action) {\n action(isRange ? vals : vals[0] || null);\n }\n\n this._destroyOutsideListener();\n }", "clickedClose() {\n this.close(\"slide\");\n }", "function close() {\n var desc1 = new ActionDescriptor();\n desc1.putEnumerated( stringIDToTypeID( \"saving\" ), stringIDToTypeID( \"yesNo\" ), stringIDToTypeID( \"no\" ) );\n desc1.putInteger( stringIDToTypeID( \"documentID\" ), app.activeDocument.id);\n desc1.putBoolean( stringIDToTypeID( \"forceNotify\" ), true );\n executeAction( stringIDToTypeID( \"close\" ), desc1, DialogModes.NO );\n}", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "closeDialog() {\n // Trigger the popup to close\n tableau.extensions.ui.closeDialog();\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 }", "closeSaveAs() {\n this.set('showSaveAs', false);\n }", "function cerrar() {\twindow.close(); }", "close() {\n this.sendAction('close');\n }", "function CerrarVentana(){\r\n\twindow.close();\r\n}", "function closeOss() {\n\t\t\tdocument.getElementById(\"Oss\").style.width = \"0\";\n\t\t}", "function closeDialog() {\n document.querySelector(\"#inq_student\").classList.add(\"hide\");\n document.querySelector(\"#inq_student .closebutton\").removeEventListener(\"click\", closeDialog);\n }", "function close_btn() {\n\n\t//Close window on click\n\t$(\".close-this\").click(function(){\n\t\t$(this).parent().hide();\n\t});\n}", "function close() {\n // automatically blur current element\n // on reload otherwise would hang\n //\n document.activeElement.blur();\n\n // and close the cli\n if (ws) {\n // disable any onclose handler first\n ws.onclose = function () { };\n ws.close();\n }\n }", "cancel() {\n this.close();\n }", "function exportCloseHandler(obj)\n{\n const exportDiv = $(\"#export-div\");\n exportDiv.remove();\n}", "close() {\n this.widgets.pop();\n this._checkFixedNeeded();\n if (this.widgets.length === 0) {\n this._removeFixedContainer();\n }\n }", "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 }", "close() {\n\n this.overlay.remove();\n this.overlay = null;\n\n }", "close() {\n this.googleInfoWindow_.close();\n this.googleInfoWindow_.setContent(null);\n }", "function close() {\n $mdDialog.hide();\n }", "close() {\n this.modal.dismiss();\n }", "function closeSipolo() {\n\t\t\tdocument.getElementById(\"Sipolo\").style.width = \"0\";\n\t\t}", "function handleClose() {\n setOpen(false)\n setEditItem(null)\n }", "function Close(){\n $('.row').remove();\n}", "close() {\n // Remove blockchain buttons and nodes - full reset\n wallets.page.boxes.c2.buttonRanges.inputControls.removeButtons();\n }", "function fnClose(){\n\n\twindow.close();\n\n}", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\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 onClose() {\r\n window.close();\r\n}", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "close() {\n super.close();\n this._popupForm.reset();\n }", "close() {\n\n this.state.infowindow.close();\n }", "handleCloseClick()\n {\n invokeCloseModal() \n this.close()\n }", "close() {\n if (!this.isOpen()) {\n return;\n }\n this.flyout_.hide();\n // TODO: We can remove the setVisible check when updating from ^10.0.0 to\n // ^11.\n if (this.workspace_.scrollbar &&\n /** @type {*} */ (this.workspace_.scrollbar).setVisible) {\n /** @type {*} */ (this.workspace_.scrollbar).setVisible(true);\n }\n Blockly.Events.fire(new BackpackOpen(false, this.workspace_.id));\n }", "function onCancelButtonClick() {\n modal.close();\n }", "function onCancelButtonClick() {\n modal.close();\n }", "function exit(){\n window.close();\n}", "close() {\n this.showDayView = this.showMonthView = this.showYearView = false\n if (!this.isInline) {\n this.$el.querySelector('.vdp-datepicker div').style.boxShadow = \"none\";\n this.$emit('closed');\n document.removeEventListener('click', this.clickOutside, false)\n }\n }", "onSubmit() {\n this.activeModal.close(1);\n }", "closeModal() {\n this.closeModal();\n }", "function closeHss() {\n\t\t\tdocument.getElementById(\"Hss\").style.width = \"0\";\n\t\t}", "close() {\n this.$store.commit(HIDE_SHARE_MODAL);\n this.$store.commit(LOAD_FULL_CONTENTS_SUCCESS, null);\n }", "close() {\n const that = this;\n\n if (!that.opened) {\n return;\n }\n\n that._close();\n }", "function close(element){\n element.style.display = \"none\";\n}", "close() {\n this._showPopup = false;\n }", "onClose() {\n\t\t}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "closeWithAction() {\n this.dismissWithAction();\n }", "closeButton() {\n if (this.openDoors == true) {\n this.closeDoors();\n }\n }", "close() {\n var windowPosition = this.window.getPosition();\n config.set(\"window.x\", windowPosition[0]);\n config.set(\"window.y\", windowPosition[1]);\n\n this.window.close();\n }", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "function closeDialog() {\n\tdialog.close();\n\tbuttonOpen.removeAttribute(\"class\", \"close\");\n\tbuttonOpen2.removeAttribute(\"class\", \"close\");\n}", "function onCloseButtonClick(event) {\n //delete app-container\n _iframe.tell('close-app-view', {});\n }", "function closeInterest() {\n interestDiv.style.display = 'none';\n homeView.style.display = 'block';\n information.style.display='block';\n events.style.display='none';\n sights.style.display='none';\n closeButton.style.display='none';\n informationButton.className = 'categoryButton selected material-icons';\n sightsButton.className = 'categoryButton material-icons';\n eventsButton.className = 'categoryButton material-icons';\n readButton.style.display = 'inline-block';\n pauseButton.style.display = 'none';\n stopButton.style.display = 'none';\n stop();\n}", "function window_close() {\n window.close()\n}", "function onBackBtnClick(e) {\n\t\twin.close();\n\t}", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "function closeHuaweitick() {\n\t\t\tdocument.getElementById(\"Huaweitick\").style.width = \"0\";\n\t\t}", "function closeEditor(event) {\n event.preventDefault();\n var edit_window = document.getElementById('table_editor');\n edit_window.classList.remove('active');\n //edit_window.style.display = 'none';\n document.getElementsByClassName('sales-data')[0].style.opacity = 1;\n}", "close() {\n this.state_ = WindowState.CLOSING;\n this.appWindow_.close();\n }", "function cancelClicked()\n{\n dwscripts.setCommandReturnValue(\"\");\n\n window.close();\n}", "close(styleOut) {\n if (this.visible) {\n let functionOut;\n if (styleOut === \"fade\") functionOut = this.fadeOut;\n else functionOut = this.slideOut;\n\n this.changing = true;\n functionOut(() => {\n this.changing = false;\n this.updateTabIndexCallback();\n });\n }\n }", "function exit() {\n window.close();\n}", "w3_close() {\n\t\tthis.mySidenav.style.display = \"none\";\n\t\tthis.overlayBg.style.display = \"none\";\n\t}", "function closeDialog() {\n setDialogOpen(false)\n }", "function sellerModalClose() {\r\n document.getElementsByTagName('body')[0].classList.remove('ovh');\r\n document.querySelectorAll('.seller-registration-modal')[0].classList.remove('seller-registration-modal_opened');\r\n document.querySelectorAll('.seller-registration-window').forEach(function (win) {\r\n win.style.display = 'none';\r\n });\r\n }", "function handleClose() {\n setOpen(false)\n }", "function make_panel_disappear (e) {\n\n var test_app = UiApp.createApplication(); \n var close_me_button = test_app.createButton('Close Me');\n var my_panel = test_app.createVerticalPanel();\n \n test_app.setTitle('UI Test App').setHeight(50).setWidth(100);\n \n \n // See: https://developers.google.com/apps-script/uiapp#DisplayingSpreadsheet # Using Client Handlers\n var close_me_client_handler =\n test_app.createClientHandler()\n .forEventSource()\n .setEnabled(false)\n .setVisible(true);\n \n var close_me_server_handler =\n test_app.createServerClickHandler('close_panel');\n \n // Add our new handler to be invoked when the button is clicked\n close_me_button.addClickHandler(close_me_server_handler);\n \n my_panel.add(close_me_button);\n test_app.add(my_panel);\n \n // USE if webapp --> return test_app; // this DISPLAYs the app's top level container element\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n spreadsheet.show(test_app);\n \n}", "function Close() {\n } // Close", "function closeEricssontick() {\n\t\t\tdocument.getElementById(\"Ericssontick\").style.width = \"0\";\n\t\t}", "closemodal() {\n this.modalCtr.dismiss();\n }", "function closeIppbx() {\n\t\t\tdocument.getElementById(\"Ippbx\").style.width = \"0\";\n\t\t}", "function closeOrchestrator() {\n\t\t\tdocument.getElementById(\"Orchestrator\").style.width = \"0\";\n\t\t}", "function onPressContactJosie() {\n isActionSheetOpen.current = true;\n awesomeModalRef.current.close();\n actionSheetRef.current.show();\n }", "function close(open){\r\n\t\t\tself.confirm_title = open;\r\n\t\t\tself.confirm_type = BootstrapDialog.TYPE_WARNING;\r\n\t\t\tself.confirm_msg = self.confirm_title + ' without saving data?';\r\n\t\t\tself.confirm_btnclass = 'btn-warning';\r\n\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t\t\tfunction (res) {\r\n\t\t\t\t\t\t\t\tfetchAllVehicles();\r\n\t\t\t\t\t\t\t\tself.save = \"saveclose\";\r\n\t\t\t\t\t\t\t\treset();\r\n\t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t );\r\n\t\t}", "function ClosePopup() {\n document.getElementById('popup').style.display='none'; \n document.getElementById('shadow').style.display='none';\n \n setSquareNums();\n saveSudoku();\n}", "function closeTab1() {\n // close rocket section\n descriptionRocketEarth.classList.remove('displayYes')\n descriptionRocketEarth.classList.add('displayNone')\n imgChevronRockEarth.src = 'images/earthChevron.png'\n //close datas sections\n descriptionDatasEarth.classList.remove('displayYes')\n descriptionDatasEarth.classList.add('displayNone')\n imgChevronDatasEarth.src = 'images/earthChevron.png'\n}", "function onPressEventSitting() {\n isActionSheetOpen.current = true;\n awesomeModalRef.current.close();\n actionSheetRef.current.show();\n }", "function closeCscf() {\n\t\t\tdocument.getElementById(\"Cscf\").style.width = \"0\";\n\t\t}", "function close() {\n $(this).parent().hide();\n}", "function closePressed() {\n $uibModalInstance.dismiss('cancel');\n }" ]
[ "0.7764902", "0.6784473", "0.6784473", "0.653303", "0.63223547", "0.63204664", "0.6280046", "0.62722516", "0.6242167", "0.62165785", "0.61930865", "0.61598074", "0.6143568", "0.61163086", "0.60978764", "0.6096772", "0.6096772", "0.6096772", "0.6043881", "0.60309917", "0.5998642", "0.59942144", "0.5991003", "0.59736156", "0.5964318", "0.59434795", "0.593756", "0.5929794", "0.59273255", "0.5921233", "0.5910301", "0.59102625", "0.59102625", "0.59038734", "0.58971184", "0.58857524", "0.58848864", "0.58703023", "0.5869218", "0.5855725", "0.5853206", "0.58417743", "0.58341706", "0.58341706", "0.5832901", "0.58103853", "0.58103806", "0.58103806", "0.58082145", "0.5799186", "0.57966435", "0.57871014", "0.5785042", "0.57809895", "0.57809895", "0.5780013", "0.5776035", "0.5773941", "0.5752286", "0.5745697", "0.5738296", "0.57337713", "0.57334083", "0.5732432", "0.5728962", "0.5727668", "0.57256734", "0.57234555", "0.5717457", "0.57076997", "0.5696293", "0.56951964", "0.5695137", "0.5692111", "0.5690319", "0.5687097", "0.56846637", "0.5684556", "0.56835866", "0.5677614", "0.56707907", "0.56699914", "0.5659276", "0.5655538", "0.5650963", "0.56476027", "0.5642667", "0.5641046", "0.56335086", "0.5633035", "0.5631235", "0.56309193", "0.5627315", "0.5620895", "0.56188035", "0.56146365", "0.56102973", "0.56082004", "0.56081367", "0.5603212" ]
0.7401484
1
Button method save and close sheet.
closeWithSaving() { const sheetName = this.get('closeSheetName') this.get('fdSheetService').saveCurrentItem(sheetName, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeWithoutSaving() {\n const sheetName = this.get('closeSheetName')\n this.get('fdSheetService').rollbackCurrentItem(sheetName);\n this.confirmClose(sheetName);\n }", "function save ()\n {\n $uibModalInstance.close(vm.item);\n }", "function saveAndExit() {\n scope.showSaveAndExitModal = true;\n }", "saveAndExit() {\n saveAndExit();\n }", "function saveAndClose(){\n save_button.addEventListener('click', function(event){\n event.preventDefault();\n active_element.innerHTML = editable_content.value;\n let json = {\n project_id: iframe.attributes['data-project-id'].value,\n selector: getUniqueSelector(active_element),\n change_value: editable_content.value,\n comment: content_comment.value\n }\n let myJSON = JSON.stringify(json);\n // Send data to backend\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/savechanges\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n console.log(\"Saved!\");\n }\n };\n xhr.send(myJSON);\n\n pu.style.display = 'none';\n editable_content.innerHTML = \"\";\n });\n close_button.addEventListener('click', function(){\n pu.style.display = \"none\";\n editable_content.innerHTML = \"\";\n });\n }", "function save() {\r\n\t\tvar date = new Date(),\r\n\t\t\tall = $('.cell'),\r\n\t\t\tsaveboard = [],\r\n\t\t\tcondition;\r\n\t\t\r\n\t\t// saves current state of board\r\n\t\tfor (var i = 0; i < TOTALCELLS; i++) {\r\n\t\t\tsaveboard[i] = ($(all[i]).hasClass('clicked')) ? 'c' : $(all[i]).text();\r\n\t\t}\r\n\t\r\n\t\tif (messageDiv.hasClass('loseMessage')) {\r\n\t\t\tcondition = 'l';\r\n\t\t} else if (messageDiv.hasClass('winMessage')) {\r\n\t\t\tcondition = 'w';\r\n\t\t}\r\n\r\n\t\tvar value = { \r\n size: SIZE,\r\n condition: condition,\r\n time: time,\r\n clicks: clicks,\r\n board: saveboard,\r\n cells: cells,\r\n minecells: minecells\r\n };\r\n\t\t\r\n\t\tlocalStorage.setItem(STORAGE_NAME, JSON.stringify(value));\r\n\t\tloadButton.removeClass('noload');\r\n\t\tmessageDiv.removeClass().addClass('notice').html('saved!');\r\n\t}", "saveAndClose() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "function onSaveButtonPress() {\n\tif (!validateSettings()) return;\n\tdlgMain.close(saveButtonID);\n}", "saveSheet(name=\"sheet.json\") {\n textFileUserDownload(JSON.stringify(this.fbpSheet.exportJSON(),\n (key, value) =>\n (key === \"id\" && value instanceof Number) ? \"#\"+value.toString(16)\n : value\n ,\n 2),\n name\n );\n }", "onClickSave() {\n HashBrown.Helpers.SettingsHelper.setSettings(this.model.id, null, 'info', this.model.settings.info)\n .then(() => {\n this.close();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function closeSave() {\n const title = document.querySelector('#title-input').value;\n const body = document.querySelector('#input-textarea').value;\n if(title) {\n fetch('/documents/' + document_id, {\n method: 'PUT',\n body: JSON.stringify({\n title: title,\n body: body\n })\n });\n }\n else {\n fetch('/documents/' + document_id, {\n method: 'PUT',\n body: JSON.stringify({\n body: body\n })\n });\n }\n if(title != \"\") {\n document.querySelector('#doc-title').innerHTML = title;\n }\n document.querySelector('#overlay').style.display = 'none';\n document.querySelector('#save-popup').style.display = 'none';\n}", "function save() {\n Bar.createWithConfig(dataForm.name, dataForm.frequency, PoP.getFinalStatements().getItem(dataForm.final_statement))\n .then(() => {\n goBack();\n return Promise.resolve()\n })\n .catch(error => {\n console.log(error);\n console.dir(error);\n console.trace();\n\n Dialog.alert({\n title: \"Error\",\n message: error,\n okButtonText: \"Ok\"\n });\n\n return Promise.reject(error);\n });\n\n\n\n\n}", "closeSaveAs() {\n this.set('showSaveAs', false);\n }", "function delsaveButton(){\r\n localStorage.removeItem(\"save\")\r\n location.reload();\r\n}", "function writeBook() {\n\tfile.workbook.xlsx.writeFile(path)\n\t\t.then(() => {\n\t\t\tconsole.log(`[${dateNow()}] Added posts to excel file succesfully!!`);\n\t\t})\n\t\t.catch(console.error);\n}", "function respondToExportButton() { \n google.script.run.export_gcal_to_gsheet(); \n return false;\n }", "function save(e) {\n\tif (markerSwitch === false && document.getElementById(\"name\").value.trim() !== '') {\n\t\t//Inserts a new row and cells to the markertable and assigns values to cells\n\t var table = document.getElementById(\"markertable\");\n\t row = table.insertRow(-1);\n\t var cell1 = row.insertCell(0);\n\t var cell2 = row.insertCell(1);\n\t var cell3 = row.insertCell(2);\n\t\tvar cell4 = row.insertCell(3);\n\t\tvar cell5 = row.insertCell(4);\n\t\tvar cell6 = row.insertCell(5);\n\t\tcell1.innerHTML = tableRowId;\n\t cell2.innerHTML = '<div class=\"brk\" style=\"word-break:break-all;\">' + document.getElementById(\"name\").value + '</div>';\n\t cell3.innerHTML = '<div class=\"brk\" style=\"word-break:break-all;\">' + document.getElementById(\"desc\").value + '</div>';\n\t cell4.innerHTML = document.getElementById('coordinates').value;\n\t\tcell6.innerHTML = '<button class=\"btn btn-danger deletebutton\" onclick=\"deleteRow(this)\">Kustuta</button>';\n\t\tcell4.id = coordCellId;\n\n\t\t//Marker gets popup text from \"name\" and \"desc\" textareas\n\t\tnewMarker.bindPopup(\"Nimi: \" + document.getElementById(\"name\").value.toString()\n\t\t\t\t\t\t\t\t\t\t\t+ \"<br>Kirjeldus: \" + document.getElementById(\"desc\").value.toString());\n\n\t\t//Function for opening corresponding marker popup upon clicking table row\n\t\trow.addEventListener('click', function() {\n\t\t\tmarkerDict[cell4.id].openPopup();\n\t\t}, false);\n\n\t\t//Clear textfields\n\t document.getElementById(\"name\").value = '';\n\t document.getElementById(\"desc\").value = '';\n\n\t\t//Set button states\n\t document.getElementById('setmarker').disabled = false;\n\t\tdocument.getElementById('save').disabled = true;\n\t\tdocument.getElementById('cancel').disabled = true;\n\n\t\tif (tableRowId === 1) { //First marker icon color to green\n\t\t\tmarkerDict[coordCellId].setIcon(greenIcon);\n\t\t}\n\n\t\tmarkerDict[coordCellId].setIcon(greenIcon);\n\t\ttableRowId++;\n\t\tcoordCellId++;\n\t\tdistanceCalc();\n\t\tnearestCalc();\n\t markerSwitch = true;\n\n\t} else if(document.getElementById(\"name\").value.trim() == '') { //If \"Nimi\" is empty\n\t\talert(\"Unustasid markerile nime määrata!\");\n\t} else { //Marker hasn't been set on the map\n\t\talert(\"Unustasid markeri kaardile märkida!\");\n\t}\n}", "_handleButtonSave()\n {\n var element = this._getJQueryElement();\n if ($(element).is(':visible'))\n {\n this.model.set('job_settings', this._editor.getValue());\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOWJOB_SAVE, {workflowjob: this.model, workflow: this._workflow});\n }\n }", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function save() {\n $(\"#save-dialog\").dialog({\n resizable: false,\n draggable: false,\n height: 200,\n width: 400,\n modal: true,\n buttons: {\n \"Yes\": function () {\n saveBackend(true);\n $(this).siblings(\".ui-dialog-titlebar\").find(\"button\").remove();\n $(this).siblings(\".ui-dialog-buttonpane\").remove();\n $(this).children(\"p\").text(\"Saving and archiving...\");\n $(this).children(\"img\").show();\n },\n \"No\": function () {\n saveBackend(false);\n $(this).siblings(\".ui-dialog-titlebar\").find(\"button\").remove();\n $(this).siblings(\".ui-dialog-buttonpane\").remove();\n $(this).children(\"p\").text(\"Saving...\");\n $(this).children(\"img\").show();\n }\n }\n });\n}", "function saveButton() { \n \n if ($(\"#selectWorksheet\").val() == null || $(\"#selectCampo1\").val() == null || $(\"#selectCampo2\").val() == null || $(\"#selectCampo3\").val() == null) {\n alert('Configuración inválida \\n\\Selecciona una hoja de trabajo y campos válidos.');\n return;\n }\n else {\n if ($(\"#selectCampo1\").val() == 'NA' && $(\"#selectCampo2\").val() == 'NA' && $(\"#selectCampo3\").val() == 'NA') {\n alert('Configuración inválida \\n\\nSelecciona al menos un campo.');\n return;\n }\n else {\n var l1 = $(\"#selectCampo1\").val();\n var l2 = $(\"#selectCampo2\").val();\n var l3 = $(\"#selectCampo3\").val();\n \n if ((l1 == 'NA' && (l2 != 'NA' || l3 != 'NA')) || (l2 == 'NA' && (l3 != 'NA') )) {\n alert('Configuración inválida \\n\\nCampos deben ser consecutivos.');\n return;\n }\n if (l1 == 'NA' || l2 == 'NA' || l3 == 'NA') {\n alert('Configuración inválida \\n\\nAl menos 3 campos obligatorios.');\n return;\n }\n if (l1 == l2 || l1 == l3 || l2 == l3) {\n alert('Configuración inválida \\n\\nNo se permiten campos duplicados.');\n return;\n }\n \n }\n } \n\n tableau.extensions.settings.set(\"selectWorksheet\", $(\"#selectWorksheet\").val()); \n tableau.extensions.settings.set(\"selectCampo1\", $(\"#selectCampo1\").val());\n tableau.extensions.settings.set(\"selectCampo2\", $(\"#selectCampo2\").val());\n tableau.extensions.settings.set(\"selectCampo3\", $(\"#selectCampo3\").val()); \n\n tableau.extensions.settings.saveAsync().then((currentSettings) => {\n tableau.extensions.ui.closeDialog(\"10\");\n });\n }", "submitSave() {\n confirmAlert({\n title: 'Confirm To Save',\n message: 'Are you sure you want to do this?',\n buttons: [\n {\n label: 'Yes',\n onClick: () => this.saveData()\n },\n {\n label: 'No',\n onClick: () => { }\n }\n ],\n closeOnEscape: true,\n closeOnClickOutside: true\n });\n }", "onClickSaveBtn(ev){\n\tthis.hide()\n\tthis.owner.setDates(this.data)\n}", "dispose() {\n this._save();\n }", "savePool(file) {\n this.book.xlsx.writeFile(file);\n }", "onClickSave() {\n SettingsHelper.setSettings(this.projectId, null, 'info', this.model)\n .then(() => {\n this.modal.hide();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function save_and_export() {\r\n\r\n}", "function handleSaveChangesButton(event, file_name_stockImg) {\n let startDate = $('#startDate').val();\n let stockPublished;\n if (document.getElementById('published').checked) {\n stockPublished = \"true\";\n } else {\n stockPublished = \"false\";\n }\n startDate = moment(startDate).format(\"YYYY-MM-DD\")\n let endDate = \"\"\n if ($('#endDate').val() !== null || $('#endDate').val() !== \"\") {\n endDate = $('#endDate').val()\n endDate = moment(endDate).format(\"YYYY-MM-DD\")\n }\n if (endDate === \"Invalid date\") {\n endDate = \"\"\n }\n\n const stock = {\n id: $('#stockId').val(),\n stockImg: file_name_stockImg,\n stockTitle: $('#stockTitle').val(),\n stockText: $('#stockText').summernote('code'),\n startDate: startDate,\n endDate: endDate,\n published: stockPublished\n }\n let method = (stock.id !== '' ? 'PUT' : 'POST')\n fetchStock(stock, method)\n\n function fetchStock(stock, method) {\n fetch(stockApiUrl, {\n method: method,\n headers: myStockHeaders,\n body: JSON.stringify(stock)\n }).then(function (response) {\n if (response.status === 200) {\n successActionMainPage(\"#mainWindowAlert\", \"Акция успешно сохранена\", \"success\")\n } else {\n successActionMainPage(\"#mainWindowAlert\", \"Акция не сохранена\", \"error\")\n }\n })\n }\n\n $('#stockModal').modal('hide')\n}", "function saveData() {\n\t\t\n\t\t// After Save, Alert User with a Dailog //\n\t\t$.mobile.changePage( \"#dialogAlert\", {\n\t\t transition: \"pop\",\n\t\t reverse: false,\n\t\t changeHash: false\n\t\t});\n\n\t\t// When #alertDialog Loads, Target ID, Clear the Div and Append the Following Save Alert //\n\t\t// In A listview with an Anchor Leading to #viewData //\n\t\t$('#alert').empty();\n\t\t$('#alert').append($('<li>').append($('<a href=\"#viewData\" id=\"saveAlertLink\" data-icon=\"rightarrow\"></a>')\n\t\t\t.append($('<img src=\"save.png\" class=\"iconImg\" />' +\n\t\t\t\t'<h4>Hooray!</h4>' +\n\t\t\t\t'<p>Your Loan Has Been Saved!</p>')\n\t\t)));\n\t\t// Refresh The Dialog listview to Ensure Proper View //\n\t\t$('#alert').listview(\"refresh\");\n\t}", "onSavePress() {\n\t\t\tvar sUrl = this._buildPreviewURL(this._buildReturnedURL());\n\t\t\tif (isValidUrl(sUrl) && this._areAllTextFieldsValid() && this._areAllValueStateNones()) {\n\t\t\t\tthis._close(this._buildReturnedSettings());\n\t\t\t} else {\n\t\t\t\tthis._setFocusOnInvalidInput();\n\t\t\t}\n\t\t}", "function downloadExcel(){\n\t\n\tvar fileName = sheet.getName()+\".xlsx\";\n\t\n\tvar json = spread.toJSON({\n\t\tincludeBindingSource : true ,\n\t\trowHeadersAsFrozenColumns : true ,\n\t\tcolumnHeadersAsFrozenRows : true ,\n\t\tignoreFormula : true ,\n\t\tignoreStyle : false\n\t});\n\t\t\n // here is excel IO API\n excelIO.save(json, function(blob){\n saveAs(blob, fileName);\n }, function (e) {\n // process error\n console.log(e);\n }, {password: \"\"});\n \n}", "function saveBoard() {\n $scope.board.$create(\n function (result) {\n $scope.isSaving = false;\n $modalInstance.dismiss('success');\n $state.go('sb.board.detail', {boardID: result.id});\n }\n );\n }", "function onSaveClick() {\n logger.info('save_button click event handler');\n closeKeyboards();\n clearAllErrors();\n var isValid = true;\n\n if (!($.customer_profile_first_name.value)) {\n showError($.customer_profile_first_name, $.first_name_error, _L('Please provide a first name.'), true);\n isValid = false;\n }\n if (!($.customer_profile_last_name.value)) {\n showError($.customer_profile_last_name, $.last_name_error, _L('Please provide a last name.'), true);\n isValid = false;\n }\n\n if (isValid) {\n var params = {\n first_name : $.customer_profile_first_name.value,\n last_name : $.customer_profile_last_name.value\n };\n\n var promise = currentCustomer.setProfile(params);\n Alloy.Router.showActivityIndicator(promise);\n promise.done(function(model, params, options) {\n notify(_L('Customer profile data successfully saved.'));\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n });\n }\n\n if (!isValid) {\n notify(_L('Please fill in all the required fields.'));\n }\n}", "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "saveAs () {\n const filepath = dialog.showSaveDialog(this.win, {\n title: translate(\"dialog-save\"),\n defaultPath: this.filepath || this.defaultPath\n });\n if (filepath) {\n return this.save(filepath);\n }\n return Promise.resolve(false);\n }", "function createSaveButton(panel, translator) {\n const trans = (translator || nullTranslator).load('jupyterlab');\n function onClick() {\n if (panel.context.model.readOnly) {\n return showDialog({\n title: trans.__('Cannot Save'),\n body: trans.__('Document is read-only'),\n buttons: [Dialog.okButton({ label: trans.__('Ok') })]\n });\n }\n void panel.context.save().then(() => {\n if (!panel.isDisposed) {\n return panel.context.createCheckpoint();\n }\n });\n }\n return addToolbarButtonClass(ReactWidget.create(React.createElement(UseSignal, { signal: panel.context.fileChanged }, () => (React.createElement(ToolbarButtonComponent, { icon: saveIcon, onClick: onClick, tooltip: trans.__('Save the notebook contents and create checkpoint'), enabled: !!(panel &&\n panel.context &&\n panel.context.contentsModel &&\n panel.context.contentsModel.writable) })))));\n }", "function ExportSave() {\n Gameboy.Core.exportSave();\n}", "function save() {\n $scope.broadcastFromRoot(addPageCtrl.constants.CC_PAGE_ADDED, { page: addPageCtrl.page });\n closeDialog();\n }", "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n saveOutputOption();\r\n break;\r\n }\r\n}", "function resetsheet() {\nwindow.location.reload();\n}", "save() {\n this.currentTabView.save();\n }", "function save() {\n if (!pro) {\n $ionicPopup.alert({\n title: 'Pro Feature',\n template: 'Workouts can only be saved in Ruckus Pro. You can however still share!'\n });\n return false;\n }\n\n if (vm.saved) {\n return false;\n }\n workoutService.editOrCreate(saveSnapShot.date, saveSnapShot).then(function(res) {\n vm.saved = true;\n }, function(err) {\n log.log('there was an error with saving to the datastore' + err);\n });\n }", "saveThenCloseDialog () {\n\n // Save a reference to this component\n let thisComponent = this;\n\n // Make sure to piece together the settings\n const newSettings = {\n 'salesforce': {\n 'FieldMappings': this.state.selectedFieldMappings,\n 'ObjectName': this.state.selectedObject,\n 'username': util.getProp(['salesforce','username'],this.state.settings,''),\n 'password': util.getProp(['salesforce','password'],this.state.settings,'')\n },\n 'tableau': {\n 'worksheet': this.state.selectedSheet\n }\n }\n\n // Persist the changes made to settings\n tableau.extensions.settings.set(thisComponent.state.config.settingsKey, JSON.stringify(newSettings));\n tableau.extensions.settings.saveAsync().then((newSavedSettings) => {\n thisComponent.closeDialog()\n });\n }", "function callSaveFile() {\n let win = BrowserWindow.getFocusedWindow();\n win.webContents.send('save-menu-click');\n}", "function toggleSaveButton(con){\n\n\tsaveButton.visible = false;\n\tif(con){\n\t\tsaveButton.visible = true;\n\t\t\n\t\tbuttonReplay.x = canvasW/100 * 40;\n\t\tsaveButton.x = canvasW/2;\n\t\tscoreboardButton.x = canvasW/100 * 60;\n\t\tbuttonReplay.y = saveButton.y = scoreboardButton.y = canvasH/100*65;\n\t}else{\n\t\tbuttonReplay.x = canvasW/100 * 45;\n\t\tscoreboardButton.x = canvasW/100 * 55;\n\t\tbuttonReplay.y = saveButton.y = scoreboardButton.y = canvasH/100*65;\t\n\t}\n}", "function menuSaveClick(event) {\n // console.log('menuSaveClick');\n\n event.preventDefault();\n\n let diagramTitle = PageData.SavedImageTitle;\n let storageKey = Date.now().toString();\n\n let overwrite = Common.customConfirm('Overwrite existing diagram?');\n if (overwrite) {\n storageKey = PageData.Filename;\n } else {\n diagramTitle = Common.customPrompt('Save diagram as:', diagramTitle);\n if (!diagramTitle) return;\n }\n\n const svgXml = SvgModule.getSvgXml();\n const svgObject = { Title: diagramTitle, SvgXml: svgXml };\n const jsonData = JSON.stringify(svgObject);\n localStorage.setItem(storageKey, jsonData);\n}", "function close() {\n var desc1 = new ActionDescriptor();\n desc1.putEnumerated( stringIDToTypeID( \"saving\" ), stringIDToTypeID( \"yesNo\" ), stringIDToTypeID( \"no\" ) );\n desc1.putInteger( stringIDToTypeID( \"documentID\" ), app.activeDocument.id);\n desc1.putBoolean( stringIDToTypeID( \"forceNotify\" ), true );\n executeAction( stringIDToTypeID( \"close\" ), desc1, DialogModes.NO );\n}", "function saveDataToSheet(records)\n{\n //START - command to clear the data in the Spreadsheet\n ClearCells();\n //END - command to clear the data in the Spreadsheet \n \n var spreadsheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1WG-gZMZuRni403_fskzHYnqW8qm0AxqeUwfnRyOw3Cc/edit#gid=0');\n var sheet = spreadsheet.getSheetByName(\"Sheet1\");\n for(var r=0;r<records.length;r++)\n {\n sheet.appendRow([records[r].OrderId,records[r].Quantity,records[r].Product, records[r].Destination,records[r].CustomerEmail ]);\n }\n \n}", "function clickSaveButton() {\n\tif(this.innerHTML === savedButtText) {\n\t\tthis.innerHTML = notSavedButtText;\n\t} else {\n\t\tthis.innerHTML = savedButtText;\n\t}\n\n\tupdateAllSavedPCs();\n}", "function saveBook(event) {\n event.preventDefault();\n let currentTitle = this.querySelector('[name=title-x]').value;\n let currentAuthor = this.querySelector('[name=author-x]').value;\n let currentPages = this.querySelector('[name=pages-x]').value;\n const userBook = new Book(currentTitle, currentAuthor, currentPages);\n addBookToLibrary(userBook);\n document.querySelector(\".modal\").style.display = 'none';\n formatBookObject();\n}", "onAfterSaveCell(row, cellName, cellValue) {\n this.id = row.id;\n this.updatingButtonOnSaveCell(this.id,row.pushedToStage);\n var newValue = ({\n id: this.id,\n defaultShipMethodId: row.defaultShipMethodId,\n shipMethodName: row.shipMethodName,\n shippingMethodServiceCode: row.shippingMethodServiceCode\n })\n alert(`Sucessfully saved the value!`);\n return this.UpdatingData(newValue);\n }", "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "saveRecipeCard() {\n this.articleSaveRecipeCardButton.scroll();\n if (this.articleSaveRecipeCardButton.waitForExist()) {\n this.recipeCardID = this.getRecipeID();\n this.articleSaveRecipeCardButton.click();\n }\n }", "onSaved() {\n this.saved.raise();\n }", "function onPressEventSitting() {\n isActionSheetOpen.current = true;\n awesomeModalRef.current.close();\n actionSheetRef.current.show();\n }", "function saveClickHandler() {\n var billingFolderHeader = $(\"#billingFolderHeader\");\n var equipmentHoursHeader = $(\"#equipmentHoursHeader\");\n\n // Reset label colors for properties being verified\n billingFolderHeader.css( \"color\", \"#000000\" );\n equipmentHoursHeader.css( \"color\", \"#000000\" );\n\n // After checking the equipment hours, this function is called to\n // confirm the billing folder selection before saving the work order\n var confirmBillingFolderFn = function() {\n var confirmPrompt =\n Localization.getText( \"billingFolderConfirmPrompt\" ).replace( \"billingFolder\",\n repairDetailsViewModel.selectedBillingFolder() );\n if ( WorkOrder.isBillingFolderVerified() ) {\n saveWorkOrder();\n } else {\n Dialog.showConfirmYesNo( Localization.getText( \"billingFolderLabel\" ),\n confirmPrompt,\n function() {\n Dialog.closeDialog( false );\n WorkOrder.setBillingFolderVerified( true );\n saveWorkOrder();\n },\n function() {\n Dialog.closeDialog( false );\n billingFolderHeader.css( \"color\", \"#FF0000\" );\n }, \"400px\"\n );\n }\n };\n\n if ( repairDetailsViewModel.hourMeter() < currentlySavedHourMeter ) {\n // Equipment hour meter cannot be less than currently saved value\n equipmentHoursHeader.css( \"color\", \"#FF0000\" );\n Dialog.showAlert( Localization.getText( \"equipmentHoursLabel\" ),\n Localization.getText( \"equipmentHourMeterValueInvalid\" ) + currentlySavedHourMeter,\n null, \"350px\" );\n } else if ( repairDetailsViewModel.hourMeter() == currentlySavedHourMeter ){\n // Display confirm when equipment hour meter is unchanged\n Dialog.showConfirmYesNo( Localization.getText( \"equipmentHoursLabel\" ),\n Localization.getText( \"equipmentHoursUnchangedPrompt\"),\n function() {\n Dialog.closeDialog( false );\n confirmBillingFolderFn();\n }, function() {\n equipmentHoursHeader.css( \"color\", \"#FF0000\" );\n Dialog.closeDialog( false );\n }, '400px'\n );\n } else {\n confirmBillingFolderFn();\n }\n }", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "onClickSave() {\n let saveAction = this.$element.find('.editor__footer__buttons select').val();\n let postSaveUrl;\n\n let setContent = () => {\n // Use publishing API\n if(this.model.getSettings('publishing').connectionId) {\n // Unpublish\n if(saveAction === 'unpublish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/unpublish', this.model);\n\n // Publish\n } else if(saveAction === 'publish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/publish', this.model);\n \n // Preview\n } else if(saveAction === 'preview') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/preview', this.model);\n\n }\n }\n\n // Just save normally\n return HashBrown.Helpers.RequestHelper.request('post', 'content/' + this.model.id, this.model);\n }\n\n this.$saveBtn.toggleClass('working', true);\n\n // Save content to database\n setContent()\n .then((url) => {\n postSaveUrl = url;\n \n return HashBrown.Helpers.RequestHelper.reloadResource('content');\n })\n .then(() => {\n this.$saveBtn.toggleClass('working', false);\n \n this.reload();\n \n HashBrown.Views.Navigation.NavbarMain.reload();\n\n this.dirty = false;\n\n if(saveAction === 'preview') {\n UI.iframeModal(\n 'Preview',\n postSaveUrl\n );\n }\n })\n .catch((e) => {\n this.$saveBtn.toggleClass('working', false);\n UI.errorModal(e);\n });\n }", "function close(type) {\n if (type == 'save') {\n $uibModalInstance.close(oneThreePackingEditModalCtrl.ePage.Masters.Package.FormView);\n } else {\n $uibModalInstance.close(oneThreePackingEditModalCtrl.ePage.Masters.Package.FormViewCopy);\n }\n }", "onAfterSaveCell(){\n console.log(\"saved!\");\n alert(\"test\");\n }", "function saveButtonOnClick(ev)\n{\n\tlet stopPointInfo = getCurrentStopPointInfo();\n\t//console.log(\"saveButtonOnClick(\", ev, \"): name \", stopPointInfo.name);\n\tlet savedStopPoints = generateStopPointsToSave(stopPointTable, stopPointInfo);\n\tstorage.setStopPoints(savedStopPoints);\n}", "function openSaveAs() {\n var ediv = $(\"#edit-widget-content\").get(0);\n if ($.data(ediv, \"assetid\")) {\n saveAssetContent(null,null);\n } else {\n if (contentEditCriteria.producesResource) {\n $.perc_browser({on_save:onSave, initial_val:\"\"});\n } else {\n saveAssetContent(contentEditCriteria.contentName,null);\n }\n }\n }", "'.save click'() {\n this.saveContact();\n Navigator.openParentPage();\n\n // Prevent the default submit behavior\n return false;\n }", "function saveText(event) {\n var saved = ( $(this).parent().children().eq(1) ).val();\n //console.log(saved);\n var index = $(this).parent().children().eq(1).attr(\"index\");\n //console.log(index);\n textStorage[index] = saved;\n \n $(this).parent().children().eq(2).attr(\"class\", \"saveBtn\");\n $(this).parent().children().eq(2).children().attr(\"class\", \"fas fa-save\");\n //console.log(save);\n //console.log(textStorage);\n localStorage.setItem(\"hour_planner\", JSON.stringify(textStorage));\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "function openSave () {\n $('#saveTemplate').modal('show');\n }", "function openSave () {\n $('#saveTemplate').modal('show');\n }", "async function _export(exportName, creator,sheets,dataArray) {\n try {\n const workbook = new excelJS.Workbook();\n workbook.creator = creator ; \n \n sheets.forEach(s => {\n\n const worksheet = workbook.addWorksheet(`${s}`)\n const data = dataArray[s]\n const fixColumnsDef = columnDefs[s + 'Columns'].slice()\n var columnDef = fixColumnsDef\n \n worksheet.columns = columnDef.map(col => {\n return { key: col.id, header: col.columnTitle, width: col.columnWidth };\n });\n\n for (const d of data) {\n let rowData = {};\n for (const column of columnDef) {\n if (column.format) {\n rowData[column.id] = column.format(d[column.propertyName]);\n }\n else {\n rowData[column.id] = d[column.propertyName];\n }\n }\n var row = worksheet.addRow(rowData);\n }\n worksheet.properties.defaultRowHeight = 25;\n worksheet.properties.defaultColWidth = 30; \n\n })\n\n //now dump custom attributes.\n\n const buffer = await workbook.xlsx.writeBuffer();\n fs.writeFileSync(`./Excel_Exports/${exportName}.xlsx`, buffer, \"binary\")\n console.log(`./Excel_Exports/${exportName}.xlsx is saved`);\n return true\n } catch (e) {\n console.log(`./Excel_Exports/${exportName}.xlsx failed`);\n return false \n } \n}", "function save() {\n\n // stops the loop so that it will not automatically get more updates\n stop_loop();\n loading();\n\n // display deployments again so that it disables Save button and site buttons at the same time\n saving = true;\n document.getElementById(\"save\").disabled = true;\n console.log(\"saving...\");\n obj.init = \"False\";\n display_deployments();\n\n dep = {};\n dep['new_deployments'] = new_deployments;\n DATA['deployments'] = dep;\n api.request(\"update\", \"deployments\");\n\n}", "close() {\n\t\tthis.model.save({ content: this.input.val() });\n\t\tthis.$el.removeClass('editing');\n\t}", "click() {\n let $saveIcon = $(\"#\" + this.recId + \" .save_button i\");\n\n RecButton.toggleIconFill($saveIcon);\n\n if ($saveIcon.hasClass(\"fas\")) {\n DatabaseUpdater.putRecToUserWatchlist(this.rec, CurrentUser);\n } else {\n DatabaseUpdater.deleteRecFromUserWatchlist(this.rec, CurrentUser);\n }\n }", "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "close() {\n\t\tif (!this.open) throw \"la encuesta ya está cerrada.\"\n\t\tthis.open = false;\n\t\tthis.save();\n\t}", "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "function saveAction(saveURL)\r\n{\r\n var workArea = _getWorkAreaDefaultObj();\r\n var docData = workArea.getHTMLDataObj();\r\n if(docData != null && docData.hasUserModifiedData() == true)\r\n {\r\n \tdocData.setSaveURL(saveURL);\r\n docData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n \tvar objAjax = new htmlAjax();\r\n \tobjAjax.error().addError(\"warningInfo\", szMsg_No_change, false);\r\n \t_displayProcessMessage(objAjax);\r\n }\r\n}", "function saveAnimation(){\n $scope.component.ui.savingStatus = 'saving'\n var animation = editorAnimationToProjectAnimation($scope.component.animation);\n\n AnimationService.updateAnimationByIndex(animation, $scope.component.ui.selectedAnimationIdx, function () {\n // $scope.animations = AnimationService.getAllAnimations();\n $scope.component.ui.savingStatus = 'saved'\n toastr.info(\"保存成功\");\n $scope.$emit(\"ChangeCurrentPage\");\n $timeout(function(){\n $scope.component.ui.savingStatus = ''\n },1000)\n }.bind(this));\n }", "function saveEvent() {\n $('.save-button').on('click', function() {\n var trId = $(this)\n .closest('tr')\n .attr('id');\n var textAreaVal = $(this)\n .closest('tr')\n .find('textarea')\n .val()\n .trim();\n\n storedSchedule = JSON.parse(localStorage.getItem(date));\n scheduleObj = {};\n\n scheduleObj[trId] = textAreaVal;\n scheduleArr.push(scheduleObj);\n localStorage.setItem(date, JSON.stringify(scheduleArr));\n\n for (var i = 0; i < storedSchedule.length; i++) {\n if (storedSchedule[i].hasOwnProperty(trId)) {\n storedSchedule[i][trId] = textAreaVal;\n scheduleArr = storedSchedule;\n localStorage.setItem(date, JSON.stringify(scheduleArr));\n return;\n }\n }\n });\n }", "function archiveWardRoundSheet(){\r\n const currentSpreadSheet = SpreadsheetApp.getActiveSpreadsheet();\r\n const sheet = currentSpreadSheet.getActiveSheet();\r\n const sheetName = sheet.getName();\r\n \r\n const ui = SpreadsheetApp.getUi();\r\n const result = ui.alert(\r\n \"Archiver la tournée\",\r\n \"Voulez-vous archiver la tournée : \" + sheetName,\r\n ui.ButtonSet.OK_CANCEL);\r\n\r\n // Process the user's response.\r\n if (result == ui.Button.CANCEL) {\r\n return;\r\n }\r\n \r\n const folder = DriveApp.getFileById(currentSpreadSheet.getId()).getParents().next();\r\n const archiveFolder = getFoldersByNameOrCreate(getFoldersByNameOrCreate(folder,\"Archives\"),\"Tournées\");\r\n \r\n const pdf = convertSheetToPdf(currentSpreadSheet,sheet,Utilities.formatDate(new Date(), \"GMT+1\", \"yyyy_MM\") + sheetName,\"I\");\r\n archiveFolder.createFile(pdf);\r\n \r\n currentSpreadSheet.deleteSheet(sheet);\r\n \r\n wardRoundSheetArchived();\r\n}", "function newOrClose(){\r\n\t\tconsole.log(self.save);\t\t\t\t\r\n\t\tif(self.save== \"saveclose\" ){\r\n\t\t\t drawerClose('.drawer') ;\r\n\t\t}\r\n\t\treset();\r\n\t}", "function Save() {\n win.name = JSON.stringify(store);\n }", "function save() {\n storage.write(filename, data);\n }", "saveDocument(window, getSavePath) {\n this.getDocumentContents(window, (data) => {\n const contents = JSON.stringify(data);\n const document = this.getDocumentByWindow(window);\n\n const saveFile = (fileName, contents) => {\n fs.writeFile(fileName, contents, (err) => {\n if (err) {\n alert(err.message);\n }\n\n this.setWindowEditStatus(window, false);\n });\n };\n\n if (document.fileName && fs.existsSync(document.fileName)) {\n saveFile(document.fileName, contents);\n } else {\n getSavePath(window, (fileName) => {\n // TODO: Check if fileName exists -- when clicking cancel on save dialog it is undefined\n const basename = path.basename(fileName);\n saveFile(fileName, contents);\n this.setWindowFilename(window, fileName);\n window.setRepresentedFilename(basename);\n window.setTitle(basename);\n });\n }\n });\n }", "function close(open){\r\n\t\t\tself.confirm_title = open;\r\n\t\t\tself.confirm_type = BootstrapDialog.TYPE_WARNING;\r\n\t\t\tself.confirm_msg = self.confirm_title + ' without saving data?';\r\n\t\t\tself.confirm_btnclass = 'btn-warning';\r\n\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t\t\tfunction (res) {\r\n\t\t\t\t\t\t\t\tfetchAllVehicles();\r\n\t\t\t\t\t\t\t\tself.save = \"saveclose\";\r\n\t\t\t\t\t\t\t\treset();\r\n\t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t );\r\n\t\t}", "function saveCallback()\n {\n clearUndoBuffer();\n updateUndoButton();\n if (!($('#perc-region-tool-inspector').hasClass('buttonPressed')))\n {\n $(\"#perc-undo-tool\").hide();\n $(\"#perc-undo-tool-disabled\").hide();\n }\n }", "function updateSheet() {\n\n\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Creating parent color and size columns...' });\n\n\t\t\t\tProductsSheet.insertColumn(Products.FootPrint.ForTree.InsertParentIndex);\n\t\t\t\tProductsSheet.columnWidth(Products.FootPrint.ForTree.InsertParentIndex, 100);\n\t\t\t\tProductsSheet.insertColumn(Products.FootPrint.ForTree.InsertColorSizeIndex);\n\t\t\t\tProductsSheet.columnWidth(Products.FootPrint.ForTree.InsertColorSizeIndex, 170);\n\t\t\t\tProductsSheet.insertColumn(Products.FootPrint.ForTree.InsertColorSizeIndex);\n\t\t\t\tProductsSheet.columnWidth(Products.FootPrint.ForTree.InsertColorSizeIndex, 170);\n\n\t\t\t\tProductsSheet.range(Products.FootPrint.ForTree.ParentCellIndex + 1).value('Parent');\n\t\t\t\tProductsSheet.range(Products.FootPrint.ForTree.ColorCellIndex + 1).value('Color');\n\t\t\t\tProductsSheet.range(Products.FootPrint.ForTree.SizeCellIndex + 1).value('Size');\n\n\t\t\t\tProducts.FootPrint.NoEdit.split('')\n\t\t\t\t.forEach(function(ColumnIndex) {\n\n\t\t\t\t\tvar Range = ColumnIndex + '1:' + ColumnIndex + RowCount;\n\t\t\t\t\tProductsSheet.range(Range).enable(false)\n\t\t\t\t});\n\n\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Updating last saved parent, color & size data...' });\n\t\t\t\t\n\t\t\t\tvar I = 1; // ROW Index\n\n\t\t\t\tfunction updateParentColorSizeRow() {\n\n\t\t\t\t\tvar RowIndex = I+1;\n\t\t\t\t\tvar SKUCell = \t\tProductsSheet.range(Products.FootPrint.ForTree.SKUCellAfterInsertIndex + RowIndex);\n\t\t\t\t\tvar SKU = SKUCell.value();\t\t\t\t\t\n\t\t\t\t\tvar ParentCell = \tProductsSheet.range(Products.FootPrint.ForTree.ParentCellIndex + RowIndex);\n\t\t\t\t\tvar ColorCell = \tProductsSheet.range(Products.FootPrint.ForTree.ColorCellIndex + RowIndex);\n\t\t\t\t\tvar SizeCell = \t\tProductsSheet.range(Products.FootPrint.ForTree.SizeCellIndex + RowIndex);\n\n\t\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Updating ' + I + ' - ' + SKU });\n\n\t\t\t\t\tif(jQuery.trim(SKU) != '') {\n\t\t\t\t\t\t\n\t\t\t\t\t\tSKU = jQuery.trim(SKU).split(',').join('.'); // Correct sku\n\t\t\t\t\t\tSKUCell.value(SKU);\n\n\t\t\t\t\t\tvar SKUCode = SKU.split('.');\n\t\t\t\t\t\tvar ParentSKUCode = SKUCode[0] + '.' + SKUCode[1] + '.' + SKUCode[2];\n\t\t\t\t\t\tParentCell.value(ParentSku.Data[SKU] || ParentSKUCode); // Pude ser nuevo\n\t\t\t\t\t\tColorCell.value(ColorSize.Data[SKU] && ColorSize.Data[SKU].color || '');\n\t\t\t\t\t\tSizeCell.value(ColorSize.Data[SKU] && ColorSize.Data[SKU].size || '');\n\t\t\t\t\t}\n\n\t\t\t\t\tI++;\n\n\t\t\t\t\tif(I<RowCount + 1) {\n\n\t\t\t\t\t\tif(CanProcess) {\n\n\t\t\t\t\t\t\treturn $timeout(updateParentColorSizeRow, 0);\n\n\t\t\t\t\t\t} else {\n\t\t\n\t\t\t\t\t\t\t$rootScope.$emit(\n\t\t\t\t\t\t\t\t'notifydialog', \n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\ttext: 'Process cancelled. Please load file again',\n\t\t\t\t\t\t\t\t\tclose: function() {\n\n\t\t\t\t\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t\t\t\t\t'A1:' + Products.FootPrint.ForTree.SizeCellIndex + RowCount\n\t\t\t\t\t\t\t\t\t\t).clear();\n\t\t\t\t\t\t\t\t\t\t$rootScope.$emit('closedialog');\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\n\t\t\t\t\t\t\t$timeout(function() {\t\t\n\n\t\t\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t\t\t'A1:' + Products.FootPrint.ForTree.SizeCellIndex + RowCount\n\t\t\t\t\t\t\t\t).clear();\n\t\t\t\t\t\t\t\t$rootScope.$emit('closedialog');\n\n\t\t\t\t\t\t\t}, 5000);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Data updated, creating variations...' });\n\n\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t'A2:' + \n\t\t\t\t\t\t\tProducts.FootPrint.ForTree.SizeCellIndex + \n\t\t\t\t\t\t\tRowCount\n\t\t\t\t\t\t).sort(Products.FootPrint.ForTree.InsertParentIndex);\n\n\t\t\t\t\t\t$timeout(function() {\n\n\t\t\t\t\t\t\tI = 1; // Reset ROW Index\n\n\t\t\t\t\t\t\tprocessVariationsRow();\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tupdateParentColorSizeRow();\n\n\t\t\t\t// Sort and colorize variations\n\n\t\t\t\tvar SKUParent = '';\n\t\t\t\tvar AlternateProduct = true;\n\n\t\t\t\tfunction processVariationsRow() {\n\n\t\t\t\t\tvar RowIndex = I+1;\n\t\t\t\t\tvar SKUCell = ProductsSheet.range(Products.FootPrint.ForTree.SKUCellAfterInsertIndex + RowIndex);\n\t\t\t\t\tvar ParentCell = ProductsSheet.range(Products.FootPrint.ForTree.ParentCellIndex + RowIndex);\n\t\t\t\t\tvar SKU = SKUCell.value();\n\t\t\t\t\tvar Parent = ParentCell.value();\n\n\t\t\t\t\tif(jQuery.trim(SKU) != '') {\t\t\t\t\t\t\n\n\t\t\t\t\t\tif(Parent != SKUParent) { \n\n\t\t\t\t\t\t\tSKUParent = Parent;\n\t\t\t\t\t\t\tAlternateProduct = !AlternateProduct;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar ProductColor = AlternateProduct ? '#efefef' : '#ffffff';\n\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t'A' + (I+1) + ':' + Products.FootPrint.ForTree.SizeCellIndex + (I+1)\n\t\t\t\t\t\t).background(ProductColor);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Grouping ' + I + ' - ' + SKU + ' > ' + SKUParent });\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t'A' + (I+1) + ':' + Products.FootPrint.ForTree.SizeCellIndex + (I+1)\n\t\t\t\t\t\t).background('#cc0000');\n\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t'A' + (I+1) + ':' + Products.FootPrint.ForTree.SizeCellIndex + (I+1)\n\t\t\t\t\t\t).color('#ffffff');\n\n\t\t\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Product without SKU' });\n\t\t\t\t\t}\n\n\t\t\t\t\tI++;\n\n\t\t\t\t\tif(I<RowCount + 1) {\n\n\t\t\t\t\t\tif(CanProcess) {\n\n\t\t\t\t\t\t\treturn $timeout(processVariationsRow, 0);\n\n\t\t\t\t\t\t} else {\n\t\t\n\t\t\t\t\t\t\t$rootScope.$emit(\n\t\t\t\t\t\t\t\t'notifydialog', \n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\ttext: 'Process cancelled. Please load file again',\n\t\t\t\t\t\t\t\t\tclose: function() {\n\n\t\t\t\t\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t\t\t\t\t'A1:' + Products.FootPrint.ForTree.SizeCellIndex + RowCount\n\t\t\t\t\t\t\t\t\t\t).clear();\n\t\t\t\t\t\t\t\t\t\t$rootScope.$emit('closedialog');\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\n\t\t\t\t\t\t\t$timeout(function() {\t\t\n\n\t\t\t\t\t\t\t\tProductsSheet.range(\n\t\t\t\t\t\t\t\t\t'A1:' + Products.FootPrint.ForTree.SizeCellIndex + RowCount\n\t\t\t\t\t\t\t\t).clear();\n\t\t\t\t\t\t\t\t$rootScope.$emit('closedialog');\n\n\t\t\t\t\t\t\t}, 5000);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t\t$rootScope.$emit('notifydialog', { text: 'Data processed' });\n\n\t\t\t\t\t\t$timeout(function() {\n\n\t\t\t\t\t\t\t$rootScope.$emit('closedialog');\n\t\t\t\t\t\t\t$scope.allowProcessing = true;\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "get saveButton() {\n return {\n command: \"save\",\n icon: \"save\",\n label: \"Save\",\n type: \"rich-text-editor-button\",\n };\n }", "function toggleSaving() {\n let button = $(\"#save-page\");\n button.blur();\n\n if (button.hasClass('waiting')) {\n button.attr(\"disabled\", false);\n button.removeClass('waiting');\n button.find('.spinner-border').addClass('d-none');\n } else {\n button.attr(\"disabled\", true);\n button.addClass('waiting');\n button.find('.spinner-border').removeClass('d-none');\n }\n }", "function saveBeforeClose() {\n // We've already saved all other open editors when they go active->inactive\n saveLineFolds(EditorManager.getActiveEditor());\n }", "function saveAndContinueRoll(){\n var rolledStatDivs = $(\".rand-callout\");\n for (var i=0; i<rolledStatDivs.length; i++){\n var rolledStatSpan = $(rolledStatDivs[i]).children()[0];\n var statValue = $(rolledStatSpan).text();\n var statSelectOption = $(rolledStatDivs[i]).children()[1];\n var statSelected = $(statSelectOption).find(\"option:selected\").attr(\"value\");\n localStorage.setItem(statSelected, statValue);\n }\n window.open(\"./character-sheet.html\", \"_self\");\n }", "function save(id) {\n idx = id.replace('save-button','');\n article = {\n \"author\": data.articles[idx].author,\n \"content\": data.articles[idx].content,\n \"description\": data.articles[idx].description,\n \"publishedAt\": data.articles[idx].publishedAt,\n \"title\": data.articles[idx].title,\n \"url\": data.articles[idx].url,\n \"urlToImage\": data.articles[idx].urlToImage\n };\n if(document.getElementById(id).src.includes(\"empty.png\")) {\n document.getElementById(id).src = \"images/save_icon_fill.png\";\n $(\"#\"+id).after('<p id=\"success\">Added article to Saved!</p>');\n $(\"#success\").delay(2000).fadeOut();\n saveArticle(article);\n } else {\n document.getElementById(id).src = \"images/save_icon_empty.png\";\n $(\"#\"+id).after('<p id=\"success\">Removed article from Saved!</p>');\n $(\"#success\").delay(2000).fadeOut();\n }\n}", "function submit(){\n // set the sheet names for the excel doc\n var keys = [\"sponsored\",\"non_sponsored\",\"pending\",\"protocols\"];\n keys.forEach(function(key){\n reports[key]['sheet_name'] = key;\n });\n var event = {\n report_title : \"foo\",\n filename: makeFilename(req.params.querystring.p_Invest_ID),\n reports: reports\n }\n //RDashExports.generateExcel(event, fakeContext );\n ExcelExport.generateExcel(event, fakeContext );\n }", "function save_options() {\n let sheetIdValue = document.getElementById('sheet_id').value;\n\tlet baseUrlValue = document.getElementById('base_url').value;\n\tconst debugModeValue = document.getElementById(\"debug_mode\").checked;\n\n\tbaseUrlValue = baseUrlValue\n .replace(/(^\\w+:|^)\\/\\//, \"\")\n .replace(/\\/+$/, \"\");\n\n\tsheetIdValue = sheetIdValue.trim();\t\n\n\tbrowser.storage.sync.set({ sheetIdValue, baseUrlValue, debugModeValue }).then( () => {\n\t\tvar status = document.getElementById('status');\n\t\tstatus.textContent = 'Options saved...';\n\t\tsetTimeout(function () {\n\t\t\tstatus.textContent = '';\n\t\t}, 750);\n\t})\n\n}", "function saveData(key) {\n\t\t// Set Random Key for Stored Data //\n\t\tif(!key) {\n\t\t\tvar id = Math.floor(Math.random()*10001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t// Call Functions //\n\t\tgetCheckboxValue();\n\t\tgetSelectedRadio();\n\t\tvar item \t\t\t\t= {};\n\t\t\titem.training \t\t= [\"Training Style: \", $('#training').value];\n\t\t\titem.wname\t\t\t= [\"Workout Name: \", $('#wname').value];\n\t\t\titem.favorite\t\t= [\"Favorite: \", favoriteValue];\n\t\t\titem.howlong\t\t= [\"How Long: \", $('#howlong').value + \" minutes\"];\n\t\t\titem.timeofday\t\t= [\"Preferred Time: \", timeValue];\n\t\t\titem.completiondate\t= [\"Completion Date: \", $('#completiondate').value];\n\t\t\titem.comments\t\t= [\"Self-Motivation: \", $('#comments').value];\n\t\t\t\n\t\t// Save Data into Local Storage with JSON.stringify //\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Workout Saved!\");//\n\t\t// Set dialog using Dialog //\n\t\t//$('#dialog').attr(\"title\", \"Saved!\").text(\"Your workout has been saved.\").dialog('open');\n\t}", "okPressed() {\n this.$uibModalInstance.close(this.processingType.specimenProcessing.input);\n }", "@action\n saveRow() {\n set(this, 'isEditRow', false);\n }", "function renderSaveButton() {\n\t\treturn (\n\t\t\t<IconButton variant=\"success\" onClick={() => run('update_settings', { settings })} icon=\"save\" title={lang.settingview_save} />\n\t\t);\n\t}", "function savePano(panoId) {\n // console.log('savePano()', panoId);\n pId = extractId(panoId)\n // console.log('pId: ', pId)\n \n let newPanoId = gPanos.length // Id of new pano to be created\n let curPanoId = gPanos.length-1 // Id of current pano being saved\n let btnType = \"save\" // Saved (already has a number label) Pano was clicked (to save edits)\n if (pId == curPanoId) { // Top Pano panel was clicked to Add new pano\n btnType = 'add' \n }\n // console.log('btnType: ', btnType)\n const val = checkInput(pId)\n\n if (gbvaluesValid){ // All data validated (in checkInput) for current pano\n if( btnType === \"add\"){ // Add new pano\n // Parse the data from the current pano fields and populate the pano object\n populatePanoValues(pId)\n \n // Create the json object that contains all the pano data.\n // Submit the json to the server. \n // submitData()\n\n // Change some of the HTML of this newly saved pano, so it appears as a saved panel.\n gPanos[curPanoId].elements.addButton.value = \"Save\"\n gPanos[curPanoId].elements.addButton.style.color = '#757575'\n gPanos[curPanoId].elements.addButton.style.backgroundColor = '#e2e2e2'\n // Change the Title from New Pano to the current pano name.\n gPanos[curPanoId].elements.title.innerHTML = '<b>Pano '+(curPanoId+1).toString()+'</b>' \n // Change the style of the saved Pano from green to gray.\n let mainDiv = document.querySelector('#pano-'+curPanoId.toString())\n if (curPanoId%2 == 0){\n mainDiv.setAttribute('class', 'pano_b');\n } else {\n mainDiv.setAttribute('class', 'pano_a');\n }\n \n // Reveal the delete button.\n gPanos[curPanoId].elements.deleteButton.style.display = \"block\"\n \n // Create a new pano panel, html set and pano object populated with elements refs and values.\n createPano(newPanoId)\n\n // enable Make Panos button\n const mpb = document.querySelector('#submit_button')\n console.log(mpb.getAttribute('disabled'))\n mpb.setAttribute('class', 'submit_button')\n mpb.disabled = false\n console.log(mpb)\n\n } else { // Save Pano edits\n // Set the Save button back to gray\n gPanos[pId].elements.addButton.style.color = '#757575'\n gPanos[pId].elements.addButton.style.backgroundColor = '#e2e2e2'\n // Save edited Pano Data\n\n }\n\n // Rebuild the VR world\n \n // Reset all the fields in the top level pano\n } else { // Some fields were not valid\n // Hilight fields in error\n // console.log('pano '+pId+' has invalid fields')\n let val = validateNewPano(pId)\n flagInvalidFields(val, true)\n // Throw error message\n } \n }", "function save_data(assoc){\n Logger.log(\"--- save_data ---\"); \n \n try {\n var dateTime = new Date();\n \n // Paste the URL of the Google Sheets starting from https thru /edit\n // For e.g.: https://docs.google.com/..../edit \n var ss = SpreadsheetApp.openByUrl(\"https://docs.google.com/spreadsheets/d/1Z1zi6RZ5MKmf20VnDkYECsZGFY4L0bM8YYKNsvYW7zc/edit\");\n var summarySheet = ss.getSheetByName(\"Summary\");\n var dataLoggerSheet = ss.getSheetByName(\"DataLogger\");\n \n var col = dataLoggerSheet.getLastColumn() + 1;\n // Get last edited row from DataLogger sheet\n var row = dataLoggerSheet.getLastRow() + 1;\n \n var header = dataLoggerSheet.getRange(1, 3, 1, col-3); //A1 to O1\n var headerVals = header.getValues()[0];\n\n dataLoggerSheet.getRange(\"A\" + row).setValue(row -1); // ID\n dataLoggerSheet.getRange(\"B\" + row).setValue(dateTime); // dateTime\n\n var colval;\n for (colval in assoc)\n {\n var iCol=headerVals.indexOf(colval);\n if (iCol>=0)\n {\n dataLoggerSheet.getRange(row, iCol+3).setValue(assoc[colval]); // ID\n }\n else\n {\n iCol=col;\n col=col+1; \n headerVals.push(colval);\n dataLoggerSheet.getRange(1, iCol).setValue(colval); // ID \n dataLoggerSheet.getRange(row, iCol).setValue(assoc[colval]); // value \n }\n }\n \n // Update summary sheet\n summarySheet.getRange(\"B1\").setValue(dateTime); // Last modified date\n // summarySheet.getRange(\"B2\").setValue(row - 1); // Count \n }\n \n catch(error) {\n Logger.log(JSON.stringify(error));\n }\n \n Logger.log(\"--- save_data end---\"); \n}" ]
[ "0.658167", "0.652474", "0.62201965", "0.6186926", "0.6125711", "0.6085243", "0.60583186", "0.6017914", "0.60128427", "0.6012832", "0.59898955", "0.59464777", "0.59022284", "0.5885294", "0.58716226", "0.58231175", "0.5816282", "0.5790984", "0.5676336", "0.5676336", "0.5667803", "0.56217575", "0.56213844", "0.56206894", "0.5603494", "0.55807287", "0.55681115", "0.556607", "0.5550358", "0.5532974", "0.5525144", "0.5522772", "0.55016243", "0.55013907", "0.5483995", "0.54823244", "0.54801875", "0.5479989", "0.54677933", "0.546413", "0.5461277", "0.5459886", "0.5446952", "0.5441275", "0.5439314", "0.54381907", "0.5424626", "0.5423706", "0.54183084", "0.54094464", "0.5409403", "0.5406882", "0.5405472", "0.5402281", "0.5401996", "0.5401423", "0.54007936", "0.5397895", "0.53879166", "0.53825766", "0.53824854", "0.5380962", "0.53802377", "0.53662115", "0.53628033", "0.53429", "0.53414816", "0.534051", "0.534051", "0.53333855", "0.5330335", "0.53266704", "0.53186625", "0.5301168", "0.5299939", "0.52963036", "0.52950025", "0.5292066", "0.52903", "0.528803", "0.5282468", "0.5277911", "0.52764136", "0.52626485", "0.5251241", "0.5249364", "0.52459514", "0.5243964", "0.5233399", "0.52292633", "0.5228956", "0.5227759", "0.5224514", "0.5219171", "0.5219094", "0.5216788", "0.52156585", "0.52087015", "0.52058285", "0.51937616" ]
0.7764474
0
After returning to main screen from other screen in the site
static restoreSelectedSwitchesInMainScreen(symbolsArr) { symbolsArr.forEach(function(symbol) { $(`#${symbol}`).prop("checked", true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnToMainScreen() {\n if ($percCookieSiteTable.fnClearTable !== undefined) {\n $percCookieSiteTable.fnClearTable();\n }\n $('.cookie-consent-site-stats').hide();\n $('#delete-btn-site').hide();\n $('#delete-btn-all').show();\n $('#advanced').addClass('collapse');\n $('#advanced').removeClass('in');\n isAdvancedDisplayed = false;\n miniMsg.dismissMessage(loadingMsg);\n adjustIframeHeight($percCookieTable);\n mainHTML.show();\n }", "function returnToMain(){\n teleMode = false;\n console.log('reutrn to main');\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('startScreen');\n }, this);\n}", "_backToMainAccount() {\n this._closeMenu();\n AuthActions.backToMainAccount();\n }", "function gotoIkarte() {\n\t$.mobile.changePage(\"#pageIkarte\");\n\tsessionStorage.iLastScreenVisited = \"K\";\n}", "function returnToHome(){\n\t\n}", "function returnToMainMenu() {\r\n\r\n // Reset the game state. \r\n resetGameState();\r\n\r\n // End game flag.\r\n gameHasStarted = false;\r\n\r\n // Reload main menu.\r\n startUp();\r\n}", "function startScreen() {\n // If local storage contains a key, then they have already entered a valid key and can use the app\n // otherwise, take them to the key registration page\n if (window.localStorage.getItem(\"key\") == null) {\n window.location.replace(\"login.html\");\n }\n getNumbers();\n getReports();\n \n}", "function backToScreenDtl(){\n\tupdateAccountListInfo(); \n\tnavController.initWithRootView('corp/account/list_info/acc_list_account_info_dtl', true, 'xsl');\n}", "function navigateToScoreOverview(){\n ApplicationEnded=true;\n gotoScoreOverview();\n}", "exitGame() {\n // !Maybe solution for AppLogger or similar\n setTimeout(() => {\n window.top.location.href = RealityCheckModel.exit_URL || RealityCheckModel.lobby_URL;\n });\n }", "function ExitPage() {\n\t\talert('Are you sure you want navigate away from this App?');\n\t\tgetit()\n\t}", "function goToHomePage(){\n clearques();\n self.location=\"index.html\";\n}", "function viewBackFromOther() {\n\tlogInfo('Back send info user approve');\n}", "function Back() {\n\tmainMenuController.GetComponent(MainMenu).MainMenu();\n}", "function onNextClick() {\n\n\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('startScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\n}", "function navigateGo() {\n $('.screen').hide();\n // $(\".screen button\")\n // .on(\"transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd\",\n // function(e){\n // $('.screen .'+whichButton).removeClass('activated');\n // $('.screen button').show();\n // $('.screen').hide();\n // $(this).off(e);\n // });\n if(currentScreen !== \"screen-home\") {\n $('.' + currentScreen).show();\n }\n $('.order-current').hide();\n $('.lock-current').hide();\n}", "function returnToMain() {\n window.location = 'top-posts.html';\n}", "function returnHome() {\n sessionStorage.removeItem(\"strokes\");\n sessionStorage.removeItem(\"level\");\n location = \"index.html\";\n}", "function onClicked() {\r\n\t\ttablet.gotoWebScreen(APP_URL);\r\n\t}", "function backToMenu() {\n location.reload();\n }", "function loginScreen() {\r\n var newLocation = \"#pageHome\";\r\n window.location = newLocation;\r\n}", "function fnExit(){\n localStorage.clear();\n window.location.replace('index.html');\n }", "function actionOnClickBack() {\n\t\t\t//alert('Saldras de la carrera');\n\t\t\tgame.state.start('mainMenuState')\n\t\t}", "function handleFinalPage() {\r\n $(`main`).on(`click`, `#restart`, function () {\r\n store.quizStarted = false;\r\n store.questionNumber = 0;\r\n store.score = 0;\r\n render();\r\n });\r\n}", "_prevScreenApp() {\n\t\tthis.props.navigation.goBack(null);\n }", "function onBackClick() {\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\n}", "function backToHomeView () {\n currentFolder = -1\n showOneContainer(homeContain)\n fetchSingleUser(currentUser)\n }", "static goToHome() {\n browser.refresh();\n new MenuBar().clickHome();\n }", "function onGoBack() {\n setFormDataEdit(null);\n setStep('Menu');\n }", "function backToHome() {\r\n // unsaved warning box \r\n if (!warnUnsavedDialog())\r\n return;\r\n\r\n location.href = '/dbmiannotator/main';\r\n}", "function updateWelcomeScreen () {}", "switchBackToShopmanagament() {\n window.location.assign(\"#/eventmgmt/shop\")\n }", "function backToHome(){\n resultPage.style.display = \"none\";\n startPage.style.display = \"block\";\n}", "function backToMenuFromGame()\r\n\t\t{\r\n\t\t\tresetMatch();\r\n\t\t\tcancelAnimationFrame(requestId);\r\n\t\t\tdocument.getElementById('canvasSpace').style.display = \"none\";\r\n\t\t\tdocument.getElementById('menuInGame').style.display = \"none\";\r\n\t\t\tdocument.getElementById('settings').style.display = \"none\";\r\n\t\t\tdocument.getElementById('menu').style.display = \"initial\";\r\n\t\t}", "onBackButtonClick_() {\n this.userActed('os-trial-back');\n }", "function gotoIliste() {\n\t$.mobile.changePage(\"#pageIliste\");\n\tsessionStorage.iListeInit = 1;\n\tsessionStorage.iLastScreenVisited = \"L\";\n}", "function CreditstoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'CREDITS' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n credits.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n }, 600);\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1400);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }", "function bringBackContent() {\n bringBack2.hidden = true;\n bringBack.hidden = false;\n livesFinished.hidden = false;\n bringBack.addEventListener(\"click\", function(){\n window.location.reload(false)\n });\n}", "function goBackToMainPage() {\n location.href = \"index.html\";\n loadImages();\n}", "onLoginSuccess() {\n\t\tApp.navigatePrevious();\n\t}", "function homePage() {\n window.location.href = initApi.homeUrl;\n //location.reload();\n }", "function onHomeClick(e) {\n\ttry {\n\t\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('manageScreen');\n\t\tvar parentWindow = Alloy.Globals.NAVIGATION_CONTROLLER.getCurrentWindow();\n\t\tif (parentWindow != null && parentWindow.windowName === \"newHomeScreen\") {\n\t\t\tparentWindow.window.refreshHomeScreen();\n\t\t}\n\n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"manageScreen\", \"homeClick\", ex);\n\t}\n}", "function afterReload () {\n //based on today date valid our html field(date field)\n valid.dateValidHtml();\n //see last time wich page was active \n let wichPage = localStorage.getItem('page');\n //show actived page with info that has have before\n switch(wichPage) {\n case '1':\n ui.showfirst();\n break;\n case null:\n ui.showfirst();\n break;\n case '2':\n ui.showMid();\n ui.cul();\n ui.addTitle();\n break;\n case '3':\n ui.showLast();\n ui.done();\n break;\n }\n}", "function mainMenu(){\n window.location.replace(\"https://stavflix.herokuapp.com/client/\");\n }", "function LoadingScreen()\n{\n\twindow.location.href ='MainHUD.html';\n}", "async function returnToHome() {\n textConsole.bigText();\n backButton.hide();\n credits.hide();\n await writeText(textScripts.start.title);\n HomeButton.showAll();\n}", "function first_page(){\n\tif (localStorage.synced!='YES'){\t\n\t\tvar url = \"#login\";\n\t\t$.mobile.navigate(url);\t\t\n\t}else{\n\t\tvar url = \"#pageHome\";\n\t\t$.mobile.navigate(url);\t\t\n\t\t};\n}", "function returnHome() {\n $state.go(constants.states.soon);\n }", "processGoHome() {\n window.todo.model.goHome();\n }", "function back() {\n 'use strict';\n\n welcomeScreen.style.display = 'block';\n gameScreen.style.display = 'none';\n endScreen.style.display = 'none';\n reset();\n}", "function backPage() {\n switch(currentPage) {\n case \"login\":\n navigator.app.exitApp();\n break;\n case \"main\":\n navigator.app.exitApp(); // TODO: Close app or logout?\n break;\n case \"settings\":\n loadMainTemplate(false, true);\n break;\n case \"zonesettings\":\n loadSettingsTemplate(false, true);\n break;\n case \"manage\":\n loadSettingsTemplate(false, true);\n break;\n case \"edit\":\n loadManageSchedulesTemplate(false,true);\n break;\n default:\n loadMainTemplate(false, true);\n }\n}", "function moveToMainPage(pathName) {\n\tif(pathName.indexOf('locator.jsp') !== -1) {\n\t\t/* Moving to main_payment_page with #home for home(pay your bill) page */\n\t\tlocation.href = 'main_payment_page.jsp?resourceAppId=' + applicationId + '#home';\n\t\treturn;\n\t}\n\thashChangedCalled = true;\n\tmakeActiveTab('footerHomeTab');\n\tbookmarks.sethash(\"#home\", loadHomeScreenArea);\n}", "function onBackKeyDown() {\n\n app.preloader.hide();\n $$(\".page\").removeClass(\"contentload\");\n\n var currentPage = sessionStorage.currentPage;\n\n var orderID = sessionStorage.orderID;\n var backScreenType = sessionStorage.backScreenType;\n var bookingId = sessionStorage.bookingId;\n var pageType = sessionStorage.pageType;\n\n\n if (currentPage == \"task-details\") {\n\n if (sessionStorage.isServiceStartDialogOn == \"false\") {\n\n if (backScreenType == \"allTask\") {\n\n app.views.main.router.navigate('/all-task/');\n\n } else if (backScreenType == \"completedTask\") {\n\n app.views.main.router.navigate('/completed-task/');\n\n } else if (backScreenType == \"assignedTask\") {\n\n app.views.main.router.navigate('/assigned-task/');\n\n } else if (backScreenType == \"dashboardTask\") {\n\n app.views.main.router.navigate('/dashboard/');\n\n } else if (backScreenType == \"profileAssignedTask\") {\n\n app.views.main.router.navigate('/assigned-task/?backScreenType=' + backScreenType);\n\n } else if (backScreenType == \"profileCompletedTask\") {\n\n app.views.main.router.navigate('/completed-task/?backScreenType=' + backScreenType);\n\n } else if (backScreenType == \"profileAllTask\") {\n\n app.views.main.router.navigate('/all-task/?backScreenType=' + backScreenType);\n\n } else if (backScreenType == \"notification\") {\n\n app.views.main.router.navigate('/notification/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n }\n\n } if (currentPage == \"generate-bill\") {\n\n if (sessionStorage.isServiceStartDialogOn == \"false\") {\n app.views.main.router.navigate('/task-details/?orderId=' + orderId + '&backScreenType=' + backScreenType);\n }\n }\n else if (currentPage == \"update-details\") {\n\n app.views.main.router.navigate('/task-details/?orderId=' + orderID + '&backScreenType=' + backScreenType);\n\n }\n else if (currentPage == \"all-task\") {\n\n if (backScreenType == \"profileAllTask\") {\n\n app.views.main.router.navigate('/profile/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"assigned-task\") {\n\n if (backScreenType == \"profileAssignedTask\") {\n\n app.views.main.router.navigate('/profile/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"completed-task\") {\n\n if (backScreenType == \"profileCompletedTask\") {\n\n app.views.main.router.navigate('/profile/');\n\n } else {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"otp\") {\n\n if (pageType == \"taskDetails\") {\n\n app.views.main.router.navigate('/task-details/?orderId=' + bookingId + '&backScreenType=' + backScreenType);\n\n } else {\n\n if (sessionStorage.backButtonOpenDialog == \"false\") {\n\n sessionStorage.backButtonOpenDialog = \"true\";\n\n app.dialog.confirm('Do you want to exit.', function () {\n navigator.app.exitApp();\n },\n function () {\n\n sessionStorage.backButtonOpenDialog = \"false\";\n\n });\n\n }\n\n }\n\n } else if (currentPage == \"profile\") {\n\n if (sessionStorage.logoutDialogOpen == \"false\") {\n\n app.views.main.router.navigate('/dashboard/');\n\n }\n\n } else if (currentPage == \"notification\") {\n\n app.views.main.router.navigate('/dashboard/');\n\n } else if (currentPage == \"login\") {\n\n navigator.app.exitApp();\n\n } else if (currentPage == \"dashboard\") {\n\n if (sessionStorage.logoutDialogOpen == \"false\") {\n\n if (sessionStorage.backButtonOpenDialog == \"false\") {\n\n sessionStorage.backButtonOpenDialog = \"true\";\n\n app.dialog.confirm('Do you want to exit.', function () {\n navigator.app.exitApp();\n },\n function () {\n\n sessionStorage.backButtonOpenDialog = \"false\";\n\n });\n\n }\n\n }\n } else {\n\n mainView.router.back();\n\n }\n}", "function switchToLogin(){\n\t\tturnService.closeWaitingAlert();\n\t\t$userLoginArea.show();\t\t\n\t\t$pageWrapper.hide();\n\t}", "function BackButtonClickHandler()\n{\n SlideToPage(\"account.html\");\n}", "function onBackKeyDown() {\n if(app.views.main.router.currentRoute.path == \"/login/\" )\n {\n navigator.app.exitApp();\n }\n else\n {\n if(localStorage.user_role == \"Driver\")\n {\n if(app.views.main.router.currentRoute.path == \"/pesanan/\")\n {\n navigator.app.exitApp();\n\n }\n else\n {\n //app.views.main.router.navigate('/pesanan/');\n app.views.main.router.back();\n }\n }\n else\n {\n if(app.views.main.router.currentRoute.path == \"/beranda/\")\n {\n navigator.app.exitApp();\n }\n else\n {\n //app.views.main.router.navigate('/beranda/');\n app.views.main.router.back();\n }\n }\n }\n}", "function onNavigatedTo(args) {\n page = args.object;\n \n //create a reference to the topmost frame for navigation\n topmostFrame = frameMod.topmost();\n}", "function goBack() {\n\tloadElements();\n}", "function backToGame() {\r\n //Unpause the game\r\n togglePause();\r\n\r\n //Hide the modal\r\n hideModal();\r\n\r\n //Remove the event listeners\r\n removeListeners();\r\n }", "function navigateToHome() {\n\tclearIntervalTimers();\n\tvar pathName = $(location).attr('pathname');\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tvar fundingSourceTypes_JsonType=\"\";\n\tif($('#editCardForm').is(':visible')){\n\t\t\tfundingSourceTypes_JsonType = getFundingSource(\"editCardForm\");\n\t\tif(isEditCardFieldsChanged(fundingSourceTypes_JsonType)){\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t}else if ($('#addPaymentCardForm').is(':visible')) {\n\t\t\tfundingSourceTypes_JsonType = getFundingSource(\"addPaymentCardForm\");\n\t\tif (isValueInAddCardFormFields(\"addCardForm\" + fundingSourceTypes_JsonType)) { \n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t} else if ($('#edit_profile_area').is(':visible')){\n\t\tif (isEditProfileFieldsChanged()) {\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t} else if ($('#edit_profile_security_area').is(':visible')) {\n\t\tif (isUserSecurityFieldsChanged()) {\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMainPage(pathName);\n\t\t}\n\t} else{\n\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\tmoveToMainPage(pathName);\n\t}\t /*mainPaymentPageResize();*/\n\t$('#clearOnClickBtn').unbind( \"click\" );\n\t$('#clearOnClickBtn').click(function(event){\n\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\tmoveToMainPage(pathName);\n\t});\n}", "function onPopAndStart(){\n var l = location.href;\n //http://localhost/.../hash\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n // if no pageName set pageName to false\n pageName = pageName || false;\n switchToSection(pageName);\n }", "function BackButtonClickHandler()\n{\n SlideToPage(\"workersnearby.html\");\n}", "function onBack() {\n resetPageState();\n }", "switchToGamePage() {\n if (this.currentPage !== null) {\n this.currentPage.hide();\n }\n Utility.RemoveElements(this.mainDiv);\n this.mainDiv.appendChild(this.gamePage.getDiv());\n this.currentPage = this.gamePage;\n this.gamePage.show();\n }", "function goToMain() {\n let inputValue = $('#land-input').val()\n\n user.lastRecipeSearched = inputValue;\n user.addSearchedIngredients(inputValue);\n save(user)\n\n redirectMainUrl();\n}", "function menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'menupage';\n }", "function flyToHome() {\r\n $('#main').data('clicked', true);\r\n toggleSvgButton('#main', true);\r\n\r\n closePanel2();\r\n\r\n let selectedAsset = main;\r\n onPickedAsset(selectedAsset);\r\n }", "function LeaveStandalone()\n\t{\n\t\tif(m_should_back_out){\n\t\t\tm_should_back_out = false;\n\t\t\thistory.back();\n\t\t}\n\t\telse{\n\t\t\tHide();\n\t\t}\n\t}", "function pageLoad_welcome() {\n console.log(\"On welcome page\");\n var loggedInUser = persist.getLoggedInUser();\n if (loggedInUser.id) {\n console.log(loggedInUser.username + \" already logged in\");\n navigateToScreen(SCREENS.MAIN);\n }\n}", "function back() {\n window.history.back();\n //director.navigateTo({ path: 'customer-service-dashboard' });\n }", "function home(){\r\n\tif(screenOn === false){\r\n\t\tpower();\r\n\t}else{\r\n\t\t//If the menu is open\r\n\t\tappMenuOpen = false;\r\n\t\t$(\"#app-menu\").attr(\"style\", \"display: none;\");\r\n\r\n\t\t$(\"#bottom-menu-bar\").attr(\"style\",\"display: block;\");\r\n\r\n\t\trecentAppsOpen = false;\r\n\t\t$(\"#recent-apps-screen\").attr(\"style\", \"display: none;\");\r\n\r\n\t\t// Hides call screen\r\n\t\t$(\"#call-screen\").attr(\"style\",\"display: none;\");\r\n\r\n\t\t//Hides notification-box\r\n\t\t$(\"#notification-box\").css(\"display\", \"none\");\r\n\r\n\t\t//if the camera app is open:\r\n\t\t$(\"#camera-screen\").css(\"display\", \"none\");\r\n\t}\r\n}", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "function go_to_main()\n{\n window.location.replace('main.html');\n}", "function switchToGameBoard(){\n\t\tif(userlist.length === 0){\n\t\t\tturnService.showWaitingAlert();\n\t\t}\n\t\t$userLoginArea.hide();\n\t\t$pageWrapper.show();\n\t\t$currentPhrase.hide();\n\t}", "popupAction() {\n setTimeout(() => {\n // Chi dung navigateBackHome khi tao va chuyen trang\n // Quay ve Home -> Prechecklist List\n NavigationService.navigateBackHome('Prechecklist', {isNew : true})\n }, 400);\n }", "function SwitchPage(){\t\n\tconsole.log(\"SwitchPage()\");\n\tif(SwitchPageRan==true){\n\t\t//This page has been ran before...\n\t\t//widget.scrollToPosition(0);\n\t\tconsole.log(\"This page was shown before.\");\t\t\n\t\t$.when(SwitchPageGetData()).done(function() {\n\t\t\tSwitchPage_Buttons();\n\t\t});\n\t}else{\n\t\tconsole.log(\"This is the first time the user has looked at this page.\");\n\t\t//This is the first time the user has looked at this page!\n\t\tSwitchPageRan = true;\n\t\t$.when(SwitchPageGetData()).done(function() {\n\t\t\tSwitchPage_Buttons();\t\t\t\t\t\t\n\t\t});\n\t}\n}", "function redirectHome() {\n cleanUp();\n $state.go('app.home');\n }", "function loadHomeScreen() {\n location.reload();\n // $(\"#settingsScreenOptions\").hide();\n\n // $(\".foodPantries\").show();\n // $(\".environmental\").show();\n // $(\".homeless\").show();\n // $(\".refugees\").show();\n // $(\".elderly\").show();\n // $(\".animalShelters\").show();\n}", "function back(){\r\n\tif(appMenuOpen){\r\n\t\tappMenuOpen = false;\r\n\t\t$(\"#app-menu\").attr(\"style\", \"display: none;\");\r\n\t}\r\n\r\n\tif(recentAppsOpen){\r\n\t\trecentAppsOpen = false;\r\n\r\n\t\t//un-Hides menu bar on bottom of screen\r\n\t\t$(\"#bottom-menu-bar\").attr(\"style\",\"display: block;\");\r\n\t\t$(\"#recent-apps-screen\").attr(\"style\", \"display: none;\");\r\n\t}\r\n\r\n\t// screens to just close\r\n\t$(\"#call-screen\").attr(\"style\",\"display: none;\");\r\n\t$(\"#camera-screen\").attr(\"style\",\"display: none;\");\r\n\r\n\t//Hides notifications-box\r\n\t$(\"#notification-box\").css(\"display\", \"none\");\r\n}", "function onBackKeyDown(){\n //if($.mobile.activePage.attr('id') == 'home'){ // PARA AÑADIR MAS USAR SEPARADORES \"||\"\n // navigator.notification.confirm(\n // '¿Salir de la aplicación?', \n // function(button) {\n // if (button == 2) {\n // navigator.app.exitApp();\n // }\n // }, \n // 'Salir', 'No,Si');return false;\n // }\n // else { //else if ($.mobile.activePage.attr('id') == 'charlas'){\n //$.mobile.changePage('#home');\n //}else\n\t\tnavigator.app.exitApp();\n // }\n }", "toMainPage() {\n this.$router.go(-1);\n }", "function OnQuit()\n{\n\t// back to main menu\n\tApplication.LoadLevel(\"StartMenu\");\n}", "function startFromWelcome() { \n $state.go('tabs.home').then(function () {\n $ionicHistory.clearHistory();\n $state.go('tabs.buybitcoin-welcome');\n }); \n }", "function openHomeScreen(prevScreen) {\n prevScreen.hide();\n $(\"#homeScreen\").show();\n}", "function backBtn(args){\n frameModule.topmost().navigate('home/home-page');\n}", "confirmPageNavigate() {\n this.confirm_navigation_level = 0;\n this.pageNavigate();\n }", "function application_post_init(){\n \tappscore.print.start();\n \tmenuVisibility = false;\n //\tgoogleAnalytics = new ganalytics.GAnalyticsLib(\"dsfhjdfhsdhskh\"); //UA-80818309-1 for MyPower\n\tkony.application.setApplicationCallbacks(callbacksObj);\n\tif(loginManager.getLogin() != null){\n\t\t// Validate token\n\t\tvar token = loginManager.getLogin().token;\n\t\t// If token is valid then navigate to FormMenu\n\t\t// invokeAppService(\"Login\", {\"token\":token}, function(){status, resultTable});\n\t\t// else navigate to FormLogin\n\t\treturn frmSplash;\n\t}\n \tappscore.print.stop(); \n}", "resetPage() {\n this._showApplicationComponentsPage();\n }", "function viewBackFromOther() {\n flagLoadImExport = false;\n}", "function back() {\n const url = \"./goout.html\";\n window.location.href = url;\n }", "function go_home() {\n\tdocument.getElementById(\"display-screen\").innerHTML = loading;\n\tx_home_page(\"\", do_display);\t\t\t\t\n}", "function GoMainPage(){\n window.location=\"index.html\";\n}", "function pageLoad() {\n //only show start page. Hide other content.\n highscoreScreen.setAttribute(\"class\", \"hide\");\n quizScreen.setAttribute(\"class\", \"hide\");\n scoreDisplay.setAttribute(\"class\", \"hide\");\n\n if (startQuiz == true){\n return;\n }\n\n}", "BackToStartPage(){\n this._MqttClient.end()\n this._MqttClient = null\n this._DeviceConfig = null\n this._DeviceConnected = false\n this._DeviceMqttQueue = []\n this._LoadStartView()\n }", "function backHome() {\n leaderboardScreen.style.display = 'none';\n homeScreen.style.display = 'block';\n endQuiz.style.display = 'none';\n quizPrompts.style.display = 'none';\n timer.style.visibility = 'hidden';\n}", "function after_Logout() {\n\t\twindow.location = WAKL.CONST.PAGE_LOGIN;\n\t}", "function onMenuKeyDown() {\n\n //if ($(\"#Home-layout\").css(\"display\") == \"none\") {\n // if ($(\"#Login-home\").css(\"display\") != \"none\") {\n // return false;\n // }\n // else {\n // window.location = \"#Home-layout\";\n // }\n //}\n\n }", "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "function loadHome(){\r\n switchToContent(\"page_home\");\r\n}", "function Home(){\r\n Restart();\r\n document.getElementById(\"homeFrame\").style.display= \"\";\r\n document.getElementById('betting').style.display=\"none\";\r\n document.getElementById('mainContent').style.display = \"none\";\r\n}" ]
[ "0.72739637", "0.6836959", "0.6735878", "0.66409266", "0.6579563", "0.65522593", "0.6457241", "0.64409244", "0.642298", "0.6392403", "0.6389071", "0.6316404", "0.6286425", "0.6266742", "0.62640136", "0.62638116", "0.62635326", "0.62616074", "0.62613744", "0.6256071", "0.62481314", "0.6236945", "0.62336564", "0.6225986", "0.62189", "0.6217359", "0.62125736", "0.6212456", "0.62122244", "0.62000567", "0.61986566", "0.61985373", "0.6196316", "0.617169", "0.6164215", "0.6158437", "0.6157087", "0.6148789", "0.6147129", "0.61402214", "0.61254317", "0.6120556", "0.6110886", "0.6107598", "0.610578", "0.60989386", "0.60964566", "0.6094958", "0.60927224", "0.60922325", "0.6091914", "0.6091423", "0.6090729", "0.6088686", "0.60794026", "0.6079385", "0.6078713", "0.6050838", "0.6036098", "0.60360277", "0.60344446", "0.60298383", "0.6027542", "0.6021445", "0.6010076", "0.60061806", "0.5993439", "0.59908855", "0.5990367", "0.59897757", "0.5989023", "0.5985593", "0.59844977", "0.59843725", "0.59823114", "0.59699965", "0.59693545", "0.59652257", "0.59637254", "0.59624517", "0.59573126", "0.5952802", "0.59519255", "0.5949718", "0.5946759", "0.5945562", "0.5934304", "0.59311527", "0.5928042", "0.5926568", "0.592541", "0.59243673", "0.5923927", "0.59109086", "0.5904419", "0.59022325", "0.5897735", "0.5896568", "0.5896568", "0.58956206", "0.5892529" ]
0.0
-1
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at < Redux actions for the search state
function addSearchQuery(cx, query) { return { type: "ADD_QUERY", cx, query }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search (state = '', action) {\n switch (action.type) {\n case INFORMATION_UPDATE_SEARCH:\n return action.value\n\n case INFORMATION_CLEAR_SEARCH:\n return ''\n\n default:\n return state\n }\n}", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "function searchReducer(search = { isFetching: false, results: {}}, action) {\n console.debug(\"searchReducer called \" + action)\n switch (action.type) {\n case types.REQUEST_SEARCH:\n console.debug(\"REQUEST_SEARCH\")\n console.debug(action.searchFields)\n \n return { ...search, \n isFetching: true,\n results: action.results,\n searchFields: action.searchFields,\n lastUpdated: action.requestedAt\n }\n case types.RECEIVE_SEARCH:\n console.debug(\"RECEIVE_SEARCH\")\n console.debug(action.results)\n return { ...search, \n isFetching: false,\n results: action.results,\n lastUpdated: action.receivedAt\n }\n\n case types.SEARCH_FAILED:\n console.debug(\"SEARCH_FAILED\") \n return { ...search,\n isFetching: false,\n message: action.message,\n lastUpdated: action.failedAt\n }\n default:\n console.debug(\"default\")\n return search;\n }\n}", "search() {\n this.props.onSearch(this.state.searchValue);\n }", "onActionClickSearchBar() {\n this.search(this.state.search)\n }", "_dispatchSearchResults(value) {\r\n let action = {\r\n type: PeopleSearch_State_Action_1.peopleSearchActionTypes.SEARCH,\r\n payload: {\r\n data: !!value.data.results ? value.data.results : []\r\n }\r\n };\r\n this._storeAccess.dispatchAction(action);\r\n }", "searchByText(event) {\n this.state[event.target.query] = event.target.value;\n //this.props.SearchItems(this.state);\n }", "function searchMovie(state = {\n isFetching: false,\n movieTitle: '',\n movieOverview: '',\n moviePosterPath: '',\n searchValue: ''\n}, action) {\n switch (action.type) {\n case UPDATE_HT_VALUE:\n return Object.assign({}, state, {\n searchValue: action.value\n });\n\n // If the reducer is passed that the request is made is notes it in the state object\n case REQUEST_HT:\n return Object.assign({}, state, {\n isFetching: true,\n searchValue: action.movie\n });\n // If the reducer is passed that the response has been received, it updates the state\n case RECEIVE_MOVIE_META:\n return Object.assign({}, state, {\n isFetching: false,\n movieTitle: action.movieObject[0].original_title,\n movieOverview: action.movieObject[0].overview,\n moviePosterPath: action.movieObject[0].poster_path,\n _id: action.movieObject[0].id,\n lastUpdated: action.receivedAt\n });\n case CLEAR_MOVIE_SEARCH:\n return Object.assign({}, state, {\n isFetching: false,\n movieTitle: '',\n movieOverview: '',\n moviePosterPath: '',\n lastUpdated: action.receivedAt\n });\n default:\n return state;\n }\n}", "function modalSearch(state = '', action) {\n switch (action.type) {\n case utils_constants__WEBPACK_IMPORTED_MODULE_2__[\"SearchTypes\"].SET_MODAL_SEARCH:\n {\n return action.data.trim();\n }\n\n default:\n return state;\n }\n}", "handleSearch() {\n if (this.state.searchTerm) {\n this.props.onSearch(this.state.searchTerm);\n }\n else {\n return;\n }\n }", "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "function mapStateToProps(state) {\nreturn {\n studentSearch: state.StudentSearch\n};\n}", "function searchText(state = '', action) {\n if (action.type === CHANGE_SEARCH_TEXT) {\n return action.text;\n }\n return state;\n}", "_actionSearch(q) {\n\t\tthis.context.executeAction(SearchAction.getSearchChild, {\n\t\t\tapi: this.context.api,\n\t\t\tcdnom: this.props.cdnom,\n\t\t\toptions: { q: q }\n\t\t});\n\t}", "filterBooksBySearch(key,value) {\n //update state by search parameters passed from search module to actions to store\n this.setState({\n key: key,\n query: value.toLowerCase()\n });\n }", "search(){\n // Condition checks if nothing has been input when first entering website and clicking the button or when something is typed and then deleted\n // returns out of method if this is the case as there will be no results\n if(this.state === null || this.state.term === ''){\n return;\n }\n\n // Calls the passed down event handler search function from App.js\n this.props.onSearch(this.state.term);\n }", "handleSearch() {\n this.props.searchBeerApi(this.state.term);\n }", "function data(state = initialState, action) {\n switch (action.type) {\n case 'SEARCH_VIDEO': {\n let results = [];\n if (action.payload.query) {\n state.data.categories.forEach( category => {\n results = results.concat(\n category.playlist.filter( item => {\n return item.author.toLowerCase()\n .includes(action.payload.query.toLowerCase())\n }))\n })\n }\n return {\n ...state,\n search: results\n }\n }\n default:\n return state;\n }\n}", "function mapDispatchToProps(dispatch) {\r\n return {\r\n onSearchQueryChange: event => {\r\n let searchQuery = event.target.value\r\n dispatch(getSearchResult(searchQuery))\r\n },\r\n }\r\n}", "termSearch() {\n this.props.termSearch(this.state.selectedTerms)\n }", "function SearchBox({ search, dispatch }) {\n // Use state hook to set searchState\n const [searchState, setSearchState] = useState(\"init\");\n\n // Handle submit with api get request and setting redux state\n // Set await and sync for timing\n const handleSubmit = async (evt) => {\n evt.preventDefault();\n let result = await axios.get(\n `https://newsapi.org/v2/everything?q=${searchState}&apiKey=${process.env.GATSBY_API_KEY}`\n );\n let output = await dispatch({ type: `SET`, value: result.data });\n alert(`Submitting Name ${output} ${search}`);\n };\n\n // return form for search input\n return (\n <div className=\"text-center\">\n <Form onSubmit={handleSubmit}>\n <Form.Label>\n Please enter your search here:\n <Form.Control\n type=\"search\"\n value={searchState}\n onChange={(val) => setSearchState((search = val.target.value))}\n />\n </Form.Label>\n <Button type=\"submit\">Submit</Button>\n </Form>\n </div>\n );\n}", "doPerformSearch() {\n var self = this;\n var query = this.searchInput.value;\n\n cl(\"performing search\");\n\n appStore.discoverQuery({ query: query })\n .then((results) => {\n self.setState({ searchResults: results, isSearching: true });\n })\n }", "handleClickEvent() {\n this.props.fetchSearch(this.state.search)\n }", "function mapDispatchToProps(dispatch) {\n return {\n goToSearch(e, query) {\n e.preventDefault();\n dispatch(push(`/search/${query}`));\n }\n };\n}", "componentDidMount() {\n this.props.dispatch({\n type: \"SET_SEARCH_TERM\",\n payload: \"*all\",\n });\n //\n }", "searchClicked(_) { console.log(this.state.term) }", "onConfirmSearchBar() {\n //this.search(this.state.search)\n }", "createSearch() {\n\t\t\tconst {searchTerms} = this.state;\n\t \tif (searchTerms) {\n\t \t\tconst terms = searchTerms\n\t \t\tthis.setState({\n\t \t\t\tsearchTerms: ''\n\t \t\t})\n\t \t\tthis.props.sendSearchToParent(terms);\n\t \t}\n\t \t}", "triggersearch(){\r\n\t\t\tlet query='';\r\n\t\t\tif(this.props.keyword){\r\n\t\t\t\tquery=this.props.keyword\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tquery=this.props.query\r\n\t\t\t}\r\n\t\t\tthis.props.fetchSearchResults(query);\r\n\t}", "handleSubmit(name){\n //resets input value to empty string\n document.getElementById('search').value = '';\n //sends action to reducer that searches through contacts array for match\n this.props.find(name);\n }", "function search(value){\n\n // Call parent search method\n props.action(value);\n }", "checkTopStoriesSearchTerm(searchTerm){\n return !this.state.results[searchTerm];\n }", "constructor() {\n super();\n this.state = {\n showingSearch: false,\n searchTerm: '',\n searchResults: {items: [], total: 0}\n };\n }", "handleSearch(target){\n this.setState(() => {\n return {\n searchTerm: target,\n searchItem: target\n }\n })\n console.log(this.state);\n }", "search(keyword) {\n const searchResults = WasteWizard.search(keyword);\n this.setState({ searchResults });\n }", "onSearch() {\n const {\n onBarsSearch,\n location\n } = this.props;\n onBarsSearch(location);\n }", "search(e: Event) {\n // Retrieving input html element with the search string\n const target = ((e.target: any): HTMLInputElement);\n\n // Retrieving search string\n const needle: string = target.value.toLowerCase();\n\n // Asserting search was initialized\n invariant(this._preSearchData && this._preSearchData != null, \"CRUDActions.search: search wasn't initialized\");\n\n // If search string wasn't retrieved successfully or it is an empty string, stop search\n if (!needle) {\n this.crudStore.setData(this._preSearchData);\n return;\n }\n\n // Retrieving fields of data\n const fields: List<string> = this.crudStore.getSchema().map(item => item.id);\n\n // Retrieving all records that have the search string\n let searchData;\n if (this._preSearchData && this._preSearchData != null) {\n searchData = this._retrieveSearchData(this._preSearchData, fields, needle)\n\n // Updating data in store without committing since this update is temporary until\n // search in finished\n this.crudStore.setData(searchData);\n }\n }", "search(){\n\t\t\t\tlet serviceAddrList = _.cloneDeep(this.state.serviceAddrList)\n\t\t\t\tif(!CommonUtil.isServcieAddrEmpty(this.state.currentAddress,serviceAddrList)){\n\t\t\t\t\t\tserviceAddrList.push(this.state.currentAddress)\n\t\t\t\t}\n\t\t\t\tthis.setState({serviceAddrList})\n\t\t\t\tif(this.validateForm(serviceAddrList)){\n\t\t\t\t\t\tthis.setState({isError:false})\n\t\t\t\t\t\tthis.setState({isProcessing:true,showResult:false})\n\t\t\t\t\t\tthis.props.actions.lookupESIIDsByAddr({serviceAddressList:serviceAddrList});\n\t\t\t\t\t\tthis.setState({isAjaxCalled:true});\n\t\t\t\t\t\t//this.setState({serviceAddrList:[]});//emptying the address list after the call.\n\t\t\t\t}else{\n\t\t\t\t\t\tthis.setState({isError:true, errorMessage:\"StreetNumber and StreetName is required for the search. Please enter required fields.\"})\n\t\t\t\t}\n }", "onSearch(e) {\n e.preventDefault();\n this.setState({ searchTerm: e.target.value });\n\n // TODO refactor this and just call a search method in a 'Products' service that handles all the API calls\n if (e.target.value && e.target.value.length > 2) {\n fetch(`http://localhost:3035/products?q=${e.target.value}`)\n .then(res => res.json())\n .then(searchResults => {\n this.setState({ searchResults })\n });\n } else {\n this.setState({ searchResults: {items: [], total: 0} });\n }\n }", "function search(data){\n setSearch(data); \n }", "function mapStateToProps(state) {\n return {\n products: state.SearchReducer.products,\n }\n}", "searchWardrobe(query) {\n this.props.searchWardrobe(query.target.value);\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "handleSearch(query) {\n const {Store} = this.props;\n Store.setQuery(query);\n //calls the computed function searchQuery\n Store.searchQuery;\n }", "onSearchSubmit(event) {\n const { searchTerm } = this.state;\n\n // set the searchKey whenever search is submitted using that search query string\n this.setState({ searchKey : searchTerm }); \n \n if(this.needsToSeachTopStories(searchTerm)) {\n this.fetchSearchTopStories(searchTerm);\n }\n\n // if you try to search without this, the browser will reload. That's a native browser behavior\n // for a submit callback in an HTML form. In React, you will often come across the preventDefault()\n // event method to suppress the native browser behavior\n event.preventDefault();\n }", "function search(value) {\n return function(dispatch) {\n dispatch({ type: actionTypes_1.default.SEARCH, payload: value });\n dispatch(refresh());\n };\n }", "function mapStateToProps(state) {\n return {users: state.users,\n searchText: state.searchText\n }\n}", "handleSubmit(e) {\n e.preventDefault();\n let search = (this.refs.search.value).toUpperCase();\n store.searchPeople(search);\n }", "process({ httpClient, getState, action, environmentConfig }, dispatch, done) {\n const state = selectors.pages(getState());\n httpClient.get(`${environmentConfig.BASE_URL}/recipes?page=${action.payload.page||state.currentPage}&pageSize=${action.payload.pageSize||state.size}&search=${action.payload.value||state.value}`)\n .then(resp => {\n return resp.data;\n }) // use results property of payload\n .then(results => dispatch(searchFulfilled({...results, value: action.payload.value})))\n .catch((err) => {\n console.error(err); // might be a render err\n dispatch(searchRejected(err))\n })\n .then(() => done()); // call done when finished dispatching\n }", "handleSearch(e) {\n var text = e.target.value;\n this.props.onSearch(text);\n this.setState({\n queryText: text\n });\n }", "onSearchSubmit(event) {\n const { searchTerm } = this.state;\n this.setState({ searchKey: searchTerm });\n\n if (this.needsToSearchTopStories(searchTerm)) {\n this.fetchSearchTopStories(searchTerm);\n }\n\n event.preventDefault();\n }", "function searchSelect(e) {\n setSearchState({ ...searchState, searchType: e, dropdownTitle: e });\n }", "handleChangeSearchValue(searchValue) {\n this.props.findFavoriteAlbums(searchValue); // Fetch favorite albums from criterion search\n }", "handleSearchClick(event, passedState) {\n\t\tif(passedState) {\n\t\t\tthis.loadSearchResults(passedState);\n\t\t} else {\n\t\t\tthis.loadSearchResults(this.state);\n\t\t}\n\t\t\n\t}", "search(term) {\n Spotify.search(term)\n .then(searchResults => this.setState({\n searchResults: searchResults\n }));\n }", "function searchSymbol(state = { symbols: [] }, action) {\n const { type, response } = action\n\n if (type === ActionTypes.SYMBOLS.SUCCESS) {\n return merge({}, state, { symbols: response })\n }\n\n return state\n}", "searchData(firebase){\n this.setState({loading:true, noMatches: false});\n this.props.search(firebase, this.state.name, this)\n\n }", "function refReducer(state = initialState, action) {\n switch (action.type) {\n case SET_REF_RESULTS:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n results: action.newState.results,\n },\n });\n case SET_REF_HEADERS:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n headers: action.newState.headers,\n },\n });\n case SENDING_REF_REQUEST:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n currentlySending: action.sending,\n },\n });\n case SET_REF_QUERY:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n query: action.query,\n },\n });\n case SET_REF_FILTER:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n filter: action.filter,\n },\n });\n case SET_REF_ERROR_MESSAGE:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n errorMessage: action.message,\n },\n });\n case SET_REF_PERIOD:\n return assign({}, state, {\n ...state,\n refSearch: {\n ...state.refSearch,\n period: action.period,\n },\n });\n default:\n return state;\n }\n}", "function searchBook() {\n setSearchTerm(searchValue.current.value)\n }", "handleSearch(event) {\n this.props.searchYelp(this.state.term, this.state.location, this.state.sortBy);\n event.preventDefault();\n }", "handleSearch(e) {\n this.setState({\n search: e.target.value,\n });\n }", "handleSearchClick(event) {\n\t\tthis.props.onSearchClick(event, this.state);\n\t}", "function renderSearchFromState() {\n\tconst state = JSON.parse(sessionStorage.getItem(SEARCH_STATE_KEY));\n\n\tif (state) {\n\t\tconst searchResults = document.querySelector('#search-results');\n\t\tconst searchInput = document.querySelector('#search-input');\n\n\t\tsearchInput.value = state.searchTerm;\n\t\tsearchResults.classList.add('visible');\n\t\tsearchResults.classList.add('no-transition');\n\t\tsearchResults.innerHTML = state.resultsMarkup;\n\n\t\t// remove class which prevents transition on page move\n\t\tsetTimeout(() => searchResults.classList.remove('no-transition'), 100);\n\t}\n}", "handleSearch(event) {\n if(this.state.term && this.state.location){\n this.props.searchYelp(this.state.term, this.state.location, this.state.sortBy);\n event.preventDefault();\n this.setState({ arrow: \"visible\"});\n this.setState({ searchError: ''});\n }else{\n this.setState({ searchError: 'Please ensure you fill the What food? and Where? fields before clicking the Let\\'s Go button'});\n }\n \n }", "constructor() {\n super();\n this.state = {\n showingSearch: false,\n ls: [{}],\n searching: false,\n };\n }", "searchQuery(state, payload) {\n let filtered = [];\n if (payload === \"\") alert(\"Enter Valid Warehouse Name\");\n else {\n filtered = state.data.filter((item) => {\n return item.name.toLowerCase().includes(payload.toLowerCase());\n });\n state.warehouses = filtered;\n }\n }", "componentWillMount(): void {\n this._updateSearch(this.props.filter);\n }", "handleSearch (filter) {\n // cambio la propiedad filter de mi estado, con lo que me paso en la funcion\n this.setState({\n filter\n });\n }", "submitSearch(){\n //Term that we will use for query\n const searchTerm = this.state.searchTerm;\n\n //Require that name not be an empty string\n if(searchTerm.length === 0)\n {\n //Reset state\n this.setState({\n loading: false,\n lastSearchTerm: '',\n results: []\n });\n }\n //Avoid unneeded duplicate requests by checking if search term has changed at all from the term whose results are currently being displayed\n else if(searchTerm !== this.state.lastSearchTerm){\n this.setState({\n lastSearchTerm: searchTerm,//Store this search term as what was previously searched to avoid unneeded duplicate requests\n loading: true//Begin showing loading spinner until results are received\n });\n\n //Send test search with query in format \"[search term] in [location]\"\n PlacesService.textSearch({\n //Searching by zip sucks - like Schenectady, NY's zip code is 12345 and google doesn't know what to do with that\n //Instead, using the formatted name of the location gets way cleaner results!\n query: `${searchTerm} in ${this.props.locationName}`\n }, this.handleSearchResults);\n }\n }", "function mapStateToProps(state) {\n return {\n searchOptions: getSearchOptions(state),\n searchParameters: getSearchParameters(state),\n }\n}", "handleSearch() {\r\n this.updateState();\r\n if (this.state.isReturn) {\r\n this.props.navigation.navigate('Return');\r\n } else {\r\n this.props.navigation.navigate('OneWay');\r\n }\r\n }", "async search() {\n this.mixpanelTrack(\"Discover Stax Search Started\");\n if(this.state.catgorychoosen==Strings.discover_category_home)\n { \n await this.catWisestax(this.state.searchquery);\n }\n else\n { \n await this.categoryselected(\"\", this.state.catgorychoosen)\n }\n }", "constructor(props){\n super(props); //Calls parent method. \n this.state = {term:''};//initialises state. New object. term will be our search term property.\n }", "constructor(props){\n super(props);\n this.state={\n searchTerm:''\n }\n }", "recipesList({ commit, state }, payload) {\n axios\n .get(config.API_URL + \"recipesList?search=\" + payload.search)\n .then(function(response) {\n commit(\"recipesList\", response.data);\n })\n .catch(function(error) {\n console.log(error);\n });\n }", "search(term){\n // fetch a token from Spotify and perform the track search\n Spotify.getAccessToken();\n Spotify.search(term).then(searchResults =>{\n\n // update the state with the searchResults\n this.setState({ SearchResults:searchResults });\n });\n\n }", "doSearch( searchItem ) {\n let itemId= this.props.ItemNotFound\n \n window.location.hash='#'; // hashy clear\n if( this.props.ItemNotFound === (itemId= this.props.searchByName( searchItem )) ) {\n if( this.props.ItemNotFound === (itemId= this.props.searchByAge(searchItem )) ) {\n if( this.props.ItemNotFound === (itemId= this.props.searchByWeight( searchItem )) ) {\n if( this.props.ItemNotFound === (itemId= this.props.searchByHeight( searchItem )) ) {\n if( this.props.ItemNotFound === (itemId= this.props.searchByHairColor( searchItem )) ) {\n if( this.props.ItemNotFound === (itemId= this.props.searchByProfessions( searchItem )) ) {\n window.location.hash='#';\n } else { window.location.hash= itemId; }\n } else { window.location.hash= itemId; }\n } else { window.location.hash= itemId; }\n } else { window.location.hash= itemId; } \n } else { window.location.hash= itemId; }\n } else { window.location.hash= itemId; }\n\n }", "personSearch( term ){\n this.setState({ \n searched: term\n })\n }", "onSearchRepository(searchString) {\n const searchResults = this.state.userReposDefault.filter(repo => repo.name.toLowerCase().includes(searchString.toLowerCase()));\n\n this.setState({userRepos: searchResults});\n }", "onSearch(event) {\n //using this.setState to manipulate the internal component state\n this.setState({ query: event.target.value}); \n }", "trackResultsChange(results) {\n /**\n * Construct the payload.\n */\n const gtmSearchTitle = this.props.searchName || 'Unnamed React search';\n const keywordField = this.props.keywordField || 'q';\n const query = this.searchkit.state[keywordField];\n let page = typeof this.searchkit.state.p == 'undefined' ? 1 : this.searchkit.state.p;\n let totalResults = this.getHitsCount();\n\n /**\n * Figure out paging and filtering events.\n */\n let previousPage = typeof this.previousState.p == 'undefined' ? 1 : this.previousState.p;\n let pagingEvent = page != previousPage && query == this.previousState.q;\n\n var pushObject = {\n 'event': 'site search event',\n 'content-name': '/search?query=' + query + '&cat=' + gtmSearchTitle + '&page=' + page,\n 'keyword': query,\n 'target': gtmSearchTitle,\n 'value': totalResults,\n 'searchFiltered': 'false',\n 'searchSorted': 'false',\n 'searchPaged': pagingEvent ? 'true' : 'false',\n 'searchNoResults': totalResults < 1 ? 'true' : 'false',\n 'searchGeo': 'false',\n 'pageNumber': page\n };\n\n /**\n * Allow the object to be changed.\n */\n const derivedValues = this.derivePayloadValues(results);\n let payload = defaults(derivedValues, pushObject);\n\n /**\n * Set the content-name to be constructed from other values.\n */\n payload['content-name'] = '/search?query=' + payload.keyword + '&cat=' + payload.target + '&page=' + payload.pageNumber;\n\n /**\n * Push the event to dataLayer.\n */\n dataLayer.push(payload);\n\n /**\n * Save state for later, this needs redux :C\n */\n this.previousState = this.searchkit.state;\n }", "searchStores() {\n StoreService.getStores((data) => {\n this.setState({ stores: data });\n });\n }", "HandleSearch(e) {\n this.props.searchname(this.state.search);\n this.setState({ clicked: true, search: '' });\n this.props.handleClickParent(e);\n }", "updateSearchState(event) {\n let search = event.target.value;\n return this.setState({\n search: search\n });\n }", "componentDidMount() {\n const searchTerm = this.props.match.params.searchTerm;\n this.props.submitSearch(searchTerm);\n }", "search(term) {\n Spotify.search(term).then(searchResults =>\n this.setState({ searchResults: searchResults })\n );\n }", "search(term) {\n Spotify.search(term).then((searchResults) =>\n this.setState({ searchResults: searchResults })\n );\n }", "static searchArtistAsync(searchText) {\n return (dispatch) => {\n axios.get(`${base}?term=` + searchText + \"&media=music\")\n .then((response) => {\n dispatch(ArtistActions.loading(true));\n dispatch(ArtistActions.loadArtistResults(response.data.results))\n dispatch(ArtistActions.updateSearch('search',''))\n })\n .catch((error) => {\n console.log(error)\n dispatch(ArtistActions.loading(true));\n })\n }\n }", "constructor(){\n super()\n this.state = {\n searchText: \"\"\n }\n }", "showSearchContainer(e) {\n e.preventDefault();\n this.setState({\n showingSearch: !this.state.showingSearch,\n searchTerm: '',\n searchResults: {items: [], total: 0}\n });\n }", "static getDerivedStateFromProps(nextProps, prevState) {\n if (prevState.search === null) {\n const { data } = nextProps;\n return {\n searchResults: data,\n filterResults: data,\n };\n }\n return null;\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function handleSearchSubmit(event) {\n event.preventDefault()\n setQuery(event.target.search.value)\n history.push('/search')\n }", "render() {\n //this is where const {search } = this.state;\n return (\n <div>\n <form onSubmit={this.handleSubmit} className=\"form-inline my-2 my-lg-0\">\n <input\n className=\"form-control mr-sm-2\"\n type=\"text\"\n placeholder=\"ID Number\"\n aria-label=\"search\"\n name=\"fullName\"\n ></input>\n\n <button\n className=\"btn btn-outline-success my-2 my-sm-0\"\n type=\"submit\"\n >\n Search\n </button>\n </form>\n </div>\n );\n }", "onSubmit(event){\n const { searchTerm } = this.state;\n this.setState({ searchKey: searchTerm });\n\n if (this.checkTopStoriesSearchTerm(searchTerm)) {\n this.fetchTopStories(this.state.searchTerm, DEFAULT_PAGE);\n }\n\n event.preventDefault();\n }", "reducer({ settings, translations, searchState, keyword, englishWords }) {\n return {\n settings,\n translations,\n searchState,\n keyword,\n englishWords,\n };\n }", "function checkSearchState() {\n //check latest state\n if ($rootScope.$state.current.name == 'home.search') {\n return {\n status: true,\n queryString: $rootScope.$stateParams.queryString || \"\"\n }\n } else if ($rootScope.stateHistory.length > 0) {\n //check if previous state was search and current state is post\n if ($rootScope.stateHistory[$rootScope.stateHistory.length - 1].hasOwnProperty('home.search') && $rootScope.$state.current.name == 'home.post') {\n //checking the previous state\n return {\n status: true,\n queryString: $rootScope.stateHistory[$rootScope.stateHistory.length - 1]['home.search'].queryString\n }\n } else {\n return {\n status: false\n }\n }\n } else {\n return {\n status: false\n }\n }\n }", "searchBar(event) {\n\n this.setState({ searchedText: event.target.value },\n () => {\n this.props.returnedData(this.state.searchedText);\n });\n\n }", "search(params) {\n let query = params;\n this.set('query', query);\n this.transitionToRoute('search', {queryParams: {q: query, p: this.page }});\n }", "async searchSongs(){\n try{\n const results = this.props.songs.filter(song => \n song.title.toLowerCase().includes(this.state.search.toLowerCase()) || \n song.artist.toLowerCase().includes(this.state.search.toLowerCase()) ||\n song.album.toLowerCase().includes(this.state.search.toLowerCase()) ||\n song.genre.toLowerCase().includes(this.state.search.toLowerCase()));\n if(results != ''){\n console.log(results);\n this.state.results = results;\n this.state.submitted = true;\n this.setState({state: this.state});\n }else{\n alert(\"no results\");\n }\n }\n catch{\n console.log(\"unable to search\")\n } \n }", "handleSearch(event) {\n\n this.setState({\n\n [event.target.id]: event.target.value\n\n }, function() {\n\n this.setState({\n\n filteredProducts: Object.values(this.state.products).filter(user => user.name.toLowerCase().includes(this.state.search.toLowerCase()))\n \n })\n\n });\n\n }" ]
[ "0.7706961", "0.73616976", "0.73032963", "0.71947926", "0.7121118", "0.70772076", "0.7018136", "0.70005715", "0.69931114", "0.6952204", "0.6917944", "0.68207926", "0.68108606", "0.67667747", "0.67456853", "0.67100334", "0.6708941", "0.6704832", "0.66680425", "0.66554266", "0.66492677", "0.6639269", "0.6635467", "0.66236484", "0.6614557", "0.6600479", "0.65934557", "0.6546774", "0.6528669", "0.64968973", "0.64900446", "0.6487034", "0.6484713", "0.6466517", "0.64510995", "0.6450191", "0.6440149", "0.63971984", "0.6378293", "0.63752854", "0.63689476", "0.6368758", "0.6352801", "0.63469654", "0.63432056", "0.6331395", "0.63286996", "0.63204604", "0.63181597", "0.63160753", "0.63155365", "0.62879", "0.6287512", "0.6252365", "0.62463474", "0.6239477", "0.62274015", "0.621866", "0.6215792", "0.6190716", "0.6189038", "0.6186116", "0.61721134", "0.6171202", "0.6165092", "0.6160473", "0.6156949", "0.6152049", "0.6129119", "0.6126129", "0.6123351", "0.6119962", "0.6119806", "0.6117893", "0.6117474", "0.6112219", "0.61066407", "0.6098441", "0.60943115", "0.60932666", "0.6090081", "0.6083962", "0.6082877", "0.60795945", "0.6077992", "0.6074869", "0.6072615", "0.60704535", "0.60686475", "0.6065125", "0.6064682", "0.6064222", "0.6061335", "0.605876", "0.6055382", "0.60492116", "0.60461485", "0.60440266", "0.60403025", "0.6039725", "0.6037478" ]
0.0
-1
You will be given an array (a) and a value (x). All you need to do is check whether the provided array contains the value, without using a loop. Array can contain numbers or strings. X can be either. Return true if the array contains the value, false if not. With strings you will need to account for case.
function check(a,x){ return a.some(element => element == x) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contains(arr, x) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === x) return true;\n }\n return false;\n }", "function contains(arr, x) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === x) {\n return true;\n }\n }\n return false;\n}", "function findValue(array, x) {\n if (array.includes(x)) {\n return true;\n }\n else {\n return false;\n }\n \n }", "function contains(arr, value) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] === value) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function arrayContainsValue(array, value) {\n if (array.indexOf(value) != -1) {\n return true;\n } else {\n return false;\n }\n}", "function arrayContains(inputArr, val) { return inputArr.indexOf(val) !== -1; }", "function arrayContains(inputArr, val) { return inputArr.indexOf(val) !== -1; }", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] === value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] === value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] === value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function contains(arr, value) {\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] == value) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function IsInArray(value, array) {\n return array.indexOf(value) > -1;\n}", "function contains(arr, val) {\n for (var i = 0; i < arr.length; i ++) {\n if (arr[i]===val) {\n return true;\n }\n }\n return false;\n}", "function oneOf (arr, x) {\n\t if (!Array.isArray(arr)) {\n\t throw new Error('expected an array')\n\t }\n\t return arr.indexOf(x) !== -1\n\t}", "function inArray(value, array){\n\t\t for(var i=0;i<array.length;i++){\n\t\t if(array[i]==value) {return false;}\n\t\t \t}\n\t\t\t}", "function in_array(value, array)\n{\n\tfor (var i in array)\n\t\tif (array[i] == value)\n\t\t\treturn true;\n\treturn false;\n}", "function check(a, x) {\nif(a.includes(x)){\n\treturn true\n}\nreturn false\n}", "function arrayContains(array, value) {\n for (var i = 0; i < array.length; i++) {\n var cur = array[i];\n if (cur = value) {\n return true;\n }\n }\n}", "function isInArray(value, array) {\n \treturn array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n}", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n}", "function isInArray(value, array) {\n\n for ( var item of array ) {\n if ( item == value ) { return true; }\n }\n return false;\n}", "function exists(value, array) {\n return array.some((e) => e === value);\n}", "function contains(a, e) {\r\n for(j=0;j<a.length;j++)if(a[j]==e)return true;\r\n return false;\r\n}", "function contains(a, e) {\r\n for(j=0;j<a.length;j++)if(a[j]==e)return true;\r\n return false;\r\n}", "function in_array(variable, theArray)\n{\n\tfor (var i = 0; i < theArray.length; i++)\n\t{\n\t\tif (theArray[i] == variable)\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "function containsElement(arr, x){\n for(var r = 0; r < arr.length; r++){\n if(r == x){\n return true;\n }else{\n return false;\n }\n }\n return containsElement;\n }", "function inArray(val, arr) {\n\tfor (var i=0; i < arr.length; i++) {\n\t\tif (arr[i] == val) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function existsInArray(arr, value){\n for(i in arr){\n if(value === arr[i]){\n return true;\n }\n }\n return false;\n}", "function check(a, x) {\n return a.indexOf(x) > -1;\n }", "function validarExistenciaValorDeArray(value, array, x_value) {\n for (let i = 0; i < array.length; i++) {\n if (value === array[i][x_value]) {\n return true;\n }\n }\n return false;\n}", "function search(arr, x) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === x) return true;\n }\n return false;\n}", "static hasValue(array, value) {\n for (var tI = 0; tI < array.length; tI++) {\n if (array[tI] === value) {\n return true;\n }\n }\n return false;\n }", "function searchForX(arr, x) {\n\tfor (i = 0; i > arr.length; i ++) {\n\t\tif (arr[i] === x) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "contains(num, arr) {\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === num) {\n return true;\n }\n }\n return false;\n }", "function contains(someArray, someString){\n containsVal = false;\n for (x=0; x<someArray.length; x++){\n if (someArray[x] == someString){\n containsVal = true;\n break;\n }\n }\n return containsVal\n}", "function checkIn(value, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (value == arr[i]) {\n return true;\n }\n }\n return false;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function includes(array, value) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === value)\n return true;\n }\n return false;\n}", "function in_array(variable, theArray)\n{\n\treturn $.inArray(variable, theArray) != -1;\n}", "function isInArray(array, value)\r\n{\r\n\tvar found = false;\r\n\r\n\tfor(var i = 0; i < array.length; i++)\r\n\t{\r\n\t\tif(value === array[i])\r\n\t\t{\r\n\t\t\tfound = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn found;\r\n}", "function checkValue(arr, val) {\n\treturn arr.indexOf(val) > -1;\n}", "function isInArray(array, value) {\n return array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) > -1;\n }", "function contains(a, e) {\n var j;\n for (j = 0; j < a.length; j += 1) {\n if (a[j] === e) {\n return true;\n }\n }\n return false;\n }", "function contains(arr, val) {\n return arr.indexOf(val) !== -1;\n }", "function contains(arr, item){\r\n\tfor(var i = 0; i < arr.length; i++){\r\n\t\tif(arr[i] == item)\r\n\t\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "function containsAll(arr){\n for (let k = 1; k < arguments.length; k++){\n let num = arguments[k];\n if (arr.indexOf(num) === -1){\n return false;\n }\n }\n return true;\n}", "function arrayValueExist(array, value){\n\t\tfor(var i = 0; i < array.length; i++) if (array[i] == value) return true;\n\t\treturn false;\n\t}", "function contains(arr, val) {\n return indexOf(arr, val) !== -1;\n }", "function contains(arr, val) {\n return indexOf(arr, val) !== -1;\n }", "function existsInArray(arr, val){\n\tvar res = false;\n\tfor(var i = 0; i < arr.length; ++i){\n\t\tif(arr[i] == val){\n\t\t\tres = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn res;\n}", "function tool_isInArray(item,arr) {\n\n\tfor(x=0;x<arr.length;x++) {\n\t\tif (arr[x] == item) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function arrayValueExist(array, value){\r\n\t\tfor(var i = 0; i < array.length; i++) if (array[i] == value) return true;\r\n\r\n\t\treturn false;\r\n\t}", "function contains(arr, val) {\n\t return indexOf(arr, val) !== -1;\n\t }", "function isInArray(string, array) {\n\tfor (let i = 0; i < array.length; i++){\n\t\tif(array[i]===string){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function containsAll(arr){\r\n\tfor(let k=1; k<arguments.length;k++){\t\t//arguments object to pass arguments\r\n\t\tlet num=arguments[k];\r\n\t\tif(arr.indexOf(num)===-1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function arrayContainsCard(a, card)\r\n{\r\n\r\n for (var i = 0; i < a.length; i++)\r\n {\r\n if (a[i] === card)\r\n return true;\r\n }\r\n return false;\r\n\r\n}", "function contains(a1, e) {\n for (var j = 0; j < a1.length; j++) {\n if (a1[j] == e) return true;\n }\n return false;\n}", "function in_array(item,arr) {\r\n for(p=0;p<arr.length;p++) if (item == arr[p]) return true;\r\n return false;\r\n}", "function arrContains(arr,item){\n var nItems = arr.length;\n var retVal = false, i;\n\n for (i=0;i<nItems;i++) {\n if (arr[i] == item) {\n retVal = true; \n break;\n }\n }\n \n return retVal;\n}", "function contains(arr, str){\nif(arr.indexOf(str) == -1 ){\n return false;\n}else{\n return true;\n}\n}", "function in_array(array,element){\n\tindex=array.indexOf(element);\n\tif (index>-1){\n\t\treturn true;\n\t};\n\treturn false;\n}", "function arrayContains(a, obj) {\n var i = a.length;\n while (i--) {\n if (a[i] === obj) {\n return true;\n }\n }\n return false;\n}", "function contains(arr, element) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === element) {\n return true;\n }\n }return false;\n}", "function arrayContains(element, array) {\n return (array.indexOf(element) > -1);\n}", "function arrayCheck (arrayItem, arrayName) {\n for (x = 0; x < arrayName.length; x++) {\n if(arrayName.includes(arrayItem)) {\n return false;\n }\n }\n return true;\n}", "function any(array, test) {\n var length = array.length;\n for (var i = 0; i < length; ++i) {\n if (test(array[i])) {\n return true;\n }\n }\n return false;\n}", "function int_in_array(value, arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (parseInt(arr[i], 10) == parseInt(value, 10)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function arrayContains (a, obj) {\n var i = a.length;\n while (i--)\n if (a[i] === obj)\n return true;\n return false;\n}", "arraysItemInArray(a, b) {\r\n for(let item of a) {\r\n if(b.includes(item)) return true;\r\n }\r\n return false;\r\n }", "function arrCont(arr, x) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === x) \n return true;\n }\n return false;\n}", "function contains(array, obj) {\n var i = a.length;\n while (i--) {\n if (a[i] === obj) {\n return true;\n }\n }\n return false;\n}", "function contains(a, obj) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] == obj) {\n return true;\n }\n }\n return false;\n}", "function check(a, x) {\n return a.includes(x)?Boolean(1):Boolean(0);\n}", "function arrayIncludes(array, value) {\n return array.indexOf(value) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(a, obj){\n\tfor(var i = 0; i < a.length; i++) {\n \tif(a[i] == obj){\n\t\t\treturn true;\n \t}\n \t}\n \treturn false;\n}", "function isInArray(array, search)\n{\n if (array.indexOf(search) >= 0) {\n return true;\n }\n else{\n return false;\n }\n}", "function contains(arr, value, transform) {\n arr = arr || [];\n if (is_1.isString(arr))\n arr = arr.split('');\n return arr.filter(function (v) {\n if (transform)\n v = transform(v);\n return is_1.isEqual(v, value);\n }).length > 0;\n}", "function inArray(array,elemento) {\n var i =0;\n\n while (i < array.length) {\n if (array[i] == elemento) {\n return true;\n }\n i ++;\n }\n return false;\n}", "function contains(array, item)\n{\n for (var i in array)\n {\n arrayItem = array[i];\n\n if (arrayItem[0] == item[0] && arrayItem[1] == item[1])\n {\n return true;\n }\n }\n\n return false;\n}", "function inArr(arr, e){\n\tif(arr.length == 0)\n\t\treturn false;\n\treturn arr.indexOf(e) !== -1\n}", "function inArr(arr, e){\n\tif(arr.length == 0)\n\t\treturn false;\n\treturn arr.indexOf(e) !== -1\n}", "function inArray(value, array){\n\tvar i;\n\tfor (i=0; i < array.length; i++) {\n\t\tif (array[i] === value) {\n\t\t\treturn value;\n\t\t}\n\t}\n\treturn false;\n}", "function contains$1(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains$1(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function arrayHasValue(arr, value) {\n var idx = arr.indexOf(value);\n if (idx !== -1) {\n return true;\n }\n return false;\n }", "static ArrayContains(p_Array, p_Value) {\n for (let i_Idx = 0; i_Idx < p_Array.length; i_Idx++) {\n if (p_Array[i_Idx] === p_Value) {\n return true; } }\n return false;\n }", "function isInArray(string, array) {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === string) return true;\n }\n return false;\n}", "function findInArray(arr, value) {\n // code\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] == value) {\n return true;\n }\n }\n return false;\n}" ]
[ "0.8176493", "0.81291085", "0.80173653", "0.7809401", "0.7735965", "0.77010363", "0.77010363", "0.76982313", "0.76982313", "0.76982313", "0.76978886", "0.75953937", "0.7569852", "0.7568723", "0.756283", "0.74789995", "0.74748945", "0.7473922", "0.7464376", "0.7433884", "0.7433884", "0.74265164", "0.7403775", "0.7401148", "0.7401148", "0.7382325", "0.7374627", "0.7354023", "0.73508304", "0.7328597", "0.7321977", "0.7316931", "0.7313961", "0.7312604", "0.730116", "0.7300734", "0.7288192", "0.7275801", "0.7275801", "0.7275801", "0.7265041", "0.7264408", "0.7261468", "0.7255977", "0.7212042", "0.72058475", "0.72046655", "0.7203508", "0.7201868", "0.71980226", "0.71924734", "0.71876514", "0.71876514", "0.7178964", "0.7175424", "0.71751356", "0.71718436", "0.7147783", "0.7143102", "0.71395725", "0.71367437", "0.71350425", "0.7129486", "0.71220535", "0.7118321", "0.7115765", "0.7111279", "0.70966494", "0.70961344", "0.707062", "0.7067301", "0.7052854", "0.7051399", "0.700941", "0.70040554", "0.69926953", "0.6992278", "0.6989875", "0.69881386", "0.69881386", "0.69881386", "0.69881386", "0.69881386", "0.69881386", "0.69881386", "0.69881386", "0.6981051", "0.69774216", "0.69749045", "0.6972175", "0.6969527", "0.69690496", "0.69690496", "0.6967571", "0.6956679", "0.6956679", "0.6924467", "0.6912047", "0.69109523", "0.68943244" ]
0.734581
29
Returns a random phrase from the phrases array
getRandomPhrase () { const phrases = this.phrases; const randIndex = Math.floor(Math.random() * phrases.length); return phrases[randIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomPhrase() {\n const phrase = phrases[Math.floor(Math.random() * phrases.length)];\n return phrase;\n}", "function getRandomPhraseAsArray(arr) {\n let pick = Math.floor(Math.random() * arr.length);\n return phrases[pick];\n}", "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "getRandomPhrase() {\n const randNum = Math.floor(Math.random() * this.phrases.length);\n const phrase = this.phrases[randNum];\n return phrase;\n }", "getRandomPhrase() {\n let phraseArray = this.phrases;\n let randomPhrase = phraseArray[Math.floor(Math.random() * phraseArray.length)];\n return randomPhrase;\n }", "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "getRandomPhrase(){\r\n const phraseIdx = Math.floor(Math.random() * this.phrases.length);\r\n return this.phrases[phraseIdx];\r\n }", "function getRandomPhraseAsArray(arr) {\n let i = Math.floor(Math.random() * phrases.length)\n return phrases[i].split(\"\");\n }", "getRandomPhrase() { // Gets a random phrase\n const rand = this.phrases[Math.floor(Math.random() * this.phrases.length)];\n return rand;\n }", "getRandomPhrase(){\n \t\tconst randomIndex = Math.floor(Math.random()*this.phrases.length)\n \t\treturn this.phrases[randomIndex];\n \t}", "getRandomPhrase() {\n const randomPhrase = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomPhrase];\n }", "getRandomPhrase(phraseList){\r\n const randomNumber = Math.floor(Math.random()*(this.phrases.length));\r\n return phraseList[randomNumber];\r\n }", "function getRandomPhraseAsArray(arr) {\n const randomNumber = Math.floor(Math.random() * phrases.length + 1);\n const chosenPhrase = phrases[randomNumber].split('');\n return chosenPhrase;\n}", "getRandomPhrase() {\n return this.phrases[Math.floor(Math.random() * this.phrases.length)];\n }", "getRandomPhrase() {\n return this.phrases[Math.floor(Math.random() * this.phrases.length)];\n }", "getRandomPhrase() {\n const randNum = Math.floor(Math.random() * Math.floor(5));\n const randomPhrase = this.phrases[randNum];\n return randomPhrase;\n }", "function getRandomPhraseArray(arr) {\n const randomNumber = Math.floor((Math.random() * 4) + 0);\n const randomPhrase = arr[randomNumber];\n return randomPhrase\n}", "getRandomPhrase(){\n const randomIndex = Math.floor((Math.random()*this.phrases.length));\n return new Phrase(this.phrases[randomIndex]);\n }", "getRandomPhrase() {\r\n return this.phrases[Math.floor(Math.random()*this.phrases.length)];\r\n }", "getRandomPhrase() {\r\n let randomPhrase = this.phrases[Math.floor(Math\r\n .random() * this.phrases.length)];\r\n return randomPhrase;\r\n }", "getRandomPhrase() {\n //Generates random number between 0 and this.phrase.length -1 \n let num = Math.floor(Math.random() * this.phrases.length);\n let randomPhrase = this.phrases[num];\n return randomPhrase;\n }", "getRandomPhrase() {\n let randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber];\n }", "function getRandomPhraseAsArray(arr){\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n return randomPhrase;\n }", "getRandomPhrase() {\n var randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber]\n }", "function getRandomPhraseAsArray(array){\r\n let chosenPhrase = Math.floor(Math.random() * array.length)\r\n return array[chosenPhrase];\r\n}", "function getRandomPhraseAsArray(array) {\n let number = Math.floor(Math.random() * array.length);\n let randomPhrase = array[number].split(\"\");\n return randomPhrase;\n}", "function getRandomPhraseAsArray(arr) {\n\tlet randomPhrase = phrases[Math.floor(Math.random() * phrases.length)];\n\treturn randomPhrase.split(\"\");\n}", "function getRandomPhraseAsArray () {\n var result= phrase[Math.floor(Math.random() * phrase.length)]; \n result = result.split(\"\");\n return result;\n}", "getRandomPhrase() {\n let randomOneToFive = Math.floor(Math.random() * 5);\n return this.phrases[randomOneToFive];\n }", "function getRandomPhraseAsArray(arr) {\n const randomPhraseSelection = arr[Math.floor(Math.random() * phrases.length)];\n const phraseLetters = randomPhraseSelection.split('');\n return phraseLetters;\n}", "function getRandomPhraseAsArray(array) {\r\n const randomPhrase = array[Math.floor(Math.random() * array.length)];\r\n return randomPhrase.toUpperCase().split('');\r\n}", "function randomPhrase() {\n var phraseNum = randomNumber(first, phrases.length - 1);\n var thePhrase = phrases[phraseNum];\n $('#message').text(thePhrase);\n}", "getRandomPhrase(){\n return this.phrases[Math.floor(Math.random() * this.phrases.length)];\n }", "function getRandomPhraseAsArray(arr) {\n let pickedPhrase = '';\n // Set random number to pick phrase\n const pickPhraseNumber = Math.floor(Math.random() * 7 );\n\n // Loop through phrase array to get phrase that is equal to random number\n for (let i = 0; i < arr.length; i++) {\n if (pickPhraseNumber === i) {\n pickedPhrase = arr[i];\n } \n }\n // Convert picked phrase into its own array and return\n const pickedPhraseArray = pickedPhrase.split(''); \n return pickedPhraseArray;\n}", "getRandomPhrase(){\r\n let randomNumber = Math.floor((Math.random() * 5))\r\n return this.phrases[randomNumber];\r\n }", "randomText(positive) {\n const posPhrases = [\n 'Goed gedaan!',\n 'Netjes!',\n 'Je doet het súper!',\n 'Helemaal goed!',\n 'Je bent een topper!'\n ]\n const negPhrases = [\n 'Ik weet dat je het kunt!',\n 'Jammer, probeer het nog eens!',\n 'Bijna goed!',\n 'Helaas pindakaas'\n ]\n\n const phrases = positive ? posPhrases : negPhrases\n const maximumNumber = phrases.length\n const randomNumber = Math.floor(Math.random() * maximumNumber)\n \n return phrases[randomNumber]\n }", "function getRandomPhraseAsArray(arr) {\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n // showing letter of pharse and split is gaps between the words.\n return randomPhrase.toUpperCase().split('');\n}", "function getRandomPhraseAsArray(arr) {\n return arr[Math.floor(Math.random() *arr.length)].split('');\n}", "createPhrases() {\r\n const phrases = [\r\n new Phrase('easy peasy lemon squeezy'),\r\n new Phrase('apple of my eye'),\r\n new Phrase('down to the wire'),\r\n new Phrase('rome was not built in a day'),\r\n new Phrase('too many cooks in the kitchen')\r\n ];\r\n return phrases;\r\n }", "createPhrases() {\n const phrases = [new Phrase('They call me Prank Sinatra'),\n new Phrase('This is going to be legendary'),\n new Phrase('Suit up'),\n new Phrase('Designers make it work'),\n new Phrase('Winter is coming')\n ];\n return phrases\n }", "function getRandomPhraseAsArray(arr){\n //Choose random phrase.\n let randomNumber = Math.floor(Math.random()*5)\n let randomPhrase = arr[randomNumber].split(\"\")\n return randomPhrase;\n}", "function getRandomPhraseAsArray (arr) {\n const index = Math.floor(Math.random() * arr.length);\n const randomPhrase = arr[index].split(\"\");\n return randomPhrase;\n}", "function randomStartingPhrase() {\n if (Math.random() < 0.33) {\n return phrases[Math.floor(Math.random() * phrases.length)]\n }\n return ''\n}", "getRandomPhrase() {\n const randomPhrase = this.phrases[Math.floor(Math.random() * this.phrases.length)];\n //return the function by calling the randomPhrase variable\n return randomPhrase;\n }", "createPhrases() {\n const phrases = [\n new Phrase ('You should hire me'),\n new Phrase ('You cant plan a poop'),\n new Phrase ('Its not always sunny in philidelphia'),\n new Phrase ('Cookies are good with milk'),\n new Phrase ('Javascript is fun')\n ];\n return phrases;\n }", "function randFromList(phrase_list){\n\treturn phrase_list[Math.floor((Math.random() * phrase_list.length))]\n\n}", "function getRandomPhraseAsArray(arr) {\n const arrayLength = arr.length;\n const randomNumber = Math.floor(Math.random() * arrayLength);\n const chosenPhrase = arr[randomNumber];\n return chosenPhrase.split(\"\");\n}", "function getRandomPhraseAsArray(arr) {\n let randomPhrase = Math.floor(Math.random() * arr.length);\n return arr[randomPhrase].split(\"\");\n}", "createPhrases() {\n let phraseOne = new Phrase('life is like a box of chocolates');\n let phraseTwo = new Phrase('there is no trying');\n let phraseThree = new Phrase('may the force be with you');\n let phraseFour = new Phrase('you have to see the matrix of yourself');\n let phraseFive = new Phrase('you talking to me');\n let arrayOfPhrases = [phraseOne, phraseTwo, phraseThree, phraseFour, phraseFive];\n return arrayOfPhrases;\n }", "function getRandomPhraseAsArray(arr) {\n let randomArr = arr[Math.floor(Math.random() * phrases.length)]; \n return splitArray = randomArr.split([,]);\n}", "function getRandomPhraseAsArray(arr) {\n let randomPhrase = arr[Math.floor(Math.random()*arr.length)];\n return randomPhrase.toString().split('');\n}", "function getRandomPhraseAsArray(arr) {\n const getRandomPhrase = arr[Math.floor(Math.random()*arr.length)];\n let answerPhrase = getRandomPhrase.split(\"\");\n return answerPhrase;\n}", "function getRandomPhraseAsArray(arr) {\n let num = Math.floor((Math.random() * arr.length));\n let splitPhrase = arr[num].split('');\n return splitPhrase;\n}", "function getNewPhrase() {\n // Select a random index into the abusePhrases array\n // This little formula of taking the floor of a random\n // number between 0 and 1 times the length of an array\n // gets used all the time.\n let phraseIndex = Math.floor(Math.random() * abusePhrases.length);\n // Get the phrase at that index\n let newPhrase = abusePhrases[phraseIndex];\n // Set the current phrase\n return newPhrase;\n}", "function getRandomPhraseAsArray(arr){\n ul.textContent = \"\";\n const randomPhrase = arr[Math.floor(Math.random()*phrases.length)];\n message = randomPhrase;\n const phraseAsArray = randomPhrase.split(\"\");\n return phraseAsArray;\n }", "getRandomPhrase() {\r\n let randomNumber = Math.floor(Math.random() * this.phrase.length);\r\n //console.log(randomNumber); \r\n return this.phrase[randomNumber];\r\n}", "function getRandomPhraseAsArray(array) {\n let getRandomPhrase = array[Math.floor(Math.random() * array.length)];\n let newPhraseArray = [];\n currentPhrase = getRandomPhrase;\n\n for (let i = 0; i < getRandomPhrase.length; i++) {\n newPhraseArray.push(getRandomPhrase.charAt(i));\n }\n return newPhraseArray;\n}", "getRandomPhrase() {\n const index1 = Math.floor(Math.random() * this.phrases.length);\n function index2(index1) {\n return Math.floor(Math.random() * game.phrases[index1].length);\n }\n if (index1 === 0) {\n this.clue = 'Video Games';\n return this.phrases[index1][index2(index1)];\n } else if (index1 === 1) {\n this.clue = 'Literature';\n return this.phrases[index1][index2(index1)];\n } else if (index1 === 2) {\n this.clue = 'Golden Girls Quotes';\n return this.phrases[index1][index2(index1)];\n } else {\n this.clue = 'Crafts';\n return this.phrases[index1][index2(index1)];\n }\n }", "function getRandomPhraseAsArray(arr) {\n let arrayPosition = Math.floor(Math.random() * arr.length);\n let randomPhrase = arr[arrayPosition];\n let phraseCharacters = [];\n\n for (let i = 0; i < randomPhrase.length; i += 1) {\n phraseCharacters.push(randomPhrase[i]);\n }\n\n return phraseCharacters;\n}", "function getRandomPhraseAsArray(phr) {\n const randomPhrase = phr[Math.floor(Math.random()*phr.length)];\n const splitRandomPhrase = randomPhrase.split(\"\");\n return splitRandomPhrase;\n}", "function getRandomPhraseAsArray(arr) {\n let randomNumber = Math.floor(Math.random() * arr.length);\n let split = arr[randomNumber].split(\"\");\n return split;\n}", "function getRandomPhraseAsArray (pharses) {\n \n/*\n input: pharses is an array\n\n instruction: \n 1. randomly choose a phrase from the phrases array\n a. understand how to randomly get number\n b. choose a phrase from the phrases array\n 2. split that phrase into a new array of characters. \n\n output: The function should then return the new character array.\n */\n\n let randomNumber = getRandomNumber(pharses.length)\n let randomPhrase = pharses[randomNumber].toLowerCase()\n let splitPhrase = randomPhrase.split('');\n return splitPhrase;\n}", "getMotivationalPhrase(won) {\n // Select either winner phrases or looser phrases\n let phrasesToUse = won ? this.winnerPhrasesToUse : this.looserPhrasesToUse;\n let phrases = won ? this.winnerPhrases : this.looserPhrases;\n\n // Refill the phrases to use in case they got empty\n if (phrasesToUse.length == 0) phrasesToUse = [...phrases];\n\n // Choose a random phrase, and then delete it from the phrasesToUse array,\n // so that next time doesn't repeat\n const randomNumber = Math.floor(Math.random() * phrasesToUse.length);\n const phraseToUse = phrasesToUse[randomNumber];\n phrasesToUse.splice(randomNumber, 1);\n\n return phraseToUse;\n }", "function randomSelection() {\n secretPhrase = secretArray[Math.floor(Math.random() * secretArray.length)];\n console.log(secretPhrase)\n}", "function getRandomPhraseAsArray(arr){\n //do stuff to any arr that is passed in\n let randomNumber = arr.length;\n let i = Math.floor(Math.random() * randomNumber);\n arr[i].split('');\n return arr[i];\n\n}", "function makeAPhrase (){\n var word1 = [\"Waz Up\", \"Sucky Sucky\", \"Chopy Chopy\", \"Vada Ving\", \"Vada Vunm\"]\n var word2 = [\"Trumper\", \"Out there!\", \"MOSt folf\", \"Wolf of Wall Street\", \"lambo\" ];\n var word3 = [ \"Porche\", \"Samsung\", \"Motorola\", \"Wolfagangpck\", \" DOODOO DID\"];\n\n var rand1 = Math.floor (Math.random() * word1.length);\n var rand2 = Math.floor (Math.random() * word2.length);\n var rand3 = Math.floor (Math.random() * word3.length);\n\n var phraseOfTheDay = word1[rand1] + \" \" + word2[rand2] + \" \" + word3[rand3];\n\n alert(phraseOdTheDay);\n}", "function pickWords()\n{\n\tfor (var i = 0; i < textNodes.length; i++)\n\t{\n\t\t// splits string into array of word strings\n\t\tvar stringArray = textNodes[i].split(\" \");\n\n\t\tvar j = Math.floor(Math.random() * 15) + 2;\n\t\twhile (j < stringArray.length)\n\t\t{\n\t\t\t// TODO: make translation snippets randomly varied in word length, don't cut across sentences\n\t\t\t// \t\t at some point, make snippets logical phrases for better translation\n\t\t\t// \t\t (e.g. \"and then he said\" instead of \"cat and then\")\n\t\t\tvar phraseToTranslate = stringArray[j] + \" \" + stringArray[j+1] + \" \" + stringArray[j+2];\n\t\t\tif (validate(phraseToTranslate))\n\t\t\t{\n\t\t\t\tvar item = {\n\t\t\t\t\tuntranslated : phraseToTranslate,\n\t\t\t\t\ttranslated : \"\"\n\t\t\t\t};\n\n\t\t\t\tjsonObject.phraseArray.push(item);\n\t\t\t}\n\n\t\t\tj += Math.floor(Math.random() * 90) + 80;\n\t\t}\n\t}\n\n\tvar arrLength = jsonObject.phraseArray.length.toString();\n\tchrome.runtime.sendMessage({ type: \"setBadge\", badgeText : arrLength });\n\n\tloadLangs();\n}", "function getRandomQuote (array) {\nreturn array[random(0,quotes.length)]\n}", "createPhrases(){\n \t\tconst samplePhrases = [\"I love lamp\", \"You stay classy San Diego\", \"Great Odens Raven\", \"By the beard of Zeus\", \"Cannon ball\"]\n \t\tfor (let p of samplePhrases){\n \t\t\tconst newPhrase = new Phrase(p)\n \t\t\tthis.phrases.push(newPhrase)\n \t\t}\n \t}", "function getRandomPhraseAsArray(arr){\n // Remove 1 from the array length to get the max number (inclusive)\n const length = arr.length - 1;\n // Generate a random number between 0 and length\n const choose = getRandomNumber(0, length);\n const currentPhrase = arr[choose];\n // Split the phrase into array of individual characters\n const letters = currentPhrase.split('');\n return letters;\n}", "function getSearchPhrase() {\n return (['Search', 'Find', 'Let\\'s Travel', 'Look up', 'Go'])[Math.floor(Math.random() * 5)];\n}", "phraseMaker() {\n const phrases = [\n new Phrase('filter method'),\n new Phrase('getter method'),\n new Phrase('object interaction'),\n new Phrase('callback function'),\n new Phrase('anonymous function'),\n ];\n //return the function by calling the phrases array\n return phrases;\n }", "static getRandomPronounChoicePhrase(excludeCases=undefined) {\n const phrases = CHOICE_PHRASES.pronouns;\n\n // Build an array of the indicies and shuffle them so that we can iterate through the\n // phrases randomly\n let shuffledIndicies = [...Array(phrases.length).keys()];\n shuffleArray(shuffledIndicies);\n\n // Stop at the first phrase which contains a target case we can use\n for (const phraseIndex of shuffledIndicies) {\n const thisPhrase = phrases[phraseIndex];\n\n if (excludeCases === undefined) {\n\n // If no cases are exluded, just return the first phrase\n return new PronounChoicePhrase(thisPhrase);\n\n } else if (!excludeCases.includes(thisPhrase.targetCase)) {\n\n // If the substitution in this pronoun phrase uses a case that isn't excluded, return it\n return new PronounChoicePhrase(thisPhrase);\n\n }\n }\n }", "function getRandomQuote(array) {\n return quotes[Math.floor(Math.random() * array.length)];\n}", "function getRandomQuote(array) {\r\n return array[Math.floor(Math.random() * array.length)];\r\n }", "function generateParagraph() {\n\tconst tempPhrase = [];\n\tfor (let i = 0; i < calcParagraphLength(); i++) {\n\n\t\ttempPhrase.push(\n\t\t\ttext.forEach((textCollection, i) => {\n\t\t\t\ttempPhrase.push(shuffleArrays(textCollection)[0])\n\t\t\t})\n\t\t)\n\t}\n\treturn tempPhrase.join(\" \");\n}", "createPhrase( ) {\n for (let i = 0; i < 5; i++) {\n let randomPhrase = '';\n let adjective = '';\n let noun = '';\n let declaration = '';\n let verb = '';\n const words = { // excuse the absurdities; I got carried away. This is an object of arrays. \n adjective: ['rich', 'ugly', 'divorced', 'skilled','widowed', 'frisky', 'pregnant', 'infected', 'smart', 'scared', 'pretty', 'nice', 'evil', 'virgin', 'married', 'baptised', 'acquitted', 'drunk', 'christian'],\n noun: ['dogs', 'cats', 'husbands', 'women', 'athletes','housewives', 'zoomers', 'cosmonauts','immigrants','hipsters', 'lawyers', 'priests', 'artists', 'fish', 'zombies', 'veterans', 'inmates', 'hippies'],\n declaration: ['never', 'always', 'rarely', 'long to','often', 'cannot', 'refuse to', 'are willing to', 'love to', 'eagerly'],\n verb: ['cry', 'smile', 'snuggle','surrender', 'offend', 'lose', 'win','say thank you','settle','beg', 'spoon','die', 'nark', 'drive','eat', 'lie', 'sleep', 'fart', 'sweat', 'puke', 'help', 'talk', 'divorce', 'kill', 'have sex', 'remarry', 'pray', 'protest']\n } \n /**\n * generates a random index based on @param.length\n * @param {array} wordList - an object of arrays \n */\n const randomIndex = (wordList) => Math.floor( Math.random() * wordList.length );\n\n for (let prop in words) {\n const list = words[`${prop}`];\n const index = randomIndex(list);\n if (prop === 'adjective') adjective = words[`${prop}`][index];\n if (prop === 'noun') noun = words[`${prop}`][index];\n if (prop === 'declaration') declaration = words[`${prop}`][index];\n if (prop === 'verb') verb = words[`${prop}`][index];\n }\n randomPhrase = `${adjective} ${noun} ${declaration} ${verb}`; \n this.phrases.push(new Phrase(randomPhrase, noun, adjective, verb)); \n }\n }", "function getRandomQuote(array){\n return quotes[Math.floor(Math.random() * quotes.length)];\n}", "createPhrase() {\r\n return (this.phrases = [\r\n new Phrase('Some like it hot'),\r\n new Phrase('I dont give a damn'),\r\n new Phrase('Its alive'),\r\n new Phrase('Heres johnny'),\r\n new Phrase('My precious'),\r\n ]);\r\n }", "function getRandomQuote(array) {\n\treturn array[Math.floor(Math.random()*array.length)]\n}", "function getRandomQuote(array) {\n let randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}", "function getRandomQuote(array) {\n var randomQuote = quotes[Math.floor(Math.random(array) * quotes.length)];\n return randomQuote;\n}", "function getRandomQuote(array){\n var storeRandNum; \n storeRandNum = Math.floor(Math.random() * array.length);\n return array[storeRandNum]\n}", "function pick() {\r\n index = Math.floor(Math.random() * words.length);\r\n return words[index];\r\n}", "function getRandomQuote(array) {\n selector = Math.floor(Math.random() * quotes.length);\n return array[selector];\n }", "function getRandomPhraseAsArray(arr) {\n var a = arr[Math.floor(Math.random() * 6)];\n const b = [];\n \n for (let i = 0; i < a.length; i++) {\n b.push(a.charAt(i));\n }\n\n return b\n}", "function pickWord(words) {\n return words[Math.floor(Math.random() * words.length)]\n}", "function pickWord(words) {\n var word = stringToArray(words[Math.floor((Math.random() * words.length) + 0)]);\n return word;\n}", "function chooseWord(list_of_words){ \n return list_of_words[Math.floor(Math.random()*list_of_words.length)];\n}", "function pickword(dictionary) {\n return dictionary[Math.floor(Math.random() * (dictionary.length - 1))];\n }", "function getRandomQuote(array){\n var rando = Math.floor(Math.random() * array.length);\n var randomQuote = array[rando];\n return randomQuote; \n}", "function getRandomQuote(array)\n{\n\tvar rando = Math.floor(Math.random() * array.length);\n\tvar randomQuote = array[rando];\n\treturn randomQuote;\n}", "function getRandomWord() {\n const index = Math.floor(Math.random() * dictionary.length);\n return dictionary[index];\n}", "static getRandomNounChoicePhrase(excludeCases=undefined) {\n const phrases = CHOICE_PHRASES.nouns;\n\n // Build an array of the indicies and shuffle them so that we can iterate through the\n // phrases randomly\n let shuffledIndicies = [...Array(phrases.length).keys()];\n shuffleArray(shuffledIndicies);\n\n // Stop at the first phrase which contains a target case we can use\n for (const phraseIndex of shuffledIndicies) {\n const thisPhrase = phrases[phraseIndex];\n\n if (excludeCases === undefined) {\n\n // If no cases are exluded, just return the first phrase\n return new NounChoicePhrase(thisPhrase);\n\n } else {\n\n // If the phrase contains a case substitution that is not in the exclusion list, return it\n for (const substitution of thisPhrase.substitutions) {\n if (!excludeCases.includes(substitution.targetCase)) {\n return new NounChoicePhrase(thisPhrase);\n }\n }\n }\n }\n }", "function getRandomQuote(array) {\n let randQuote = Math.floor(Math.random() * (quotes.length));\n let rand_quote = quotes[randQuote];\n return rand_quote;\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 wordRandomizer() {\r\n\treturn randomWords[Math.floor(Math.random()*randomWords.length)];\r\n}", "function Words() {\n var random = Math.floor(Math.random() * words.length);\n var randomword = words[random];\n console.log(randomword);\n}" ]
[ "0.8513017", "0.8383263", "0.8343142", "0.8343142", "0.8343142", "0.8326532", "0.83141935", "0.83011556", "0.8273669", "0.8270718", "0.82391804", "0.82370436", "0.82281893", "0.81543237", "0.81147563", "0.8100584", "0.8100584", "0.8094644", "0.8080133", "0.8065723", "0.8046206", "0.80191827", "0.800943", "0.7979917", "0.7945814", "0.79221594", "0.7909913", "0.78670466", "0.78531444", "0.7852712", "0.7818692", "0.78009874", "0.7770131", "0.7740036", "0.77043587", "0.76433843", "0.7637815", "0.763332", "0.75797904", "0.75704366", "0.7565103", "0.7563528", "0.75604475", "0.75255096", "0.75194675", "0.75090355", "0.75015074", "0.74984646", "0.74552244", "0.74507546", "0.7434306", "0.7432899", "0.7387257", "0.73830575", "0.7376534", "0.7375489", "0.7328218", "0.7326181", "0.7320341", "0.7255413", "0.7218737", "0.7165278", "0.71451014", "0.71038485", "0.70017827", "0.6822986", "0.6818303", "0.68117493", "0.6795271", "0.6790826", "0.6787439", "0.67833596", "0.67622423", "0.66870743", "0.66760325", "0.66642034", "0.6653946", "0.6653549", "0.6623169", "0.66126513", "0.6609949", "0.65948284", "0.65585476", "0.6530491", "0.65279037", "0.65222096", "0.6514312", "0.650716", "0.64794576", "0.64699584", "0.6456609", "0.64440733", "0.64387065", "0.64359236", "0.64329785", "0.6430282", "0.6403892", "0.6393912", "0.6387502", "0.63867736" ]
0.84569424
1
Increment missed counter and alter heart image if life is lost
removeLife () { const lives = document.getElementsByClassName("tries"); this.missed++; for (let i=0; i<this.missed; i++){ lives[i].innerHTML = `<img src="images/lostHeart.png" alt="Lost Heart Icon" height="35" width="30">`; } // Lose the game if user runs out of lives if (this.missed === 5){ this.gameOver(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeLife() {\n heartNodes[this.missed].src = 'images/lostHeart.png';\n this.missed += 1;\n if (this.missed === heartNodes.length) {\n this.gameOver(false);\n }\n }", "removeLife() {\r\n let heart = document.getElementsByTagName('img');\r\n heart[this.missed].setAttribute('src', 'images/lostHeart.png');\r\n this.missed += 1;\r\n\r\n if (this.missed === 5) {\r\n this.gameOver();\r\n }\r\n }", "removeLife(){\r\n this.missed++\r\n console.log(this.missed);\r\n heartPng[heartPng.length - this.missed].src = null;\r\n heartPng[heartPng.length - this.missed].src = \"images/lostHeart.png\";\r\n }", "removeLife() {\r\n // increment here, to facilitate generating the\r\n // heartListOl.children index below\r\n this.missed = this.missed + 1;\r\n if (this.missed > maxMisses) {\r\n this.gameOver(false);\r\n } else {\r\n const li = heartListOl.children[heartListOl.children.length-this.missed];\r\n li.children[0].src=\"images/lostHeart.png\";\r\n }\r\n }", "removeLife() {\n const liveHeart = document.querySelector('[src=\"images/liveHeart.png\"]');\n liveHeart.setAttribute('src', 'images/lostHeart.png');\n this.missed += 1;\n if (this.missed === 5) {\n this.gameOver();\n }\n }", "removeLife() {\n const liveHeart = document.querySelector(\"img[src='images/liveHeart.png']\");\n liveHeart.setAttribute(\"src\", \"images/lostHeart.png\");\n this.missed++;\n if (this.missed === 5) {\n this.gameOver();\n }\n }", "removeLife() {\n //Selects all heart images in the DOM\n const healthPoints = document.querySelectorAll('img');\n \n //A heart is selected and changed to a 'lostHeart' based on the missed property index value\n healthPoints[this.missed].src = \"images/lostHeart.png\";\n \n // Increases the value of the missed property\n this.missed++;\n }", "removeLife() {\n $('.tries img').eq(this.missed).remove();\n $('.tries').eq(this.missed).append('<img src=\"images/lostHeart.png\" alt=\"Missing Heart Icon\" height=\"35\" width=\"30\"></img>');\n this.missed += 1;\n if (this.missed === 5) {\n this.gameOver();\n }\n }", "removeLife() {\n\n // select the heart DOM element and log it to ensure you're selecting the correct elements\n const heartTries = document.querySelectorAll('.tries img');\n\n if (this.missed < heartTries.length) {\n\n heartTries[this.missed].src = 'images/lostHeart.png';\n\n }\n\n //increment the games missed property by 1 using either this.missed += 1 or this.missed++\n this.missed++;\n\n if (this.missed === 5) {\n this.gameOver(false);\n }\n\n }", "removeLife() {\n const wrongSound = document.querySelector('.wrongSound');\n const heartImage = document.getElementsByTagName('img');\n heartImage[this.missed].src = 'images/lostHeart.png'\n wrongSound.play();\n \n \n\n \n if(this.missed >= 4){\n this.gameOver(false) ;\n } else {\n this.missed += 1;\n }\n \n \n }", "function catchHeart(){\n for (let k = 1; k <= numberofHeart; k++) {\n setInterval(function(){\n if(j == (parseFloat($('#like'+k).css('left'))-790)/30 && i == (parseFloat($('#like'+k).css('top')) - 413)/30){\n life++;\n randomHeartPosition();\n }\n },5) \n }\n }", "removeLife() {\n //Store the value of 'img'\n let hearts = (document.querySelectorAll('img'));\n //Store the value of lost heart\n let gray = 'images/lostHeart.png';\n hearts[this.missed].src = gray\n //Missed guesses increase by 1\n this.missed++;\n //If missed guess is eaquals to 5\n if (this.missed === 5) {\n //Gameover\n this.gameOver()\n }\n }", "function livesCounter(brokenHearts){\n if(brokenHearts === 0){\n //5 hearts on screen\n image(img, imgCoord.x -200, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x -100, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x +100, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x +200, imgCoord.y, imgCoord.size, imgCoord.size2);\n } else if (brokenHearts === 1){\n //4 hearts on screen\n image(img, imgCoord.x -200, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x -100, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x +100, imgCoord.y, imgCoord.size, imgCoord.size2);\n } else if (brokenHearts === 2){\n //3 hearts on screen\n image(img, imgCoord.x -200, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x -100, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x, imgCoord.y, imgCoord.size, imgCoord.size2);\n } else if (brokenHearts === 3){\n //2 hearts on screen\n image(img, imgCoord.x -200, imgCoord.y, imgCoord.size, imgCoord.size2);\n image(img, imgCoord.x -100, imgCoord.y, imgCoord.size, imgCoord.size2);\n } else if (brokenHearts === 4){\n //1 hearts on screen\n image(img, imgCoord.x -200, imgCoord.y, imgCoord.size, imgCoord.size2);\n } else if (brokenHearts === 5){\n //0 hearts on screen, finishes game\n state = 'ending';\n }\n}", "removeLife() {\n const hearts = document.querySelector(\"img[src='images/liveHeart.png']\");\n hearts.src = \"images/lostHeart.png\";\n\n this.missed += 1;\n if (this.missed === 5) {\n this.gameOver();\n }\n }", "removeLife() {\n this.missed += 1;\n const heart = document.querySelector(\"img[src*='live']\")\n if (heart){\n heart.setAttribute('src', 'images/lostHeart.png');\n }\n else if (!heart) {\n this.gameOver();\n }\n }", "removeLife(){\n this.missed++;\n const $lostHeart = $('#scoreboard img[src=\"images/liveHeart.png\"]:last');\n $lostHeart.attr('src', 'images/lostHeart.png');\n if(this.missed >= 5){\n let isWon = false;\n this.gameOver(isWon);\n }\n \n }", "removeLife() {\r\n const hearts = document.querySelectorAll('.tries');\r\n for (let i = 0; i <= this.missed; i++) {\r\n hearts[i].lastElementChild.src = 'images/lostHeart.png';\r\n }\r\n\r\n this.missed += 1;\r\n \r\n if (this.missed === 5) {\r\n this.gameOver(this.checkForWin()); \r\n }\r\n }", "removeLife(){\n const firstHeart = document.querySelector('img[src=\"images/liveHeart.png\"]');\n if(firstHeart){\n firstHeart.src = 'images/lostHeart.png';\n }\n this.missed++;\n if(this.missed >= 5){\n this.gameOver();\n }\n }", "removeLife() {\r\n const lifeIcon = document.querySelector('[alt=\"Heart Icon\"]'); // returns first one it finds\r\n \r\n /* Apply heart icon css animation */\r\n lifeIcon.className = 'spin-heart';\r\n \r\n /* Allow animation to complete before changing to lost heart icon */\r\n window.setTimeout(() => {\r\n lifeIcon.className = null;\r\n lifeIcon.setAttribute('alt', 'Lost Heart Icon');\r\n lifeIcon.setAttribute('src', 'images/lostHeart.png');\r\n }, 750);\r\n \r\n this.missed += 1;\r\n if (this.missed === 4) this.gameOver(false);\r\n }", "removeLife(){\n this.missed++;\n let images = document.querySelector(\"img[src='images/liveHeart.png']\");\n if (this.missed < 5) {\n images.src = \"images/lostHeart.png\";\n } else if (this.missed === 5) {\n this.gameOver(true);\n }\n }", "removeLife() {\n let heart = document.querySelector(\"img[src='images/liveHeart.png']\");\n heart.src = \"images/lostHeart.png\";\n this.missed += 1;\n if(this.missed === 5){\n this.gameOver(this.checkForWin());\n }\n }", "removeLife() {\r\n this.missed += 1;\r\n if(this.missed === 5){\r\n this.gameOver(false);\r\n };\r\n document.querySelectorAll('.tries img')[this.missed -1].src = 'images/lostHeart.png'; \r\n }", "removeLife() {\n //replace image source\n let tries = document.querySelectorAll('.tries img')\n tries[this.missed].src = 'images/lostHeart.png';\n //increase missed count\n this.missed += 1\n if (this.missed === 5) {\n //call gameOver once out of lifes\n this.gameOver(false)\n }\n }", "removeLife() {\n const hearts = document.querySelectorAll('.tries > img');\n console.log(this.missed);\n if(this.missed < 4) {\n hearts[this.missed].src = \"images/lostHeart.png\";\n this.missed += 1;\n random_bg_color();\n } else {\n this.missed += 1;\n this.gameOver();\n } \n }", "removeLife(){\n const img = document.querySelectorAll('img');\n\n this.missed += 1;\n\n if(this.missed === 5){\n this.gameOver('lose');\n } else {\n for(let i = 0; i < this.missed; i++){\n img[i].src = \"images/lostHeart.png\";\n }\n }\n }", "function removeHearts() {\n let index = missed - 1; //set an index variable to use on lives array\n const source = \"images/lostHeart.png\";\n lives[index].src = source; //set the next heart (starting at zero index) to the new src image)\n}", "removeLife(){\n const hearts = document.querySelectorAll('.tries img');\n\n if (this.missed < hearts.length) {\n hearts[this.missed].src = 'images/lostHeart.png';\n }\n \n this.missed++;\n\n\n if (this.missed === 5) {\n this.gameOver(false);\n }\n }", "removeLife() {\r\n const tries = document.getElementsByClassName('tries')[this.missed];\r\n tries.firstChild.src = \"images/lostHeart.png\";\r\n this.missed += 1;\r\n if (this.missed === 5) {\r\n this.gameOver(false)\r\n }\r\n }", "removeLife(){\n \t\tconst remainingTries = document.querySelectorAll('[src=\"images/liveHeart.png\"]')\n \t\tconst remainingTriesIndex = remainingTries.length-1\n\n \t\tif(this.missed < 4){\n \t\t\tthis.missed += 1\n \t\t\tremainingTries[remainingTriesIndex].src=\"images/lostHeart.png\"\n \t\t}else{\n \t\t\tthis.gameOver(false);\n \t\t}\n \t}", "removeLife() {\n const lives = document.getElementsByClassName(\"tries\"); //Total Lives\n const triesLeft = lives.length - this.missed; //Total tries left: length - missed\n\n //If we have more than 0 tries then change the pic and add to missed\n if (triesLeft > 0) {\n lives[this.missed].firstElementChild.src = \"images/lostHeart.png\"; //change heart image\n this.missed += 1; // add one to missed\n }\n\n //If missed count is 5, call gameOver\n if (this.missed == 5) {\n this.gameOver(false);\n }\n }", "removeLife() {\n const hearts = document.querySelectorAll('.tries');\n this.missed += 1;\n if (this.missed === 5) {\n this.gameOver('lose');\n } else {\n for (let i=0; i < this.missed; i++) {\n hearts[i].firstElementChild.setAttribute('src', 'images/lostHeart.png');\n }\n }\n }", "removeLife() {\r\n const tries = document.querySelectorAll('.tries');\r\n tries[this.missed].firstElementChild.setAttribute('src', 'images/lostHeart.png');\r\n this.missed += 1;\r\n if (this.missed === 5) {\r\n this.gameOver();\r\n };\r\n }", "removeLife() {\r\n const scoreboard = document.getElementsByClassName('tries');\r\n // Replace last heart with empty heart.\r\n scoreboard[scoreboard.length-this.missed-1].getElementsByTagName('img')[0].src = 'images/lostHeart.png'\r\n // count up missed property\r\n this.missed += 1;\r\n\r\n // Call gameOver() if player lost all lives\r\n if(this.missed === 5) {\r\n this.gameOver();\r\n }\r\n }", "function animateHeart(){\n if(stepAnimateHeart == 120){\n stepAnimateHeart--;\n }\n for (let i = 1; i <= numberofHeart; i++) {\n $('#like' + i).width(stepAnimateHeart*0.15); \n }\n if(stepAnimateHeart == 0){\n stepAnimateHeart++;\n }\n stepAnimateHeart++;\n requestAnimationFrame(animateHeart);\n }", "removeLife() {\n const tries = document.querySelectorAll(\".tries img\");\n tries[4 - this.missed].setAttribute(\"src\", \"images/lostHeart.png\");\n this.missed++;\n if (this.missed === 5) {\n this.gameOver(false);\n }\n }", "removeLife() {\r\n this.missed += 1;\r\n let listScore = document.querySelectorAll('#scoreboard ol li');\r\n for(let i=0; i<listScore.length; i++){\r\n if(i === this.missed-1){\r\n let img = listScore[i].querySelector('img');\r\n img.setAttribute('src','images/lostHeart.png');\r\n }\r\n }\r\n if(this.missed === listScore.length){\r\n this.gameOver(false);\r\n }\r\n\r\n }", "function drawLives()\n{\n offset = 0;\n push();\n \n fill(255, 0, 0);\n for(i = 0; i < lives; i++)\n {\n heart(width-150+offset, 20, 18);\n offset += 30; \n }\n pop();\n}", "removeLife() {\n const lives = document.querySelectorAll('.tries');\n lives[this.missed].firstElementChild.setAttribute('src', 'images/lostHeart.png');\n this.missed += 1;\n if(this.missed > 4) {\n this.gameOver(false);\n }\n }", "removeLife(){\r\n const scoreboard = document.querySelectorAll('#scoreboard img')\r\n scoreboard[this.missed].src = \"images/lostHeart.png\"\r\n this.missed += 1;\r\n\r\n if(this.missed === 4){\r\n document.querySelector('.main-container').classList.add('onelife');\r\n }\r\n\r\n if(this.missed === 5){\r\n this.gameOver();\r\n document.querySelector('.main-container').classList.remove('onelife');\r\n }\r\n }", "removeLife() {\n this.missed += 1;\n let triesElement = document.getElementsByClassName('tries');\n triesElement[this.missed-1].firstElementChild.src = \"images/lostHeart.png\"\n if (this.missed == 5) {\n this.gameOver(false);\n }\n }", "removeLife(){\n const triesImgs = document.querySelectorAll('.tries img');\n\n triesImgs[this.missed].src = \"images/lostHeart.png\";\n this.missed += 1;\n\n if(this.missed === triesImgs.length){\n this.gameOver(false);\n }\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}", "removeLife() {\n // get all the li that has heart images\n let liLives = document.querySelector('#scoreboard ol').children;\n this.missed += 1;\n // Loops through the li with heart images to find the one that needs to be changed\n for (let i = 0; i < liLives.length; i++) {\n // Selecting image of li\n const heartImg = liLives[i].querySelector('img');\n // if missed is less than 5 AND heartimg.src includes liveHeart.png then replaces image with lostHeart\n if (this.missed < 5 && heartImg.src.includes(\"liveHeart.png\")) {\n heartImg.src = \"images/lostHeart.png\";\n break;\n\n } else if (this.missed >= 5){\n // Replaces the last heart image with lostHeart image \n heartImg.src = \"images/lostHeart.png\";\n this.gameOver(false);\n }\n }\n }", "removeLife(){\r\n let hearts = document.querySelectorAll('.tries img')\r\n hearts[this.missed].setAttribute('src', 'images/lostHeart.png')\r\n this.missed +=1;\r\n if(this.missed === 5){\r\n this.gameOver()\r\n }\r\n}", "function countHearts() {\n\t\t$(\"#hearts\").html(\"\");\n\t\tfor (let i = 0; i < fullHearts; i++) {\n\t\t\t$(\"#hearts\").append('#');\n\t\t}\n\t\tfor (let j = 0; j < emptyHearts; j++) {\n\t\t\t$(\"#hearts\").append('*');\n\t\t}\n\n\t}", "removeLife() {\n //selects the scoreboard div\n const scoreboard = document.getElementsById('scoreboard');\n const arrayScoreBoard = scoreboard.map(heart => heart.innerHTML);\n for (let i = 0; i < arrayScoreBoard[i].length; i++) {\n //one of the liveHeart.png images is replaced with a lostHeart.png image\n scoreboard[i].src.replace('liveHeart.png', 'lostHeart.png');\n //increments the missed property\n return this.missed++;\n }\n //if the player has lost the game\n if (this.missed < 4) {\n //call the gameOver() method\n this.gameOver();\n }\n }", "removeLife() {\r\n let lives = document.querySelectorAll('img');\r\n //console.log(lives);\r\n lives[this.missed].src=\"images/lostHeart.png\";\r\n this.missed += 1;\r\n\r\n if (this.missed === 5) {\r\n //console.log('Game Over');\r\n // const overlay = document.getElementById('overlay');\r\n // const heading = document.getElementById('game-over-message');\r\n // //console.log(overlay);\r\n // overlay.className = 'lose';\r\n // overlay.style.display = 'flex';\r\n // heading.textContent = 'GAME OVER';\r\n this.gameOver(false);\r\n }\r\n}", "removeLife(){\n if(overlay.classList.contains('win')){\n } else {\n const liveHeart = [];\n this.missed ++;\n for(let x = 0; x < hearts.length; x++){\n if(hearts[x].firstElementChild.classList != 'lostLife'){\n liveHeart.push(hearts[x]);\n }\n }\n if(liveHeart.length > 1){//if they have any lives left\n liveHeart[0].firstElementChild.src = 'images/lostHeart.png';\n liveHeart[0].firstElementChild.classList.add('lostLife');\n } else { //else if no lives left, then game is over\n this.gameOver();\n }\n }\n }", "removeLife() {\n let hearts = document.getElementsByClassName(\"tries\");\n if (this.missed < 5) {\n hearts[this.missed].firstElementChild.src = \"images/lostHeart.png\";\n this.missed++;\n }\n // } else {\n // this.gameOver(false);\n // }\n }", "removeLife() {\r\n const hearts = $('img[src = \"images/s-l300.png\"]');\r\n const arr = [...hearts];\r\n\r\n let lastHeart = arr.slice(-1);\r\n\r\n $(lastHeart).removeAttr(\"src\");\r\n $(lastHeart).attr(\"src\", \"images/lostHeart.png\");\r\n this.missed++;\r\n if (this.missed == 5) {\r\n this.gameOver(false);\r\n }\r\n }", "removeLife() {\n this.missed++\n const tries = document.querySelectorAll('.tries img')\n if (this.missed === 1) {\n tries[0].src = 'images/emptyHeart.png'\n } else if (this.missed === 2) {\n tries[1].src = 'images/emptyHeart.png'\n } else if (this.missed === 3) {\n tries[2].src = 'images/emptyHeart.png'\n } else if (this.missed === 4) {\n tries[3].src = 'images/emptyHeart.png'\n } else if (this.missed === 5) {\n tries[4].src = 'images/emptyHeart.png'\n this.gameOver()\n }\n }", "function recall() {\n if (picker === 1) {\n picker = 2;\n\n // Check marks\n if (count <=4) {\n $('.check'+count).css('background-image', 'url(\"./tick.png\")');\n count ++;\n }\n\n\n toSeconds(breakTime, 0);\n }\n else {\n picker = 1;\n\n\n // When check marks reaches 4, restart\n if (count > 4) {\n $('.check').css('background-image', 'url()');\n count = 1;\n }\n\n toSeconds(studyTime, 0);\n }\n}", "removeLife() {\n this.missed+=1;\n const liTries = document.getElementsByClassName(\"tries\");\n \n \n for (let i = 0; i < this.missed; i ++) {\n liTries[i].firstElementChild.src = \"images/lostHeart.png\";\n }\n \n if (this.missed === 5) {\n game.gameOver(false);\n }\n \n }", "removeLife() {\n // increment missed count\n this.missed += 1;\n\n // remove a life if there are still lifes left\n if(this.missed !== 5) {\n\n // flag to track if lifes left image has already been changed\n let scoreboardChanged = false;\n \n // let's reference the li elements holding number of lifes left\n const scoreBoardElement = $('#scoreboard li');\n\n // iterate over the lifes li elements\n scoreBoardElement.each( (i, li) => {\n // reference scoreboard image element\n let img = li.firstElementChild;\n\n // get current image name\n let currentImgName = img.src.substring(img.src.lastIndexOf(\"/\")+1, img.src.length);\n\n // change image source to lost image if current image name is liveHeart.png and we haven't updated \n // the image yet in this iteration\n if(currentImgName === 'liveHeart.png' && scoreboardChanged === false) {\n img.src = 'images/lostHeart.png';\n scoreboardChanged = true;\n }\n });\n\n } else {\n // missed five times already, we end the game\n this.gameOver('lost');\n }\n }", "function appleInterval() {\n if (apple.apple_image === 4)\n apple.apple_image = 1;\n else\n apple.apple_image++;\n}", "removeLife(){\r\n \r\n const scoreboard = document.querySelectorAll('.tries img');\r\n for(let heart of scoreboard){\r\n if(heart.getAttribute('src') === 'images/liveHeart.png'){\r\n heart.src = 'images/lostHeart.png';\r\n this.missed ++;\r\n break;\r\n \r\n }\r\n \r\n \r\n }\r\n if(this.missed === 5 ){\r\n return this.gameOver(false);\r\n }\r\n}", "removeLife() {\r\n this.missed += 1;\r\n\r\n if (this.missed === 5) {\r\n this.gameOver(false);\r\n } else {\r\n document.querySelector(\".tries\").firstElementChild.src =\r\n \"images/lostHeart.png\";\r\n document\r\n .querySelector(\".tries\")\r\n .firstElementChild.parentElement.classList.remove(\"tries\");\r\n }\r\n }", "function heartBeatChecker(){\n\n if (!numbers[counter]){\n let counterState = {num:counter, likes: likesState}\n numbers[counter] = counterState\n } else {\n numbers[counter].likes = likesState\n }\n\n // update number and count in li\n let counterLikeDisplay = document.createElement('li');\n\n let text = document.createTextNode(`${numbers[counter].num} - likes: ${numbers[counter].likes}`);\n\n counterLikeDisplay.appendChild(text);\n\n likesContainer.appendChild( counterLikeDisplay);\n\n likesState=0\n }", "removeLife() {\n const tries = document.getElementsByClassName('tries');\n tries[this.missed].firstElementChild.src = \"images/lostHeart.png\";\n this.missed += 1; \n //If missed guess count gets to 5, the player loses\n if (this.missed === 5) {\n this.gameOver();\n }\n }", "function takeLifeAway() {\r\n // identify id of the heart image to remove\r\n var lifeId = \"h\" + lives;\r\n console.log(\"heart id: \" + lifeId);\r\n var life = document.getElementById(lifeId);\r\n // if answer is wrong, decrement lives and remove a heart on the screen\r\n if (!checkAnswer()) {\r\n lives--;\r\n console.log(\"lives left: \" + lives);\r\n life.style.display = \"none\";\r\n\t\tdocument.getElementById('wrong').play();\r\n }\r\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 }", "removeLife() {\n // const hearts = document.querySelector('#scoreboard > ol').children;\n const lifeHeartHTML = `<img src=\"images/liveHeart.png\" alt=\"Heart Icon\" height=\"35\" width=\"30\">`;\n const lostHeartHTML = `<img src=\"images/lostHeart.png\" alt=\"Heart Icon\" height=\"35\" width=\"30\">`;\n const lifeTaker = arr => {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].innerHTML == lifeHeartHTML) {\n arr[i].innerHTML = lostHeartHTML;\n break;\n }\n }\n }\n\n this.missed++;\n this.missed > 4 ? this.gameOver() : lifeTaker(hearts);\n }", "function heartLine(k) {\r\n var k;\r\n for (i = 0; i< 10; i++) {\r\n i = i + k;\r\n var color\r\n switch (i%5) {\r\n case 0:\r\n color = \"#9b5de5\"; // Amethyst\r\n break;\r\n case 1:\r\n color = \"#f15bb5\"; // Magenta Crayola\r\n break;\r\n case 2:\r\n color = \"#fee440\"; // Minion Yellow\r\n break;\r\n case 3:\r\n color = \"#00bbf9\"; // Capri\r\n break;\r\n case 4:\r\n color = \"#00f5d4\"; // Sea Green Crayola\r\n break;\r\n \r\n default:\r\n break;\r\n }\r\n i = i - k;\r\n setTimeout(createHeart,500*i, color);\r\n\r\n }\r\n\r\n }", "function heartHeartHeart() {\r\n document.body.appendChild(heartsHome);\r\n heartBlock(); \r\n }", "removeLife() {\n this.missed += 1;\n const tries = document.getElementById('scoreboard').querySelector('ol').querySelectorAll('li');\n for (let i = 0; i < this.missed; i++) {\n tries[i].innerHTML = '<img src=\"images/lostHeart.png\" alt=\"Heart Icon\" height=\"35\" width=\"30\"></img>';\n tries[i].className = \"lost\";\n }\n if (this.missed >= 5) {\n this.gameOver(false);\n }\n }", "removeLife(){\r\n const hearts = document.querySelectorAll('#scoreboard ol li img');\r\n if(this.missed === 1){\r\n hearts[4].src = \"images/lostHeart.png\";\r\n } else if (this.missed === 2){\r\n hearts[3].src = \"images/lostHeart.png\";\r\n } else if(this.missed === 3){\r\n hearts[2].src = \"images/lostHeart.png\";\r\n } else if (this.missed === 4){\r\n hearts[1].src = \"images/lostHeart.png\";\r\n } else if(this.missed === 5){\r\n hearts[0].src = \"images/lostHeart.png\";\r\n }\r\n }", "function scoreCounter() {\n $('#points').append('<img class=\"points\" src=\"assets/images/scoring-images/star-point-removebg-preview.png\" alt=\"star-points\">');\n }", "reduceHearts() {\n const activeHeart = \"rgb(232, 9, 9)\";\n const lostHeart = \"rgb(232, 232, 232)\";\n if ($(\"#heart1\").css(\"color\") == activeHeart) {\n $(\"#heart1\").css(\"color\", lostHeart);\n }\n else if ( $(\"#heart2\").css(\"color\") == activeHeart) {\n $(\"#heart2\").css(\"color\", lostHeart);\n }\n else if ($(\"#heart3\").css(\"color\") == activeHeart) {\n $(\"#heart3\").css(\"color\", lostHeart);\n gameOver();\n }\n }", "removeLife() {\n let lives = document.getElementsByClassName('tries');\n lives = Array.from(lives);\n lives = lives.filter( el => el.firstChild.getAttribute(\"src\") === \"images/liveHeart.png\");\n lives[0].firstChild.setAttribute('src','images/lostHeart.png');\n this.missed += 1;\n if (this.missed === 5){\n this.gameOver(false);\n }\n }", "function timeUp() {\n clearInterval(timer);\n\n lost++;\n\n preloadImage('lost');\n setTimeout(nextQuestion, 3 * 1000);\n}", "function crankpulse() {\n stroke_count += 1;\n}", "removeLife() {\r\n this.missed += 1;\r\n const hearts = document.querySelectorAll('li.tries');\r\n for (let i = 0; i < this.missed; i++) {\r\n hearts[i].innerHTML = '<img src=\"images/lostHeart.png\" alt=\"Heart Icon\" height=\"35\" width=\"30\">';\r\n }\r\n }", "function pacmanInterval() {\n if (pacman.pacman_image === 2)\n pacman.pacman_image = 1;\n else\n pacman.pacman_image++;\n}", "function heartBlock() {\r\n for (i = 0; i < 10; i++) {\r\n setTimeout(heartLine,5000*i,i);\r\n }\r\n }", "timeStepFireEffect() {\n if (this.fireEffect.animationCounter > 0) {\n this.fireEffect.fireEffectSound.play()\n let fireEffectLocationHash = this.fireEffect.fireLocation(this.dino)\n this.fireEffect.killCrates(this.cratesArray, fireEffectLocationHash, this.newScore)\n this.canvasContext.drawImage(this.fireEffect.returnImage(), fireEffectLocationHash['xLoc'], fireEffectLocationHash['yLoc'], fireEffectLocationHash['xSize'], fireEffectLocationHash['ySize'])\n }\n }", "function letterNotInPhrase() {\n // Increments missed counter\n missed++;\n\n // Removes a heart\n document.querySelectorAll(\".tries img\")[missed - 1].src = \"images/lostheart.png\";\n\n // Displays lose screen if there are 5 misses\n if (missed === 5) {\n resetGame();\n displayOverlay(\"lose\");\n }\n}", "removeLife(){\n \n const tries = document.querySelectorAll(\".tries\");\n tries[this.missed].firstElementChild.setAttribute(\"src\",\"images/lostHeart.png\");\n this.missed += 1;\n if(this.missed == 5) {\n console.log('game over!');\n this.gameOver(this.checkForWin());\n }\n \n }", "function changeStatusIconReaction() {\n // load();\n const iconHeartCounter = Array.from( document.getElementsByClassName(\"counter__heart\"));\n const iconHearts = Array.from(document.querySelectorAll(\".heart > i\"));\n console.log(iconHeartCounter)\n console.log(iconHearts)\n \n iconHearts.forEach((item,index)=>{\n item.addEventListener(\"click\",(e)=>{\n item.classList.toggle('active')\n let parentid = e.target.parentNode.dataset.id;\n // console.log(iconHeartCounter.length)\n if(item.classList.contains('active')){\n dataPost[parentid].totalHeart ++;\n }else{\n dataPost[parentid].totalHeart --;\n }\n iconHeartCounter[index].innerText = dataPost[parentid].totalHeart\n })\n })\n }", "function counting(context)\n{\n\t\tif(GameState.Counting>=0)\n\t\t{\n\t\t\tvar countImg = new Image();\n\t\t\tcountImg.src = \"image/\"+GameState.Counting+\".gif\";\n\t\t\tcontext.drawImage(countImg, 400, 200, 100, 100);\n\t\t}\n}", "function addHeart() {\n\n // Grab all the heart images from the html page\n var heart1 = $(\"#heart1\");\n var heart2 = $(\"#heart2\");\n\n if (heart1.hasClass('removed') && heart2.hasClass('removed')) {\n heart2.removeClass('removed');\n } else if (heart1.hasClass('removed')) {\n heart1.removeClass('removed');\n }\n}", "function guessesRemaining() {\n guessesCount = 7 - badGuessess\n imgCounter += 1\n document.querySelector(\"#guessesRemaining\").innerHTML = \"You have \" + guessesCount + \" remaining.\";\n document.getElementById(\"img\").src = \"./assets/images/Hangman-\" + imgCounter + \".png\" ;\n}", "function growingHearts()\n {\n var ox = 0\n var oy = 80\n\n var w = document.body.clientWidth - ox - 200\n var h = document.body.clientHeight - oy - 200\n\n var newInterval = Util.random(200, 2000)\n\n window.setInterval(function()\n {\n\n var heart = createHeart()\n heart.style.fontSize = '0%'\n heart.style.left = Util.random(ox, ox + w) + 'px'\n heart.style.top = Util.random(oy, oy + h) + 'px'\n\n var growInterval = Util.random(10, 50)\n var size = Util.random(200, 2000)\n var i = 0\n var id = window.setInterval(function()\n {\n i += 20\n heart.style.fontSize = i + '%'\n\n if (i < size / 2 ) {\n heart.style.opacity = '1'\n } else {\n heart.style.opacity = (1 - (2 * i - size) / size ) + ''\n }\n\n if (i >= size) {\n window.clearInterval(id)\n document.body.removeChild(heart)\n }\n }, growInterval)\n }, newInterval)\n }", "function setHeartIcon () {\n var image = data.images ? data.images[data.index] : data.image;\n if (Saved.has(image)) {\n page.querySelector('.app-button.heart').classList.add('fav');\n } else {\n page.querySelector('.app-button.heart').classList.remove('fav');\n }\n }", "function risingHearts()\n {\n var ox = 0\n var oy = 80\n\n var w = document.body.clientWidth - ox - 200\n var h = document.body.clientHeight - oy - 200\n\n var newInterval = Util.random(200, 2000)\n\n window.setInterval(function()\n {\n var x = Util.random(ox, ox + w)\n var y = Util.random(oy + h - 100, oy + h)\n\n var heart = createHeart()\n heart.style.fontSize = Util.random(100, 2000) + '%'\n heart.style.left = x + 'px'\n heart.style.top = y + 'px'\n\n var riseInterval = Util.random(10, 50)\n var rise = Util.random(h / 4, h)\n var drift = Util.random(-1, 1)\n var i = 0\n var id = window.setInterval(function()\n {\n i++\n if (Util.random(1, 100) <= 1) {\n drift = (drift == Util.random(-1, 1) ? 1 : 0)\n }\n\n x = Math.min(Math.max(x + drift, ox), ox + w)\n\n heart.style.left = x + 'px'\n heart.style.top = (y - i) + 'px'\n\n if (i < rise / 4) {\n heart.style.opacity = (4 * i / rise) + ''\n } else if (i < rise / 2 ) {\n heart.style.opacity = '1'\n } else {\n heart.style.opacity = (1 - (2 * i - rise) / rise ) + ''\n }\n\n if (i >= rise) {\n window.clearInterval(id)\n document.body.removeChild(heart)\n }\n }, riseInterval)\n }, newInterval)\n }", "function heartBeat() {\n if ($(this).data('beating')) {\n $(this).animateCSS({\n 'duration': '0.2s',\n 'timing_function': 'ease-in',\n 'css': {'transform': \"scale(1.1, 1.1)\"}\n }).animateCSS({\n 'duration': '0.5s',\n 'timing_function': 'ease-out',\n 'css': {'transform': \"scale(1, 1)\"}\n }).queue(function(next) {\n heartBeat.call(this);\n next();\n });\n }\n }", "function updateHearts() {\n const lives = document.getElementById('lives');\n lives.innerHTML = '';\n numHearts = maxGuesses - missedGuesses;\n for (i = 0; i < numHearts; i++) {\n lives.insertAdjacentHTML('beforeend', liveHeartTemplate);\n }\n for (i = 0; i < missedGuesses; i++) {\n lives.insertAdjacentHTML('beforeend', lostHeartTemplate);\n }\n}", "dragonKill() {\n this.expCounter += 100;\n }", "didMissFetch() {\n this.timePillowFactor *= 2;\n }", "function timeUp() {\n // clear the timing interval on the timer function.\n clearInterval(timer);\n // count the non answer as a wrong answer\n loss++;\n /* run preloadImage function with \"lost\" as argument (still trying to fully understand why calling it\n with the argument lost makes it work, i found this solution online)*/\n preloadImage(\"lost\");\n // set a timeout interval of 3 seconds before the nextquestion is generated\n setTimeout(nextQuestion, 3 * 1000);\n }", "function checkBottleAnimation() {\n setInterval(function () {\n let index = thrownbottleGraphicsIndex % thrownbottleGraphics.length;\n thrownbottleCurrentImage = thrownbottleGraphics[index];\n thrownbottleGraphicsIndex = thrownbottleGraphicsIndex + 1;\n }, 70);\n}", "removeLife(){\n let pictureElement = document.getElementsByClassName('tries');\n this.missed += 1;\n //console.log(this.missed);\n if(this.missed == 1){\n pictureElement[4].firstElementChild.setAttribute('src', 'oop_game-v2/images/lostHeart.png');\n }\n if(this.missed == 2){\n pictureElement[3].firstElementChild.setAttribute('src', 'oop_game-v2/images/lostHeart.png');\n }\n if(this.missed == 3){\n pictureElement[2].firstElementChild.setAttribute('src', 'oop_game-v2/images/lostHeart.png');\n }\n if(this.missed == 4){\n pictureElement[1].firstElementChild.setAttribute('src', 'oop_game-v2/images/lostHeart.png');\n }\n if (this.missed == 5){\n pictureElement[0].firstElementChild.setAttribute('src', 'oop_game-v2/images/lostHeart.png');\n this.gameOver(false);\n }\n }", "function imgOnload(){\n addedImagesCount--;\n if(addedImagesCount === 0) highlightMessage(selectedMessageId);\n }", "function update() {\n console.log(kickBeat.value)\n if (tickNum === 4) {\n tickNum = 0\n counterNum = tickNum + 1\n }\n tickNum += 1\n checkSetBeat()\n playMetronone()\n playSnareDrum()\n playHiHat()\n playKick()\n\n console.log(tickNum)\n\n\n\n\n counterArea.innerText = tickNum\n\n\n\n}", "function resetHearts() {\n let source = \"images/liveHeart.png\";\n for (let life of lives) {\n life.src = source;\n }\n}", "function addHearts(){\n $(\"#livesLeft\").empty();\n for(i=0;i<lives; i++){\n $(\"#livesLeft\").append('<img src=\"images/heart.png\" class=\"lifesize\">');\n }\n }", "function whack(e) // whack function\r\n{\r\n if (isGolden == true) // if its golden, it will reveal itself as golden AND give +3 to the score value\r\n {\r\n score += 3;\r\n this.style.backgroundImage = 'url(\"Gkorman2.png\")'; //GOLDEN whacked image\r\n this.style.pointerEvents = 'none';\r\n setTimeout(() => {\r\n this.style.backgroundImage = 'url(\"korman1.png\")'; // makes sure image isn't golden afterwards\r\n this.style.pointerEvents = 'all';\r\n }, 800)\r\n scoreBoard.textContent = score;\r\n }\r\n else // if its just a normal yoda, it will have the normal animation for being whacked and give only +1 to the score value\r\n {\r\n score++;\r\n this.style.backgroundImage = 'url(\"korman2.png\")'; //whacked image\r\n this.style.pointerEvents = 'none';\r\n setTimeout(() => {\r\n this.style.backgroundImage = 'url(\"korman1.png\")'; //resets the yoda back to its original state before being whacked\r\n this.style.pointerEvents = 'all';\r\n }, 1000)\r\n scoreBoard.textContent = score;\r\n }\r\n}", "function drawHeart (index) {\n const offset = index * 40;\n\n noStroke();\n fill(255, 0, 0);\n ellipse(offset + 30, 60, 15, 15);\n ellipse(offset + 40, 60, 15, 15);\n triangle(offset + 23, 63, offset + 47, 63, offset + 35, 75);\n}", "update() {\n this.counter += (this.incrementor);\n\n if(this.counter % 255 ==0){\n this.incrementor *= -1;\n }\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}", "function removeLife (){\n Images.frog.src = '../images/icons8-Poison-96.png'\n frogImages[lives - 1].remove()\n setTimeout(function(){\n Images.frog.src = '../images/frog.png'\n }, 700)\n x = 225\n y = 560\n counter = 60\n}" ]
[ "0.7489492", "0.7144877", "0.71126765", "0.7092963", "0.70334816", "0.69606113", "0.69494385", "0.6942037", "0.68981504", "0.68339264", "0.68173593", "0.6800112", "0.6789708", "0.6781099", "0.67639846", "0.6747806", "0.67064005", "0.6676143", "0.6665336", "0.66474426", "0.66413283", "0.6627626", "0.66079164", "0.6601692", "0.65997463", "0.6581239", "0.65689", "0.65391576", "0.65186495", "0.64441884", "0.6414248", "0.6409085", "0.64070576", "0.6404957", "0.6371524", "0.6356599", "0.635344", "0.6333953", "0.63312125", "0.6327802", "0.6327187", "0.63086593", "0.62939566", "0.62758577", "0.6245392", "0.62389594", "0.6236109", "0.62032026", "0.6192428", "0.6177625", "0.6166244", "0.61334133", "0.6122086", "0.6106326", "0.6099171", "0.60913247", "0.60849607", "0.6076115", "0.6057575", "0.60478395", "0.60457706", "0.60413146", "0.5995111", "0.59819186", "0.5964675", "0.5964352", "0.59571207", "0.5951926", "0.59494066", "0.59399724", "0.59182614", "0.5911086", "0.5902851", "0.5897252", "0.5894466", "0.58908546", "0.58669424", "0.58401626", "0.58134747", "0.5810303", "0.58069754", "0.58041215", "0.58015007", "0.57974017", "0.57836485", "0.5760379", "0.57293147", "0.5721569", "0.57172334", "0.57115847", "0.5709727", "0.5706532", "0.569717", "0.5687829", "0.56858623", "0.56817466", "0.56795484", "0.56753343", "0.56604326", "0.56586367" ]
0.60102326
62
Function is declared in the current existig (enclosing) scope
function foo () { return "Bar"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function someFunction() {\r\n // Local Scope #1\r\n function someOtherFunction() {\r\n // Local Scope #2\r\n }\r\n}", "FunctionDeclaration() {\n pushContext();\n }", "function someFunction() {\n // Local Scope #1\n function someOtherFunction() {\n // Local Scope #2\n }\n}", "function bar() {\n // Local function scope of bar\n }", "function checkscope(){\n //function scope Everthing in the function block is locally accessable to the function only!!!\n var scope = \"local scope\" // local variable\n\n // create a local variable!!\n var scope = \"local scope\" // a local variable\n function f(){ return scope;} // another local variable\n\n return f(); //Return the value in the scope here\n }", "function funcDeclare() {\n console.log(\"Function declared inside if\");\n }", "function checkscope2() {\n var scope = \"local scope\";\n function f() {\n return scope;\n }\n return f;\n}", "function checkscope2() {\n\t var scope = \"Local\";\n\t function nested() {\n\t\t var scope = \"nested\";\n\t\t return scope;\n\t }\n\t return nested();\n }", "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n }", "function foo() {\n\tvar bar = 'bat'\n\n\tfunction asdf() {\n\t\tconsole.log(bar)\n\t}\n\tasdf() // bat\n}", "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n }", "function checkScope11(){\n let i11=\"function scope\";//Did not effect\n if(true){\n let i11=\"block scope\";//Global scope\n console.log(\"Block scope i11 is: \", i11);//,\"block scope\"\n }\n console.log(\"Function scope i11 is: \", i11);//,,\"function scope\"\n return i11;\n}", "function foo() {\r\n}", "function Scope() {\n 'use strict';\n let i = 'scope';\n if (true) {\n let i = 'block scope';\n console.log('Block scope i is: ', i);\n }\n console.log('Function scope i is: ', i);\n return i;\n }", "function checkScope(){\n var i = 'function scope';\n if(true){\n i = 'block scope';\n console.log('Block scope i is ',i);\n }\n console.log('Block scope i is ',i);\n\n}", "function fun() { }", "function foo (){\n foo()\n}", "function fn() {\n\t\t }", "checkCurrentFunctionPython() {\n var cursorPosition = this.currentEditor.getCursorBufferPosition();\n var text\n var i\n for( i = cursorPosition.row; i >= 0; --i ) {\n text = this.currentEditor.lineTextForBufferRow( i );\n text = text.split(' ');\n\n var isFunctionLinePy = text.includes('def')\n var isFunctionLinePerl = text.includes('sub')\n\n var keyword = '';\n if( isFunctionLinePy ) keyword = 'def'\n else if( isFunctionLinePy ) keyword = 'sub'\n\n if( keyword != '' ) {\n defIndex = text.indexOf( keyword );\n\n var n = text[ defIndex + 1 ].indexOf( '(' )\n if( n > -1 ) {\n text[ defIndex + 1 ] = text[ defIndex + 1 ].slice(0, n)\n }\n this.currentFunction = text[ defIndex + 1 ]\n break\n }\n else if( i == 0 ) {//the case where you are above the top level function and in the global scope, not a function scope\n this.currentFunction = \"???\";\n }\n }\n }", "function foo(){\n foo();\n}", "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n console.log(\"Function scope i is: \", i);\n return i;\n}", "function exampleFunction() {\n var x = \"declared inside function\"; // x can only be used in exampleFunction\n console.log(\"Inside function\");\n console.log(x);\n}", "function func(){\r\n\r\n}", "function checkScope() {\n \"use strict\";\n let i = \"function scope\";\n if (true) {\n let i = \"block scope\";\n console.log(\"block scope i is: \", i);\n }\n console.log(\"function scope i is: \", i);\n return i;\n}", "function foo() {\r\n alert('global foo');\r\n }", "function add()\n{\n var xx = \"sdsjd\"; //variable declared inside function can only be used for that function(function scoped)\n}", "function myFunction() { //declaring and initializing a function\n return 1+2; //as mentioned before, this function is now available anywhere \n}", "function foo()\n{\n console.log('Function Declaration');\n}", "function checkScope() {\n \"use strict\";\n\n let i = \"function scope\";\n\n if (true) {\n let i = \"block scope\";\n console.log(\"Block scope i is: \", i);\n }\n\n console.log(\"Function scope i is: \", i);\n return i;\n}", "function exampleFunction() {\n var x = \"declared inside function\"; // x can only be used in exampleFunction\n console.log(\"Inside function\");\n console.log(x);\n}", "function checkScope(){\n var i=\"function scope\";\n if(true){\n i=\"block scope\";\n console.log(\"Block scope i is: \", i);//,\"block scope\"\n }\n console.log(\"Function scope i is: \", i);//,\"block scope\"\n return i;\n}", "function selfish() {\n let localScope = 'you cant get me!'\n}", "function scope(){\n var x = 33; //local scope inside of a function - variables only exist within that function\n console.log(x); //you can also read the global scope (x) inside of this funtion if x isn't defined inside of the function\n}", "function golbal_func () {\n console.log(this); \n console.log(this == window); //this is true\n\n function local_func() {\n console.log(this);\n console.log(this == window); //this is true as well\n }\n local_func()\n }", "function foo() {\n\n}", "function thisIsAFunction(){\n\n}", "function thisIsAFunction(){\n\n}", "function xyz(){\n console.log(abc); // it is available here!\n function qwe(){\n console.log(abc); // it is available here too!\n }\n\n}", "function foo() {...}", "function checkScope() {\n 'use strict';\nlet i = 'function scope';\n if (true) {\n let i = 'block scope';\n console.log('Block scope i is: ', i);\n }\n console.log('Function scope i is: ', i);\n return i;\n}", "function foo(){\n function bar(){\n console.log(\"hello\");\n }\n}", "function outer() {\n\tfunction inner() {\n\t};\n\ttypeof inner === 'function';\n}", "function foo() {\n}", "function scoper() {\n // let cat = 'Toby';\n console.log('cat inside scoper ', cat);\n function innerScope() {\n console.log('cat inside innerScope ', cat);\n }\n innerScope();\n}", "function DefaultScope() {}", "function f(){\n}", "function myFunction() {\n console.log(\"Hoisting\");\n}", "function thisIsHoisted() {\n console.log('this is a function declared at the bottom of the file')\n}", "function functionScope(){\n var functionVariable='function-value';\n console.log(functionVariable);\n}", "function scope(){\n if(true){\n // Var is scoped to the nearest function keyword and declaration is pulled to the top of its scope\n var a = 5;\n\n // Let and Const are scoped by the block they are in.\n let b = 10;\n }\n console.log(a);\n console.log(b);\n}", "function bar (){\n // Compiler: \"Hey, scope of bar I have a new declaration to declare. His identifier is foo.\"\n // the function bar is now compiled\" (Compiler having a conversation with scope portion of the engine.. the scope manager)\n var foo = \"baz\";\n // We are done with the function bar. Popping ourselves back out to the global scope\n}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('Prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "enterFuncdef(ctx) {\n\t}", "function foo () { }", "function testScope() {\n//var e is hoisted only to the top of the function, not the global scope. Since this is functional scoped.\n console.log(e); //undefined\n var e = \"I'm a var in a function!\";\n console.log(e); //\"I'm a var in a function\"\n}", "function question4() {\n question2('functions in functions');\n}", "function Func_s() {\n}", "function scopeDemo(){\n\tvar name = \"function\";\n\tconsole.log(name);\n}", "function myFunc() { \n\n}", "function checkscope() {\n\tvar scope = \"local\"; // Declare a local variable with the same name\n\treturn scope; // Return the local value, not the global one\n}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function x(){\n}", "function checkScope1(){\n let i = 'function scope';\n if(true){\n let i = 'block scope';\n console.log('Block scope i is ',i);\n }\n console.log('Block scope i is ',i);\n\n}", "function myFunction() {\n console.log(\"This is in myFunction.\");\n}", "function checkScope1(){\n let i1=\"function scope\";//Did not effect\n if(true){\n i1=\"block scope\";//Global scope without var keyword\n console.log(\"Block scope i1 is: \", i1);//,\"block scope\"\n }\n console.log(\"Function scope i1 is: \", i1);//,\"block scope\"\n return i1;\n}", "function myFunction() {\n}", "function myFunction() {\n \n}", "function f() {\n}", "function f() {\n}", "function StackFunctionSupport() {\r\n}", "function fuction() {\n\n}", "function functionDeclaration() {}", "function f() {\n (function () {\n x;\n function a() {}\n print(a)\n })()\n}", "function y()\n{\n console.log (\"This function was defined normally\")\n}", "function checkscope() {\n var scope = \"local\"; // Here we overwrite the variable, scope now is \"local\".\n return scope;\n}", "function scopeTest() {\n\n if (true) {\n var a = 123;\n }\n\n console.log(a);\n}", "function miFuncion(){\n\n}", "function seeScope() {\n var testVar = \"first\";\n\n function showF() {\n console.log(testVar);\n // var testVar = \"second\";\n }\n\n showF();\n}", "function scopeTest() {\n // var a is being hoisted up to the top of its scope, which is\n // here... the function scope\n\n if (true) {\n var a = 10;\n }\n\n console.log(a); // I can actually access a outside of the if block, \n // even though it was defined in there!\n}", "function funcA() {\n console.log(a);\n console.log(foo());\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function foo(){\n\ta = 3;\n\n\tconsole.log( a );\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\" to top of foo.\n\n}", "function a() {}", "function a() {}", "function a() {}", "function functionDeclarationHoisted() {\n function bar() { return 1; }\n function bar() { return 2; }\n return bar();\n}", "function x() {\n console.log(\"this is function x\");\n}", "function f() {\n f();\n}", "function myLocalScope() {\n var myVar = 5;\n console.log(myVar);\n}", "function foo(){}", "function foo(){}", "function abc() {\n\n}", "function foo () {\n\tvar x = 1;\n\tfunction bar () {\n\t\tvar y = x + 1;\t//bar可以访问foo的变量x\n\t}\n\tvar z = y + 1;\t//foo不可以访问bar的变量y\n}", "function fn() {}", "function foo() {\n\ta = 1;\t// `a` not formally declared\n}", "function fun(){\n console.log(this) // this represents he global object.\n // bcz these functions are in global context.\n}" ]
[ "0.69811606", "0.6943759", "0.69380796", "0.68799454", "0.6865237", "0.68526596", "0.6793431", "0.67850965", "0.6701261", "0.6659013", "0.6627059", "0.65843856", "0.6567878", "0.6561872", "0.65543056", "0.65454143", "0.6528692", "0.6521522", "0.6517772", "0.651613", "0.64935076", "0.645907", "0.6456741", "0.64545697", "0.6453036", "0.6445121", "0.6444863", "0.64447373", "0.6442048", "0.64406127", "0.6440294", "0.64371926", "0.6433499", "0.64191985", "0.64177626", "0.6413548", "0.6413548", "0.6409616", "0.64087796", "0.63959044", "0.6392092", "0.63814056", "0.6376331", "0.6371354", "0.6355901", "0.6353942", "0.63445646", "0.63412035", "0.63397014", "0.6334544", "0.63306093", "0.63279575", "0.6299262", "0.62933075", "0.62714994", "0.62642884", "0.62577546", "0.62571627", "0.62563664", "0.62495875", "0.62388134", "0.6227912", "0.6227912", "0.6227912", "0.6227912", "0.6227912", "0.6227912", "0.6221041", "0.6214171", "0.62136376", "0.6211833", "0.62099046", "0.61993366", "0.61978316", "0.61978316", "0.6196462", "0.6196368", "0.61948353", "0.6192362", "0.6189273", "0.61875284", "0.61698127", "0.6159319", "0.6146229", "0.6144952", "0.61426294", "0.6136359", "0.6135779", "0.6135779", "0.6135779", "0.6127735", "0.6118834", "0.6110739", "0.610644", "0.6099878", "0.6099878", "0.6098646", "0.6097988", "0.60978895", "0.60957235", "0.6090994" ]
0.0
-1
END saveSpiel() [ errorHandler() ]
function errorHandler(e) { var msg = ''; switch (e.code) { case FileError.QUOTA_EXCEEDED_ERR: msg = 'QUOTA_EXCEEDED_ERR'; break; case FileError.NOT_FOUND_ERR: msg = 'NOT_FOUND_ERR'; break; case FileError.SECURITY_ERR: msg = 'SECURITY_ERR'; break; case FileError.INVALID_MODIFICATION_ERR: msg = 'INVALID_MODIFICATION_ERR'; break; case FileError.INVALID_STATE_ERR: msg = 'INVALID_STATE_ERR'; break; default: msg = 'Unknown Error'; break; } console.log('Error: ' + msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {}", "function save() {\n Bar.createWithConfig(dataForm.name, dataForm.frequency, PoP.getFinalStatements().getItem(dataForm.final_statement))\n .then(() => {\n goBack();\n return Promise.resolve()\n })\n .catch(error => {\n console.log(error);\n console.dir(error);\n console.trace();\n\n Dialog.alert({\n title: \"Error\",\n message: error,\n okButtonText: \"Ok\"\n });\n\n return Promise.reject(error);\n });\n\n\n\n\n}", "save() {\n }", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "function saveRecord()\r\n{\r\n /* On save record:\r\n\r\n\t- PURPOSE\r\n\r\n\r\n\r\n\t FIELDS USED:\r\n\r\n\t\t--Field Name--\t\t\t--ID--\t\t--Line Item Name--\r\n\r\n\r\n */\r\n\r\n\r\n // LOCAL VARIABLES\r\n\r\n\r\n\r\n // SAVE RECORD CODE BODY\r\n\r\n\r\n\treturn true;\r\n\r\n}", "function trySave() {\n exam.display && exam.display.saving(true);\n var saved = pipwerks.SCORM.save();\n if(!saved) {\n Numbas.display.showAlert(R('scorm.failed save'),function(){\n setTimeout(trySave,1);\n });\n }\n else {\n exam.display && exam.display.saving(false);\n }\n }", "function onSaveError()\n\t{\n\t\talert('Could not save field! Check console');\n\t\tconsole.warn('save error', this, arguments);\n\t\tthis.sidebar.layout.removeClass('saving');\n\t}", "save(){\n //\n }", "save() {\n this._toggleSaveThrobber();\n try {\n this._readFromForm();\n var resp = this.dao.save();\n if (!resp) {\n alert(\"Error while saving taxon.\")\n } else {\n var jsonObj = JSON.parse(resp);\n if (jsonObj[0].response == false ) {\n alert(jsonObj[1].response);\n } else {\n console.log(this.dao)\n // make sure the latin name input field is showing the correct name, reload data from server\n document.getElementById('latin_name').value = this.dao.unique_name;\n alert('Saved');\n }\n }\n } catch(e) {\n alert(e);\n console.log(e);\n }\n this._toggleSaveThrobber();\n }", "@action\n save(){\n throw new Error(\"Not implemented\");\n }", "function fhArrival_save() {\n\t\n\t if (!jQuery('#fhArrival_form').valid()) {\n\t\treturn false;\n\t}\n\t\n\tvar myPostArray = DMUtil.inputsToArray('#fhArrival_form');\n\tmyPostArray.push('arrivalId=' + fhArrival_data.arrivalId);\n\tvar rowsData = escape(JSON.stringify(fhArrival_data.arrival.ldvs));\n\tmyPostArray.push('rowsData=' + rowsData);\n\t\n\tvar myPostData = myPostArray.join('&'); \n\t\n\tjQuery.post(\n\t 'index.php?controller=arrival&task=jsonSave&type=json',\n\t myPostData,\n\t function (data) {\n\t \t\n\t \tvar result = DMResponse.validateJson(data);\n\t \t\n\t \tif ((result != false) && (result.result >= 0)) {\t\n\t \t\talert(\"Documento salvato\");\n\t \t\twindow.location = 'index.php?controller=arrival';\n\t \t} else {\n\t \t\talert(\"Si è verificato un errore (\" + result.result + \"): \" + result.description);\n\t \t}\n\t \t\n\t }\n\t); \n\t\n}", "saveEntity(onReturn2list) {\n super.saveEntity(onReturn2list).catch(this.onError.bind(this))\n }", "function guardarExpediente()\n{\n\tvar idExp=$(\"input#idExpe\").val();\n\tvar idCita=$(\"select#idCita\").val();\n\tvar diagnostico=$(\"textarea#diagnostico\").val();\n\tvar receta=$(\"textarea#receta\").val();\n\tvar indicaciones=$(\"textarea#indicaciones\").val();\n\tvar fecha=$(\"input#fecha\").val();\n\t\n\tobjetoExpediente = {Id_Expediente:idExp,Id_Cita:idCita,Diagnostico:diagnostico, Receta:receta, Indicaciones:indicaciones, Fecha:fecha};\n\tif(idExp == 0){\n\t\t//insertar Medicamento:\n\t\taccion = \"insertar\";\n\t}else{\n\t\t//Actualizar Medicamento:\n\t\taccion = \"actualizar\";\n\t}\n\tpeticionJSON = JSON.stringify(\n\t\t\t{\n\t\t\t\t\"Id\": generarID(),\n\t\t\t\t\"method\":accion,\n\t\t\t\t\"clase\": CLASE_EXPEDIENTES,\n\t\t\t\t\"Params\":[objetoExpediente]\n\t\t\t});\n\t$.post(GATEWAY_EXPEDIENTES, peticionJSON, exitoGuardadoExpediente);\n}", "saveItem() {\n\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 }", "async handleSave() {\n\n console.log(\"HANDLE!\")\n await this.setState({eroareValidare: \"\"})\n\n if (!this.state.intrebare || this.state.intrebare.length < 5) {\n await this.setState({eroareValidare: \"Intrebarea trebuie sa aiba cel putin 5 caractere!\"})\n }\n\n //Verificare daca exista cel putin 2 variante de raspuns\n if (this.state.varianteRaspuns.length < 2){\n await this.setState({eroareValidare: \"Trebuie cel putin 2 variante de raspuns!\"})\n }\n\n if (this.state.eroareValidare.length === 0) {\n //Este ok\n //Construim intrebarea asa cum trebe\n //Si dam mai departe prin callbackul (functia stabilita de parinte prin care poate fi notificat) din props catre parinte\n\n this.props.onSave({\n tip: this.getTipIntrebare(),\n detalii: {\n titlu: this.state.intrebare,\n optiuni: this.state.varianteRaspuns\n }\n })\n }\n else{\n this.setState({snackbar: true});\n }\n\n }", "function SaveForm() {\n debugger;\n \n ValidateChequeNo();\n}", "function saveRouteFail(data){\n Message.showError('Falha ao cadastrar Rota', 'Ocorreu uma falha ao tentar cadastrar a rota.');\n }", "function saveLugarExpedicion() {\n\tvar ubicacion = getUbicacionFromWebPage()\n\n\t$.post(getAbsolutePath(\"/domicilio/save?name=expedicion\"), ubicacion).done(function(data) {\n\n\t\tshowMessage('#modal-domicilio', data)\n\n\t\treloadExpedicion()\n\n\t});\n\n}", "function save() {\r\n \t\t// get busy\r\n \t\tgetBusy();\r\n \t\t\r\n \t\t/****/\r\n \t\t\r\n \t\t\r\n \t\t/*****/\r\n \t\t\r\n \t\tangular.forEach(vm.examenes, function(examen, key) {\r\n \t\t\tif(examen.create) {\r\n \t\t\t\tcreate({\r\n\t\t\t\t\t\ttmp: {\r\n\t\t\t\t\t\t\tcodigoCausaExterna: vm.examenDetail.codigoCausaExterna,\r\n\t\t\t\t\t\t\tcodigoClaseServicio: vm.examenDetail.codigoClaseServicio,\r\n\t\t\t\t\t\t\tvalorCostoEps: '',\r\n\t\t\t\t\t\t\tvalorCuotaModeradora: ''\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t_embedded: {\r\n\t\t\t\t\t\t\texamenTipo:{\r\n\t\t\t\t\t\t\t\tid: examen.tipo,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tafiliado: {\r\n\t\t\t\t\t\t\t\tid: $stateParams.afiliadoId\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tmedico: vm.examenDetail.medico\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\texamen: {}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n \t\t\t}\r\n \t\t})\r\n\t\t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t\t\r\n \t}", "function save() {\n validateFinanceCube();\n }", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "async save() {\n return;\n }", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function save(req, res) {\n const nome = req.sanitize('nome').escape();\n const logo = req.sanitize('logo').escape();\n const categoria = req.sanitize('categoria').escape();\n req.checkBody(\"nome\", \"insert text only\").matches(/^[a-z ]+$/i);\n req.checkBody(\"categoria\", \"insert text only\").optional({ checkFalsy: true }).matches(/^[a-z ]+$/i);\n req.checkBody(\"logo\", \"insert a valide url\").optional({ checkFalsy: true }).isURL();\n const errors = req.validationErrors();\n if(errors) {\n res.send(errors);\n return;\n }\n if(nome != \"NULL\" && categoria != \"NULL\" && typeof(nome) != 'undefined') {\n const post = {\n nome: nome,\n logo: logo,\n categoria: categoria\n };\n const query = connect.con.query('INSERT INTO sponsor SET ?',\n post,\n function(err, rows, fields) {\n console.log('query: ', query.sql);\n if(!err) {\n res.status(jsonMessages.db.successInsert.status).location(rows.insertId).send(jsonMessages.db.successInsert);\n } else {\n res.status(jsonMessages.db.dbError.status).send(jsonMessages.db.dbError);\n }\n });\n } else {\n //if data sent by form were null\n res.status(jsonMessages.db.requiredData.status).send(jsonMessages.db.requiredData);\n }\n}", "function SaveForm() {\n debugger;\n\n ValidateChequeNo();\n}", "function saveTransfer() {\n retrieveValues();\n saveToServer();\n}", "saveAndExit() {\n saveAndExit();\n }", "function guardar() {\r\n var nombre = ventana.document.getElementById(\"txtnom\").value;\r\n var apellidos = ventana.document.getElementById(\"txtape\").value;\r\n var foto = ventana.document.getElementById(\"txtfoto\").value;\r\n var funciones = ventana.document.getElementById(\"txtfunc\").value;\r\n var telefono = ventana.document.getElementById(\"txttel\").value;\r\n\r\n crearNuevoSocio(nombre, apellidos, foto, funciones, telefono);\r\n ventana.close();\r\n}", "function saveActionsPerso(){\r\n\t\r\n\tvar obj = WORKINGOBJ;\r\n\t\r\n\tvar lst = recupActionsPerso();\r\n\t//blocks\r\n\tobj.text3 = lst;\r\n\t\r\n\t//blocks\r\n\tvar lst2 = recupParamsPerso();\r\n\tobj.text5 = lst2;\r\n\t\r\n\tvar actions = lst.split('|');\r\n\tvar params = lst2.split('|');\r\n\t\r\n\tvar sc = '';\r\n\tvar condiopen = false;\r\n\t\r\n\tvar i = 0;\r\n\t\r\n\tfor (i=0;i<actions.length;i++){\r\n\t\t\r\n\t\t//Si condition\r\n\t\tif(actions[i].indexOf('cod')!=-1){\r\n\t\t\tif(condiopen){sc = sc+'}';}\r\n\t\t\tcondiopen = true;\r\n\t\t}\r\n\t\tsc += scActionsEdit(actions[i],params[i]);\r\n\t\t\r\n\t}\r\n\t\r\n\tif(condiopen){sc = sc+'}';}\r\n\t\r\n\tsc += 'LUDI.waitReset();';\r\n\t\r\n\t//final script\r\n\tobj.text4 = sc;\r\n\tobjetSendToString();\r\n\t\r\n\tsetTimeout(function(){ saveActionsPerso() }, 300);\r\n\r\n}", "function afterSave(rs) {\n if (rs.status==='fail') {\n if (rs.msg === 'collision') {\n var ht = 'An unlikely name collision took place. Please try your save again.'\n } else if (rs.msg === 'busy') {\n var ht = 'The site is too busy to do the save. Please try again later';\n } else if ((rs.msg===\"noSession\")||(rs.msg === \"timedOut\")) {\n var ht = 'Your session has timed out. Please sign in again.'\n page.logout();\n } else {\n var ht = \"Error: \"+rs.msg;\n }\n return ht;\n } else {\n return \"ok\"\n }\n}", "function saveSpieler(form) {\n form.preventDefault();\n\n let url = \"./resource/spieler/\";\n let type;\n\n let spielerUUID = $(\"#spielerUUID\").val();\n if (spielerUUID) {\n type= \"PUT\";\n url += \"update\"\n } else {\n type = \"POST\";\n url += \"create\";\n }\n\n $\n .ajax({\n url: url,\n dataType: \"text\",\n type: type,\n data: $(\"#spielereditForm\").serialize()\n })\n .done(function (jsonData) {\n window.location.href = \"./nba-shop.html\"\n })\n .fail(function (xhr, status, errorThrown) {\n if (xhr.status == 404) {\n $(\"#message\").text(\"Dieser Spieler existiert nicht\");\n } else {\n $(\"#message\").text(\"Fehler beim Speichern des Spielers\");\n }\n })\n}", "function saveEditSale() {\n\n if ($('#editSaleAmount').val() == \"\" || $('#editSale').val() == \"\") {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Organization Name or amount field is empty.\"));\n errArea.appendChild(divMessage);\n }\n else {\n currentItem.set_item(\"Title\", $('#editSale').val());\n currentItem.set_item(\"ContactPerson\", $('#editSalePerson').val());\n currentItem.set_item(\"ContactNumber\", $('#editSaleNumber').val());\n currentItem.set_item(\"Email\", $('#editSaleEmail').val());\n currentItem.set_item(\"DealAmount\", $('#editSaleAmount').val());\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n showSales();\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n }\n}", "function ep_Save() {\n\tvar bankAccount = nlapiGetFieldValue('custpage_2663_bank_account');\n\tvar batchId = nlapiGetFieldValue('custpage_2663_batchid');\n\tif (bankAccount && batchId) {\n\t\tif (!document.forms['main_form'].onsubmit || document.forms['main_form'].onsubmit()) {\n\t\t\tupsertBatch(bankAccount, batchId);\n\t\t\t\n\t\t\t// set the refresh flag\n\t\t nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n\n // set to view mode\n nlapiSetFieldValue('custpage_2663_edit_mode', 'F', false);\n \n\t\t // suppress the alert\n\t\t setWindowChanged(window, false);\n\t\t \n\t\t // submit the form -- calls submitForm function\n\t\t document.forms.main_form.submit();\n\t\t}\n\t}\n}", "function saveImagen() {\n\t$(\"#btnGuardar3\").hide();\n\t$(\"#mensajeTemporal3\").show();\n\t$(\"#inmueble_subirImagen\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idInmueble\").val(positions[pos_comp].id);\n\tif (inmueble_pos_comp == -1) {\n\t\t$(\"#nuevo\").val(\"1\");\n\t\t$(\"#modificar\").val(\"0\");\n\t\t$(\"#idInmuebleInmueble\").val(\"0\");\n\t}\n\telse {\n\t\t$(\"#nuevo\").val(\"0\");\n\t\t$(\"#modificar\").val(\"1\");\n\t\t$(\"#idInmuebleInmueble\").val(inmueble_positions[inmueble_pos_comp][0]);\n\t}\n\t\n\t\n\t$(\"#subirImagen\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar3\").show();\n\t\t\t$(\"#mensajeTemporal3\").hide();\n\t\t\t$(\"#inmueble_subirImagen\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tinmueble_cerrarPopUp2();\n\t\t\tinmueble_imagenInmuebleCampos(pos_comp, respuesta_json.datos);\n\t\t}\n\t});\n}", "function saveImagen() {\n\t$(\"#btnGuardar3\").hide();\n\t$(\"#mensajeTemporal3\").show();\n\t$(\"#inmueble_subirImagen\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idInmueble\").val(positions[pos_comp].id);\n\tif (inmueble_pos_comp == -1) {\n\t\t$(\"#nuevo\").val(\"1\");\n\t\t$(\"#modificar\").val(\"0\");\n\t\t$(\"#idInmuebleInmueble\").val(\"0\");\n\t}\n\telse {\n\t\t$(\"#nuevo\").val(\"0\");\n\t\t$(\"#modificar\").val(\"1\");\n\t\t$(\"#idInmuebleInmueble\").val(inmueble_positions[inmueble_pos_comp][0]);\n\t}\n\t\n\t\n\t$(\"#subirImagen\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar3\").show();\n\t\t\t$(\"#mensajeTemporal3\").hide();\n\t\t\t$(\"#inmueble_subirImagen\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tinmueble_cerrarPopUp2();\n\t\t\tinmueble_imagenInmuebleCampos(pos_comp, respuesta_json.datos);\n\t\t}\n\t});\n}", "function insertTempObra(x) {\n //code Insertando avances fisicos\n \n if (AOTI && x >= AOTI.length) {\n //code\n console.log(\"Todas las inserciones terminadas:::::::::::::::::::::::::::::::::\");\n location.href=\"mapa_proyectos.html\";\n // insertarAvanceFinancieroProyectos(0);\n }\n \n else if (AOTI && AOTI.length > 0) {\n console.log(\"Cargando datos espere un momento ::: 4 X=\" + x + \" Avances: \"+ AOTI.length);\n \n \n \n db.transaction(function(tx) {\n \n tx.executeSql('INSERT INTO TempAvanceObras(idAvanceFinanciero, idAvanceFisico, idObra)' +\n ' VALUES (?, ?, ?)',\n [AOTI.item(x).idAvanceFinanciero, AOTI.item(x).idAvanceFisico, AOTI.item(x).idObraFisico]);\n console.log(\"Avance Temp en Proyectos: \" + AOTI.item(x).idObraFisico);\n \n \n }, errorCB, function (){\n console.log(\"Se inserto correctamente el avance temporal: \" + AOTI.item(x).idObraFisico);\n \n x++;\n insertTempObra(x);\n \n }); \n \n } else {\n console.log(\"No hay avances temporales de obra :::::::::::::::::::::::\");\n // insertarAvanceFinancieroProyectos(0);\n }\n}", "async postSave () {\n\t}", "function doSalvaEmpresa(i) {\r\n //passa os dados da empresa a ser editada via ajax para o backend\r\n $.post('empresa.php?acao=saveEmpresa',\r\n {empresaID: i,\r\n nome: htmlentities($(\"#nome\").val()),\r\n endereco: htmlentities($(\"#endereco\").val()),\r\n complemento: htmlentities($(\"#complemento\").val()),\r\n cidade: htmlentities($(\"#cidade\").val()),\r\n estado: htmlentities($(\"#estado\").val()),\r\n cep: htmlentities($(\"#cep\").val()),\r\n telefone: htmlentities($(\"#telefone\").val()),\r\n fax: htmlentities($(\"#fax\").val()),\r\n email: htmlentities($(\"#email\").val())\r\n },\r\n function(d) {\r\n try {\r\n d = JSON.parse(d);\r\n } catch (e) {\r\n if (e instanceof SyntaxError) {\r\n alert(\"Erro encontrado. Contacte o administrador e mostre essa mensagem: \" + e.message + \"\\nJSON retornado: \" + d);\r\n }\r\n }\r\n //se a edicao foi bem sucedida, mostra a mensagem de sucesso\r\n if (d[0].success == true) {\r\n $(\"#cadEmpresaFeedback\").show();\r\n $(\"#cadEmpresaFeedback\").html('Empresa salva com sucesso!');\r\n } else {\r\n //senao, mostra feedback de erro\r\n $(\"#cadEmpresaFeedback\").show();\r\n $(\"#cadEmpresaFeedback\").html('Erro ao salvar empresa: ' + d[0].errorFeedback);\r\n }\r\n\r\n });\r\n}", "save() {\n try{\n validateUserData()\n }catch(err) {\n \n }\n }", "function save(title){\n if(typeof title === 'undefined' || title === '' )\n {\n FlashService.create(\"the title can't be empty!\");\n }\n else if(scope.plan.selected.length === 0){\n FlashService.create(\"the content cannot be empty!\");\n }\n else{\n\n scope.permission.planMode = false;\n angular.element('.plan-overlay').css('visibility','hidden');\n scope.plan.save(title);\n scope.plan.current = [];\n scope.plan.selected = [];\n }\n }", "function showError() {\n console.log(\"error in writing data to the database\")\n}", "function saveAndFinishLater()\n{\n\tif (vm.isSaveValid)\n\t{\n\t\t_submitAllData(SAVE_ORDER_AND_FINISH_LATER_URL, SUCCESS_MESSAGE.SAVE_ORDER_AND_FINISH_LATER);\n\t}\n}", "function statusSaveTour(resultado){\n\n\tif (resultado.indexOf(\"EXITO\")==-1) {\n\t\t//algo ocurrio mal\n\t\talert(resultado);\n\t} \t\t \n\telse {\n\t\talert(\"Horario agregado con EXITO!\");\n\t\t$(\"#formHorariosTour\").trigger(\"reset\");\n\t\tloadTours();\n\t}\n\n}", "save() {\n return null;\n }", "function ajoutRapport_mensuel(rapport_mensuel,suppression)\n {\n if (NouvelItemRapport_mensuel==false)\n {\n apiFactory.getAPIgeneraliserREST(\"rapport_mensuel/index\",'menu','getrapportvalideById','id_rapport_mensuel',rapport_mensuel.id).then(function(result)\n {\n var rapport_mensuel_valide = result.data.response;\n if (rapport_mensuel_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allrapport_mensuel = vm.allrapport_mensuel.filter(function(obj)\n {\n return obj.id !== rapport_mensuel.id;\n });\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceRapport_mensuel (rapport_mensuel,suppression); \n }\n }); \n } \n else\n {\n insert_in_baseRapport_mensuel(rapport_mensuel,suppression);\n }\n }", "function savePos2(indice){\n\t\t\n\t\t$.ajax({\n\t\t\turl: 'traitement/saveOne.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tdata: {tableJson: tableJson,\n\t\t\t\t indice: indice}\n\t\t})\n\t\t.done(function() {\n\t\t\tconsole.log(\"done\");\n\t\t})\n\t\t.fail(function() {\n\t\t\tconsole.log(\"error\");\n\t\t})\n\t\t.always(function() {\n\t\t\tconsole.log(\"complete\");\n\t\t});\n\t}", "function territory_data_save() {\n var teriName = $('#teriName').val();\n var distri = $('#distri').val();\n $.post('view.php', {save_territory: 'data', teriName: teriName, distri: distri}, function (data) {\n if (data.msgType === 1) {\n alertify.success(data.msg, 2000);\n } else {\n alertify.error(data.msg, 2000);\n }\n territory_data_table();\n clear_territory();\n }, \"json\");\n}", "function ajoutContrat_prestataire(contrat_prestataire,suppression)\n {\n if (NouvelItemContrat_prestataire==false)\n {\n apiFactory.getAPIgeneraliserREST(\"contrat_prestataire/index\",'menus',\"getcontrat_mpevalideById\",'id_contrat_mpe',contrat_prestataire.id).then(function(result)\n {\n var contrat_prestataire_valide = result.data.response;\n if (contrat_prestataire_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allcontrat_prestataire = contrat_prestataire_valide;\n vm.stepattachement = false;\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceContrat_prestataire (contrat_prestataire,suppression); \n }\n }); \n } \n else\n {\n insert_in_baseContrat_prestataire(contrat_prestataire,suppression);\n }\n }", "function saveSpec() {\n updateGeneralspe();\n if (!iserror && !iserrorOwnpanel && !iserrorGeneralSpec && !isSingleError) {\n document.forms['specForm'].action = '${pageContext.request.contextPath}/specification/Specification.action?saveandBack=';\n document.forms['specForm'].submit();\n }\n }", "save() {\n return null;\n }", "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "function handleRecipeSave(res) {\r\n\r\n}", "_save(f) {\n return (evt) => {\n\n try {\n $.parseXML(evt.target.result);\n } catch(error) {\n this._errorProcessing([f], \"Invalid XML\");\n return;\n }\n\n dbServer.add({\n xml: evt.target.result,\n filename: f.name\n }).then(() => {\n this._finished([f], 'Success');\n }).catch((error) => {\n this._errorProcessing([f], error.message);\n });\n };\n }", "_afterSave(entity, error, afterAction) {\n if (error) {\n this.setState({\n showLoading: false\n }, () => {\n this.refs.form.processEnded();\n this.addError(error);\n });\n return;\n }\n this.addMessage({ message: this.i18n('save.success', { name: entity.name }) });\n if (afterAction !== 'CONTINUE') {\n this.context.history.goBack();\n } else {\n this.setState({\n showLoading: false\n }, this.refs.form.processEnded());\n //\n this.context.history.replace(`/scripts/${ entity.id }/detail`);\n }\n }", "function saveEquipment() {\n MeasuringEquipmentServiceCalibrator.saveEquipment(\n $scope.equipmentFormData).then(\n function (data) {\n if (data == 201) {\n $scope.closeModal();\n $scope.resetEquipmentForm();\n $rootScope.onTableHandling();\n }\n });\n }", "function saveEditOpp() {\n\n if ($('#editOppAmount').val() == \"\" || $('#editOpp').val() == \"\") {\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Organization Name or amount field is empty.\"));\n errArea.appendChild(divMessage);\n }\n else {\n currentItem.set_item(\"Title\", $('#editOpp').val());\n currentItem.set_item(\"ContactPerson\", $('#editOppPerson').val());\n currentItem.set_item(\"ContactNumber\", $('#editOppNumber').val());\n currentItem.set_item(\"Email\", $('#editOppEmail').val());\n currentItem.set_item(\"DealAmount\", $('#editOppAmount').val());\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showOpps();\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllOpps\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n }\n}", "livelyPrepareSave() {\n }", "function save_order() {\n\tdb.sql(\"insert into orders (customer) values(?)\", [order.customer], function(r) {\n // inserts into orders table a customer\n\t\tif(r.error) {\n alert(\"Save Error: \"+o2j(r.error));\n\t\t\t// If there is an error, then alert that there was a save error \n}\n\t\telse {\n\t\t\tvar id = r.insert_id\n\t\t\t// set id = the id within the database\n\t\t\tfor(var i = 0; i < order.lines.length; i++) {\n \t // loop through lines array\n\t\t\t\torder.lines[i].order_id = id;\n\t\t\t\t// add id to order_id\n \t\t\twrite(order.lines[i].order_id);\n\t\t\t\t// write out the order id of the order that has just been saved\n\t\t\t\tdb.sql(\"insert into items (order_id, product, price, qty) values(?, ?, ?, ?)\", [order.lines[i].order_id, order.lines[i].product, order.lines[i].price, order.lines[i].qty], function(r) {\n\t\t\t\t// insert into items table the order_id, product, price, and quantity\n\t\t\t\t\tif(r.error) {\n\t\t\t\t\t\talert(\"Save Error: \" + o2j(r.error));\n\t\t\t\t\t\t// if there is an error alert that there is a save error\n\t\t\t\t\t}\t\n \t\t\t});\n\t\t\t}\t\n\t\t}\n\t});\t\n}", "function guardar()\n {\n var _token = $('input[name=_token]').val();\n var id_empleado= $('#id_empleado').val();\n var nombres= $('#txt_nombres').val();\n var apellido1= $('#txt_apellido1').val();\n var apellido2= $('#txt_apellido2').val();\n var cedula= $('#txt_cedula').val();\n var direccion= $('#txt_direccion').val();\n var departamento= $('#cmb_Departamento').val();\n var telefono_1= $('#txt_telefono_1').val();\n var telefono_2= $('#txt_telefono_2').val();\n var nomb_notifica= $('#txt_nomb_notifica').val();\n var estado_civil= $('#cmb_estado_civil').val();\n var telefono_not= $('#txt_telefono_not').val();\n var edad= $('#txt_edad').val();\n var correo= $('#txt_correo').val();\n var sexo= $('#cmb_sexo').val();\n\n if (apellido2!=\"\")\n apellido2:apellido2.trim().toUpperCase()\n\n if (correo!=\"\" && edad!=\"\" && estado_civil!=\"\" && nombres!=\"\" && apellido1!=\"\" && cedula!=\"\" && sexo!=\"\"&& direccion!=\"\" && departamento!=\"\" && telefono_1!=\"\" && nomb_notifica!=\"\" && telefono_not!=\"\")\n {\n alertConfirm(\"¿Está seguro que desea guardar?\", function (e) {\n showLoad(true);\n $.ajax({\n type: 'POST',\n url: '/vendedor/guardar', //llamada a la ruta\n data: {\n _token:_token,\n id_empleado:id_empleado,\n nombres:nombres.trim().toUpperCase(),\n apellido1:apellido1.trim().toUpperCase(),\n apellido2:apellido2,\n cedula:cedula.toUpperCase(),\n direccion:direccion.trim(),\n departamento:departamento,\n telefono_1:telefono_1,\n telefono_2:telefono_2,\n nomb_notifica:nomb_notifica.trim().toUpperCase(),\n estado_civil:estado_civil,\n telefono_not:telefono_not,\n edad:edad,\n correo:correo.trim(),\n sexo:sexo.trim()\n },\n success: function (data) {\n showLoad(false);\n if (data.error) {\n alertError(data.mensaje);\n return;\n }\n else\n {\n resetForm();\n alertSuccess(data.mensaje);\n tblVendedores.ajax.reload();\n }\n },\n error: function (err) {\n alertError(err.responseText);\n showLoad(false);\n }\n\n });\n });\n\n }\n else\n alertError(\"Favor completar todos los campos\");\n\n }", "function saveMaduracion(){\n\t\t rowConfig();\n\t\t var parameters = { fecha:$('#fecha').val(), \n\t\t \t\t\t\t\tsolidos:$('#solidos').val(),\n\t\t \t\t\t\t\tph:$('#ph').val(), \n\t\t \t\t\t\t\tat:$('#at').val(), \n\t\t \t\t\t\t\tbrph:$('#brph').val(), \n\t\t \t\t\t\t\tbrat:$('#brat').val()\n\t\t \t\t\t\t};\n\t if( parameters.fecha!='' && parameters.solidos!='' && parameters.ph!='' && parameters.at!='' && parameters.brph!='' && parameters.brat){\n\t\t if( (parseFloat(parameters.solidos)>= 0 && parseFloat(parameters.solidos) <=28) && (parseFloat(parameters.at)>= 0 && parseFloat(parameters.at) <=20) && (parseFloat(parameters.ph)>= 2 && parseFloat(parameters.ph) <=4) ){\n\t\t \t\tvalidateMaduracion(parameters);\n\t\t \t}\n\t\t \telse{\n\t\t \t\tif( !(parseFloat(parameters.solidos)>= 0 && parseFloat(parameters.solidos) <=28) ){\n\t\t \t\t\t$('#noNumEditSolidos').show();\n\t\t \t\t}\n\t\t \t\telse{\n\t\t \t\t\t$('#noNumEditSolidos').hide();\n\t\t \t\t}\n\t\t \t\tif( !(parseFloat(parameters.at)>= 0 && parseFloat(parameters.at) <=20) ){\n\t\t \t\t\t$('#noNumEditAt').show();\n\t\t \t\t}\n\t\t \t\telse{\n\t\t \t\t\t$('#noNumEditAt').hide();\n\t\t \t\t}\n\t\t \t\tif( !(parseFloat(parameters.ph)>= 2 && parseFloat(parameters.ph) <=4) ){\n\t\t \t\t\t$('#noNumEditPh').show();\n\t\t \t\t}\n\t\t \t\telse{\n\t\t \t\t\t$('#noNumEditPh').hide();\n\t\t \t\t}\t \n\t\t \t}\n\t\t }\n\t else{\n\t Materialize.toast('No puede dejar campos vacios', 1500);\n\t }\n\t}", "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "function ajoutContrat_prestataire(contrat_prestataire,suppression)\n {\n if (NouvelItemContrat_prestataire==false)\n {\n if (vm.session==\"AAC\")\n {\n apiFactory.getAPIgeneraliserREST(\"contrat_prestataire/index\",'menus',\"getcontrat_mpevalideById\",'id_contrat_mpe',contrat_prestataire.id).then(function(result)\n {\n var contrat_prestataire_valide = result.data.response;\n if (contrat_prestataire_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allcontrat_prestataire = contrat_prestataire_valide;\n vm.stepattachement = false;\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceContrat_prestataire (contrat_prestataire,suppression); \n }\n });\n }\n else\n {\n test_existanceContrat_prestataire (contrat_prestataire,suppression);\n }\n \n } \n else\n {\n insert_in_baseContrat_prestataire(contrat_prestataire,suppression);\n }\n }", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\tvar datos = {\n\t\tid: id\n\t};\n\t\n\t\n\tvar arrayTodosCampos = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"descripcion\", \"antiguedad\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"estadoConservacion\", \"cocinaEquipada\", \"estudio\", \"cuartoServicio\", \"cuartoTV\", \"bodega\", \"terraza\", \"jardin\", \"areaJuegosInfantiles\", \"comedor\", \"serviciosBasicos\", \"gas\", \"lineaTelefonica\", \"internetDisponible\", \"aireAcondicionado\", \"calefaccion\", \"cuotaMantenimiento\", \"casetaVigilancia\", \"elevador\", \"seguridad\", \"alberca\", \"casaClub\", \"canchaTenis\", \"vistaMar\", \"jacuzzi\", \"estacionamientoVisitas\", \"permiteMascotas\", \"gimnasio\", \"centrosComercialesCercanos\", \"escuelasCercanas\", \"fumadoresPermitidos\", \"numeroOficinas\", \"wcs\", \"recamaras\", \"hospitalesCercanos\", \"iglesiasCercanas\", \"amueblado2\", \"semiAmueblado\", \"zonaIndustrial\", \"zonaTuristica\", \"zonaComercial\", \"zonaResidencial\", \"baresCercanos\", \"supermercadosCercanos\", \"excelenteUbicacion\", \"cisterna\", \"calentador\", \"camaras\", \"anden\", \"asador\", \"vapor\", \"sauna\", \"playa\", \"clubPlaya\", \"portonElectrico\", \"chimenea\", \"areasVerdes\", \"vistaPanoramica\", \"canchaSquash\", \"canchaBasket\", \"salaCine\", \"canchaFut\", \"familyRoom\", \"campoGolf\", \"cableTV\", \"biblioteca\", \"usosMultiples\", \"sala\", \"recibidor\", \"vestidor\", \"oratorio\", \"cava\", \"patio\", \"balcon\", \"lobby\", \"metrosFrente\", \"metrosFondo\", \"cajonesEstacionamiento\", \"desarrollo\");\n\t\n\t\n\tfor (var x = 0; x < arrayTodosCampos.length; x++) {\n\t\tvar valor = \"\";\n\t\t\n\t\tswitch($(\"#\"+arrayTodosCampos[x]).prop(\"tagName\")) {\n\t\t\tcase \"INPUT\":\n\t\t\t\tif ($(\"#\"+arrayTodosCampos[x]).prop(\"type\") == \"text\")//text\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\telse//checkbox\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).prop(\"checked\") ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\tcase \"SELECT\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t\tcase \"TEXTAREA\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tdatos[arrayTodosCampos[x]] = valor;\n\t}\n\t\n\t\n\tdatos[\"cp\"] = $(\"#colonia\").val() != -1 ? $(\"#colonia option:selected\").attr(\"data-cp\") : \"\";\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updInmueble.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(inmueble_cerrarPopUp);\n\t\tconsultarTuplasExistentesPaginacion(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\tvar datos = {\n\t\tid: id\n\t};\n\t\n\t\n\tvar arrayTodosCampos = new Array(\"titulo\", \"usuario\", \"categoria\", \"tipo\", \"precio\", \"calleNumero\", \"estado\", \"ciudad\", \"colonia\", \"latitud\", \"longitud\", \"descripcion\", \"antiguedad\", \"codigo\", \"dimensionTotal\", \"dimensionConstruida\", \"estadoConservacion\", \"cocinaEquipada\", \"estudio\", \"cuartoServicio\", \"cuartoTV\", \"bodega\", \"terraza\", \"jardin\", \"areaJuegosInfantiles\", \"comedor\", \"serviciosBasicos\", \"gas\", \"lineaTelefonica\", \"internetDisponible\", \"aireAcondicionado\", \"calefaccion\", \"cuotaMantenimiento\", \"casetaVigilancia\", \"elevador\", \"seguridad\", \"alberca\", \"casaClub\", \"canchaTenis\", \"vistaMar\", \"jacuzzi\", \"estacionamientoVisitas\", \"permiteMascotas\", \"gimnasio\", \"centrosComercialesCercanos\", \"escuelasCercanas\", \"fumadoresPermitidos\", \"numeroOficinas\", \"wcs\", \"recamaras\", \"hospitalesCercanos\", \"iglesiasCercanas\", \"amueblado2\", \"semiAmueblado\", \"zonaIndustrial\", \"zonaTuristica\", \"zonaComercial\", \"zonaResidencial\", \"baresCercanos\", \"supermercadosCercanos\", \"excelenteUbicacion\", \"cisterna\", \"calentador\", \"camaras\", \"anden\", \"asador\", \"vapor\", \"sauna\", \"playa\", \"clubPlaya\", \"portonElectrico\", \"chimenea\", \"areasVerdes\", \"vistaPanoramica\", \"canchaSquash\", \"canchaBasket\", \"salaCine\", \"canchaFut\", \"familyRoom\", \"campoGolf\", \"cableTV\", \"biblioteca\", \"usosMultiples\", \"sala\", \"recibidor\", \"vestidor\", \"oratorio\", \"cava\", \"patio\", \"balcon\", \"lobby\", \"metrosFrente\", \"metrosFondo\", \"cajonesEstacionamiento\", \"desarrollo\");\n\t\n\t\n\tfor (var x = 0; x < arrayTodosCampos.length; x++) {\n\t\tvar valor = \"\";\n\t\t\n\t\tswitch($(\"#\"+arrayTodosCampos[x]).prop(\"tagName\")) {\n\t\t\tcase \"INPUT\":\n\t\t\t\tif ($(\"#\"+arrayTodosCampos[x]).prop(\"type\") == \"text\")//text\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\telse//checkbox\n\t\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).prop(\"checked\") ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\tcase \"SELECT\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t\tcase \"TEXTAREA\":\n\t\t\t\tvalor = $(\"#\"+arrayTodosCampos[x]).val();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tdatos[arrayTodosCampos[x]] = valor;\n\t}\n\t\n\t\n\tdatos[\"cp\"] = $(\"#colonia\").val() != -1 ? $(\"#colonia option:selected\").attr(\"data-cp\") : \"\";\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updInmueble.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: datos\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(inmueble_cerrarPopUp);\n\t\tconsultarTuplasExistentesPaginacion(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "function savePassion() {\r\n\tvar attrDescText = document.getElementById(\"attrDescInptId\").value;\r\n\tvar attrFullDescText = document.getElementById(\"attrFullDescInptId\").value;\r\n\t//var attributeOrder = document.getElementById(\"attrOrderInptId\").value;\r\n\tvar userProfile = document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].value;\r\n\tvar userProfileText = document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].text;\r\n\tif(validateValue(attrDescText, attrFullDescText, \"PAS\")) {\r\n\t\tvar newUserProf = Spine.Model.sub();\r\n\t\tnewUserProf.configure(\"/admin/contentconfig/savePassion\", \"attrDescTextVal\", \"userProfileVal\", \"userProfileId\", \"attrFullDescText\", \"createdBy\");\r\n\t\tnewUserProf.extend( Spine.Model.Ajax );\r\n\t\t//Populate the model with data to transfer\r\n\t\tvar modelPopulator = new newUserProf({ \r\n\t\t\tattrDescTextVal: attrDescText,\r\n\t\t\tuserProfileVal: userProfileText,\r\n\t\t\tuserProfileId: userProfile,\r\n\t\t\tattrFullDescText: attrFullDescText,\r\n\t\t\tcreatedBy: sessionStorage.getItem(\"jctEmail\")\r\n\t\t});\r\n\t\tmodelPopulator.save(); //POST\r\n\t\tnewUserProf.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t\t});\r\n\t\tnewUserProf.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t\tvar statusCode = obj.statusCode;\r\n\t\t\tif(statusCode == 200) {\r\n\t\t\t\t//alertify.set({ delay: 2700 });\r\n\t\t\t\talertify.alert(\"Passion has been successfully created.\");\r\n\t\t\t\tpopulatePassionTable(obj.existingMappingList, \"ADD\");\t\r\n\t\t\t\tdocument.getElementById(\"attrDescInptId\").value = \"\";\r\n\t\t\t\tdocument.getElementById(\"attrFullDescInptId\").value = \"\";\r\n\t\t\t\t//disableAllfield();\r\n\t\t\t} else if(statusCode == 600) {\r\n\t\t\t\talertify.alert(\"Passion already exists.\");\r\n\t\t\t} else if(statusCode == 602) {\r\n\t\t\t\talertify.alert(\"One profile should have maximum of 24 Passions.\");\r\n\t\t\t} else if(statusCode == 500) {\r\n\t\t\t\t// Error Message\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function ajoutRapport_mensuel(rapport_mensuel,suppression)\n {\n if (NouvelItemRapport_mensuel==false)\n { \n if (vm.session==\"AAC\")\n {\n apiFactory.getAPIgeneraliserREST(\"rapport_mensuel/index\",'menu','getrapportvalideById','id_rapport_mensuel',rapport_mensuel.id).then(function(result)\n {\n var rapport_mensuel_valide = result.data.response;\n if (rapport_mensuel_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé. Les données sont déjà validées!')\n .textContent('')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allrapport_mensuel = vm.allrapport_mensuel.filter(function(obj)\n {\n return obj.id !== rapport_mensuel.id;\n });\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceRapport_mensuel (rapport_mensuel,suppression); \n }\n });\n }\n else\n {\n test_existanceRapport_mensuel (rapport_mensuel,suppression); \n }\n \n } \n else\n {\n insert_in_baseRapport_mensuel(rapport_mensuel,suppression);\n }\n }", "async save() {\n try {\n await this._instance.save()\n } catch (error) {\n throw error\n }\n }", "function guardarMedicamento()\n{\n\tvar idMed=$(\"input#idMedicamento\").val();\n\tvar nombreC=$(\"input#nombrec\").val();\n\tvar nombreR=$(\"input#nombrer\").val();\n\tvar formaM=$(\"select#selectForma\").val();\n\tvar formulaM=$(\"textarea#formula\").val();\n\tvar dosisM=$(\"input#dosis\").val();\n\t\n\tobjetoMedicamento = { Id_Medicamento:idMed, Nomcien:nombreC, Nomreg:nombreR, Forma:formaM, Formula:formulaM, Dosis:dosisM};\n\tif(idMed == 0){\n\t\t//insertar Medicamento:\n\t\taccion = \"insertar\";\n\t}else{\n\t\t//Actualizar Medicamento:\n\t\taccion = \"actualizar\";\n\t}\n\tpeticionJSON = JSON.stringify(\n\t\t\t{\n\t\t\t\t\"Id\": generarID(),\n\t\t\t\t\"method\":accion,\n\t\t\t\t\"clase\": CLASE_MEDICAMENTOS,\n\t\t\t\t\"Params\":[objetoMedicamento]\n\t\t\t});\n\t$.post(GATEWAY_MEDICAMENTOS, peticionJSON, exitoGuardadoMedicamento);\n}", "function saveRide() {\n const ride = rideData();\n let u = uLog('user');\n ride.ride_user = u;\n let rides = getTableData('rides');\n ride.ride_id = rides.length + 1;\n if (ride.ride_name.length <= 0\n || ride.ride_dep.length <= 0\n || ride.ride_arr.length <= 0\n || ride.ride_dep_time.length <= 0\n || ride.ride_arr_time.length <= 0) {\n popU('No blank spaces');\n } else {\n if (ride.ride_dep === ride.ride_arr) {\n popU('The departure and arrival can\\'t called same');\n }\n if (ride.ride_dep_time >= ride.ride_arr_time) {\n popU('The arrival time can\\'t be less than the departure time')\n }\n if (ride.ride_days.length === 0) {\n popU('You must select at least one day for a ride');\n }\n else {\n insertToTable('rides', ride);\n document.getElementById('ride-add-form').reset();\n popU('Ride suscesfully added ' + u);\n renderTableRides('rides_user', 'rides');\n return true;\n }\n }\n}", "function onSave(type){\r\n\t//validating Cheque Number\r\n\tconsole.log(\"***** on Save fired ****\");\r\n\tvar okToSave=true;\r\n var sentby_cheque = nlapiGetFieldValue(\"custbody_tsa_sentbycheque\");\r\n \tvar sentby_cash = nlapiGetFieldValue(\"custbodytsa_sentbycash\");\r\n var sentby_bank = nlapiGetFieldValue(\"custbody_tsa_sentbybankcr\");\r\n \r\n var chequeNr = nlapiGetFieldValue(\"custbody_tsa_nsichequenum\");\r\n\tvar chequeNr_Field = nlapiGetField('custbody_tsa_nsichequenum');\r\n \r\n \tvar bank_acc = nlapiGetFieldValue(\"custpage_first_line_account\");\r\n\t\r\n \r\n if ( sentby_cheque==\"F\" && sentby_cash==\"F\" && sentby_bank==\"F\" ) {\r\n\t window.require(['N/translation'], function (translation) { // translations added by Viktor S. 04/2019\r\n\t\t\tvar msg_sentby_not_ticked = translation.get({collection: 'custcollection__tsa_collection_01', key: 'MSG_SENTBY_NOT_TICKED', locale: translation.Locale.CURRENT })();\r\n\t\t\talert(msg_sentby_not_ticked);\r\n\t\t});\r\n return false;\r\n }\r\n \r\n if(sentby_cheque==\"T\"){\r\n\t\tconsole.log(\"sentby is cheque\");\r\n\t\tokToSave= !!chequeNr;\r\n\t\t \r\n\t\tlocalStorage.setItem(\"field_label\", chequeNr_Field.getLabel() );\r\n\t\tif(!okToSave){\r\n\t\t\twindow.require(['N/translation'], function (translation) { \r\n\t\t\t\tvar msg_pls_enter_value = translation.get({collection: 'custcollection__tsa_collection_01', key: 'MSG_PLS_ENTER_VALUE', locale: translation.Locale.CURRENT })();\r\n\t\t\t\tvar field_label=localStorage.getItem(\"field_label\");\r\n\t\t\t\tconsole.log(\"in the window...\");\r\n\t\t\t\talert(msg_pls_enter_value+\" \"+field_label);\r\n\t\t\t});\r\n\t\t} \r\n }\r\n else{\r\n nlapiSetFieldValue(\"custbody_tsa_nsichequenum\",\"\",false,false);\r\n }\r\n\r\n if(sentby_bank==\"T\"){\r\n\t\tconsole.log(\"sentby is bank\");\r\n\t\tokToSave= !!bank_acc;\r\n\t\tif(!okToSave){\r\n\t\t\twindow.require(['N/translation'], function (translation) { \r\n\t\t\t\tvar msg_pls_enter_value = translation.get({collection: 'custcollection__tsa_collection_01', key: 'MSG_PLS_SELECT_BANK', locale: translation.Locale.CURRENT })();\r\n\t\t\t\tconsole.log(\"in the window...\");\r\n\t\t\t\talert(msg_pls_enter_value);\r\n\t\t\t});\r\n\t\t}\r\n }\r\n else{ }\r\n \r\n return okToSave;\r\n}", "function save(success, error){\r\n\r\n gameLoader.save(savedGameFile).then(function(message){ \r\n // Save success\r\n if(success) success();\r\n // console.log(message); \r\n }, function(err){\r\n if(error) error();\r\n // Save failure\r\n console.log(err)\r\n });\r\n}", "function save() {\n vm.donateModel.post().then(function () {\n Materialize.toast('Animal cadastrado com sucesso.', 3000);\n $location.path('/core/animals');\n });\n }", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function saveSituation(req, res){\n\t//check if referenced id of thing exists\n\tqueryThingAndTemplate(req.body.thing,\n\t\treq.body.situationtemplate, function(doc){\n\t\t\t//console.log(doc);\n\t\t\tif (doc[0] == null){\n\t\t\t\tinsertDocument(req.body,req.body.situationtemplate, function() {\n\t\t\t\t\tcheckCallbacks(req.body);\n\t\t\t\t\tres.json({message: \"Created\"});\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconsole.log(doc[0].sensorvalues);\n\t\t\t\tconsole.log(req.body.sensorvalues);\n\t\t\t\tif (doc[0].occured != req.body.occured || JSON.stringify(doc[0].sensorvalues) != JSON.stringify(req.body.sensorvalues)) {\n\t\t\t\t\tcheckCallbacks(req.body);\n\t\t\t\t\tupdateDocument(req.body,doc[0], req.body.situationtemplate, function(){\n\t\t\t\t\t\tres.json({message: \"Updated\"});\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\tres.json({message: \"No Update\"});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n}", "save() {\n\t\t// Rendering in PHP\n\t\treturn null;\n\t}", "save() {\n\t\t// Rendering in PHP\n\t\treturn null;\n\t}", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "function SaveComunidad(){\n\nvar nombre = $(\"#nombre\").val(); \nvar apellidos = $(\"#apellidos\").val(); \nvar telefono = $(\"#telefono\").val(); \n// var seccion = $(\"#seccion\").val(); \nvar comunidadId = $(\"#comunidadId\").val(); \nvar seccionvota = $(\"#seccionvota\").val(); \nvar nivel = $(\"#nivel\").val(); \n\nif(nombre == false)\n\t{\n\talert(\"Se necesita el campo nombre\");\n\t}\n\telse if(apellidos == false)\n\t{\n\talert(\"Se necesita el campo apellidos\");\n\t}\n\telse if(telefono == false)\n\t{\n\talert(\"Se necesita el campo telefono\");\n\t}\n\t// else if(seccion == false)\n\t// {\n\t// alert(\"Se necesita el campo seccion\");\n\t// }\n\telse if(comunidadId == false)\n\t{\n\talert(\"Se necesita el campo Comunidad\");\n\t}\n\telse if(seccionvota == false)\n\t{\n\talert(\"Se necesita el campo Seccion donde Vota\");\n\t}\n\telse if(nivel == false)\n\t{\n\talert(\"Se necesita el campo Nivel\");\n\t}\n\telse\n\t{\n\t\tvar img = $(\"#imgcrendencial\").val();\n\t\t\n\t\tif(img == false)\n\t\t{\n\t\t\tSaveSinImgCo();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSaveWidthImgCo();\n\t\t}\n\t\t\n\t\n\t}\n}", "saveBook(book) {\n // Hay, don't look like that ! I'm just an empty function D':\n }", "function guardarFromForm(data) {\n var flagError = false;\n var msgErrorParametros = 'Parámetros no validos';\n\n if (data.title === undefined || data.title === '') {\n flagError = true;\n }\n\n if (data.price === undefined || data.price === '') {\n flagError = true;\n }\n\n if (isNaN(parseFloat(data.price))) {\n flagError = true;\n }\n\n if (data.thumbnail === undefined || data.thumbnail === '') {\n flagError = true;\n }\n\n if (flagError) {\n return 400;\n } else {\n _data.lastID.lastID = _data.lastID.lastID + 1; // Se incrementa el lastID por que se va a guarda un nuevo valor.\n\n var objProducto = new _producto[\"default\"](data.title, data.price, data.thumbnail, _data.lastID.lastID);\n\n _data.productos.push(objProducto);\n\n _data.dbIDs.push(_data.lastID.lastID);\n\n return 200;\n }\n} //Funcion que se encarga de guardar los mensajes en tanto en la variable dinámica como en el archivo", "_saveVocab() {\n let deutsch = document.querySelector(\".deutsch\").value;\n let englisch = document.querySelector(\".englisch\").value;\n let notiz = document.querySelector(\".notiz\").value;\n\n if (deutsch != \"\" || englisch != \"\"){\n\n // zurück zu input!!\n\n this._vokabeln.saveNew({\n deutsch: deutsch,\n englisch: englisch,\n notiz: notiz,\n //format: html,\n });\n\n // aus JS auf andere Seite leiten\n this._app.showVocabularyOverview();\n this._app.navigate(\"/\");\n\n } else {\n alert(\"Bitte alle Angaben ausfüllen!♥\");\n }\n }", "saveProblem(pathname, response, problem, accountID) {\n //if (Server.problemIsValid(problem)) { //moved to database\n let problemName = Server.getSentID(pathname.substr(this.databaseActions[0].length));\n return this.database.saveProblem(this, response, accountID, problem, problemName);\n\n }", "function insert_in_baseMpe_soumissionaire(mpe_soumissionaire,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemMpe_soumissionaire==false)\n {\n getId = vm.selectedItemMpe_soumissionaire.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n id_prestataire: mpe_soumissionaire.id_prestataire,\n id_passation_marches: vm.selectedItemPassation_marches.id \n });\n console.log(datas);\n //factory\n apiFactory.add(\"mpe_soumissionaire/index\",datas, config).success(function (data)\n { var nb_offre = 0;\n var press= vm.allprestataire.filter(function(obj)\n {\n return obj.id == mpe_soumissionaire.id_prestataire;\n });\n\n if (NouvelItemMpe_soumissionaire == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n { \n vm.selectedItemMpe_soumissionaire.prestataire = press[0];\n \n vm.selectedItemMpe_soumissionaire.$selected = false;\n vm.selectedItemMpe_soumissionaire.$edit = false;\n vm.selectedItemMpe_soumissionaire ={};\n }\n else \n { \n vm.allmpe_soumissionaire = vm.allmpe_soumissionaire.filter(function(obj)\n {\n return obj.id !== vm.selectedItemMpe_soumissionaire.id;\n });\n nb_offre= parseInt(vm.selectedItemPassation_marches.nbr_offre_recu) - 1;\n //miseajourPassation_marches(vm.selectedItemPassation_marches,0,nb_offre);\n }\n }\n else\n {\n mpe_soumissionaire.prestataire = press[0]; ; \n\n mpe_soumissionaire.id = String(data.response); \n NouvelItemMpe_soumissionaire=false;\n\n nb_offre= parseInt(vm.selectedItemPassation_marches.nbr_offre_recu) + 1;\n //miseajourPassation_marches(vm.selectedItemPassation_marches,0,nb_offre);\n }\n vm.selectedItemPassation_marches.nbr_offre_recu = nb_offre\n mpe_soumissionaire.$selected = false;\n mpe_soumissionaire.$edit = false;\n vm.selectedItemMpe_soumissionaire = {};\n vm.allprestataire = [];\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function insert_in_baseMpe_soumissionaire(mpe_soumissionaire,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemMpe_soumissionaire==false)\n {\n getId = vm.selectedItemMpe_soumissionaire.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n id_prestataire: mpe_soumissionaire.id_prestataire,\n id_passation_marches: vm.selectedItemPassation_marches.id \n });\n console.log(datas);\n //factory\n apiFactory.add(\"mpe_soumissionaire/index\",datas, config).success(function (data)\n { var nb_offre = 0;\n var press= vm.allprestataire.filter(function(obj)\n {\n return obj.id == mpe_soumissionaire.id_prestataire;\n });\n\n if (NouvelItemMpe_soumissionaire == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n { \n vm.selectedItemMpe_soumissionaire.prestataire = press[0];\n \n vm.selectedItemMpe_soumissionaire.$selected = false;\n vm.selectedItemMpe_soumissionaire.$edit = false;\n vm.selectedItemMpe_soumissionaire ={};\n }\n else \n { \n vm.allmpe_soumissionaire = vm.allmpe_soumissionaire.filter(function(obj)\n {\n return obj.id !== vm.selectedItemMpe_soumissionaire.id;\n });\n nb_offre= parseInt(vm.selectedItemPassation_marches.nbr_offre_recu) - 1;\n //miseajourPassation_marches(vm.selectedItemPassation_marches,0,nb_offre);\n }\n }\n else\n {\n mpe_soumissionaire.prestataire = press[0]; ; \n\n mpe_soumissionaire.id = String(data.response); \n NouvelItemMpe_soumissionaire=false;\n\n nb_offre= parseInt(vm.selectedItemPassation_marches.nbr_offre_recu) + 1;\n //miseajourPassation_marches(vm.selectedItemPassation_marches,0,nb_offre);\n }\n vm.selectedItemPassation_marches.nbr_offre_recu = nb_offre\n mpe_soumissionaire.$selected = false;\n mpe_soumissionaire.$edit = false;\n vm.selectedItemMpe_soumissionaire = {};\n vm.allprestataire = [];\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "function saveValidity()\r\n{\r\n\tupdateGateKpr(arrEntp[gArrayIndex]);\r\n}", "function ajoutDocument_prestataire_scan(document_prestataire_scan,suppression)\n {\n if (NouvelItemDocument_prestataire_scan==false)\n {\n apiFactory.getAPIgeneraliserREST(\"document_prestataire_scan/index\",'menu','getdocumentvalideById','id_document_prestataire_scan',document_prestataire_scan.id_document_prestataire_scan).then(function(result)\n {\n var document_prestataire_scan_valide = result.data.response;\n if (document_prestataire_scan_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé.')\n .textContent('Les données sont déjà validées!')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n /*document_prestataire_scan.$edit = false;\n document_prestataire_scan.$selected = false;\n document_prestataire_scan.fichier = currentItemDocument_prestataire_scan.fichier ;\n document_prestataire_scan.date_elaboration = currentItemDocument_prestataire_scan.date_elaboration ;\n document_prestataire_scan.observation = currentItemDocument_prestataire_scan.observation ;*/\n\n document_prestataire_scan.fichier = null;\n document_prestataire_scan.date_elaboration = null ;\n document_prestataire_scan.observation = null ;\n document_prestataire_scan.$edit = false;\n document_prestataire_scan.$selected = false;\n\n document_prestataire_scan.id_document_prestataire_scan = null;\n document_prestataire_scan.validation = null ;\n document_prestataire_scan.existance = false ;\n vm.selectedItemDocument_prestataire_scan = {} ;\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existanceDocument_prestataire_scan (document_prestataire_scan,suppression); \n }\n }); \n } \n else\n {\n insert_in_baseDocument_prestataire_scan(document_prestataire_scan,suppression);\n }\n }", "function va01Save(){\r\n\r\n\tonscreen 'SAPLSPO2.0300'\r\n\t\tHANDLE_POPUP_0300:;\r\n\t\tenter('=OPT1');\r\n\r\n\tonscreen 'SAPLATP4.0500'\r\n\t\tenter('=WEIT');\r\n\r\n\tonscreen 'SAPLSPO2.0300'\r\n\t\tgoto HANDLE_POPUP_0300\r\n\t\t\r\n\tonscreen 'SAPMV45A.4001'\r\n\t\tgoto SAPMV45A_3;\r\n\tonscreen 'SAPMV45A.4008'\r\n\t\tSAPMV45A_3:;\t\r\n\t\tif(_message){\r\n\t\t\tprintln('----------------------------------:' + _message);\r\n\t\t\tif(_message.indexOf('has been saved') > -1) {\t// If String is found\r\n\t\t\t\tmessage(\"S: \"+_message);\r\n\t\t\t\tset(\"V[z_vaxx_*]\",\"\");\r\n\t\t\t\tset(\"V[z_va01_*]\",\"\");\r\n\t\t\t\tset('V[z_va02_order]', _message.replace(/\\D/g,''));\r\n\t\t\t\tenter('/n');\r\n\t\t\t\tgoto SCRIPT_END;\r\n\t\t\t}\r\n\t\t\tif(_message.substring(0,2) == 'E:'){\r\n\t\t\t\tmessage(_message);\r\n\t\t\t\tenter('?');\r\n\t\t\t\tgoto SCRIPT_END;\r\n\t\t\t}\r\n\t\t}\r\n\tSCRIPT_END:;\r\n\t\r\n}", "function saveUnitHandler() {\n var dim;\n\n var unit = new NaturalUnit();\n\n // update organization record\n unit.OrganizationID = currentOrg.ID;\n unit.Name = $(\"#txtName\").val();\n unit.Description = $(\"#txtDescription\").val();\n unit.isActive = 1;\n unit.UserID = UserID;\n\n saveNaturalUnit(unit, null, pmmodaErrorHandler);\n }", "function handleSchnitt(callback, sID) {\n\tdb_readMultiData(function (Leistungen) {\n\t\tconsole.log(\"INFO: Schnittberechnung wird durchgeführt\");\n\t\tdb_dynamicUpdate(\n\t\t\tcallback,\n\t\t\tfunction (Student) { // Apply (anonym wegen Argumente)\n\t\t\t\treturn schnitt_gesamt(Student, Leistungen);\n\t\t\t}, \"student\", sID);\n\t}, \"leistung\", function () {\n\t\tconsole.log(\"INFO: keine Schnittberechnung wegen leerer DB-Abfrage\");\n\t\tcallback();\n\t}\n\t);\n}", "function guardar(){\n\n\tif(validateFields()){\n\t\tvar publicacion = new Publicacion(getValue('nombreID'), getValue('contactoID'), \n\t\tgetValue('estadoID'), getValue('ciudadID'), \n\t\tgetValue('shortDesc'), getValue('longDesc'));\n\n\t\tvar item = Object.assign({}, publicacion);\n\t\tdb.collection(COL_ORG).add(item).then(\n\t\tdata => {\n\t\t\talert('Guardado');\n\t\t\tconsole.log(\"Datos guardados exitosamente!!!\", data);\n\t\t\twindow.close();\n\t\t},\n\t\terror => {\n\t\t\talert('Error');\n\t\t\tconsole.error(\"Ocurrio un error al guardar los datos!!!\", error);\n\t\t});\n\t}else{\n\t\talert('Error: llena todos los campos.');\n\t}\n\n\n\t\n}", "function store(res, request) {\n request.save(function (err, storedRequest) {\n if (err) {\n res.status(500).send({ message: \"Ocurrió un error interno, comuniquese con el Administrador\" });\n } else {\n if (!storedRequest) {\n res.status(500).send({ message: \"Ocurrió un error al guardar el préstamo, comuniquese con el Administrador\" });\n } else {\n res.status(201).send({ request: storedRequest });\n }\n }\n });\n}", "function guardar_ejercicio(){\n\tsalvaEstado()\n\tif(no_identificado)\n\t{\n\t\tif(confirm(\"Los resultados se han guardado temporalmente.\\n\\n\"+\n\t\t\t\"Para guardar definitivamente y poder recuperarlos mas adelante debe registrarse o identificarse.\\n\\n\"+\n\t\t\t\"¿Desea registrarse ahora?\"))\n\t\t\twindow.location=\"pag420\";\n\t}\n\treturn false;\n}", "save() {\n this.db.write();\n }", "function _saveLocalRecord() {\n\n // get all vars (don't worry if they've been changed).\n var columnList = [];\n columnList.push({ column: \"playername\", value: firstname });\n columnList.push({ column: \"coachname\", value: coachname });\n columnList.push({ column: \"clubname\", value: clubname });\n columnList.push({ column: \"path\", value: path });\n columnList.push({ column: \"thumbnail\", value: thumbnail });\n columnList.push({ column: \"shottype\", value: viewModel.get(\"shotTypeIndex\") });\n columnList.push({ column: \"ratingtype\", value: viewModel.get(\"ratingTypeIndex\") });\n columnList.push({ column: \"playerid\", value: playerId });\n columnList.push({ column: \"coachid\", value: coachId });\n columnList.push({ column: \"clubid\", value: clubId });\n var dateCheck = viewModel.get(\"date\");\n var timeCheck = viewModel.get(\"time\");\n columnList.push({ column: \"date\", value: new Date(dateCheck + \" \" + timeCheck) });\n \n // build query. Add each item to the query procedurally\n var query = \"INSERT INTO \" + LocalSave._tableName + \" (\";\n var first = true;\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += item.column;\n first = false;\n }\n query += \") VALUES (\";\n first = true;\n var valList = [];\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += \"?\";\n first = false;\n valList.push(item.value);\n }\n query += \");\";\n\n // run query.\n var complete = new Promise(function (resolve, reject) {\n db.queryExec(query, valList,\n function (id) {\n console.log(\"Saved new shot with id \" + id);\n resolve(id);\n },\n function (err) {\n reject(err);\n });\n });\n\n // handle query after it has completed\n complete.then(\n function (val) {\n if (page.android) {\n var Toast = android.widget.Toast;\n Toast.makeText(application.android.context, \"New Shot Saved\", Toast.LENGTH_SHORT).show();\n }\n // leave page\n var navigationOptions = {\n moduleName: \"record-shot-page\",\n backstackVisible: false\n };\n frameModule.topmost().navigate(navigationOptions);\n },\n function (err) {\n _unlockFunctionality();\n });\n}", "async function save_callback(ev) {\n ev.preventDefault();\n\n save_data();\n}", "save(saveCode) {\n if (saveCode === Constants.SaveCodes.NOSAVE) {\n this.client.disconnect();\n process.exit(Constants.SaveCodes.NOSAVE);\n }\n\n Skarm.saveLog(\"\\n\\nBeginning save sequence...\");\n\n\n Guilds.save();\n Users.save();\n this.comics.save();\n\n Skarm.saveLog(\"Beginning push to cloud storage...\");\n\n let savior = spawn('powershell.exe', [Constants.skarmRootPath + 'saveData.ps1']);\n savior.stdout.on(\"data\", (data) => {\n data = data.toString().replaceAll(\"\\r\",\"\").replaceAll(\"\\n\",\"\");\n if(data.length > 1)\n Skarm.saveLog(data);\n });\n savior.stderr.on(\"data\", (data) => {\n data = data.toString().replaceAll(\"\\r\",\"\").replaceAll(\"\\n\",\"\");\n if(data.length > 1)\n Skarm.saveLog(data);\n });\n savior.on('exit', (code) => {\n console.log(\"Received code: \" + code + \" on saving data.\");\n if (saveCode === Constants.SaveCodes.DONOTHING)\n return;\n if (saveCode === undefined)\n return;\n setTimeout(() => {\n this.client.disconnect();\n process.exit(saveCode);\n }, 2000);\n });\n\n }", "function ClickSalvar() {\n AtualizaGeral(); // garante o preenchimento do personagem com tudo que ta na planilha.\n var nome = gPersonagem.nome.length > 0 ? gPersonagem.nome : 'saved_entradas';\n if (nome == '--') {\n Mensagem('Nome \"--\" não é válido.');\n return;\n }\n HabilitaOverlay();\n SalvaNoArmazem(nome, JSON.stringify(gEntradas), function() {\n CarregaPersonagens();\n DesabilitaOverlay();\n Mensagem(Traduz('Personagem') + ' \"' + nome + '\" ' + Traduz('salvo com sucesso.'));\n });\n}", "function save() {\n if (document.getElementById(\"title\").value == \"\") {\n alert(\"Stitch Title must not be blank!\");\n return\n }\n if (document.getElementById(\"input_text\").value == \"\") {\n alert(\"There needs to be some stiches added first!\");\n return\n }\n if (get_input() == \"stitch\") {\n switch_input()\n }\n window.location.replace(\"save?lines=\" + document.getElementById(\"input_text\").value.replace(/\\n/g, \"-\") + \"&colour=\" + document.getElementById(\"color_choice\").value.replace(\"#\", \"\") + \"&title=\" + document.getElementById(\"title\").value);\n}", "function guardarOK(numeroSol, lote) {\n\n var vLote = ''\n eval('frmFormulario').oculto = 'N';\n txt_to(\"lblNumeroSolicitudesRegistradasXX\",numeroSol);\n if (lote != null)\n vLote = lote;\n \n set('frmFormulario.oidLote',vLote);\n //set('frmFormulario.lote',vLote);\n set('frmFormulario.numeroSolicitudesRegistradas',numeroSol);\n \n\t\tlimpiarListaClientes();\n\t\t// Habilita el botón Guardar del menú secundario\n\t\tbtnProxy(1, '1'); \n\t}" ]
[ "0.6628752", "0.6422631", "0.6335497", "0.6316256", "0.6288652", "0.6286282", "0.6275508", "0.62487173", "0.6214662", "0.61547756", "0.6128763", "0.6115053", "0.6101809", "0.609764", "0.60941136", "0.6058612", "0.60518914", "0.60399634", "0.6038855", "0.6025671", "0.59949356", "0.59932625", "0.59910476", "0.5987226", "0.59715486", "0.5967654", "0.5943439", "0.59408545", "0.5930666", "0.5911949", "0.58842105", "0.5815539", "0.580858", "0.579979", "0.5796242", "0.5796242", "0.5795063", "0.5792742", "0.5792231", "0.57888556", "0.5786219", "0.5772176", "0.57702416", "0.57474875", "0.57424736", "0.5739374", "0.57246184", "0.57193804", "0.5707816", "0.5707593", "0.5697423", "0.5688835", "0.56866443", "0.5683627", "0.5670516", "0.56657594", "0.56626326", "0.56618834", "0.56601685", "0.5651852", "0.5651045", "0.56452245", "0.5642745", "0.5636584", "0.5636584", "0.5623289", "0.561713", "0.56104785", "0.5609633", "0.56033844", "0.56000656", "0.55961823", "0.55928767", "0.5586701", "0.5586701", "0.55862886", "0.55826247", "0.55826247", "0.5581881", "0.5571706", "0.55711657", "0.55626744", "0.5552607", "0.55446833", "0.5542546", "0.5542546", "0.55413973", "0.55401266", "0.55278945", "0.55268216", "0.5523264", "0.55219686", "0.5520479", "0.55108607", "0.5509316", "0.55007374", "0.54990935", "0.54986507", "0.54906523", "0.54891086", "0.548467" ]
0.0
-1
Displays recent tokens as quick search links
function QueryRecentTokens() { var email = CacheStoreGet("email"); var authToken = CacheStoreGet("token"); var data = { Email: email, AuthToken: authToken, Latitude: userLat, Longitude: userLng }; $.ajax({ type: "POST", url: "../note/QueryRecentTokens", data: data, success: function (response) { if (response != null) { localStorage.setItem("recentTokens", JSON.stringify(response)); PopulateRecentTokenDisplays(response); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayChanges(tiddlers) {\n $.each(tiddlers, function(index, tiddler) {\n if (!tiddler.type \n || tiddler.type.match(/^text/)) {\n $.each(tiddler.tags, function(index, tag) {\n recentTags.add(tag);\n })\n var penSpan = $('<span>').text('\\u270E')\n .bind('click', function() {\n var title = $(this).parent().attr('data-tiddler-title');\n $(window).unbind('hashchange');\n window.location.hash = title;\n $(window).bind('hashchange', checkHash);\n startEdit(title);\n });\n var tiddlerLink = $('<a>').attr({\n href: '/' + encodeURIComponent(tiddler.title),\n target: '_blank'})\n .text(tiddler.title)\n var list = $('<li>').attr('data-tiddler-title',\n tiddler.title).append(tiddlerLink).prepend(penSpan);\n $('#recents > ul').append(list);\n }\n });\n updateTags(recentTags);\n}", "function showRecentSearches() {\n if (JSON.parse(localStorage.getItem('userSearches')) != null) {\n searchesArray = JSON.parse(localStorage.getItem('userSearches'));\n previousSearchesList.innerHTML = \"\"\n for (var i = 0; i < searchesArray.length; i++) {\n var searchItem = document.createElement(\"li\")\n searchItem.innerHTML = searchesArray[i]\n previousSearchesList.appendChild(searchItem)\n }\n }\n}", "function displaySearchResults(query){\n\t// create the complete url\n\tvar wiki_url = base_url + query;\n\tconsole.log(wiki_url);\n\t$.getJSON(wiki_url, function(json){\n\t\tvar result = json[\"query\"][\"search\"];\n\t\tfor(var i=0; i<result.length; i++){\n\t\t\tconsole.log(result[i]);\n\t\t\turl_link = base_redirect + result[i].title.replace(\" \", \"%20\");\n\t\t\t$(\"#content\").append(\"<a href='\" + url_link + \"' class='list-group-item' target='_blank'><h3>\"\n\t\t\t+ result[i].title + \"</h3><br>\" + result[i].snippet + \"<br></a>\");\n\t\t}\n\t});\n\t\n}", "function lastfollowUpSearch() {\r\n lastfollowUpWord = 'third';\r\n findLastWord(lastfollowUpWord);\r\n\r\n function findLastWord(lastfollowUpWord){\r\n document.getElementById('lastFollowUp').innerHTML = lastfollowUpWord;\r\n lastfollowUpWord = lastfollowUpWord.replace('/\\s+/g', '_');\r\n console.log('Querying: ' + lastfollowUpWord); // to show what youaresearching for\r\n let urlExtractcontent = urlforContent + lastfollowUpWord;\r\n console.log(urlExtractcontent);\r\n \r\n lasthyperlink = `https://en.wikipedia.org/wiki/${lastfollowUpWord}`;\r\n WikiLink(lasthyperlink) //get hyperlink\r\n\r\n loadJSON(urlExtractcontent, gotContent, 'jsonp'); //load content\r\n \r\n wordHistory.push(lastfollowUpWord);\r\n document.getElementById('searchedWords').innerHTML = wordHistory; //get wordHistory\r\n }\r\n \r\n // start of defining functions\r\n function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let lastfollowUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = lastfollowUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = lastfollowUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('lastContentDisplay').innerHTML =secondDescription;\r\n }\r\n\r\n function WikiLink(lasthyperlink) {\r\n var str = lasthyperlink;\r\n var result = str.link(lasthyperlink);\r\n document.getElementById(\"getLastLink\").innerHTML = result;\r\n }\r\n}", "editTokens() {\n return this.gotoState('dbaas-logs.detail.tokens');\n }", "function followUpSearch(){\r\n followUpWord = 'second' // change this\r\n findWord(followUpWord);\r\n\r\n function findWord(followUpWord){\r\n document.getElementById('followUp').innerHTML = followUpWord;\r\n followUpWord = followUpWord.replace('/\\s+/g', '_');\r\n console.log('Querying: ' + followUpWord); // to show what youaresearching for\r\n let urlExtractcontent = urlforContent + followUpWord;\r\n console.log(urlExtractcontent);\r\n secondhyperlink = `https://en.wikipedia.org/wiki/${followUpWord}`;\r\n \r\n WikiLink(secondhyperlink) //get hyperlink\r\n\r\n loadJSON(urlExtractcontent, gotContent, 'jsonp'); //load content\r\n \r\n wordHistory.push(followUpWord);\r\n document.getElementById('searchedWords').innerHTML = wordHistory; //get wordHistory\r\n }\r\n \r\n // start of defining functions\r\n function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let followUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = followUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = followUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('secondContentDisplay').innerHTML =secondDescription; \r\n }\r\n\r\n function WikiLink(secondhyperlink) {\r\n var str = secondhyperlink;\r\n var result = str.link(secondhyperlink);\r\n document.getElementById(\"getSecondLink\").innerHTML = result; \r\n }\r\n}", "function tokenHandler( result )\n{\n $( \"#app-status-ul\" ).append( '<li>token: ' + result + '</li>' );\n}", "function showToken(currentToken) {\r\n // Show token in console and UI.\r\n const tokenElement = document.querySelector(\"#token\");\r\n !!tokenElement && (tokenElement.textContent = currentToken);\r\n}", "function _build_token_link(url, token, token_name){\n\tvar new_url = url;\n\n\t// Default to \"barista_token\".\n\tif( ! token_name ){ token_name = 'barista_token'; }\n\n\tif( token ){\n\t if( new_url.indexOf('?') === -1 ){\n\t\tnew_url = new_url + '?' + token_name + '=' + token;\n\t }else{\n\t\tnew_url = new_url + '&' + token_name + '=' + token;\n\t }\n\t}\n\n\treturn new_url;\n }", "function _build_token_link(url, token, token_name){\n\tvar new_url = url;\n\n\t// Default to \"barista_token\".\n\tif( ! token_name ){ token_name = 'barista_token'; }\n\n\tif( token ){\n\t if( new_url.indexOf('?') === -1 ){\n\t\tnew_url = new_url + '?' + token_name + '=' + token;\n\t }else{\n\t\tnew_url = new_url + '&' + token_name + '=' + token;\n\t }\n\t}\n\n\treturn new_url;\n }", "function getRecentSearches() {\n rss.get(function(data) {\n var html = window.recentSearchesCompiled({searches: data});\n $$('.state-place').html(html);\n });\n }", "function showNextArticles() {\n showLatestArticles();\n}", "function showResults(result) {\n\n // set t\n var content = '';\n var nextButton = document.querySelector('#next-button');\n var prevButton = document.querySelector('#prev-button');\n\n\n\n result.items.forEach(function(item){\n content +=\n '<div class=\"col-md-4\"><div class=\"thumbnail\"><a href=\"https://www.youtube.com/watch?v=' + item.id.videoId + '\" data-youtube-id=\"' + item.id.videoId + '\"><img src=\"' + item.snippet.thumbnails.medium.url + '\" alt=\"...\"/></a><div class=\"caption\"><h3><a href=\"https://www.youtube.com/channel/' + item.snippet.channelId + '\">More from this channel</h3></div></div></div>';\n });\n\n document.querySelector('#search-results').innerHTML = content;\n\n\n if (result.nextPageToken) {\n nextButton.setAttribute('data-token', result.nextPageToken);\n nextButton.setAttribute('data-show', true);\n } else {\n nextButton.setAttribute('data-show', false);\n }\n\n if (result.prevPageToken) {\n prevButton.setAttribute('data-token', result.prevPageToken);\n prevButton.setAttribute('data-show', true);\n } else {\n prevButton.setAttribute('data-show', false);\n }\n}", "function getLink(url, term, label) {\n formattedTerm = term.split(' ').join('+');\n return \"<a target=\\\"_blank\\\" href=\\\"\" + url + formattedTerm + \"\\\" title=\\\"View results on \" + label + \"\\\"\\\">\" + term + \"</a>\";\n}", "function displaySearchHistory() {\n const key = 'Search History';\n var searchHistory = JSON.parse(localStorage.getItem(key) || \"[]\");\n var buttons = [];\n\n for (var i = 0; i < searchHistory.length; i++) {\n buttons.push('<button class=\"btn btn-secondary col-12 addedButton\">' + searchHistory[i] + '</button>');\n }\n\n $('.searchHistory').html(buttons.join(\"\"));\n}", "function wikiQuery(data) {\n var articleHTML = '<ul class=article-list pure-u-1\">';\n\n $.each(data.query.pages, function(i, article) {\n articleHTML += '<li class=\"clearfix pure-u-1\">';\n articleHTML += '<a target=\"_blank\" href=\"';\n articleHTML += article.fullurl;\n articleHTML += '\">';\n articleHTML += '<div class=\"output-text pure-u-lg-1\">';\n articleHTML += '<h2>'\n articleHTML += article.title;\n articleHTML += '</h2>'\n articleHTML += article.extract;\n articleHTML += '</div>';\n articleHTML += '</a>';\n });\n\n articleHTML += '</ul>';\n $('#search-output').css( \"opacity\", 1 );\n $('#search-output').html(articleHTML).animate({\n opacity: 1\n }, 1000 );\n\n $('.output-text p:last-child').append(\"...\");\n }", "function showResults(json) {\n document.getElementById('results').innerHTML = `<a href=${json.html_url}>${\n json.html_url\n }</a>`;\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 }", "function token2(r) {\n\t\tfor (var j = 0; j < r.length; j++) {\n\t\t\tif (r[j].match(srr[0], \"g\") && r[j].match(srr[1], \"g\")) {\n\t\t\t\t$('<p>').html(r[j]).appendTo(\"#demo-1\");\n\t\t\t\tscnt++;\n\t\t\t}\n\t\t}\n\t\tsearchql = true;\n\t\thlsSyntax(srr[0]);hlsSyntax(srr[1]);\n\t\tresultCall();\n\t}", "function getNewTokens() {\n const fakeQuery = {\n state: state,\n code: //Enter your code here\n }\n\n reddit.oAuthTokens(\n state,\n fakeQuery,\n function (success) {\n // Print the access and refresh tokens we just retrieved\n console.log(reddit.access_token);\n console.log(reddit.refresh_token);\n }\n );\n}", "function openRecentHistory(aURL) {\n let oncommand =\n 'PlacesUIUtils.markPageAsTyped(\"%url%\");' +\n 'openUILink(\"%url%\",event);';\n oncommand = oncommand.replace(/%url%/g, aURL);\n\n return {\n oncommand,\n onclick: 'checkForMiddleClick(this,event);'\n };\n }", "function renderHistoryList() {}", "showRecentSearch() {\n this.recentDropdownOpen = true;\n this.dropdownOpen = true;\n this._googlePlacesService.getRecentList(this.settings.recentStorageName).then((result) => {\n if (result) {\n this.queryItems = result;\n }\n else {\n this.queryItems = [];\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 displayMostRecentlySearched(mostRecentlySearched) {\n mostRecentlySearched = mostRecentlySearched.reverse();\n mostRecentlySearched.forEach(function( eventSearched, index ) {\n \tif(index <= 10 && eventSearched !== '') {\n\t \tvar html = `\n\t \t\t<button class=\"btn searches\">${eventSearched}</button>\n\t \t`;\n\t \t$('#recent-event-searches').append(html); \t\t\n \t}\n });\n \n $(document).ready(function(){\n $('#recent-event-searches').slick({\n slidesToShow: 5,\n slidesToScroll: 2,\n autoplay: true,\n autoplaySpeed: 5000,\n variableWidth: true,\n responsive: [\n {\n breakpoint: 768,\n settings: {\n centerMode: true,\n centerPadding: '40px',\n slidesToShow: 3,\n slidesToScroll: 1\n }\n },\n {\n breakpoint: 480,\n settings: {\n centerPadding: '40px',\n slidesToShow: 1,\n slidesToScroll: 1\n }\n }\n ]\n });\n });\n }", "function showHelp() {\n\t$(\"#info\").html(`Search for an artist that has live shows <i>(albums with a full date in the title)</i> available on Spotify, e.g. <a href=\"index.html?q=grateful-dead\">Grateful Dead</a> or <a href=\"index.html?q=the-allman-brothers-band\">The Allman Brothers Band</a>, to see their live shows in chronological order. Looks best on Chrome or Firefox, and designed to work on mobile and tablets as well.`);\n}", "function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu(\"Tokenstats\")\n .addItem(\"How To\", \"HowTo\")\n .addToUi();\n}", "function updateSearchHistory() {\r\n\t// displays searches alphabetically\r\n\t// getSearches returns searches in order of when they occurred\r\n\t\r\n\tvar taskIdx = selectedTaskIdx();\r\n\tvar searches = getSearches(taskIdx);\r\n\tif (searches.length==0) {\r\n\t\t$(\"#search_history\").html('No searches, yet');\r\n\t}\r\n\telse {\r\n\t\tvar sortedSearches = sortSearchesAlphabetically(taskIdx);\r\n\t\tvar html = '<ol>';\r\n\t\tfor (var i=0; i<sortedSearches.keys.length; i++) {\r\n\t\t\tvar key = sortedSearches.keys[i];\r\n\t\t\tvar search = sortedSearches.dict[key];\r\n\t\t\tvar query = search.query;\r\n\t\t\tvar links = search.links;\r\n\t\t\thtml += \"<li>\";\r\n\t\t\thtml += htmlEscape(query);\r\n\t\t\tif (links.length > 0) {\r\n\t\t\t\thtml += '<ul class=\"search_history_links\">';\r\n\t\t\t\tfor (var j=0; j<links.length; j++) {\r\n\t\t\t\t\tvar link = links[j];\r\n\t\t\t\t\tvar rating = link.rating == null ? UNRATED : link.rating;\r\n\t\t\t\t\thtml += '<li class=\"' + rating + '\">';\r\n\t\t\t\t\thtml += getLinkHtml(link.url, link.title, 20, rating, \"return onHistoryLinkClicked(event,'\"+htmlEscape(query)+\"');\");\r\n\t\t\t\t\thtml += \"&nbsp;\";\r\n\t\t\t\t\thtml += getRatingImage(rating);\r\n\t\t\t\t\thtml += '</li>';\r\n\t\t\t\t}\r\n\t\t\t\thtml += '</ul>';\r\n\t\t\t}\r\n\t\t\thtml += '</li>';\r\n\t\t}\r\n\t\thtml += '</ol>';\r\n\t\t$(\"#search_history\").html(html);\r\n\t}\r\n}", "function display(data) {\n var pages = data.query.pages\n var link = \"https://en.wikipedia.org/?curid=\";\n for(object in pages) {\n var id = pages[object].pageid\n\n $(\".results\").append(`<a href=\"${link+id}\"><div class=\"item\"><h6>${pages[object].title}</h6><p class=\"extract\">${pages[object].extract}</p></div></a>`);\n\n }\n}", "getUserTOCEntry() {\n let html = \"<ul>\";\n this.userIDs.forEach((obj) => {\n let name = Formatter.formatTitle(obj.name); //remove prefix\n html += `<li><a href=#${obj.id}>${name}</a>`;\n });\n html += \"</ul>\";\n return html;\n }", "function viewMoreVisitHistory() {\r\n\tajaxSend( \"./findMoreVisit.json\" \r\n\t\t\t, { cmStorSeq\t\t: clickedCmStorSeq\r\n\t\t\t\t, pageNo \t\t: ++pageVisitNo\r\n\t\t\t }\r\n\t\t\t, viewMoreVisitHistoryAft );\r\n}", "function quickSearchButton_click() {\n //Begin Search Animation\n var $quickSearchResultsListWrapper = $(\"#QuickSearchResultsListWrapper_helm\");\n var $quickSearchProgressLoaderWrapper = $(\"#QuickSearchProgressLoaderWrapper_helm\");\n quickSearchResults_show(true);\n showProgressSpinner(true, \"#QuickSearchResultsContentTab_helm\");\n var quickSearch = quickSearchOptions_GetUserDefinedValues(); //Gather the search options specified by user and package them in QuickSearchOptions_helm javascript object\n quickSearch.recentSearches.save.call(quickSearch); //save the quick search in recent quick searches\n //\n helm.xhr.getQuickSearchResults(quickSearch.toJSON()).promise().done(function() {\n showProgressSpinner(false,\"#QuickSearchResultsContentTab_helm\");\n });\n if (Compass.Global.isLoanSelected && helm.DisplayMode !== \"QuickSearchRecentlyViewedOnly\") { //a setting/check for is in iquote mode would be better here.\n helm.showBasicLoanDetailsInPageHeader(true);\n }\n }", "function displayResults(json) {\n let articles = json.response.docs;\n\n while (section.firstChild) {\n section.removeChild(section.firstChild);\n }\n\n\n\n if(articles.length === 0) {\n console.log(\"No results\");\n } else {\n for(let i = 0; i < articles.length; i++) {\n let article = document.createElement('article');\n let heading = document.createElement('h2');\n let link = document.createElement('a');\n let img = document.createElement('img'); \n let para = document.createElement('p'); \n let clearfix = document.createElement('div');\n\n let current = articles[i]; \n console.log(\"Current:\", current); \n\n link.href = current.web_url; \n link.target ='blank'; //opens a new tab\n link.textContent = current.headline.main; \n\n para.textContent = 'Keywords: '; // #1\n\n \n for(let j = 0; j < current.keywords.length; j++) {\n let span = document.createElement('span'); \n span.textContent += current.keywords[j].value + ' '; \n para.appendChild(span); //attach the 'span' to the keywords (see #1 above)\n }\n\n if(current.multimedia.length > 0) {\n img.src = 'http://www.nytimes.com/' + current.multimedia[0].url;\n img.alt = current.headline.main;\n }\n\n clearfix.setAttribute('class','clearfix');\n\n article.appendChild(heading);\n heading.appendChild(link);\n article.appendChild(para);\n article.appendChild(clearfix);\n section.appendChild(article);\n }\n }\n\n if(articles.length === 10){\n nav.style.display = 'block';\n previousBtn.style.display = 'block';\n nextBtn.style.display = 'block';\n } else if (articles.length < 10 && pageNumber > 0) {\n nav.style.display = 'block';\n previousBtn.style.display = 'block';\n nextBtn.style.display = 'none';\n } else {\n nav.style.display = \"none;\"\n }\n\n\n\n // if(articles.length >= 10 && pageNumber == 0) { //more than 1 page of results but on 1st page\n // nav.style.display = 'block'; //shows the nav display if 10 items are in the array\n // previousBtn.style.display = 'none';\n // nextBtn.style.display = 'block'; // shows the nav display if 10 items are in array\n // } else {\n // nav.style.display = 'none'; //hides the nav display if less than 10 items are in the array\n // } \n }", "function displayHistory() {\n let list = unorderedListTemplateStartTag;\n \n guesses.forEach((guess) => {\n list += historyMessageTemplate\n .replace(historyReplacePattern, guess.Number)\n .replace(historyStateReplacePattern, guess.State);\n });\n\n list += unorderedListTemplateEndTag;\n \n $('#history').html(list);\n}", "function changes() {\n $('#recents > ul').empty();\n $.ajax({\n dataType: 'json',\n headers: {'Cache-Control': 'max-age=0'},\n url: host + 'search?q=bag:' + encodeURIComponent(space)\n + '_public%20OR%20bag:' + encodeURIComponent(space)\n + '_private',\n success: displayChanges\n });\n checkHash();\n}", "function renderHistory() {\n document.getElementById('searchHistory').innerHTML = searchHistoryList.reduce(\n // allSearches = variable for initial value of reduce\n // cityObject = is each item within the list sequentially\n (allSearches, cityObject) => {\n return allSearches += `<li onclick='setCurrentSearch(\"${cityObject.city.name}\")' class=\"list-group-item\">${cityObject.city.name}</li>`\n }, '')\n}", "function updateFacetURL(){\n \t$(\".search_results .facets ul li a\").each(function() {\n \t\t$(this).parent().removeClass(\"current-filter\");\n \t\tvar hval = $(this).attr(\"href\").split(\"more%3A\");\n \t\tvar nval = hval[0] + \"more%3A\" + hval[hval.length-1];\n\t $(this).attr(\"href\", nval);\n\t\n\t\tvar sval = $(\"#main_sitesearch\").val();\n\t\t\n\t\tif (sval.indexOf(\"more\") !== -1){\n\t\t\tarr = sval.split(\"more:\");\n\t\t\tif($(this).attr(\"href\").indexOf(arr[arr.length-1]) !== -1){\n\t\t\t\t$(this).parent().addClass(\"current-filter\");\n\t\t\t}\n\t\t}\n\t});\n }", "function goWiki(term) {\n counter = counter + 1;\n //Check if Adolf Hitler\n if (term == 'Adolf Hitler') {\n console.log('Found Hitler')\n console.log('In', counter, 'Random Searches');\n } else {\n let url = searchUrl + term;\n loadJSON(url, gotSearch, 'jsonp');\n }\n}", "function onKeyPressed () {\n\n // Gets the current text in the space bar\n const currInput = searchBar.firstElementChild.value;\n\n // Gets all matching links\n const nameMatches = findNameMatches(currInput);\n\n // Hides extra buttons\n hideLinks(nameMatches.length);\n\n // Sets the linksToDisplay to the matches for output\n linksToDisplay = nameMatches;\n\n // Shows first page of output\n placePaginatedLinks(1, linksToDisplay);\n\n}", "function getLongerToken () {\n\t\t\t$.get(\"https://graph.facebook.com/v2.8/oauth/access_token?grant_type=fb_exchange_token&client_id=\"+app_id+\"&client_secret=\"+app_secret+\"&fb_exchange_token=\"+short_token+\"/\",\n\t\t\t\tfunction(data) {\n\t\t\t\t\tconsole.log(data);\n\t\t\t});\n\t\t}", "function ampaeDisplayDataTop(val) {\n var r = '<a href=\"'+val.link+'\">'+val.value+'</a>';\n return r + '\\n';\n}", "function onLinkFollowed(query, url, title) {\t\r\n var taskIdx = selectedTaskIdx();\r\n addLinkFollowed(taskIdx, query, url, title, true);\r\n gCurrentSearch = {\"query\":query, \"url\":url };\r\n\tupdateSearchHistory();\r\n}", "function searchHandler(symbol) { \n\n var tokenKey; \n tokenKey = symbol\n\n\n fetch(\"https://api.lunarcrush.com/v2?data=assets&key=axnpldsftoa03n17z75cy5r&symbol=\"+tokenKey+\"&interval=day&time_series_indicators=open,close,high,low&data_points=90\")\n .then (response => response.json())\n .then (data => {\n percentChange.innerText = data.data[0].percent_change_24h;\n tickerName.innerText = data.data[0].name;\n })\n\n\n fetch(\"https://api.lunarcrush.com/v2?data=assets&key=axnpldsftoa03n17z75cy5r&symbol=\"+tokenKey+\"&interval=day&time_series_indicators=open,close,high,low&data_points=1\")\n .then (response => response.json())\n .then (data => {\n reddit.innerText = data.data[0].reddit_posts;\n twitter.innerText = data.data[0].tweets;\n urlShares.innerText = data.data[0].unique_url_shares;\n })\n \n fetch(\"https://api.lunarcrush.com/v2?data=feeds&key=axnpldsftoa03n17z75cy5r&symbol=\"+tokenKey+\"&limit=10&sources=news\")\n .then (response => response.json())\n .then (data => {\n newsTitleEl.innerText = data.data[0].title;\n newsTitleEl.setAttribute(\"href\", data.data[0].url);\n newDescrEl.innerText = data.data[0].description;\n\n newsTitleEl2.innerText = data.data[1].title;\n newsTitleEl2.setAttribute(\"href\", data.data[1].url);\n newDescrEl2.innerText = data.data[1].description;\n\n newsTitleEl3.innerText = data.data[2].title;\n newsTitleEl3.setAttribute(\"href\", data.data[2].url);\n newDescrEl3.innerText = data.data[2].description;\n\n newsTitleEl4.innerText = data.data[3].title;\n newsTitleEl4.setAttribute(\"href\", data.data[3].url);\n newDescrEl4.innerText = data.data[3].description;\n\n newsTitleEl5.innerText = data.data[4].title;\n newsTitleEl5.setAttribute(\"href\", data.data[4].url);\n newDescrEl5.innerText = data.data[4].description;\n\n newsTitleEl6.innerText = data.data[5].title;\n newsTitleEl6.setAttribute(\"href\", data.data[5].url);\n newDescrEl6.innerText = data.data[5].description;\n\n newsTitleEl7.innerText = data.data[6].title;\n newsTitleEl7.setAttribute(\"href\", data.data[6].url);\n newDescrEl7.innerText = data.data[6].description;\n })\n\n //news time\n fetch(\"https://api.lunarcrush.com/v2?data=feeds&key=axnpldsftoa03n17z75cy5r&symbol=\"+tokenKey+\"&limit=10&sources=news\")\n .then (response => response.json())\n .then (data => {\n newTimeEl1.innerText = moment.unix(data.data[0].time).format(\"MM/DD/YYYY\");\n newTimeEl2.innerText = moment.unix(data.data[1].time).format(\"MM/DD/YYYY\");\n newTimeEl3.innerText = moment.unix(data.data[2].time).format(\"MM/DD/YYYY\");\n newTimeEl4.innerText = moment.unix(data.data[3].time).format(\"MM/DD/YYYY\");\n newTimeEl5.innerText = moment.unix(data.data[4].time).format(\"MM/DD/YYYY\");\n newTimeEl6.innerText = moment.unix(data.data[5].time).format(\"MM/DD/YYYY\");\n newTimeEl7.innerText = moment.unix(data.data[6].time).format(\"MM/DD/YYYY\");\n })\n\n // fetch to render 1st chart\n var xmlhttp = new XMLHttpRequest();\n var api = 'https://api.lunarcrush.com/v2?data=assets&key=axnpldsftoa03n17z75cy5r&symbol='+tokenKey+'&interval=day&time_series_indicators=open,close,high,low&data_points=90';\n xmlhttp.open(\"GET\", api, true);\n xmlhttp.send();\n xmlhttp.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n var data = JSON.parse(this.responseText);\n var closes = data.data[0].timeSeries.map(function(elem){\n return elem.close;\n });\n var dates = data.data[0].timeSeries.map(function(elem){\n var date = new Date(elem.time *1000);\n var formattedDate = (date.getMonth()+1)+\n \"/\"+date.getDate()+\n \"/\"+date.getFullYear();\n return formattedDate;\n });\n var opens = data.data[0].timeSeries.map(function(elem){\n return elem.open;\n });\n var ctx = document.getElementById('MyChart').getContext('2d');\n if(chartObject.chart instanceof Chart) {\n chartObject.chart.destroy();\n }\n chartObject.chart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: dates,\n datasets: [{\n label: 'open',\n data: opens,\n backgroundColor: '#2B6FFF',\n borderColor: '#2B6FFF',\n borderWidth: 2,\n pointStyle: 'rectRot',\n \n },{\n label: 'close',\n data: closes,\n backgroundColor: 'black',\n borderColor: 'black',\n borderWidth: 2,\n pointStyle: 'rectRot'\n }\n ]\n },\n options: {\n scales: {\n y: {\n beginAtZero: false\n }\n }\n }\n });\n }\n } \n\n // fetch to render 2nd chart\n var xmlhttpTwo = new XMLHttpRequest();\n var apiTwo = 'https://api.lunarcrush.com/v2?data=assets&key=axnpldsftoa03n17z75cy5r&symbol='+tokenKey+'&interval=day&time_series_indicators=open,close,high,volume,low&data_points=90';\n xmlhttpTwo.open(\"GET\", apiTwo, true);\n xmlhttpTwo.send();\n xmlhttpTwo.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n var data = JSON.parse(this.responseText);\n var closes = data.data[0].timeSeries.map(function(elem){\n return elem.close;\n });\n var dates = data.data[0].timeSeries.map(function(elem){\n var date = new Date(elem.time *1000);\n var formattedDate = (date.getMonth()+1)+\n \"/\"+date.getDate()+\n \"/\"+date.getFullYear();\n return formattedDate;\n });\n var volume = data.data[0].timeSeries.map(function(elem){\n return elem.volume;\n });\n var ctx = document.getElementById('MyChart-2').getContext('2d');\n if(chartObjectTwo.chart instanceof Chart) {\n chartObjectTwo.chart.destroy();\n }\n chartObjectTwo.chart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: dates,\n datasets: [{\n label: 'volume',\n data: volume,\n backgroundColor: '#2B6FFF',\n borderColor: 'black',\n borderWidth: 2,\n pointStyle: 'rectRot',\n }\n ]\n },\n options: {\n scales: {\n y: {\n beginAtZero: false\n }\n }\n }\n });\n }\n} \n\n //nomics\n //mktcap\nfetch(\"https://api.nomics.com/v1/currencies/ticker?key=bf0f8b8bff53b4098df1df96d4d2d0531a4d8ffa&ids=\"+tokenKey+\"&interval=1d,30d&convert=EUR&per-page=100&page=1\")\n.then(response => response.json()) \n.then(data => marketCapEl.innerText = abbreviateNumber(data[0].market_cap))\n\n//volume\nfetch(\"https://api.nomics.com/v1/currencies/ticker?key=bf0f8b8bff53b4098df1df96d4d2d0531a4d8ffa&ids=\"+tokenKey+\"&interval=1d,30d&convert=EUR&per-page=100&page=1\")\n.then(response => response.json()) \n.then(data => volumeEl.innerText = abbreviateNumber(data[0][\"1d\"].volume))\n\n//supply\nfetch(\"https://api.nomics.com/v1/currencies/ticker?key=bf0f8b8bff53b4098df1df96d4d2d0531a4d8ffa&ids=\"+tokenKey+\"&interval=1d,30d&convert=EUR&per-page=100&page=1\")\n.then(response => response.json()) \n.then(data => supplyEl.innerText = abbreviateNumber(data[0].circulating_supply))\n}", "function learnMoreGoto() {\n return \"<a target='_blank' href='\"\n + WIKI_URL + \"Goto-instruction\"\n + \"'>\"\n + \"Learn more about the \" + keyword_link(\"goto\") + \" instruction.\"\n + \"</a>\"\n}", "function renderCitySearchHistory() {\n var storedCities = JSON.parse(localStorage.getItem(\"Cities\"));\n if (storedCities !== null) {\n citySearchHistory = storedCities;\n city = citySearchHistory.slice(-1)[0];\n }\n showHistory.innerHTML = \"\";\n for (var i = 0; i < citySearchHistory.length; i++) {\n var cityTitle = citySearchHistory[i];\n\n var li = document.createElement(\"li\");\n li.textContent = cityTitle;\n showHistory.appendChild(li);\n }\n}", "get txt() {\n return [['← Back', `To Q. ${this.page - 1} of 3`], [`On Q. ${this.page} of 3`, 'Next →']]; }", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let lastfollowUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = lastfollowUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = lastfollowUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('lastContentDisplay').innerHTML =secondDescription;\r\n }", "function showMore() {\n page++;\n instantSearchName();\n}", "function displayVideos(response, search) {\n let results = document.querySelector(\".results\");\n results.innerHTML = \"\";\n response.items.forEach((element) => {\n let videoLink = `https://www.youtube.com/watch?v=${element.id.videoId}`;\n let videoImage = element.snippet.thumbnails.medium.url;\n let videoTitle = element.snippet.title;\n results.innerHTML += `\n <div class=\"segment\">\n <a href = ${videoLink} target=\"_blank\">\n\t\t\t\t\t\t<img src = ${videoImage} alt=\"videoThumbnail\">\n\t\t</a> \n <a href = ${videoLink} target=\"_blank\">\n <p>${videoTitle}</p>\n </a>\n </div>\n `;\n });\n\n // Selecting the buttons through the DOM\n let next = document.querySelector(\"#next\");\n let prev = document.querySelector(\"#previous\");\n\n //Removing the hidden attribute of the next button when doing the first search\n next.removeAttribute(\"hidden\");\n\n //Adding the attribute of the nextPageToken to reuse it when next button is pressed\n next.setAttribute(\"value\", response.nextPageToken);\n\n //Event listener of the next button\n next.addEventListener(\"click\", (event) => {\n event.preventDefault();\n //Fetch call using the attribute of the nextPageToken added to the button\n fetchVideos(search, next.getAttribute(\"value\"));\n //Removing the hidden attribute of the prev button\n prev.removeAttribute(\"hidden\");\n //Setting the new attributes of the prev and next tokens\n next.setAttribute(\"value\", response.nextPageToken);\n prev.setAttribute(\"value\", response.prevPageToken);\n });\n\n //Event listner of the previous button\n prev.addEventListener(\"click\", (event) => {\n event.preventDefault();\n //Fetch call using the attribute of the prevPageToken added to the button\n fetchVideos(search, response.prevPageToken);\n //Updating the previous token\n prev.setAttribute(\"value\", response.prevPageToken);\n });\n}", "function displayMatches() {\n const matches = findMatches(this.value, entries);\n const searchReg = new RegExp(this.value, 'gi');\n const html = matches.map(entry => {\n const matchedTerm = entry.term.toUpperCase().replace(searchReg, `<span class='highlight1'>${this.value.toUpperCase()}</span>`);\n const matchedDef = entry.definition.replace(searchReg, `<span class='highlight2'>${this.value}</span>`);\n const matchedLinks = entry.link.split(\" \").map(link => {return `</br><a href=\"${link}\" target=\"_blank\">${link}</a>`}).join(\"\");\n return `\n <li>\n <!--<span><b>${entry.term}:</b> ${entry.definition}</span>-->\n <span><b>${matchedTerm}:</b> ${matchedDef}</span></br>\n <span><b>links:</b> ${matchedLinks}</span>\n </li>\n `;\n }).join(\"\");\n suggestions.innerHTML = html;\n}", "function showRemarkInHomepage(userToken) {\n\tvar news = document.querySelector(\"#dashboard > div.news\");\n\tvar userCount = document.querySelectorAll(\"div.flex-items-baseline > div > a[data-hovercard-type=user]\").length;\n\tvar observer = new MutationObserver(function (mutations, self) {\n\t\tvar users = document.querySelectorAll(\"div.flex-items-baseline > div > a[data-hovercard-type=user]\");\n\t\tif (userCount != users.length) {\n\t\t\tuserCount = users.length\n\t\t\tusers.forEach(function (element) {\n clearRemarkOfCurrentNode(element.parentNode);\n\t\t\t\tvar username = getMasterOfPage(element.href);\n\t\t\t\tgetRemark(userToken, username, function (remark) {\n var remarkEl = generateRemarkSpan('link-gray pl-1 github-remarks', userToken, username, remark);\n\t\t\t\t\tinsertAfter(remarkEl, element);\n\t\t\t\t});\n\t\t\t}, this);\n\t\t}\n\t});\n\tobserver.observe(news, { childList: true, subtree: true });\n}", "function displaySearchHistory() {\n $(\"#search-history\").empty();\n search_history.forEach(function (city) {\n var history_item = $(\"<li>\");\n history_item.addClass(\"list-group-item btn btn-light\");\n history_item.text(city);\n $(\"#search-history\").prepend(history_item);\n });\n\n $(\".btn\").click(getWeather);\n $(\".btn\").click(Forecast);\n }", "function displayResults(data){\r\n // remove all past results\r\n $(\".results\").remove();\r\n // lift WikiSearch title to top of page\r\n $(\".titleClass\").css(\"padding-top\",\"0px\");\r\n // show results\r\n \r\n const result = data[\"query\"][\"search\"][0][\"title\"];\r\n // create div for all search results\r\n $(\".searchMenu\").append(\"<div class = 'searchResults results'></div>\");\r\n // main search result title\r\n $(\".searchResults\").append(\"<div class='searchTitle'></div>\");\r\n $(\".searchTitle\").html(\"Search Results for <a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+result+\"\\'>\"+result+\"</a>\"); // push titleClass to top of page\r\n \r\n // results\r\n for (var ii =1; ii < data[\"query\"][\"search\"].length -1; ii++){\r\n // create div for each result\r\n $(\".searchResults\").append(\"<div class='key\" + ii + \" result'></div>\");\r\n // append to div\r\n var searchResult = data[\"query\"][\"search\"][ii][\"title\"];\r\n $(\".key\" + ii).append(\"<p class = 'resultTitle'><a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+searchResult+\"\\'>\"+searchResult+\"</a></p>\");\r\n $(\".key\"+ii).append(\"<p class = 'resultText'>\" + data[\"query\"][\"search\"][ii][\"snippet\"]+\"...\" + \"</p>\");\r\n }\r\n}", "function stichLinks(mdText){\n return mdText.replace(/\\[[^\\[^\\]^\\(^\\)]*\\]\\([^\\[^\\]^\\(^\\)]*\\)/gi,\n (x) => {return x.replace(/\\([^\\[^\\]^\\(^\\)]*\\)/,\n (x)=>{return'(search?q='+x.substring(1,x.length-1).split(' ').join('+') +')'})\n });\n}", "function morelinks() {\n\tvar json10afterurl = redditTracker.jsonurl + \"?after=\" + redditTracker.after + \"&limit=10\";\n\t$.getJSON(json10afterurl, getAfterLinks);\n}", "function show_results(data, tsearch) \n { sout = '<table id=\"search_table\">';\n sout += result_content (data.nct);\n\n // page navigation\n sout += '<tr><td colspan=\"3\"><p id=\"nav_search\">'\n first = parseInt(data.nct[0][1]);\n last = parseInt(data.nct[data.nct.length-1][1]);\n np = parseInt(data.npag);\n // previous\n if (np > 1)\n sout += '<span id=\"rprev\" class=\"nav_page\"> Previous Page (' + (first-20) + ' - ' + (last-20) + ')</span>';\n else\n sout += '<span> Previous Page </span>'\n // current\n sout += '<span id=\"rshow\"> Showing (' + first + ' - ' + last + ')</span>'\n // next\n pmax = Math.ceil(parseInt(data.n.replace(',',''))/20);\n if (np+1 <= pmax)\n sout += '<span id=\"rnext\" class=\"nav_page\"> Next Page (' + (first+20) + ' - ' + (last+20) + ')</span>'\n else\n sout += '<span> Next Page </span>'\n sout += '</p></td></tr></table>';\n $(\"#results\").html(sout); \n \n // navigation clicks\n $('#rprev').bind('click', function() \n { if (tsearch == 'advanced')\n advanced_search(parseInt(data.npag)-1);\n else\n search(parseInt(data.npag)-1);\n\t$(document).scrollTop(0);\n });\n\n $('#rnext').bind('click', function() \n { if (tsearch == 'advanced')\n advanced_search(parseInt(data.npag)+1);\n else\n search(parseInt(data.npag)+1);\n\t$(document).scrollTop(0);\n });\n\n $('.filter_link').bind('click', function() \n { tag_cloud_filtering (tsearch); });\n }", "function retrieveHistory () {\n $\n .get('/revisions/' + uid)\n .done(function (res) {\n revisions = res.sort(function (a, b) {\n return new Date(a.createdAt) > new Date(b.createdAt);\n });\n\n revisions.forEach(function (revision, i) {\n var date = $.formatDate(revision.createdAt, true);\n var whoDid = (revision.length >= i + 1) ? revision[i + 1].overridenBy : article.lastAuthorName;\n\n if (i === 0) {\n date = $.formatDate(article.updatedAt, true);\n $target.append('<a href=\"#\" class=\"collection-item blue-text\" data-index=\"' + (revisions.length - i) + '\">Dernier article du ' + date + ' par ' + whoDid + '</a>');\n } else {\n $target.append('<a href=\"#\" class=\"collection-item blue-text\" data-index=\"' + (revisions.length - i) + '\">Révision du ' + date + ' par ' + whoDid + '</a>');\n }\n });\n\n var date = $.formatDate(article.createdAt, true);\n\n $target.append('<a href=\"#\" class=\"collection-item initialVersion blue-text\" data-index=\"0\">Création par ' + article.authorName + ' (' + date + ')</a>');\n\n revisions.push({\n content: article.content\n });\n\n $('.collection-item')\n .mouseenter(function () {\n var i = $(this).data('index');\n var content = revisions[i].content;\n\n var html = marked(content, {\n breaks: true,\n sanitize: true,\n highlight: function (code) {\n return hljs.highlightAuto(code).value;\n }\n });\n $preview.html(html);\n\n if (i !== revisions.length - 1) {\n // Select this one\n var $selecter = $('<a href=\"#\" class=\"btn waves-effect waves-light blue\" id=\"restore\">Restorer cette version</a>')\n .click(function (e) {\n e.preventDefault();\n\n $selecter.addClass('disabled').attr('disabled', '');\n $\n .ajax({\n url: '/articles/' + uid,\n type: 'put',\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({ content: content })\n })\n .done(function () {\n location.href = '/read/' + uid;\n })\n .fail(function (res) {\n location.href = '/error/' + res.status;\n });\n });\n $preview.append($selecter);\n }\n\n // Fix https://github.com/chjj/marked/issues/255\n $('pre code').addClass('hljs');\n\n // KateX\n renderMathInElement($preview[0]);\n })\n .click(function (e) {\n e.preventDefault();\n });\n })\n .fail(function (res) {\n location.href = '/error/' + res.status;\n });\n }", "function updateMoreSearchText() {\n if ($('ms-srch-group-link a') !== null) {\n $('.ms-srch-group-link a').text('Show All People Results');\n $('.ms-srch-group-link a').attr('title', 'Show All People Results...');\n }\n }", "function displayWikiEntries() {\n display().then(function(titles, content, links, totalNumOfWikis) {\n for (var i = 0; i < QUERY_LIMIT; i++) {\n $(\"#searchResults\").append(`<div class=\"wikiEntry\"> <p> <b> ${titles[\n i\n ]} </b> </p>\n <p> ${content[i]} </p> <p> <a href=\" ${links[\n i\n ]} \"> Tell me more</span></a></div>`);\n // num = i;\n // console.log(num + 1);\n }\n $(\"#searchResults\").prepend(\n `<p> Showing ${$(\".wikiEntry\").length} of ${totalNumOfWikis} entries. </p>`\n );\n})\n}", "function showPrevPage() {\n var token = $(\"#prev-button\").data('token');\n var q = $('#prev-button').data('query');\n \n $(\"#videos-view\").empty();\n $(\"#buttons\").empty();\n\n var params = $.param({\n part: 'snippet, id',\n maxResults: '1',\n q: keyword,\n pageToken: token,\n type: 'video', \n key: 'AIzaSyBbcLfQsPms45781ZJd_5pwv-V3sj6G9C0'\n });\n var url = \"https://www.googleapis.com/youtube/v3/search?\" + params;\n console.log(url);\n\n q = $(\".input\").val();\n\n $.ajax({\n url: url,\n method: \"GET\"\n }).then(function(data) {\n\n var nextPageToken = data.nextPageToken;\n var prevPageToken = data.prevPageToken;\n\n console.log(\"Response length: \" + data.items.length)\n \n $.each(data.items, function(i, item){ \n\n var result = showVideos(item);\n\n $(\"#videos-view\").append(result)\n });\n\n var buttons = showButtons(prevPageToken, nextPageToken);\n\n $(\"#buttons\").append(buttons);\n\n });\n}", "function random() {\n $('#search').autocomplete(\"close\");\n $.ajax({\n url: \"https://en.wikipedia.org/w/api.php\",\n dataType: \"jsonp\",\n data: {\n 'action': \"query\",\n 'format': \"json\",\n 'list': \"random\",\n 'rnnamespace': 0,\n 'rnredirect': true\n },\n success: function(data) {\n // console.log(data);\n $('#search').val(data.query.random[0].title);\n }\n });\n}", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "function renderSearchHistory() {\n var storedInitials = JSON.parse(localStorage.getItem(\"search\"));\n locationArr = storedInitials;\n\n for (var i = 0; i < locationArr.length; i++) {\n var searchHistoryList = document.createElement(\"li\");\n searchHistoryList.setAttribute(\"class\", \"list-group-item\");\n searchHistoryList.textContent = locationArr[i];\n locationEl.append(searchHistory);\n }\n searchHistory.append(searchHistoryList);\n}", "function loadLatestSearch() {\n\n var latestTerms = pullLatestSearches();\n\n var recentlySearched = latestTerms[0];\n\n searchHandler(recentlySearched);\n}", "function buildClickableSpan(textToShow) {\n return \"<span class='hashtagspan'>\" + textToShow + \"</span>\";\n}", "function addUserHistoryLink(){\r\n var userhistory = '<a href=\"javascript:;\" class=\"user-history-button\" title=\"view user history\" target=\"_blank\">H</a>'\r\n if( this.firstChild ) return $(this).find('a:last').append(','+userhistory);\r\n $(this).append('['+userhistory+']');\r\n }", "function myTweets(){\n\tvar params = {screen_name: 'JediRose13', limit: 20};\n\trightKeys.get('statuses/user_timeline', params, function(error, tweets, response) {\n \t\tif (!error) {\n \t\t\tfor (var i = 0; i < 20; i++) {\n \t\t\t\tconsole.log(\" \");\n \t\t\t\tconsole.log(tweets[i].text + \n \t\t\t\t\t\"\\n----------------------------------------------------------------------------------\");\t\t\t\n \t\t\t}\n\t\t}\n\t});\n\t//There's nothing special about the (%). It's just an attempt at making \n\t//the text file easier to read.\n\tfs.appendFile(\"log.txt\", \" (%) Get Tweets\");\n\tfs.writeFile(\"index.html\", \" (%) Get Tweets\");\n}", "function showSearchResults(searchQuery) {\n searchData(searchQuery).then(results => {\n const html = results.map(movie => `\n <li>\n <span class=\"title\">${movie.title}</span>\n <span class=\"rating\">${movie.rating}</span>\n </li>\n `);\n\n resultsElement.innerHTML = html.join('');\n });\n }", "@action\n showHistoryAction() {\n this.showHistory = true;\n }", "function showTermsUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, footerUrlName[\"FooterTermsUrl\"]);\n\treturn false;\n}", "function twitter(){\n//This will show your last 20 tweets and when they were created at in your terminal/bash window//\n }", "function showTweets() {\n\t// access twitter keys inside keys object\n\tvar client = new Twitter(keys.twitterKeys);\n\t// twitter search parameters\n\tvar params = {\n\t\tscreen_name: 'sjm27527',\n\t\tcount: 20\n };\n\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n \tif (error) {\n \t\tconsole.log(\"Twitter Error\");\n \t} else {\n \t\tconsole.log('');\n \t\tconsole.log('My last 20 tweets: ');\n \t\tconsole.log('------------------------');\n \t\ttweets.forEach(function(individualTweet) {\n \t\t\tconsole.log('Time Posted: ' + individualTweet.created_at);\n \t\t\tconsole.log('Tweet: ' + individualTweet.text);\n \t\t\tconsole.log('_____________________');\n \t\t});\n \t}\n });\n\n}", "function updateHistory() {\n \n var ottPlatforms = ['netflix', 'hotstar', 'primevideo', 'sonyliv'];\n\tfor(var i=0;i<4;i++){\n\t chrome.history.search({\n\t \t'text': ottPlatforms[i],\n\t \tmaxResults: 10\n\t }, function(historyItems) {\n\t for (var i = 0; i<historyItems.length&&i<10;++i) {\n\t \tconsole.log(historyItems[i].url);\n\t }\n\t });\n }\n}", "function generateLinkToCurrentView() {\n\tvar linkToCurrentView = window.location.href.split('?')[0] + '?';\n\tvar first = true;\n\tfor(var i in viewerVars.pvs) {\n\t\tvar pvName = viewerVars.pvs[i];\n\t\tif(first) { first = false; } else { linkToCurrentView += \"&\"; }\n\t\tlinkToCurrentView += \"pv=\" + pvName;\n\t}\n\tlinkToCurrentView += \"&from=\" + viewerVars.start.toISOString();\n\tlinkToCurrentView += \"&to=\" + viewerVars.end.toISOString();\n\tconsole.log(linkToCurrentView);\n\t$(\"#alertInfoText\").text(linkToCurrentView);\n\t$('#alertModal').modal('show');\n}", "function guessHistory() {\n\tdocument.querySelector(\"#history\").innerHTML = \"History: \" + usedLetters.join(' , ');\n}", "docs() {\n const listOfDetails = [];\n const helpDoc = this.command.docLink || getDocLink(this.command.id);\n if (!helpDoc) {\n return '';\n }\n const hyperLink = urlUtil.convertToHyperlink('MORE INFO', helpDoc);\n // if the terminal doesn't support hyperlink, mention complete url under More Info\n if (hyperLink.isSupported) {\n listOfDetails.push(chalk.bold(hyperLink.url));\n } else {\n listOfDetails.push(chalk.bold('MORE INFO'));\n listOfDetails.push(indent(helpDoc, 2));\n }\n return listOfDetails.join('\\n');\n }", "function showList() {\n\n let weatherHistory = JSON.parse(localStorage.getItem(\"list\"))\n\n if (weatherHistory !== null) {\n for (let i = 0; i < weatherHistory.length; i++) {\n let history = $(\"<div class='btn mb-2 btn-secondary'>\")\n history.text(weatherHistory[i])\n $(\"#prevSearch\").prepend(history);\n\n }\n }\n}", "function displaySearchResults(startAt) {\n var count = 0; // how many things we've added\n var lastChecked = 0; // last result looked at\n\n var addHtml = '';\n\n for(var i=startAt;count < 5 && i<searchResults.length; i++) {\n var track = searchResults[i];\n var regionClass = 'available';\n\n if (!isSongAvailable(track, 'US')){\n regionClass = 'unavailable';\n }\n\n var artist = getSongArtist(track);\n var song = getSongName(track);\n\n var toAdd = artist + ' - '+song;\n addHtml += '<p class=\"'+regionClass+'\" onClick=\"queueSong('+\"'\"+getSongLink(track)+\"'\"+')\">'+toAdd+'</p>';\n count++;\n\n lastChecked = i;\n }\n\n if(lastChecked >= 5) {\n var prevStart = startAt - 5;\n addHtml += '<span onClick=\"displaySearchResults('+prevStart+')\">Prev &nbsp;</span>';\n } \n else {\n addHtml += '<span> &nbsp; &nbsp; &nbsp; &nbsp;</span>';\n }\n\n startAt += 5;\n\n if(lastChecked < searchResults.length - 1){\n addHtml += '<span onClick=\"displaySearchResults('+startAt+')\">Next</span>';\n } \n\n if(searchResults.length == 0){\n addHtml = '<p><em>No tracks found.</em></p>';\n }\n\n if($(\"#results\").html()=== ''){\n $(addHtml).hide().appendTo(\"#results\").slideDown(\"slow\");\n }\n else{\n $(\"#results\").html(addHtml);\n }\n\n}", "function prevQuote() {\n loading();\n\n // Check if at the first quote index generated\n if (historyIndex >= 1) {\n historyIndex -= 1;\n nextQuoteBtn.style.visibility = \"visible\";\n } else {\n prevQuoteBtn.style.visibility = \"hidden\";\n }\n const prevIndex = quoteHistory[historyIndex];\n console.log(prevIndex);\n const quote = apiQuotes[prevIndex];\n\n // Display quote text\n quoteText.textContent = quote.text;\n \n // Check if author field is blank and replace it with 'unknown'\n \n if (!quote.author || quote.author === null) {\n authorText.textContent = \"Author Unknown\";\n searchAuthorBtn.style.visibility = \"hidden\";\n \n } else {\n authorText.textContent = quote.author;\n searchAuthorBtn.style.visibility = \"visible\";\n }\n\n // Check quote length to determine styling\n if (quote.text.length > 50) {\n quoteText.classList.add('long-quote');\n } else {\n quoteText.classList.remove('long-quote');\n }\n\n if (historyIndex === 0) {\n prevQuoteBtn.style.visibility = \"hidden\";\n }\n complete();\n}", "function moreGoogle(){\n //clearVenues();\n displayInfo.pagination.nextPage();\n}", "function displayQueryResults() {\n\t\t\t$scope.resultsAvailable = true;\n\t\t\tresultsOffset = 0;\n\t\t\t$scope.getNextResultsPage();\n\n\t\t}", "highlightPrevious() {\n ipc.send('search-bar-query-previous');\n }", "highlightPrevious() {\n ipc.send('search-bar-query-previous');\n }", "function drawHistoryCloud(itemList, option) {\t\t\n\tg_cloudShowOption = (option == undefined) ? g_cloudShowOption : option;\n\tvar options = [];\n\toptions.push(getCloudOption('Helpful', 'link_helpful', 'drawHistoryCloud'));\n\toptions.push(getCloudOption('Unhelpful', 'link_unhelpful', 'drawHistoryCloud'));\n\toptions.push(getCloudOption('Unrated', 'link', 'drawHistoryCloud'));\n\tvar showOptions = { label:'Queries: ', options:options };\n\t\n\tdrawCloud(\"tag_cloud\", itemList, function(i, item) {\n\t\tvar link = item.query;\n\t\tvar url = '#';\n\t\tvar weight = g_cloudShowOption == 'link_helpful' ? item.ratings.helpful : (g_cloudShowOption == 'link_unhelpful' ? item.ratings.unhelpful : item.count-item.ratings.helpful-item.ratings.unhelpful);\n\t\treturn {link:link, url:url, weight:weight};\n\t}, { show:showOptions, color:{start:g_actionColors[g_cloudShowOption], end:g_actionColors[g_cloudShowOption]}, className:'noLink' });\n}", "function pastSearch() {\n for (var i = 0; i < cities.length; i++) {\n var button = $(\"<button>\");\n button.text(cities[i]).appendTo(\"#history\");\n $(button).addClass(\"btn btn-light\");\n }\n }", "function tokenInit() {\n// $.each($(\"a\"), function (key, value) {\n// $(value).attr(\"href\", $(value).attr(\"href\") + \"?token=\" + globalToken);\n// });\n// // var allA=$(\"a\");\n// // for(var a in allA){\n// // var element=$(allA[a]);\n// // console.log(element);\n// // element.attr(\"href\",element.attr(\"href\")+\"?token=\"+globalToken);\n// // }\n}", "getAppTOCEntry() {\n let html = \"<ul>\";\n this.appIDs.forEach((obj) => {\n let name = Formatter.formatTitle(obj.name); //remove prefix\n html += `<li><a href=#${obj.id}>${name}</a>`;\n });\n html += \"</ul>\";\n return html;\n }", "function showResults () {\n const value = this.value\n const results = index.search(value, 8)\n // console.log('results: \\n')\n // console.log(results)\n let suggestion\n let childs = suggestions.childNodes\n let i = 0\n const len = results.length\n\n for (; i < len; i++) {\n suggestion = childs[i]\n\n if (!suggestion) {\n suggestion = document.createElement('div')\n suggestions.appendChild(suggestion)\n }\n suggestion.innerHTML = `<b>${results[i].tablecode}</>: ${results[i].label}`\n // `<a href = '${results[i].tablecode}'> ${results[i]['section-name']} ${results[i].title}</a>`\n\n // console.log(results[i])\n }\n\n while (childs.length > len) {\n suggestions.removeChild(childs[i])\n }\n //\n // // const firstResult = results[0].content\n // // const match = firstResult && firstResult.toLowerCase().indexOf(value.toLowerCase())\n // //\n // // if (firstResult && (match !== -1)) {\n // // autocomplete.value = value + firstResult.substring(match + value.length)\n // // autocomplete.current = firstResult\n // // } else {\n // // autocomplete.value = autocomplete.current = value\n // // }\n }", "function showRecords(node, query) {\n var rank = node.attr('rank');\n if (rank == 'kingdoms') return;\n var name = node.attr('id');\n // url for records list\n var recordsUrl = urlConcat(biocacheWebappUrl, \"/occurrences/search?q=\") + query +\n \"&fq=\" + rank + \":\" + name;\n document.location.href = recordsUrl;\n}", "function displayWikiResults(responseJson) {\n const pageid= Object.keys(responseJson.query.pages)[0]\n const { extract } = responseJson.query.pages[pageid]\n $('#wiki-results').html(extract)\n $('#results').removeClass('hidden');\n}", "function displayResults() {\n if (suggestionsArray.length > 0){\n $(\"#name\").append(suggestionsArray[0].name)\n $(\"#description\").append(suggestionsArray[0].description);\n $(\"#link\").prop(\"href\", suggestionsArray[0].link)\n $(\"#IMG\").attr(\"src\", suggestionsArray[0].IMG);\n suggestionsArray.splice(0, 1);\n } else {\n netflixAndChill();\n }\n }", "function loadTokens(tableCell, requestResult, requestURL)\n\t\t{\n\t\t\t//Highlight the cell since we just updated it\n\t\t\ttableCell.highlight();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Grab the token from the page\n\t\t\t\tvar tokens = requestResult.match(/You currently have \\d+ release/)[0].match(/\\d+/)[0];\n\t\t\t\tvar tokenText = tokens;\n\t\t\t\t//Find the next release token availability\n\t\t\t\tif(tokens < 3)\n\t\t\t\t{\n\t\t\t\t\t//First release token\n\t\t\t\t\tvar tokens = requestResult.match(/\\<li\\>[a-zA-Z0-9 ,\\:]+\\<br\\>/g);\n\t\t\t\t\tvar tmp = tokens[tokens.length - 1];\n\t\t\t\t\t//Calculate time difference\n\t\t\t\t\tvar nextToken = parseMarmosetDate(tmp) - Date.now();\n\t\t\t\t\t//Add in the text for the next token time\n\t\t\t\t\ttokenText += \" (renew in \" + Math.floor(nextToken / 3600000) + \"h \" + Math.floor((nextToken % 3600000) / 60000) + \"m)\";\n\t\t\t\t}\n\t\t\t\t//Show the tokens\n\t\t\t\ttableCell.html(tokenText);\n\t\t\t}\n\t\t\tcatch(error)\n\t\t\t{\n\t\t\t\t//Set to 3 tokens if we can't find the token string\n\t\t\t\ttableCell.html(\"3\");\n\t\t\t}\n\t\t}", "function randomSearch() {\n\tvar randomURL = \"https://en.wikipedia.org/wiki/Special:Random\";\n\twindow.open(randomURL);\n}", "function token3(r) {\n\t\tfor (var j = 0; j < r.length; j++) {\n\t\t\tif (r[j].match(srr[0], \"g\") && r[j].match(srr[1], \"g\") && r[j].match(srr[2], \"g\")) {\n\t\t\t\t$('<p>').html(r[j]).appendTo(\"#demo-1\");\n\t\t\t\tscnt++;\n\t\t\t}\n\t\t}\n\t\tsearchql = true;\n\t\thlsSyntax(srr[0]);hlsSyntax(srr[1]);hlsSyntax(srr[2]);\n\t\tresultCall();\n\t}", "function backToResults(keywords, year, searchKeywords, linkNumber) {\n $('.back-button').on('click', function(e) {\n e.preventDefault();\n\n getResults(keywords, year, searchKeywords, linkNumber);\n });\n }", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let followUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = followUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = followUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('secondContentDisplay').innerHTML =secondDescription; \r\n }", "function showSearchResults(){\n let filterdResult = result.items.map(function (data){\n return `<a href=\"http://www.youtube.com/watch?v=${data.id.videoId}\"><img src=\"${data.snippet.thumbnails.default.url}\"/><a>`\n })\n $(\".js-search-results\").prop('hidden', false).html(filterdResult);\n }", "_getSearchTokens(aSearch) {\n return [this._learnMoreString.toLowerCase()];\n }", "function tokenForm() {\n return Date.parse((new Date()).getFullYear() + \" \" + date.split(\",\")[1].match(/[a-zA-Z0-9 \\:]+/)[0].trim().replace(\" at \", \" \"));\n }", "function triggerRecentRefreshBkmks () {\r\n if (recentBkmkBNId != undefined) {\r\n\tlet maxResults = 10;\r\n\tlet url = recentBkmkBN.url;\r\n\tif (url != undefined) {\r\n\t let p = url.indexOf(\"maxResults=\");\r\n\t if (p > -1) {\r\n\t\tlet l = parseInt(url.slice(p+11), 10);\r\n\t\tif (l > 0) {\r\n\t\t maxResults = l;\r\n\t\t}\r\n\t }\r\n\t}\r\n\tbrowser.bookmarks.getRecent(maxResults)\r\n\t.then(refreshRecentBkmks);\r\n }\r\n}" ]
[ "0.59259725", "0.5912451", "0.5720877", "0.56542844", "0.5644335", "0.55709684", "0.55578554", "0.5451679", "0.5439425", "0.5439425", "0.5363226", "0.53194386", "0.52875847", "0.52714527", "0.5270312", "0.524372", "0.5239619", "0.5201644", "0.5194869", "0.5193146", "0.51919687", "0.51802534", "0.5179067", "0.51701826", "0.5156494", "0.5154348", "0.5136442", "0.51337016", "0.5122647", "0.51157", "0.51096374", "0.5104165", "0.5101689", "0.51016885", "0.5100885", "0.5066284", "0.50561446", "0.5051225", "0.5049659", "0.50477886", "0.5036292", "0.5034996", "0.5034614", "0.5033096", "0.5031809", "0.50316316", "0.5011103", "0.50066155", "0.5005515", "0.5000854", "0.49919823", "0.4991898", "0.4991672", "0.49837223", "0.49835902", "0.49809772", "0.49731246", "0.49708587", "0.4965678", "0.4965073", "0.49641615", "0.49639875", "0.49546775", "0.4950554", "0.4948276", "0.49397877", "0.49246746", "0.49225032", "0.49186036", "0.49072838", "0.49064773", "0.49053538", "0.48998618", "0.48835376", "0.48782417", "0.48776284", "0.4877481", "0.48714522", "0.48700616", "0.4864892", "0.48640525", "0.48607928", "0.48607928", "0.48585254", "0.48579183", "0.4853485", "0.48521546", "0.48496675", "0.48448884", "0.48425022", "0.48391905", "0.483893", "0.48309135", "0.48223168", "0.48221427", "0.48217288", "0.48179486", "0.4811346", "0.48058867", "0.48050696" ]
0.5007218
47
updates note on server and updates UI appropriately
function UpdateNote(noteNodeObj) { // Prevent two facades from updating the same note // this can happen in the "complete" logic if (noteNodeObj.note().updating) { return; } noteNodeObj.note().updating = true; // update each save button to display loading ShowLoadingByClassName("SaveEditButton"); var noteContents = noteNodeObj.note().contents(); if (noteContents == "") { HideButtonImageByClassName("SaveEditButton"); return; } var email = CacheStoreGet("email"); var authToken = CacheStoreGet("token"); var today = new Date(); var data = { Email: email, AuthToken: authToken, NoteContents: noteContents, Completed: noteNodeObj.note().completed(), City: userCity, Latitude: userLat, Longitude: userLng, RowKey: noteNodeObj.note().noteId }; $.ajax({ type: "POST", url: "../note/UpdateNote", data: data, success: function (response) { if (response.Status == "Success") { cachedNotes.UpdateNote(response.Note); noteNodeObj.onSuccessfulUpdate(); } if (response.Status == "Expired") { // Auth token has expired AuthUserAndSetCookie(email, CacheStoreGet("password"), function () { UpdateNote(noteNodeObj); }, // on success function () { Redirect('Signup.html'); showError("Please log in to continue"); }) // on failure } HideButtonImageByClassName("SaveEditButton"); } }); // Unlock the note window.setTimeout(function () { noteNodeObj.note().updating = false; }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateNote(worker, note) {\n if (note != null) {\n note = datastore.updateNote(note);\n worker.port.emit(\"NoteUpdated\", note);\n }\n}", "function updateNote(noteEl) {\n const noteText = document.getElementById('note-text').value\n fetch(url + '/' + `${noteEl.parentElement.id} `, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n title: noteText,\n body: noteText,\n updated_at: moment().format()\n })\n })\n .then(res => res.json())\n .then(data => {\n renderNoteText(noteEl.parentElement, data)\n })\n}", "function update() {\n\t\tUtil.txt.setLibraryBrowser( Util.fs.getLibraries() );\n\t\tUtil.txt.setFileBrowser( Util.fs.getNotes(currentLib) );\n\t\tUtil.txt.setInputText( Util.fs.getNoteContent(currentLib,currentNote) );\n\t}", "function updateGoalNote(worker, note) {\n if (note != null) {\n note = datastore.updateNote(note);\n worker.port.emit(\"GoalNoteUpdated\", note);\n }\n}", "async onSubmit(note) {\n let clonedNotes = [...this.state.notes];\n for (let n of clonedNotes) {\n if (n.time === note.time) {\n n.text = note.text;\n n.title = note.title;\n n.color = note.color;\n n.lastEdited = new Date().getTime();\n break;\n }\n }\n\n // To make sure changes are stored...\n // Realm storing\n await this.storeLocal(clonedNotes);\n await this.setState({ notes: clonedNotes },\n function() {\n this.updateItem(this.state);\n }.bind(this));\n\n // We request a remote sync, because note was edited.\n await this.state.requestSync();\n }", "function changeNote(responseXML) {\n //parse the needed info from XML response and change note accordingly\n var noteObject = responseXML.getElementsByTagName(\"note\")[0];\n var title = noteObject.getElementsByTagName(\"title\")[0];\n var target = noteObject.getElementsByTagName(\"targetUser\")[0];\n var author = noteObject.getElementsByTagName(\"author\")[0];\n var message = noteObject.getElementsByTagName(\"message\")[0];\n var deadline = noteObject.getElementsByTagName(\"deadline\")[0];\n var category = noteObject.getElementsByTagName(\"category\")[0];\n title = title.childNodes[0].nodeValue;\n target = target.childNodes[0].nodeValue;\n author = author.childNodes[0].nodeValue;\n message = message.childNodes[0].nodeValue;\n deadline = deadline.childNodes[0].nodeValue;\n category = category.childNodes[0].nodeValue;\n $(\"#noteTitle\").text(title);\n $(\"#noteTarget\").text(\"Targeted to: \" + target);\n $(\"#noteAuthor\").text(\"Sent by \" + author);\n $(\"#noteMessage\").text(\"Message: \" + message);\n $(\"#noteDueDate\").text(\"Due by: \" + deadline);\n $(\"#noteCategory\").text(\"Category: \" + category);\n //when tect changed, show to user\n note.show();\n }", "function update_note(data)\n {\n data.id = rcmail.html_identifier_encode(data.uid);\n\n var row, is_new = (notesdata[data.id] == undefined && data.list == me.selected_list);\n notesdata[data.id] = data;\n\n if (is_new || me.selected_note && data.id == me.selected_note.id) {\n render_note(data);\n update_taglist(data.tags || []);\n }\n else if (data.tags) {\n update_taglist(data.tags);\n }\n\n // add list item on top\n if (is_new) {\n noteslist.insert_row({\n id: 'rcmrow' + data.id,\n cols: [\n { className:'title', innerHTML:Q(data.title) },\n { className:'date', innerHTML:Q(data.changed || '') }\n ]\n }, true);\n\n noteslist.select(data.id);\n }\n // update list item\n else if (row = noteslist.rows[data.id]) {\n $('.title', row.obj).text(data.title);\n $('.date', row.obj).text(data.changed || '');\n // TODO: move to top\n }\n }", "function updateNote(e){\n let note = notes[e.path[1].classList[0].split(\"id\")[1]];\n switch(e.target.name){\n case \"title\":\n note.title = e.target.value;\n break;\n case \"content\":\n note.content = e.target.value;\n break;\n case \"color\":\n e.path[1].style.backgroundColor = e.target.value;\n note.color = e.target.value;\n break;\n }\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "patch_note_content(route, nbid, update) { //#ADJUST TO NOTEBOOKS\n const url = this.baseUrl + route + \"/\" + nbid\n return client.fetch(url, {\n method: \"PATCH\",\n body: json(update)\n })\n .then(response => response.json())\n }", "function saveNote() {\n var noteContent = [];\n // Looping through the paragraphs and getting the contents of them\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n noteContent.push(paragraph.getContent());\n });\n\n // Saving the note content in the server\n utils.showLoadingOverlay($('#paragraphs'));\n $.ajax({\n type: 'PUT',\n data: JSON.stringify(noteContent),\n url: constants.API_URI + 'notes/' + noteSelf.name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully saved');\n\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient != null) {\n paragraph.paragraphClient.unsavedContentAvailable = false;\n }\n });\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n utils.hideLoadingOverlay($('#paragraphs'));\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay($('#paragraphs'));\n }\n });\n }", "function NoteSave(){\n\t\tvar noteData;\n\t\tvar newNote = $(\".bootbox-body textarea\").val().trim();\n\t\tif(newNote){\n\t\t\tnoteData = {\n\t\t\t\t_id: $(this).data(\"article\")._id,\n\t\t\t\tnoteText: newNote\n\t\t\t};\n\t\t\t$.post(\"/scrape/notes\", noteData).then(function(){\n\t\t\t\tbootbox.hideAll();\n\t\t\t});\n\t\t}\n\t}", "editNote(e) {\n e.preventDefault();\n fetch(config.API_ENDPOINT + \"/api/notes/\" + this.state.id, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(this.state),\n })\n .then((res) => {\n if (!res.ok) {\n throw new Error(\"Something went wrong, please try again later.\");\n }\n return res;\n })\n .then((res) => {\n this.context.editNote();\n this.setState({ ...res.body, error: null });\n })\n .catch((err) => {\n this.setState({\n error: \"Unable to edit note. Please try again later.\",\n });\n });\n }", "function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/notes\", note_obj).then(function()\n {\n // on success, close the modal\n bootbox.hideAll();\n });\n }\n }", "function saveNote(){\r\n if($('.notes-list-container').children('.note-item').length > 0){\r\n let content = editor.getContents();\r\n editNoteContent(editorNotebook, editorNote, editor.getContents());\r\n $('.notes-list-container .note-item.selected .note-item-title h4').text((content.ops[0].insert.length > 18) ? content.ops[0].insert.substr(0, 18) + \"...\" : content.ops[0].insert);\r\n }\r\n }", "function getNoteAndUpdate(apiUrl) {\n\n\treaderContent.hide(0);\n\treaderLoader.fadeIn(200);\n\n\t$.getJSON( apiUrl, function( note ) {\n\t\tif (note['valid'] == \"true\") {\t\n\n\t\t\tnewUrl = \"#/\";\n\t\t\tnewUrl += note['Permalink'];\n\t\t\tnewUrl += \"/\";\n\t\t\tnewUrl += note['NoteID'];\n\n\t\t\tupdateReader(note); // Update reader data with the returned object\n\t\t\tchangeURL(newUrl);\n\t\t\tdisplayReader(); // Show specific reader for this object\n\t\t}\n\t\telse{\n\t\t\tmessage = '<p>'+ note['status'] +'</p>';\n\n\t\t\ttry {\n\t\t\t // create the notification\n\t\t \tnotification = new NotificationFx({\n\t\t \t\tmessage : message,\n\t\t \t\tlayout : 'growl',\n\t\t \t\teffect : 'genie',\n\t\t \t\ttype : 'notice', // notice, warning or error\n\t\t \t\tonClose : function() {\n\t\t \t\t\t//bttn.disabled = false;\n\t\t \t\t}\n\t\t \t});\n\t\t \tnotification.show();\n\t\t\t}\n\t\t\tcatch(err) {\n\t\t\t\talert(message)\n\t\t\t console.log(err);\n\t\t\t}\n\t\t}\n\t\t\n\n\t})\n\t.error(function() {\n\t\tmessage = '<p>Sorry... We couldn\\'t retrieve information for that note... Try later</p>';\n\n\t\ttry {\n\t\t // create the notification\n\t \tnotification = new NotificationFx({\n\t \t\tmessage : message,\n\t \t\tlayout : 'growl',\n\t \t\teffect : 'genie',\n\t \t\ttype : 'notice', // notice, warning or error\n\t \t\tonClose : function() {\n\t \t\t\t//bttn.disabled = false;\n\t \t\t}\n\t \t});\n\t \tnotification.show();\n\t\t}\n\t\tcatch(err) {\n\t\t\talert(message)\n\t\t console.log(err);\n\t\t}\n\n\t})\n\t.complete(function() { \n\t\treaderLoader.fadeOut(0);\n\t\treaderContent.fadeIn(200);\n\t});\n}", "handler () {\n notes.addNote(title, body);\n }", "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\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 }", "function showNote(note, button) {\n shownNote = note;\n shownNoteButton = button;\n $(\"#noteTime\", slide.contentDocument).text(new Date(note.time).toLocaleString());\n $(\"#noteBody\", slide.contentDocument)[0].value = note.body;\n $(\"#noteBody\", slide.contentDocument)[0].focus();\n }", "async update(noteObject) {\r\n let store = await this.notesAccessStore(\"readwrite\")\r\n return store.put(noteObject)\r\n }", "afficher(note){\n\t\tdocument.querySelector(\"#currentNoteView\").innerHTML = this.convertir(note);\n\t}", "async function updateTaskNote(pNote) {\r\n await taskRef.update({note: pNote});\r\n console.log(\"Note of \" + task + \"updated to \" + pNote + \".\");\r\n}", "function updateNote(req, res) {\n Note.findByIdAndUpdate(\n req.params.id,\n {\n $set: {\n title: req.body.title,\n body: req.body.body\n }\n },\n {\n new: true\n }\n )\n .then(dbNoteData => res.status(200).json(dbNoteData))\n .catch(err => {\n console.log(err);\n res.status(500).json(err);\n });\n}", "function UpdateButn(index){\n let editTitle = document.getElementById('editTitle');\n let editTxt = document.getElementById(\"editTxt\");\n let notesObj = {\n title: editTitle.value,\n text: editTxt.value,\n id: index,\n };\n let data = Object.keys(notesObj)\n .map((key) => {\n return key + \"=\" + notesObj[key];\n })\n .join(\"&\");\n\n fetch(\"http://localhost:8081/php-notes-app/update-note.php\", {\n method: \"POST\",\n body: data,\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n }\n })\n .then((response) => response.json())\n .then((data) => {\n if (data.className == \"success\") {\n showAlert(data.msg, data.className); \n }\n if (data.className == \"danger\") {\n showAlert(data.msg, data.className);\n }\n // Dismiss after 2 seconds\n setTimeout(function () {\n document.getElementById(\"alert\").remove();\n }, 2000);\n editTxt.value = \"\";\n editTitle.value = \"\";\n showNotesById(userid.value);\n })\n .catch((error) => {\n console.log(error);\n });\n }", "render() {\n this.saveNotes()\n this.displayNotes()\n }", "handleSaveNote(event) {\n const updatedNote = this.trimNote(); //* returns the selected note with the whitespace around title/text removed\n\n if (this.isValidNote(updatedNote)) {\n //* saves the changes from selectedNote into the savedNotes list\n updatedNote.lastSaved = (new Date()).toUTCString(); //* updates save timestamp\n const savedNotes = this.state.savedNotes;\n\n //* updates selected note & state\n savedNotes.set(updatedNote.id, updatedNote);\n this.setState({ savedNotes });\n }\n\n else {\n alert('COMPUTER SAYS: The note must be filled out to use it...');\n }\n }", "update({ note, body }, res) {\n console.log(\n `${dateFormat(null, \"isoUtcDateTime\")} - REQUEST update [${note.id}]`\n );\n\n if (!validateNote(body)) {\n res.sendStatus(400);\n return;\n }\n\n body.id = note.id;\n body.tags = []\n .concat(getTagsInText(body.title))\n .concat(getTagsInText(body.description));\n\n db\n .collection(\"notes\")\n .updateOne({ id: body.id }, { $set: body }, (err, result) => {\n if (err) {\n return console.log(err);\n }\n res.sendStatus(204);\n\n db\n .collection(\"notes\")\n .find()\n .toArray(function(err, results) {\n broadcast(results);\n });\n });\n }", "function showNote() {\n $('#note').empty();\n let id = this.id;\n let note = createDiv(\"noteDiv\", data.players[id - 1].note)\n $('#note').append(note);\n }", "async function editNoteHandler(event) {\n event.preventDefault();\n\n const text = document.querySelector('input[name=\"note-text\"]').value.trim();\n const id = window.location.toString().split('/')[\n window.location.toString().split('/').length - 1\n ];\n const response = await fetch(`/api/notes/${id}`, {\n method: 'PUT',\n body: JSON.stringify({\n text\n }),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n\n if (response.ok) {\n document.location.replace('/dashboard');\n } else {\n alert(response.statusText);\n }\n}", "createUpdatedNote(req, res) {\n res.note.title = req.body.title\n res.note.description = req.body.description\n res.note.isPinned = req.body.isPinned != null ? req.body.isPinned : res.note.isPinned\n res.note.isArchived = req.body.isArchived != null ? req.body.isArchived : res.note.isArchived\n res.note.isDeleted = req.body.isDeleted != null ? req.body.isDeleted : res.note.isDeleted\n res.note.color = req.body.color || res.note.color\n }", "updateHandler() {\n\n // 1. Check if its (a) new note to be added or (b) update the existing note based on selectedBoardID\n var selectedBoardID = this.view.boardView.selectedBoardID;\n if (selectedBoardID === -1) {\n\n // There are 3-scenarios of add/insert\n // 1. First note added\n // 2. Insert after the last board displayed\n // 3. Append at last\n\n // 1. First note added\n if (this.startNoteID === -1 && this.endNoteID === -1) {\n\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = 0;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the empty board (if any) or the last board\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID\n this.startNoteID = 0;\n this.endNoteID = 0;\n\n } else {\n if (this.view.boardView.noOfNotes === this.view.boardView.maxNoBoards) {\n\n // NOTE: Board is full condition\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = this.endNoteID + 1;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the empty board (if any) or the last board\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID\n ++this.endNoteID;\n ++this.startNoteID;\n\n } else if (this.view.boardView.noOfNotes < this.view.boardView.maxNoBoards) {\n\n // Still empty boards are available to be filled\n // 1. Fetch the noteID after which the note should be inserted\n var insertedNoteID = this.endNoteID + 1;\n // 2. Insert the new note to the model\n this.model.insertNote(this.noteForm.elementCollection, insertedNoteID);\n // 3. Update the view with the new note added to the end of the noteCollection\n this.view.boardView.displayNoteAtEnd(insertedNoteID, this.model.noteCollection[insertedNoteID].name);\n // 4. Update the startNoteID and endNoteID \n ++this.endNoteID;\n }\n }\n\n } else {\n\n // Update the existing note\n // 1. Update the note in the model\n var noteToBeUpdated = this.view.boardView.boardCollection[selectedBoardID].getNote();\n this.model.updateNote(noteToBeUpdated.noteID, this.noteForm.elementCollection);\n\n // 2. Update the note in the view\n var updatedNote = this.model.noteCollection[noteToBeUpdated.noteID];\n this.view.boardView.displayNoteAt(selectedBoardID, noteToBeUpdated.noteID, updatedNote.name);\n }\n }", "async updateNote ({ commit, state }, noteObj)\n { \n let req = await axios.post('/save-note', noteObj) \n }", "notify (note) {\n // Handle type-specific updates.\n this.log('notes', 'notify', note)\n switch (note.type) {\n case 'order': {\n const order = note.order\n const mkt = this.user.exchanges[order.host].markets[order.market]\n if (mkt.orders) {\n for (const i in mkt.orders) {\n if (mkt.orders[i].id === order.id) {\n mkt.orders[i] = order\n break\n }\n }\n }\n break\n }\n case 'balance': {\n const wallet = this.user.assets[note.assetID].wallet\n if (wallet) wallet.balance = note.balance\n break\n }\n case 'feepayment':\n this.handleFeePaymentNote(note)\n break\n case 'walletstate': {\n const wallet = note.wallet\n this.assets[wallet.assetID].wallet = wallet\n this.walletMap[wallet.assetID] = wallet\n const balances = this.main.querySelectorAll(`[data-balance-target=\"${wallet.assetID}\"]`)\n balances.forEach(el => { el.textContent = (wallet.balance.available / 1e8).toFixed(8) })\n }\n }\n\n // Inform the page.\n if (this.loadedPage) this.loadedPage.notify(note)\n // Discard data notifications.\n if (note.severity < ntfn.POKE) return\n // Poke notifications have their own display.\n if (note.severity === ntfn.POKE) {\n this.pokeNote.firstChild.textContent = `${note.subject}: ${note.details}`\n this.pokeNote.classList.add('active')\n if (this.pokeNote.timer) {\n clearTimeout(this.pokeNote.timer)\n }\n this.pokeNote.timer = setTimeout(() => {\n this.pokeNote.classList.remove('active')\n delete this.pokeNote.timer\n }, 5000)\n return\n }\n // Success and higher severity go to the bell dropdown.\n this.notes.push(note)\n this.setNoteElements()\n }", "function UpdateNoteHandler(req, res, next) {\n const vidID = req.params.vidID;\n courseModel.updateNote(vidID, req.params.course, req.body.note, req.body.user).then(data => {\n res.status(200).json(data);\n });\n}", "function saveChanges() {\n var note_id = $('.note-info').attr('id'),\n csrftoken = $.cookie('csrftoken'),\n title = $('#title').text(),\n note_title = title === \"\" ? \"Untitled note\" : title,\n note_content = $('.editor').html(),\n data = {\n id: note_id,\n title: note_title,\n body: note_content,\n csrfmiddlewaretoken: csrftoken\n };\n\n $.post(\"/notes/editnote/\", data).success(function (data) {\n var note = $('#notelist').find('a[data-noteid=' + note_id + ']');\n $(note).find('strong').html(data.title);\n $(note).find('.preview').html(data.preview);\n });\n }", "updateActiveNote(note) {\n this.root.querySelector('.notes__title').value = note.title;\n this.root.querySelector('.notes__body').value = note.body;\n\n this.root.querySelectorAll('.notes__list-item').forEach(noteListItem => {\n noteListItem.classList.remove('notes__list-item--selected');\n });\n\n this.root.querySelector(`.notes__list-item[data-note-id='${note.id}']`).classList.add('notes__list-item--selected');\n }", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function updateothernote()\n{\n var logopener=\"----entering updateothernote----\";\n console.log(logopener);\n\n //lets get the id. \n console.log(\"UniqueGuid is \" + event.target.id);\n\n //we have the id. now, we need to do a post call to update it. \n var tempbutton = event.target;\n\n apiworkothernoteupdate(tempbutton);\n \n var logcloser=\"----leaving updateothernote----\";\n console.log(logcloser);\n}", "'change .js-editNote' (event) {\n // Get value from editNote element\n const text = event.currentTarget.value;\n note.set(text);\n }", "saveNote() {\n if (this.noteMessageInput.value) {\n let key = Date.now().toString();\n localStorage.setItem(key, this.noteMessageInput.value);\n this.displayNote(key, this.noteMessageInput.value);\n StickyNotesApp.resetMaterialTextfield(this.noteMessageInput);\n this.toggleButton();\n }\n }", "function updateContent(/** @type {string} */ text) {\r\n\t\tlet json;\r\n\t\ttry {\r\n\t\t\tif (!text) {\r\n\t\t\t\ttext = '{}';\r\n\t\t\t}\r\n\t\t\tjson = JSON.parse(text);\r\n\t\t} catch {\r\n\t\t\tnotesContainer.style.display = 'none';\r\n\t\t\terrorContainer.innerText = 'Error: Document is not valid json';\r\n\t\t\terrorContainer.style.display = '';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tnotesContainer.style.display = '';\r\n\t\terrorContainer.style.display = 'none';\r\n\r\n\t\t// Render the scratches\r\n\t\tnotesContainer.innerHTML = '';\r\n\t\tfor (const note of json.scratches || []) {\r\n\t\t\tconst element = document.createElement('div');\r\n\t\t\telement.className = 'note';\r\n\t\t\tnotesContainer.appendChild(element);\r\n\r\n\t\t\tconst text = document.createElement('div');\r\n\t\t\ttext.className = 'text';\r\n\t\t\tconst textContent = document.createElement('span');\r\n\t\t\ttextContent.innerText = note.text;\r\n\t\t\ttext.appendChild(textContent);\r\n\t\t\telement.appendChild(text);\r\n\r\n\t\t\tconst created = document.createElement('div');\r\n\t\t\tcreated.className = 'created';\r\n\t\t\tcreated.innerText = new Date(note.created).toUTCString();\r\n\t\t\telement.appendChild(created);\r\n\r\n\t\t\tconst deleteButton = document.createElement('button');\r\n\t\t\tdeleteButton.className = 'delete-button';\r\n\t\t\tdeleteButton.addEventListener('click', () => {\r\n\t\t\t\tvscode.postMessage({ type: 'delete', id: note.id, });\r\n\t\t\t});\r\n\t\t\telement.appendChild(deleteButton);\r\n\t\t}\r\n\r\n\t\tnotesContainer.appendChild(addButtonContainer);\r\n\t}", "function saveNote(noteID, note) {\n // Open the object store where all f the notes are stored,\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n \n console.log(note);\n \n var transaction = objectStore.get(noteID);\n // Wait for a success message.\n transaction.onsuccess = function(e) { \n var oldNote = e.target.result;\n oldNote.note = note;\n \n // Update the note.\n objectStore.put(oldNote);\n };\n}", "async function saveNote(){\n\temail = getUserEmail();\n\ttitle = getTitle();\n\tmessage = getMessage();\n\tconst url = `http://localhost:3000/new?email=${email}title=${title}&message=${message}`;\n\tconst response = await fetch(url);\t//calling the server, sending those input values to it\n\tconst data = await response.json();\t//format that response using JSON\n\tnoteMenuView();\t\t\t\t\t\t\t//go back to the main menu\n\n}", "function postNotes() {\n var pagearea = document.querySelector(\".note-box\");\n pagearea.innerHTML = \"\";\n var title = document.createElement(\"div\");\n title.className = \"title\";\n title.innerHTML = `<h1 class=\"display-3\">\n YOUR NOTES\n </h1>\n <hr class=\"cyan accent-1\" />\n `;\n pagearea.appendChild(title);\n notes.sort(function (a, b) {\n return b.pri - a.pri;\n });\n notes.forEach(e => {\n if (e.state) {\n var note = document.createElement(\"div\");\n note.style.transform = `rotate(${randomInteger(-15, 15)}deg)`;\n if (e.pri === \"1\") note.className = `card red accent-3 text-white`;\n else if (e.pri === \"2\") note.className = `card yellow accent-1`;\n else if (e.pri === \"3\") note.className = `card light-green accent-3`;\n note.className += \" hoverable z-depth-1\";\n note.innerHTML = `\n <div class=\"card-body\">\n <h2 style=\"display:none\">${e.id}</h2>\n <h3 class=\"card-title\">${e.title}</h3>\n <pre class=\"card-text\">${e.content}</pre>\n <button class=\"btn btn-primary float-left edit\">Edit</button>\n <button class=\"btn btn-danger delete\"><i class=\"material-icons\">close</i></button>\n </div>\n `;\n pagearea.appendChild(note);\n }\n });\n var x = document.querySelectorAll(\".delete\");\n x.forEach(element => {\n element.addEventListener(\"click\", e => {\n notes.forEach((note, i) => {\n if (note.id == element.parentElement.firstElementChild.innerHTML) {\n note.state = 0;\n sendmsg(\"Note Removed\", \"warning\");\n deleteNote();\n postNotes();\n }\n });\n });\n });\n\n //Update The Note\n\n var edits = document.querySelectorAll(\".edit\");\n edits.forEach(element => {\n element.addEventListener(\"click\", e => {\n notes.forEach((note, i) => {\n if (note.id == element.parentElement.firstElementChild.innerHTML) {\n note.state = 0;\n document.getElementById(\"title\").value = note.title;\n document.getElementById(\"contentbody\").value = note.content;\n btn.innerHTML = \"Apply Changes\";\n }\n });\n });\n });\n}", "function addNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\tappendNote(tr, defaultNote);\r\n\taddState();\r\n\t\r\n\trefreshNotes();\r\n}", "function updateNotifications(number) {\n $(\"#notificationNumber\").text(number);\n $(\"#notificationWindow\").text(number + \" new personal notes\");\n }", "function handleNoteButtonEvent(thisObj) {\n _changed = true;\n if ($(thisObj.getHtmlIds().noteContainer).visible()) {\n if (thisObj.getStandardValue() == thisObj.getMeta().seeNoteCui) {\n thisObj.clearNote();\n }\n else {\n thisObj.hideNote();\n }\n }\n else {\n thisObj.showNote();\n }\n }", "function submitEditNotes(ele){\n\t\t\tvar popup = document.getElementsByClassName(\"edit-notes-form\")[0],\n\t\t\t\tupdatedNotes = ele.parentNode.getElementsByTagName(\"textarea\")[0].value;\n\n\t\t\tif(!updatedNotes) updatedNotes = \"There are no notes for this event.\"\n\n\t\t\t// Update notes\n\t\t\tcurrentStepNode.setAttribute(\"data-notes\", updatedNotes);\n\n\t\t\t// Save notes to database\n\t\t\tsaveAction.enqueue( makeJsonFromNode(currentStepNode));\n\n\t\t\t// Remove popup\n\t\t\tremoveEditNotes(popup);\n\t\t}", "function editNote(key, value) {\n updateNote({\n ...activeNote, // keep what is unchanged in the activeNote object\n [key]: value, // change the values of the keys that are specified in the\n noteLastModified: Date.now(),\n });\n }", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++;\n var note = {\n noteId: notesCounter,\n noteText: noteText.value,\n noteHead: noteHead.value,\n colorBg: noteDiv.style.background || \"rgb(255, 255, 255)\",\n tags: [],\n noteFavorite: false,\n noteFavoritePos: null,\n };\n // Add note to front end array\n notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n console.log(note);\n }", "update() { \n if( this.state == \"play\" && this.notes.length > 0) {\n this.currentTime = millis() - this.startTime;\n this.position.x = this.starterPos - this.getPosXFromBPM(this.currentTime, this.BPM);\n }\n this.BPM = this.inputBPM.value();\n // RECORD mode\n /* if( this.state === \"record\" ) {\n this.recordingNotes();\n }*/\n }", "function Update() {\n\tvar newUrl = \"http://localhost:8000/notes/\" + $('#txtUpdate').val()\n\t$.ajax({\n\t\turl: newUrl,\n\t\tdata: { value: $('#txtnew').val() },\n\t\tmethod: \"PUT\",\n\t\tsuccess: (data) => {\n\t\t\tconsole.log(data)\n\t\t\t\n\t\t}\n\t});\n}", "function editNote(index) {\r\n const uid = localStorage.getItem(\"uid\")\r\n window.scrollTo(0, 0);\r\n var adaRef = firebase.database().ref('notes/' + uid + '/' + index);\r\n adaRef.get().then((snapshot) => {\r\n if (snapshot.exists()) {\r\n var crrntNote = snapshot.val();\r\n document.getElementById(\"addTitle\").value = crrntNote.title;\r\n document.getElementById(\"addTxt\").value = crrntNote.content;\r\n CKEDITOR.instances[\"addTxt\"].setData(crrntNote);\r\n replaceButtonText('addBtn', 'Update Note');\r\n flagEdit = 1;\r\n editIndex = index;\r\n\r\n }\r\n }).catch((error) => {\r\n console.error(error);\r\n });\r\n}", "function updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\r\n}", "function noteController($scope, data) {\n\t\t\t\t$scope.data = data;\n\n\t\t\t\t$scope.updateNotes = function(data) {\n\t\t\t\t\tvar update = notesService.updateNotes(data);\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t\tupdate.then(function(response) {\n\t\t\t\t\t\t$mdDialog.hide();\n\t\t\t\t\t\tgetNotes();\n\t\t\t\t\t}, function(response) {\n\t\t\t\t\t\tgetNotes();\n\t\t\t\t\t})\n\t\t\t\t\tgetNotes();\n\t\t\t\t}\n\t\t\t}", "function saveNote() {\n var sText = document.getElementById('note_area').value;\n\n if (oSelectedNote == null) {\n note = new Note();\n note.sNote = sText;\n\n oData.jsFormula.addNote(note);\n\n oNotesTable.row.add([\n note.nuNote,\n note.iIdNote,\n note.sNote\n ]).draw( false );\n }\n else {\n oData.jsFormula.getNote(oSelectedNote.nuNote).sNote = sText;\n $('#notes_table').dataTable().fnUpdate(sText , oSelectedNote.nuNote, 2);\n }\n\n initNote();\n}", "function UpdateNote(noteIndex, newNote) {\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray[noteIndex] = newNote;\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n editNoteIndex: -1,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "function updateNote(userId, noteId, newBody, newTitle) {\r\n var d = new Date(Date.now())\r\n var lastUpdated = d.getDate() + '.' + (d.getMonth() + 1) + '.' + d.getFullYear() + ',' + d.getHours() + ':' + d.getMinutes();\r\n let updates = {\r\n ['/notes/' + userId + '/' + noteId + '/content']: newBody,\r\n ['/notes/' + userId + '/' + noteId + '/title']: newTitle,\r\n ['/notes/' + userId + '/' + noteId + '/lastUpdated']: lastUpdated\r\n }\r\n return firebase.database().ref().update(updates, (e) => {\r\n if (e) console.log(e)\r\n })\r\n}", "function renderNotes() {\n noteArray = JSON.parse(localStorage.getItem(\"dayNotes\")) || [];\n $(noteArray).each(function () {\n $(\"#\" + this.id).find(\"textarea\").text(this.note)\n });\n}", "function renderNoteText(li, noteObj) {\n li.innerHTML = `<span>${noteObj.body}</span> ${noteObj.updated_at ? moment(noteObj.updated_at).format('MMM DD, YYYY') : \"\"}`\n}", "function reloadNotes() {\n pollingObserver.reloadAll(function (notes) {\n var notesList = $(\"#js-notes-list\");\n notesList.html(createNotesHtml(notes));\n addClickHandlers(notesList);\n });\n }", "function doLogNote(note) {\n if(BD18.noteTimeout !== null) {\n clearTimeout(BD18.noteTimeout);\n }\n var msg = BD18.welcomename + \": \" + note;\n $('#lognote').text(msg);\n BD18.noteTimeout = setTimeout(function() {\n $('#lognote').text(\"\");\n BD18.noteTimeout = null;\n },\"20000\");\n}", "function renderNoteInfo(aNote) {\n while(noteTitle.firstChild){\n noteTitle.removeChild(noteTitle.firstChild)\n }\n noteTitle.innerHTML = `<h2>${aNote.title}</h2>`\n let n = document.createElement('p')\n n.innerHTML = `<a>${aNote.content}</a>\n <br>\n <br>\n <button data-id=${aNote.id} id=\"editNoteBtn\">Edit this note</button>\n <button data-id=${aNote.id} id=\"deleteNoteBtn\">Delete this note</button>\n `\n noteTitle.appendChild(n)\n}", "function showNotesEditor(noteId, noteTitle = '', noteContent = '') {\n\n newNoteBtn.addClass('d-none');\n let label = noteId ? 'Editar Nota' : 'Nueva Nota';\n let buttonText = noteId ? 'Actualizar Nota' : 'Guardar Nota';\n\n notesContainer.html(`\n <div style='text-align: center;'>\n <h4>${label}</h4>\n </div>\n <div class='form' style='margin: 15px'>\n <input id='note-title' type='text' class='form-control' placeholder='Título' maxlength='500' value='${noteTitle}'>\n <textarea id='note-content' class='form-control mt-3' placeholder='Contenido' id='floatingTextarea' style='height: 350px'>${noteContent}</textarea>\n </div>\n <div style='text-align: right; margin: 15px'>\n <button id='upsert-note' class='btn btn-success ms-auto'>${buttonText}</button>\n <button id='edit-note-cancel' class='btn btn-warning ms-auto'>Cancelar</button>\n </div>\n `);\n\n $('#edit-note-cancel').on('click', function () {\n loadNotes();\n });\n\n $('#upsert-note').on('click', function () {\n\n const title = $('#note-title').val().trim();\n const content = $('#note-content').val().trim();\n\n if (title === '') {\n iziToast.warning({\n message: 'Ingresa el título de la nota',\n close: true,\n timeout: 2000,\n });\n return;\n }\n\n if (content === '') {\n iziToast.warning({\n message: 'Ingresa el contenido de la nota',\n close: true,\n timeout: 2000,\n });\n return;\n }\n\n if (!noteId) {\n // Nueva Nota\n executeRequest('POST', 'notes/create', { title: title, content: content }).then(r => {\n\n iziToast.success({\n message: 'La nota se ha guardado correctamente',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n } else {\n // Actualizar Nota\n executeRequest('PATCH', 'notes/update', { id: noteId, title: title, content: content }).then(r => {\n\n iziToast.success({\n message: 'La nota se ha actualizado correctamente',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n }\n });\n\n}", "componentDidUpdate(oldProps) {\n if (oldProps.notes.note !== this.props.notes.note) {\n const note = this.props.notes.note;\n this.setState({ note });\n }\n if (oldProps.signedIn !== this.props.signedIn && !this.props.signedIn) {\n this.setState({ note: {\n id: null,\n text: '# Welcome to Markdown Notes\\n### This is a playground for writing markdown\\nSign in and click **Create Note** to start editing a saved note!'\n }});\n }\n }", "async addNew() {\n let newNote = {};\n // This timestamp will be used to get a unique timestamp for the new note\n let time = new Date();\n let color = this.fetchRandomColor();\n // if we can't succesfully fetch the JOKE API, we use this as a template message\n let joke = 'sample message';\n\n try {\n // First we see if we manage to find A GREAT JOKE\n joke = await this.joke();\n } catch(error) {\n console.error(error);\n }\n\n // If we already have some notes..\n if (Array.isArray(this.state.notes) && this.state.notes.length) {\n let maxOrder = Math.max.apply(Math,this.state.notes.map(function(o){return o.order;}));\n newNote = noteTemplate(time.getTime(), maxOrder+1, color, joke);\n // If we don't...\n } else {\n newNote = noteTemplate(time.getTime(), 1, color, joke);\n }\n\n // And update whatever needs to be updated (state, Realm)\n let clonedNotes = [...this.state.notes];\n clonedNotes.push(newNote);\n // Realm storing\n await this.storeLocal(clonedNotes);\n this.setState({ notes: clonedNotes },\n function() {\n this.updateItem(this.state);\n }.bind(this));\n\n let requestOptions = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n time: newNote.time,\n lastEdited: newNote.lastEdited,\n left: newNote.left,\n top: newNote.top,\n title: newNote.title,\n text: newNote.text,\n color: newNote.color,\n order: newNote.order\n }),\n };\n\n // Here we use POST method to transfer one Note to the ENDPOINT\n await fetch(API + WRITE, requestOptions)\n .then(response => response.json());\n\n }", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++; // increamenting notes count\n var note = {\n noteId: notesCounter,\n noteText: noteText.value,\n noteHead: noteHead.value,\n colorBg: noteDiv.style.background || \"rgb(255, 255, 255)\",\n tags: [],\n noteFavorite: false,\n noteFavoritePos: null,\n };\n notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n updateDB();\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\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 submitnote(note) {\n $.post(\"/api/notes\", note, function() {\n window.location.href = \"/notes\";\n });\n }", "onSaveNotesDone(response) {\n const updatedEventNotes = this.state.feed.event_notes.concat([response]);\n const updatedFeed = merge(this.state.feed, { event_notes: updatedEventNotes });\n this.setState({\n feed: updatedFeed,\n requests: merge(this.state.requests, { saveNote: null }),\n noteInProgressText: '',\n noteInProgressType: null,\n noteInProgressAttachmentUrls: []\n });\n }", "function handleNoteChanged(changed) {\n \n // default changed value is 'true'\n changed = typeof changed !== 'undefined' ? changed : true;\n \n // save the initial values if the note is unchanged\n if (!changed) {\n\tvar $noteTitle = $(\"#note-title\");\n\t$noteTitle.data('initial-value', $noteTitle.val());\n\tvar $noteText = $(\"#note-area\");\n\t$noteText.data('initial-value', $noteText.val());\n }\n \n // update the state of the save button\n $(\"#save-button\").attr(\"disabled\", !changed);\n noteChanged = changed;\n}", "function displayNotes(notes) {\n var oldContent = document.getElementById('script');\n var para = document.createElement(\"p\");\n para.id = 'script';\n var newContent = document.createTextNode(notes);\n para.appendChild(newContent);\n presenterNotes.replaceChild(para, oldContent);\n}", "function changeNote() {\n editor.value = window.localStorage.getItem(notes.value);\n}", "async updateNotes(notes, deleteNonExisting) {\n\n if (deleteNonExisting) {\n // We remove a note from memory and localStorage, if remote version is flagged for removal.\n for (let i = 0; i < notes.length; i++) {\n\n if (typeof notes[i].isRemoved === 'undefined') {\n await this.delete(notes[i].time);\n notes.splice(i, 1);\n } else {\n delete notes[i].isRemoved;\n }\n }\n\n }\n\n await this.storeLocal(notes);\n this.setState({ notes: notes, orderChanged: false },\n function() {\n this.updateItem(this.state);\n }.bind(this));\n }", "function updateEditNotePage(urlObj, options) {\n\tvar index = urlObj.hash.replace( /.*index=/, \"\" ),\n\t\tpageSelector = urlObj.hash.replace( /\\?.*$/, \"\" );\n\tvar dataJSON = jQuery.parseJSON(localStorage.getItem(index)),\n\t\t$page = $( pageSelector );\n\tvar textfield = \"<b><label class='label'>Note Title:</label></b>\" +\n\t\t\t\t\t\"<input id='editNoteTitle' type='text' class='textInput' value='\" + \n\t\t\t\t\tdataJSON.title + \"'></input><b><label id='todoLabel' class='label'>\" + \n\t\t\t\t\t\"TODO:</label></b><textarea id='editNoteText' class='textInput'>\" +\n\t\t\t\t\tdataJSON.note + \"</textarea>\";\n\t\n\t$content = $page.children(\":jqmData(role=content)\");\n\t$content.html(textfield);\n\t$page.page();\n\t$(\"input\").textinput();\n\t$(\"textarea\").textinput();\n\t$(\"#editNoteText\").TextAreaResizer();\n\toptions.dataUrl = urlObj.href;\n\t$.mobile.changePage( $page, options );\n\tupdatePageLayout(\"#editNoteContent\", \"#editNoteHeader\", \"#editNoteNavbar\");\n}", "newNote(note) {\n const { title, text } = note;\n // This is input validation requiring the title and note to both have at least 1 character.\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' both have a 1 character minimum requirement!\");\n }\n\n // This adds a unique ID to the new note as well as the title and text.\n const newNote = { title, text, id: uniqueID() };\n\n // This retrives all the notes, writes all the updated notes, adds the new note, and returns the newNote.\n return this.retrieveNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.writeFile(updatedNotes))\n .then(() => newNote);\n }", "function updateNote(req, res, callback) {\n console.log('update db connection', req.params.id, req.body);\n db.update({_id: req.params.id},\n {\n $set: {\n title: req.body.title,\n taskDate: req.body.taskDate,\n message: req.body.message,\n priority: req.body.priority,\n status: req.body.status\n }\n },\n {multi: true},\n function (err, docs) {\n if (callback) {\n callback(err, docs);\n }\n });\n}", "handler(argv) {\n notes.addNote(argv.title,argv.body)\n }", "function patchNote(content, id) {\n if(!content) {\n content = ' ';\n }\n\n let data = { content };\n $.ajax({\n url : `/notes/${id}`,\n data : JSON.stringify(data),\n type : 'PATCH',\n contentType : 'application/json',\n processData: false,\n dataType: 'json'\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}", "get note () {\n\t\treturn this._note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "get note () {\n\t\treturn this._note;\n\t}", "function addNote(worker, note) {\n if (note != null) {\n note = datastore.createNote(note);\n worker.port.emit(\"NoteAdded\", note);\n }\n}", "function newNote(gameState, text) {\n thisGameState.notes.push(text);\n socket.emit(\"save\", gameState);\n}", "function edit_notes_show_report(userid, notes_id, notes_type) \n\t\t\t{\n\t\t\t\tjQuery(\"#message\").html(\"\");\n\t\t\t\tjQuery(\"#edit_notes_div\").html(\"\");\n\t\t\t\tjQuery(\"#edit_notes_div\").html(\"<img src='../images/ajax-loader.gif'/>\");\n\t\t\t\tjQuery.get('edit_notes_show_report.php?userid='+userid+'&notes_id='+notes_id+'&notes_type='+notes_type, function(html){\n\t\t\t\t\t\n\n\t\t\t\t\t// console.log(html);exit();\n\t\t\t\t\t//console.log(html);exit();\n\t\t\t\t\tjQuery(\"#edit_notes_div\").html(html);\n\t\t\t\t\t$('textarea').summernote({\n\t\t\t\t\t\t toolbar: [\n\t\t\t\t\t\t //[groupname, [button list]]\n\t\t\t\t\t\t ['style', ['bold', 'italic', 'underline']],\n\t\t\t\t\t\t ['fontsize', ['fontsize']],\n\t\t\t\t\t\t ['para', ['ul', 'ol', 'paragraph']],\n\t\t\t\t\t\t ],\n\t\t\t\t\t\t height:200\n\t\t\t\t\t\t});\n\t\t\t\t\tsync_to_v2();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}", "function editNote(index) { \n let modalContent = document.getElementById(\"openModal\");\n let html = `<div class=\"form-group\">\n <h5 class=\"title text-dark\">Edit title</h5>\n <input type=\"text\" class=\"form-control\" id=\"editTitle\">\n </div>\n <button type=\"button\" class=\"close cross\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"form-group\">\n <h5 class=\"card-title text-dark\">Edit your note</h5>\n <textarea class=\"form-control\" id=\"editTxt\" rows=\"5\" required></textarea>\n </div>\n <button class=\"btn btn-info updateButn\" id=\"${index}\" onclick=\"UpdateButn(this.id)\" data-dismiss=\"modal\">Update Note</button>`;\n modalContent.innerHTML = html;\n let noteObj = {\n id: index,\n };\n\n var data = Object.keys(noteObj)\n .map(function (key) {\n return key + \"=\" + noteObj[key];\n })\n .join(\"&\");\n\n\n fetch(\"http://localhost:8081/php-notes-app/edit-note-by-id.php\", {\n body: data,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n }\n })\n .then(response => response.json())\n .then(data => {\n for(let i = 0; i < data.length; i++){\n if (data.length > 0) {\n document.getElementById(\"editTxt\").value = (data[i].text);\n document.getElementById(\"editTitle\").value = (data[i].title);\n }\n } \n })\n .catch(error => {\n console.log('error: ', error);\n });\n}", "setNotes (notes) {\n this.log('notes', 'setNotes', notes)\n this.notes = notes\n this.setNoteElements()\n }", "addNote(info) {\n const { title, text } = info;\n const newNote = { title, text, id: uuid() };\n return this.getInfo()\n .then ((info) => [...info, newNote])\n .then((updateInfo)=> this.write(updateInfo))\n .then(() => newNote);\n }", "function viewPostForUpdate(pst){\n\tvar singlePost = pst;\n\tvar main = $(\".note-container\");\n\tmain.html(\"\");\n\tvar userInformation = singlePost[0].user_info[0];\n\tvar postText = singlePost[0].post_text;\n\tvar postId = singlePost[0].post_id;\n\tvar postTitle = singlePost[0].post_title;\n\tvar postCategoryId = singlePost[0].category_id;\n\tvar firstName = userInformation.first_name;\n\tvar lastName = userInformation.last_name;\n\tvar imageId = userInformation.image;\n\tvar gender = userInformation.gender;\n\tvar userId = userInformation.user_id;\n\tvar postType = singlePost[0].post_type;\n\tvar imageLocation;\n\tvar likeClass = \"\";\n\tvar unlikeClass = \"\";\n\n\t$(\".user-name\").html(firstName+\" \"+lastName);\n\t$('[data-topicid~='+postCategoryId+']').addClass(\"selected\");\n\t$(\"#postTitle\").val(postTitle);\n\t$(\"#postId\").val(postId);\n\t$(\"#topicId\").val(postCategoryId);\n\t$(\"#userId\").val(userId);\n\t$(\".nicEdit-main\").html(postText);\n}", "async editNote(req, res) {\n try {\n //get the particuler user note to edit\n const notesCollection = await Notes.findOne({ ID: req.params.ID });\n //if the note doesnt exist return an error message;\n if (!notesCollection)\n return res.status(400).send(\"oops, an error occured!\");\n //get the value to be updated\n const update = {};\n } catch (error) {\n return res.status(400).json({ error: error.message });\n }\n }", "function saveNoteInPopUp() {\n var currentNote = document.querySelector(\".note-list__item[data-item-number='\" + currentNoteId + \"']\");\n notes.forEach(function(element, index) { \n if (element.noteId === currentNoteId) {\n element.noteText = editText.value;\n currentNote.style.background = element.colorBg;\n if (!editHead) {\n element.noteHead = \"\";\n } else {\n element.noteHead = editHead.value;\n }\n }\n });\n currentNote.querySelector(\".note-list__text\").innerHTML = editText.value;\n currentNote.querySelector(\".note-list__head\").innerHTML = editHead.value;\n if (!currentNote.querySelector(\".note-list__head\").innerHTML) {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"0px\";\n } else {\n currentNote.querySelector(\".note-list__head\").style.marginBottom = \"10px\";\n }\n notePopUp.style.display = 'none';\n document.querySelector(\".overlay\").style.display = 'none';\n \n }", "function refreshNotes(){\n $('.all-notes').empty();\n db.transaction(function (tx) { \n tx.executeSql('SELECT * FROM NOTES', [], function (tx, results) {\n var len = results.rows.length, i;\n msg = \"Found rows: \" + len;\n console.log(msg);\n \n if(len===1){\n $('#notes-counter').text(len+' note');\n }\n else{\n $('#notes-counter').text(len+' notes');\n }\n \n \n for (i = 0; i < len; i++){\n msg = results.rows.item(i).title;\n console.log(results.rows.item(i).ID, msg);\n \n var newNote='<a href=\"#\" data-id=\"'+results.rows.item(i).ID+'\" data-modified=\"'+results.rows.item(i).modified+'\" class=\"note-link\">'+\n '<div class=\"note\">'+\n '<small class=\"date note-modified\">'+results.rows.item(i).modified+'</small>'+\n '<h4>'+truncateTo(results.rows.item(i).title,40)+'</h4>'+\n '<p>'+truncateTo(results.rows.item(i).note,120)+'</p>'+\n '</div>'+\n '</a>';\n $('.all-notes').append($(newNote));\n\n }\n }, null);\n });\n }", "addNote(note) {\n const {title,text}=note;\n if (!title || !text){\n throw new Error(\"Neither text or title can be blank for the note entered\");\n }\n const newNote={title,text,id:uniqid()};\n return this.getNotes()\n .then((notes)=>[...notes,newNote])\n .then((currentNotes)=>this.write(currentNotes))\n .then(()=>newNote);\n }", "function syncReview(e){\n let sync = () =>{\n let inputs = headlineNote.innerText.split(\"\\n\\n\");\n inputs.forEach((input, index) => { \n index < placeholders.length ?\n placeholders[index].textContent = input.trim() :\n ''; \n });\n }\n setTimeout(sync, 0.1);\n}", "function updateAnimeFromUserList(animeID, notes) {\n db.transaction((tx) => {\n tx.executeSql(\n \"update userlist set notes = ? where id = ?\",\n [notes, Number(animeID)],\n () => {\n console.log(\n `useDB: Updated note property of anime with id ${animeID} from userlist to \"${notes}\" in database!`\n );\n dispatch(editUserDataListItemNotes({ id: animeID, notes }));\n }\n );\n });\n }", "function viewNote() {\n // increment views\n Note.get({id: $stateParams.id}).$promise.then(function(response){\n $scope.resource = response.data.resource;\n $scope.relatedResources = response.data.related_resources;\n });\n }", "sendDataToServer() {\n // clear lastEditedTimestamp (so that further edits are tracked).\n // before clearing the value, save the value for error handling.\n let tmpTimestamp = this.lastEditedTimestamp;\n this.lastEditedTimestamp = null;\n\n let snapshotTimestamp = Date.now();\n\n if (this.getNotesId()) {\n let success;\n switch (this.getNotesType()) {\n case 'notepage':\n success = ServerManager.instance.updateNotepage(this.getNotesId(), this.getTitle(), this.getTags(), this.getSource(), this.getContent());\n break;\n\n case 'notebook':\n success = ServerManager.instance.updateNotebook(this.getNotesId(), this.getTitle(), this.getTags(), this.getSource());\n break;\n\n default:\n console.error('Unknown notesType ' + this.getNotesType());\n this.lastEditedTimestamp = tmpTimestamp;\n alert('Failed to save notes.');\n return false;\n }\n\n if (success) {\n this.lastSavedTimestamp = snapshotTimestamp;\n console.debug('Text changes auto-saved at ' + snapshotTimestamp);\n\n // UI indication\n this.updateState_isNotesEdited('content-saved');\n return true;\n\n } else {\n console.error('Failed to save notepage data. Will retry after ' + AUTO_SAVE_WAIT_TIME + ' ms');\n this.lastEditedTimestamp = tmpTimestamp;\n\n // call sendTextToServer() method after AUTO_SAVE_WAIT_TIME (call once)\n setTimeout(function () { QuillEditor.instance.sendDataToServer() }, AUTO_SAVE_WAIT_TIME);\n return false;\n }\n\n } else {\n console.warn('No notes selected. Cannot save notes.');\n return false;\n }\n }", "function updateAddNotePage(urlObj, options) {\n\tvar $page = $( urlObj.hash ),\n\t\t$content = $page.children(\":jqmData(role=content)\");\n\tvar textfield = \"<b><label class='label'>Note Title:</label></b>\" +\n\t\t\t\t\"<input id='addNoteTitle' type='text' class='textInput'></input>\" +\n\t\t\t\t\"<b><label id='todoLabel' class='label'>TODO:</label></b>\" +\n\t\t\t\t\"<textarea id='addNoteText' type='text' class='textInput'></textarea>\";\n\t\n\t$content.html(textfield);\n\t$page.page();\n\t$(\"input\").textinput();\n\t$(\"textarea\").textinput();\n\t$(\"#addNoteText\").TextAreaResizer();\n\toptions.dataUrl = urlObj.href;\n\t$.mobile.changePage( $page, options);\n\tupdatePageLayout(\"#addNoteContent\", \"#addNoteHeader\", \"#addNoteNavbar\");\n}" ]
[ "0.7333453", "0.7317997", "0.6923655", "0.69101566", "0.67470664", "0.6739527", "0.66760373", "0.6638135", "0.66198355", "0.65872747", "0.655937", "0.6505686", "0.6501371", "0.649076", "0.648418", "0.6480327", "0.64525676", "0.64412075", "0.6432651", "0.64277625", "0.6414278", "0.63791776", "0.6357503", "0.63429004", "0.6339388", "0.63279593", "0.63214725", "0.63179094", "0.6310621", "0.6293707", "0.6289708", "0.62725794", "0.6252859", "0.6194194", "0.6186744", "0.61851144", "0.6183138", "0.61773366", "0.61766595", "0.6160665", "0.6150254", "0.611148", "0.61000156", "0.60868233", "0.6086752", "0.60860974", "0.6063683", "0.6051078", "0.6021713", "0.60210335", "0.6014378", "0.600017", "0.599455", "0.5993595", "0.59932464", "0.5990083", "0.59894264", "0.5989344", "0.59757483", "0.59736353", "0.5972776", "0.59714305", "0.59700483", "0.59619683", "0.59605914", "0.5959831", "0.5952762", "0.59503525", "0.5947988", "0.5940906", "0.5936867", "0.59363043", "0.5932746", "0.59319156", "0.5927658", "0.59261996", "0.5924743", "0.5916816", "0.5916201", "0.59160614", "0.59115225", "0.59115225", "0.59115225", "0.59115225", "0.59091586", "0.5908532", "0.59040314", "0.59036493", "0.5901747", "0.5901002", "0.58879423", "0.58801496", "0.5872051", "0.5866156", "0.5864807", "0.5845264", "0.58447427", "0.5842848", "0.5842622", "0.5838256" ]
0.67257565
6
delete note on server and updates UI appropriately
function DeleteNote(noteNodeObj) { // update each save button to display loading ShowLoadingByClassName("DeleteNoteButton"); var email = CacheStoreGet("email"); var authToken = CacheStoreGet("token"); var data = { Email: email, AuthToken: authToken, RowKey: noteNodeObj.note().noteId }; $.ajax({ type: "POST", url: "../note/DeleteNote", data: data, success: function (response) { if (response == "Expired") { // Auth token has expired AuthUserAndSetCookie(email, CacheStoreGet("password"), function () { DeleteNote(noteNodeObj); }, // on success function () { Redirect('Signup.html'); showError("Please log in to continue"); }) // on failure } else { if (response == "RefreshRecent") { QueryRecentTokens(); } noteNodeObj.onSuccessfulDelete(); // attempt to remove it from recent cachedNotes.DeleteNote(noteNodeObj.note().noteId); } HideButtonImageByClassName("DeleteNoteButton"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function note_delete()\n {\n // grab the .data element of note to delete\n var axe_it = $(this).data(\"_id\");\n $.ajax(\n {\n url: \"/api/notes/\" + axe_it,\n method: \"DELETE\"\n }).then(function()\n {\n // on success, hide the modal\n bootbox.hideAll();\n });\n }", "function deleteNote() {\n card_body = $(this).parent();\n card = $(this).parent().parent();\n\n text_delete_title = card_body.find($('textarea')).val();\n changeStatus(text_delete_title, \"binned\");\n\n localStorage.setItem(\"Notes\",JSON.stringify(notes));\n card.remove();\n \n $('.toast').toast(\"show\");\n}", "function delNote(){\r\n\tvar t = document.querySelector(\"#notes\");\r\n\tvar tr = t.childNodes[0];\r\n\ttr.deleteCell(tr.childElementCount-1);\r\n\tdelState();\r\n\t\r\n\trefreshNotes();\r\n}", "function deleteNote() {\n const note_id = note.id;\n axios\n .delete(`/api/deleteNote/${note_id}`)\n .then((res) => {\n // console.log(res.data);\n })\n .catch((error) => console.log(error));\n }", "handler(argv) {\n notes.removeNote(argv.title)\n // console.log('Removing the note')\n }", "function deleteNote() {\n if (oSelectedNote != null) {\n oData.jsFormula.removeNote(oSelectedNote.nuNote);\n oNotesTable.row('.selected').remove().draw( false );\n initNote();\n }\n}", "function removeNote(e) {\n div_id = e.path[2].id;\n if (div_id !== 'data') {\n // do not delete the entire data element accidentally due to html image glitches.\n document.getElementById(div_id).remove();\n save_notes();\n loadNotes();\n }\n }", "function deleteNote(note) {\n setAllNotes(allNotes.filter(item => item !== note));\n const notesDataJson = JSON.stringify(allNotes);\n localStorage.setItem('notesData', notesDataJson);\n }", "function deleteNote(index) {\r\n const uid = localStorage.getItem(\"uid\")\r\n var adaRef = firebase.database().ref('notes/' + uid + '/' + index);\r\n adaRef.remove()\r\n .then(function () {\r\n getNotesForThisUser().then(notes => display(notes)).catch(err => handleError(err))\r\n CKEDITOR.instances[\"addTxt\"].setData('');\r\n })\r\n .catch(function (error) {\r\n console.log(\"Remove failed: \" + error.message)\r\n });\r\n\r\n\r\n\r\n}", "function deleteNote(event) {\n event.preventDefault();\n const element = event.target;\n\n const note = $(this).data('id');\n\n $.ajax({\n method: 'delete',\n url: `/api/notes/${note}`,\n headers: { 'X-CSRF-Token': token },\n }).done(() => {\n $(element).parents('.note').remove();\n });\n }", "function deleteNote(noteEl) {\n fetch(url + '/' + `${noteEl.id} `, {\n method: 'DELETE'\n }).then(() => noteEl.parentElement.remove())\n}", "deleteNote() {\n\n // Check if any board is selected before delete, else terminate\n var boardID = this.view.boardView.selectedBoardID;\n if (boardID !== -1) {\n\n // 1. Delete the note from the model\n var noteToBeDeleted = this.view.boardView.boardCollection[boardID].getNote();\n this.model.deleteNote(noteToBeDeleted.noteID);\n\n // 2. Delete the note from the view\n this.view.boardView.deleteNote(boardID);\n\n // 3. Update the startNoteID and endNoteID\n if (this.startNoteID === 0 && this.endNoteID === 0) {\n this.startNoteID = -1;\n this.endNoteID = -1;\n\n } else if (this.endNoteID <= this.model.noteCollection.length - 1) {\n // (a) Get the next note from the model to be displayed (if exists) from right\n var nextNote = this.model.noteCollection[this.endNoteID];\n this.view.boardView.displayNoteAtEnd(this.endNoteID, nextNote.name);\n\n } else if (this.startNoteID > 0) {\n // (a) Get the prev note from the mode to be displayed (if exists) from left\n var prevNote = this.model.noteCollection[this.startNoteID - 1];\n this.view.boardView.displayNoteAtStart(this.startNoteID - 1, prevNote.name);\n\n --this.startNoteID;\n --this.endNoteID;\n } else {\n // No note appended at start or end\n --this.endNoteID;\n }\n\n // 4. Unselect the board after delete\n this.view.boardView.unselectBoard();\n }\n }", "deleteNote(privateNote) {\n privateNote.deleteRecord();\n privateNote.save();\n }", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "function deleteNote(note) {\n note.remove();\n borderedNote = null;\n}", "function removeNote(){\n\tthis.parentNode.remove();\n\tupdateNoteNumbers();\n}", "function removeNotes() {\n $(\".note\").remove();\n saveNotes();\n}", "function deleteNote(noteID) {\n // Retrieve the object store for the notes.\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n console.log(noteID);\n \n // Remove the note from the database.\n objectStore.delete(noteID);\n\n // Remove the radio button for the note.\n var button = $('input[value=\"' + noteID + '\"]');\n $(button[0].parentElement).slideUp(\"fast\");\n}", "delete({ note }, res) {\n console.log(\n `${dateFormat(null, \"isoUtcDateTime\")} - REQUEST delete [${note.id}]`\n );\n\n db.collection(\"notes\").deleteOne({ id: note.id }, (err, result) => {\n if (err) {\n return console.log(err);\n }\n res.sendStatus(204);\n\n db\n .collection(\"notes\")\n .find()\n .toArray(function(err, results) {\n broadcast(results);\n });\n });\n }", "async syncDelete(note) {\n try {\n let requestOptions = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n time: note.time,\n lastEdited: note.lastEdited,\n left: note.left,\n top: note.top,\n title: note.title,\n text: note.text,\n color: note.color,\n order: note.order\n })\n };\n\n await fetch(API + DELETE, requestOptions)\n .then(response => response.json());\n } catch (error) {\n console.log(error);\n }\n }", "function handlenoteDelete() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n deletenote(currentnote);\n }", "function deleteNote(index){\r\n\r\nlet notes = localStorage.getItem('notes');\r\n\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\r\n //console.log(\"Deleting Note\",index);\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "deleteNote(note) {\n this.notes = this.notes.filter(item => item !== note);\n }", "function deleteNote(index) {\r\n console.log(\"deleting this node.\", index);\r\n let notes = localStorage.getItem(\"notes\"); //take notes from localstorage.\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));//updating localstorage..\r\n showNotes();\r\n\r\n}", "function deleteNote(index) {\r\n// console.log(\"I am deleting\", index);\r\n\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 notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index){\n console.log(`I am deleting `,index);\n // let notes=localStorage.getItem(\"notes\");\n // if(notes==null){\n // notesobj=[];\n // }\n // else{\n // notesobj=JSON.parse(notes);\n // }\n notesobj.splice(index,1);\n localStorage.setItem(\"notes\",JSON.stringify(notesobj));\n showNotes();\n}", "function deleteNote(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"NoteDeleted\", noteId);\n }\n}", "function deleteNote(username){\n if(db.get('posts').find({username: username}).value() !== undefined){\n // delete note\n db.get('posts').remove({username, username}).write()\n }\n else{\n // note does not exist\n }\n}", "function deleteNote(index) {\n let notes_check = localStorage.getItem(\"notes\");\n if (notes_check == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes_check);\n }\n\n /*we are deleting from the array notesObj the elemnt in which \"Delete Note\" has been clicked and the index of that element is passed here.1 indicates that we want to delete just one element from that index number.*/\n notesObj.splice(index, 1);\n\n //after deleting, we need to update the local storage and show the updated notes.\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n //showing the updated notes\n showNotes();\n\n}", "function deleteNote(index) {\n // console.log(\"A node is being deleted\", index);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1); // Deleting the element from the array\n localStorage.setItem(\"notes\", JSON.stringify(notesObj)); //updating the local storage\n showNotes();\n}", "removeNote(noteId) {\n //localizando el hijo y buscarlo por el id\n this.db.child(noteId).remove();\n\n }", "function deleteNote(index) {\n // console.log(`I am Deleating the notes no :${index}`);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(notes);\n }\n notesArr.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArr));\n showNotes();\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 deleteNote(index) {\n let noteObj = {\n id: index,\n };\n\n var data = Object.keys(noteObj)\n .map(function (key) {\n return key + \"=\" + noteObj[key];\n })\n .join(\"&\");\n\n\n fetch(\"http://localhost:8081/php-notes-app/delete-note-by-id.php\", {\n body: data,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n }\n })\n .then(response => response.json())\n .then(data => {\n if (data.message === \"success\") {\n showAlert(\"Note Deleted!\", \"danger\");\n showNotesById(userid.value);\n }\n })\n .catch(error => {\n console.log('error: ', error);\n });\n}", "function removeNote(req, res) {\n Note.remove({\n _id: req.params.id\n })\n .then(dbNoteData => res.status(200).json(dbNoteData))\n .catch(err => {\n console.log(err);\n res.status(500).json(err);\n });\n}", "async function deleteNoteHandler(event) {\n event.preventDefault();\n\n const id = window.location.toString().split('/')[\n window.location.toString().split('/').length - 1\n ];\n const response = await fetch(`/api/notes/${id}`, {\n method: 'DELETE'\n });\n\n if (response.ok) {\n document.location.replace('/dashboard');\n } else {\n alert(response.statusText);\n }\n}", "function deleteNote(index){\r\n // console.log('I am deleting', index);\r\n titleObj.splice(index, 1);\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\",JSON.stringify(titleObj));\r\n\r\n\r\n showNotes();\r\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1)\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index)\n{\n console.log(\"I am clicking\" , index)\n let notes = localStorage.getItem('notes');\n if (notes == null)\n {\n notesObj = [];\n }\n else\n {\n notesObj = JSON.parse(notes);\n \n }\n\n notesObj.splice(index,1)\n localStorage.setItem(\"notes\" , JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index){\r\n // console.log(\"I am deleting\",index);\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 notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n };\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n \n \n let notesTitle = localStorage.getItem('notesTitle');\n if (notesTitle == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(notesTitle);\n };\n titleObj.splice(index, 1);\n localStorage.setItem('notesTitle', JSON.stringify(titleObj));\n // localStorage.removeItem('Name2');\n showNotes();\n}", "function deleteNote(index){\n console.log(\"Something deleted\");\n let notes=localStorage.getItem('notes');\n let titles = localStorage.getItem('title');\n if(notes==null){\n notesObj=[];\n }\n else{\n notesObj=JSON.parse(notes);\n }\n if (titles == null) {\n titlesObj = [];\n }\n else {\n titlesObj = JSON.parse(titles);\n }\n notesObj.splice(index,1);\n titlesObj.splice(index,1);\n notes=JSON.stringify(notesObj);\n titles=JSON.stringify(titlesObj);\n localStorage.setItem('notes',notes);\n localStorage.setItem('title',titles);\n showNotes();\n}", "function deleteNote(index) {\n\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\nlet confirmDel = confirm(\"Delete this note?\");\nif (confirmDel == true) {\n \n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}\n}", "function deleteNote(index){\n let confirmDel = confirm(\"Are you sure you want to delete this?\");\n if(confirmDel == true){\n let notes = localStorage.getItem(\"Notes\"+id);\n //if notes in localstorage is empty declare one\n if(notes == null){\n notesObj = [];\n } else{\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"Notes\"+id, JSON.stringify(notesObj));\n showNotes();\n }\n }", "function deleteCurrentNote() {\n\n // console.log(window.currentNote);\n\n // Make a confirm message for delete of a note\n var onDeletePromise = deleteNotefunction(window.currentNote);\n document.getElementById('note-description-content').innerHTML = '';\n document.getElementById('note-description-editor').innerHTML = '';\n document.getElementById('note-description-editor').value = '';\n document.getElementById('remove-note-button').classList.add('hidden');\n document.getElementById('edit-note-title-box').classList.add('hidden');\n document.getElementById('edit-title-button').classList.add('hidden');\n document.getElementById('tab-nav').classList.add('hidden');\n\n window.currentNote = ''; // Now no note is in progress to be edited!\n}", "function deleteNote(index) {\n // console.log(\"I am deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n markedObj.splice(index, 1);\n titleObj.splice(index, 1);\n localStorage.setItem(\"marked\", JSON.stringify(markedObj));\n localStorage.setItem(\"title\", JSON.stringify(titleObj));\n showNotes();\n}", "function deleteNote(index){\n console.log('I am deleting Note no ', index);\n const notes= localStorage.getItem('notes');\n if(notes==null){\n notesObj= [];\n }\n else{\n notesObj= JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n console.log(notesObj);\n}", "function deleteNote(index) {\n \n let confirmDel = confirm(\"Are you sure want to delete this note!!\");\n\n if(confirmDel == true)\n {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n }\n else {\n notesobj = JSON.parse(notes);\n }\n notesobj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesobj));\n // deletemark(index);\n showNotes();\n }\n\n}", "function deleteNote() {\n const note = notes.value;\n window.localStorage.removeItem(note);\n editor.value = '';\n for (let i = 0; i < notes.length; i++) {\n const option = notes[i];\n if (option.value === note) {\n notes.removeChild(option);\n }\n }\n}", "async function deleteNote(title) {\n setRemoveItem(title)\n setNotes(() => {\n return notes.filter(el => {\n return el.title !== title;\n })\n })\n await axios.delete(\"http://localhost:4000/api/delete\", {data: {item: title}});\n\n }", "function deleteNote (noteId) {\n request\n .delete(`https://notes-api.glitch.me/api/notes/${noteId}`)\n .auth('liz', 'dogsarebetterthancats')\n .then(response => {\n notesList = notesList.filter(note => note._id !== noteId)\n console.log(notesList)\n })\n}", "deleteNote(noteIndex) {\n const updatedNotes = this.state.notes;\n updatedNotes.splice(noteIndex, 1);\n\n this.setState({\n notes: updatedNotes,\n });\n }", "function updateView(e){\n let noteId = e.target.dataset.id\n document.querySelector(`li[data-id = '${noteId}']`).remove()\n noteCard.innerHTML = \"\"\n fetchDeleteNote(noteId)\n }", "function deleteNote(index) {\n //console.log(\"Deleting : \", index);\n let noteField = localStorage.getItem(\"data\");\n if (noteField == null) {\n noteArray = [];\n } else {\n noteArray = JSON.parse(noteField);\n }\n\n noteArray.splice(index, 1); //Splice function to remove elements in array\n localStorage.setItem(\"data\", JSON.stringify(noteArray));\n //console.log(\"Deleted\");\n display();\n}", "function deleteNote(index){\n // console.log('i am deleting' , index);\n let notes = localStorage.getItem(\"notes\");\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index , 1);\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n shownotes();\n}", "function deleteNote(index) {\n\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n\n showNotes();\n}", "function deleteNote(noteId) {\n Swal.fire({\n title: 'Eliminar Nota',\n text: `¿Estás seguro(a) que quieres eliminar la nota ${noteId}?, esta acción no se puede deshacer.`,\n icon: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Sí, Eliminar',\n cancelButtonText: 'Cancelar'\n }).then((result) => {\n if (result.isConfirmed) {\n executeRequest('DELETE', 'notes/delete', { id: noteId }).then(r => {\n\n iziToast.success({\n message: 'Nota eliminada',\n close: true,\n timeout: 1500,\n });\n\n loadNotes();\n\n }).catch(() => {\n // Se maneja en la petición\n });\n }\n })\n}", "function deleteNote(index) {\r\n // console.log(\"I am deleting\", index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n //for deleting use slice function.\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function deleteNote(index) {\n// console.log(\"I am deleting\", index);\n let confirmDel = confirm(\"Delete this note?\");\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n \n}", "function deleteNote(index) {\n let confirmDel = confirm(`Delete this note?`);\n if (confirmDel == true) {\n let notes = localStorage.getItem(\"notes\")\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n }\n\n}", "function deleteNote(index) {\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes); //string to array\r\n }\r\n notesObj.splice(index,1);//removes JS array elements and adds the existing elements back in place\r\n localStorage.setItem('notes', JSON.stringify(notesObj));//to update the local storage\r\n showNotes();\r\n\r\n}", "function deleteNote(index) {\n console.log(\"One note deleted\",\"The id is : \",index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n //splice take the starting index from where to delete,and the number of the element\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "removeNote(noteId) {\n var user = this.props.uid;\n const noteRef = firebase.database().ref(`users/${user}/notes/${noteId}`);\n noteRef.remove();\n }", "function deleteNote(index, id, date, label) {\n if (confirm(infoErrorObj.noteDeleteQ) == true) {\n CalendarService.deleteNote(id)\n .then(function (response) {\n if (response.data.message == 'deleteOk') {\n\n var currentYear = self.activeDayObj.year,\n currentMonth = toZeroBased(self.months.indexOf(self.activeDayObj.month) + 1),\n day = toZeroBased(self.activeDayObj.num.toString()),\n noteDate;\n\n if (!currentMonth && !currentYear && !day) {\n return toastr.error(infoErrorObj.noCurrentDate);\n }\n\n noteDate = currentYear + '-' + currentMonth + '-' + day;\n\n if (date == noteDate) {\n\n // Decrement note based on which one is removed\n if (label == 'Yellow') {\n self.activeDayObj.yellow--;\n }\n if (label == 'Green') {\n self.activeDayObj.green--;\n }\n if (label == 'Blue') {\n self.activeDayObj.blue--;\n }\n if (label == 'Red') {\n self.activeDayObj.red--;\n }\n\n // Remove note from active day notes\n self.activeDayObj.notes.splice(index, 1);\n }\n\n toastr.info(infoErrorObj.deleteOk);\n\n }\n })\n .catch(function (error) {\n // do some error handling\n })\n }\n\n }", "function deleteNote() {\n\t$('.nota-delete').on('click', function(e) {\n\t\te.preventDefault();\n\t\tvar $this = $(this);\n\t\tvar note = $this.closest('.nota-thumb');\n\t\tnote.addClass('transparent');\n\t\tsetTimeout(function() {\n\t\t\tnote.remove();\n\t\t}, 500);\n\t\tvar key = note.attr('id');\n\t\tconsole.log(key);\n\t\tlocalStorage.removeItem(key);\n\t});\n}", "async delNote(req, res) {\n try {\n //get the users notes\n const usersNotes = await Notes.findOne({ ID: req.params.ID });\n //handle error if note doesnt exist;\n if (!usersNotes) return res.status(401).send(\"something went wrong\");\n } catch (error) {\n return res.status(400).json({ error: error.message });\n }\n }", "function deleteNote(index) {\n if (confirm(\"Do you want to delete the note?\")) {\n let notes = localStorage.getItem(\"notes\");\n let dateItem = localStorage.getItem(\"dateItem\");\n let starItem = localStorage.getItem(\"starItem\");\n if (notes == null) {\n notesObj = [];\n dateObj = [];\n starObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n dateObj = JSON.parse(dateItem);\n starObj = JSON.parse(starItem);\n }\n notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n\n notesObj.splice(index, 1);\n dateObj.splice(index, 1);\n starObj.splice(index, 1);\n\n notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n localStorage.setItem(\"dateItem\", JSON.stringify(dateObj));\n localStorage.setItem(\"starItem\", JSON.stringify(starObj));\n }\n showNotes();\n showStarNode();\n}", "deleteNote(event) {\n //testing purposes only\n console.log('deleteNote');\n //the preventDefault() option is added to stop the page from reloading upon submitting a note\n event.preventDefault();\n //we remove the note by deleting the respective id (note key)\n this.props.deleteNote(this.props.note.id);\n }", "function deleteNote(anyValue) {\r\n console.log(anyValue);\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 notesObj.splice(anyValue, 1);\r\n let title = localStorage.getItem('title')\r\n let important = localStorage.getItem('important')\r\n\r\n if (title == null) {\r\n tObj = [];\r\n } else {\r\n tObj = JSON.parse(title);\r\n }\r\n tObj.splice(anyValue, 1);\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 if (important == null) {\r\n importantObj = [];\r\n } else {\r\n importantObj = JSON.parse(important)\r\n }\r\n timeObj.splice(anyValue, 1)\r\n importantObj.splice(anyValue, 1)\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n localStorage.setItem(\"title\", JSON.stringify(tObj));\r\n localStorage.setItem(\"time\", JSON.stringify(timeObj));\r\n localStorage.setItem(\"important\", JSON.stringify(importantObj));\r\n if (notesObj.length == 0) {\r\n console.log('0');\r\n location.reload()\r\n localStorage.clear()\r\n }\r\n showNotes();\r\n}", "function note_delete(_noteindex){\r\n\tif(_noteindex>=0 & _noteindex<notes.length) {\r\n\t\tnotes.splice(_noteindex,1);\r\n\t\tnumnote--;\r\n\t}\r\n}", "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1); // first argument - to start from, second argument - number of elements to delete\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function DeleteNote(noteIndex) {\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray.splice(noteIndex, 1);\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n editNoteIndex: -1,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "function deleteNote(index) {\n\n /*getting data from chrome.storage */\n chrome.storage.local.get(['notes-keeper'], function(result) {\n let notesArr = [];\n\n if(Object.entries(result).length == 0) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(result['notes-keeper']);\n }\n\n notesArr.splice(index, 1); //deleting the element at the given index\n let jstr = JSON.stringify(notesArr); //converting the data into JSON string\n\n /*putting back the data on chrome.storage */\n chrome.storage.local.set({\"notes-keeper\": jstr}, function() {\n deleteMsg.style.display = 'block';\n setTimeout(() => {deleteMsg.style.display = \"none\"}, 2000);\n });\n\n /*calling getNotes() function to render the data after deletion */\n getNotes();\n });\n}", "function deleteNote(index){\n let notes = localStorage.getItem('notes');\n let notesObj;\n\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes); \n }\n // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function deleteNote(index){\n let notes = localStorage.getItem('notes');\n let notesObj;\n\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes); \n }\n // splice will remove element from index, here splice(index from where it should be remove, howmany element shoudl be remove)\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNotes();\n}", "function updateNotes (notesList) {\n const notesDisplayArea = document.getElementById('notesDisplayArea')\n notesDisplayArea.innerHTML = notesToHTML(notesList)\n notesDisplayArea.querySelectorAll('delete').forEach(button => {\n button.addEventListener('click', event => {\n const noteId = button.dataset.noteId\n console.log(button.dataset.noteId)\n deleteNote(noteId)\n })\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 deleteNote(noteId) {\n\tif (confirm('Are you sure?')) {\n\t\t// get branch of the specific note\n\t\tvar toDelete = notesdb.child(noteId);\n\t\t// remove\n\t\ttoDelete.remove();\n\t}\n}", "function clearNotes()\n{\n if(notes.length !== 0)\n {\n notes.length = 0;\n console.log(`Notes are deleted successfully!`);\n }\n}", "deleteNote(id) {\n return this.getNotes()\n .then((notes)=>notes.filter((note)=>note.id !== id))\n .then((filteredNotes)=>this.write(filteredNotes));\n }", "function deleteNote(note, bord) {\n var dragid = ($('#' + bord).attr('draggable') == 'true') ? 'true' : 'false';\n if (dragid == 'true') {\n delNote('https://localhost:44382/api/notes/', parseInt($('#link' + note.substring(4, 9)).val()));\n $('#' + note).remove();\n }\n else {\n alert('Column is locked. Please unlock Column before deleting note');\n }\n }", "removeNote(noteId){\n console.log(noteId);\n // 29) to remove the note from our database, we have to tell it from what reference-- in this case we tell it to go to the key\n //we're grabbing that location in our database and saying to remove it \n //now move on to notesCard.js to allow us to edit our cards\n\n //63) we also need to grab the userID as well again\n // part 64 starts in our notesCard which is for editing \n const userId = firebase.auth().currentUser.uid;\n\n //62) we grabbed from 61) because we tiered it and have to drill down to where the note is\n const dbRef = firebase.database().ref(`users/${userId}/notes/${noteId}`);\n dbRef.remove();\n }", "function deleteNote(d) {\n var selectedListItem = noteList.options[noteList.selectedIndex];\n if (d.keyCode == 46) {\n var j = selectedListItem.id;\n var deletedNode = document.getElementById(j);\n localStorage.removeItem(j);\n var sbq = document.getElementById(\"note-\" + j);\n sbq.innerText = \"\";\n sbq.removeAttribute(\"id\");\n while (noteList.lastChild) {\n noteList.removeChild(noteList.lastChild);\n }\n displayListNotes();\n }\n}", "function deleteNote(noteId) {\n $('#mainNoteDiv' + noteId).removeClass(\"note\")\n $('#deleted' + noteId).val(\"true\");\n $('#textarea' + noteId).hide();\n $('#goBackButton' + noteId).hide();\n $('#subNoteButton' + noteId).hide();\n $('#select' + noteId).hide();\n $('#delButton' + noteId).hide();\n $('#goBack' + noteId).remove();\n\n for (var i = 0; i < map.length; i++) {\n if (map[i] == noteId) {\n deleteNote(i)\n }\n }\n }", "function deleteANote(req, res) {\n console.log(\"im in deleteANote\");\n // Articles.findByIdAndUpdate(req.body.ArticleId, (err, todo) => { \n // (req.params.id, {\n // $pull: {\n // notes: { $eq: req.body.note}\n // }\n // }, \n // { multi: false \n // }).then(function (data) {\n Articles.findByIdAndUpdate(req.params.id, {\n $pull: {\n notes: 'heres a nice note'\n }\n }, {\n new: true,\n multi: false\n }).then(function (data) {\n<<<<<<< HEAD\n console.log(\"data:\");\n console.log(data);\n=======\n console.log(data);\n\n console.log(\"data:\");\n console.log(data);\n // res.render(\"modal\", {\n // prevNotes: prevNotes\n // });\n>>>>>>> 019bf02d664ac363a06073dc2683dae70e92a330\n }).catch(function (err) {\n console.log(\"There was a DB error - deleteANote\");\n console.log(err);\n res.status(500).send(\"A Server Error Occurred\");\n });\n}", "async delete(noteID) {\r\n let store = await this.notesAccessStore(\"readwrite\")\r\n return store.delete(Number(noteID))\r\n }", "remove() {\r\n if (this.deleted === false) {\r\n this.deleted = true;\r\n } else if (this.deleted === true && DOM.current === 'deleted') {\r\n let input;\r\n do {\r\n input = prompt(`Do you really wanna remove \"${this.title}\" completely? y/n`).toLowerCase();\r\n if (input === 'y') {\r\n console.log(this.id);\r\n database.nukeNote(this.id);\r\n break;\r\n }\r\n if (input === 'n') {\r\n alert('Okey, no deletion made');\r\n break;\r\n }\r\n } while (input === 'y' || input === 'n')\r\n }\r\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 editNote(index) {\r\n // console.log(\"I am deleting\", index);\r\n \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 notesObj.findIndex((element,index)=> {\r\n\t\tMyTitle.value = element.title;\r\n\t\taddTxt.value = element.text;\r\n\t\t\r\n\t})\r\n\tnotesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n }", "deleteNote(id) {\n // This retrieves all notes, remotes the note with the specified unique ID, and finally writes the filtered notes.\n return this.retrieveNotes()\n .then((notes) => notes.filter((note) => note.id !== id))\n .then((filteredNotes) => this.writeFile(filteredNotes));\n }", "function deleteItem(e) {\n // retrieve the name of the task we want to delete. We need\n // to convert it to a number before trying it use it with IDB; IDB key\n // values are type-sensitive.\n let noteId = Number(e.target.parentNode.getAttribute('data-note-id'));\n\n // open a database transaction and delete the task, finding it using the id we retrieved above\n let transaction = db.transaction(['notes_os'], 'readwrite');\n let objectStore = transaction.objectStore('notes_os');\n let request = objectStore.delete(noteId);\n\n // report that the data item has been deleted\n transaction.oncomplete = function() {\n // delete the parent of the button\n // which is the list item, so it is no longer displayed\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n console.log('Note ' + noteId + ' deleted.');\n\n // Again, if list item is empty, display a 'No notes stored' message\n if(!list.firstChild) {\n let listItem = document.createElement('li');\n listItem.textContent = 'No notes stored.';\n list.appendChild(listItem);\n }\n };\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function DeleteNoteFromList(id){\n\t\t//this.projNotes[];\n\t\tvar noteIndex = FindProjNote(id);\n\t\t\n\t\tif(typeof noteIndex != \"boolean\"){\n\t\t\tprojNotes.splice(noteIndex, 1);\n\t\t\tnoteListChanged=true;\n\t\t}\n\t\t\n\t\t\n\t}", "function deleteGoalNote(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"GoalNoteDeleted\", noteId);\n }\n}", "static dSTIdNoteNoteIdDELETE({ id, noteId }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "function deleteNote(id) {\n setNotes((prevNotes) => {\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n }" ]
[ "0.754349", "0.75392735", "0.75181603", "0.7425493", "0.73937386", "0.7334409", "0.73153305", "0.7305322", "0.7290666", "0.7274384", "0.7268904", "0.7246179", "0.72233987", "0.7206369", "0.72047144", "0.71585107", "0.7154413", "0.71165454", "0.7113576", "0.7104984", "0.7096092", "0.7087218", "0.70846057", "0.7078138", "0.7060537", "0.70493305", "0.7048039", "0.70455754", "0.7043925", "0.7039656", "0.70306826", "0.70250523", "0.7020047", "0.7018808", "0.70168865", "0.70160544", "0.7013943", "0.700676", "0.7005479", "0.70021874", "0.70014566", "0.7001052", "0.70007277", "0.6993795", "0.69677556", "0.6963124", "0.69584715", "0.6957969", "0.6955814", "0.69485617", "0.6941228", "0.6940934", "0.69394124", "0.6937773", "0.6934376", "0.69323146", "0.6929547", "0.6924816", "0.6916539", "0.6911003", "0.6908509", "0.6906638", "0.69048005", "0.6896616", "0.6853374", "0.6851691", "0.68467027", "0.68320155", "0.6819624", "0.68182075", "0.68035245", "0.6802646", "0.67934716", "0.6773762", "0.6769646", "0.6765615", "0.6756499", "0.6756499", "0.67535174", "0.67452174", "0.67444247", "0.6715411", "0.67142045", "0.66977704", "0.66902924", "0.66762966", "0.6670184", "0.6665729", "0.66639024", "0.66550714", "0.66177887", "0.65742886", "0.656443", "0.65639985", "0.65482414", "0.6537492", "0.6534402", "0.65272987", "0.65178466", "0.65160906" ]
0.7011757
37
In this croquet club, handicaps range from 2 to +26; the better the player the lower the handicap. Input will consist of a list of lists containing two items each. Each list contains information for a single potential member. Information consists of an integer for the person's age and an integer for the person's handicap.
function openOrSenior(data){ // ... var newArray = []; for (var i = 0; i < data.length; i++){ if (data[i][0] >= 55 && data[i][1] > 7){ newArray.push("Senior"); } else { newArray.push('Open'); }; } return newArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScore(whoseHand) {\n\t\tfor (let i=0; i<whoseHand.length; i++){\n\t\t\n\t\t\t// Set value of face cards\n\t\t\tif (typeof(whoseHand[i]) === 'string') {\n\t\t\t\tif (whoseHand[i] === 'A') { \n\t\t\t\t\twhoseHand[i] = 11;\n\t\t\t\t\taces++;\n\t\t\t\t} else {\n\t\t\t\t\twhoseHand[i] = 10;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(whoseHand === playerHand) {\n\t\t\t\tif (sumPlayer > 21 && aces > 0) {\n\t\t\t\t\tsumPlayer -= 10; // change value of the ace to 1\n\t\t\t\t}\n\t\t\t\tif (sumPlayer > 21) {\n\t\t\t\t\tbust = true; // player loses\n\t\t\t\t\treturn bust;\n\t\t\t\t}\n\t\t\t\tif (sumPlayer <= 21 && sumPlayer > sumDealer && round === 3) {\n\t\t\t\t\t// player wins if she gets to end of round 3, according to margo\n\t\t\t\t\tbust = false; // player wins\n\t\t\t\t\treturn bust;\n\t\t\t\t}\n\t\t\t\tsumPlayer += whoseHand[i];\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tsumDealer += whoseHand[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "function openOrSenior(data){\n return data.map(([age, handicap]) => (age > 54 && handicap > 7) ? 'Senior' : 'Open');\n}", "function openOrSenior(data){\n return data.map(([age, handicap]) => (age > 54 && handicap > 7) ? 'Senior' : 'Open');\n}", "function openOrSenior(data){\n return data.map(([age, handicap]) => (age > 54 && handicap > 7) ? 'Senior' : 'Open');\n}", "function above(person, age){\n let aboveAge = [];\n person.forEach(element => {\n if(element.age > age)\n {aboveAge.push(element)}\n });\n return aboveAge;\n }", "abilityScores(){\n\t\tlet diceList = [null, null, null, null, null, null];\t//initialise attribute array\n\tfor (let i=0; i<6; i++){\t//for all attributes\n\t\tlet tempList = [null, null, null, null];\n\t\tfor (let j=0; j<4; j++) {\n\t\t\ttempList[j] = D6[Math.floor(Math.random() * 6)];\n\t\t}\n\t\tlet min = Math.min(...tempList);\n\t\tfor (let k=0; k<4; k++){\t\t\t//remove lowest number\n\t\t\tif (tempList[k]===min){\n\t\t\t\ttempList.splice(k,1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdiceList[i]=tempList.reduce(addition);\t\t//add sum of the 3 numbers remaining to the diceList\n\t}\n\t\n\t\n\t/*Assign all ability attributes*/\n\tif (this.str===undefined){\n\t\tthis.str=diceList[0];\n\t}\n\tif (this.dex === undefined){\n\tthis.dex=diceList[1];\n\t}\n\tif (this.con === undefined){\n\tthis.con=diceList[2];\n\t}\n\tif (this.intelligence===undefined){\n\tthis.intelligence=diceList[3];\n\t}\n\tif (this.wis===undefined){\n\tthis.wis=diceList[4];\n\t}\n\tif (this.cha===undefined){\n\tthis.cha=diceList[5];\n\t}\n\t}", "function SortByNamexOlderThan(age) {\n var pl = [];\n let k = 0;\n for (let i of players) {\n if (i.age >= age) {\n i.awards.name.sort().reverse();\n pl[c++] = i;\n }\n }\n\n return pl.age.sort();\n}", "function randomType() {\r\n let array = [\r\n { personality: \"Brawny\", bonus: \"if (players[attacker].wep.type == 'physical'){temp += 5}\", applied: 'offense' }, // if attacker's weapon is physical, damage + 5,\r\n { personality: \"Vampire\", bonus: \"if (players[attacker].wep.type == 'magic'){temp += 5}\", applied: 'offense' }, // if attacker's weapon is physical, damage + 5,\r\n { personality: \"Clown\", bonus: \"if (players[attacker].hp <= 10){temp += 8}\", applied: '' }, // If attacker is bellow ten hp, damage + 8\r\n { personality: \"Smart\", bonus: \"if (players[defender].type.personality == 'Dumb'){temp += 15}\", applied: 'offense' }, // if defender personality is dumb, damage + 15\r\n { personality: \"Dumb\", bonus: \"if (players[attacker].hp >= '10'){temp += 5}\", applied: 'offense' }, // if attacker is above ten HP, damage + 5\r\n { personality: \"Saiyan\", bonus: \"if (randomInt(1, 10) > 5){temp += 5}\", applied: 'offense' }, // If random number from 1-10 above 5, + 5 damage.\r\n { personality: \"Paladin\", bonus: \"if (players[defender].hp < 10){temp -= 5}\", applied: 'defence' }, // if defender bellow ten hp, + 5 shield\r\n { personality: \"Ailen\", bonus: \"if (players[defender].hp > 20){temp -= 3}\", applied: 'defence' }, // if defender above 20 HP, shield + 3\r\n { personality: \"Slave\", bonus: \"if (players[attacker].type.personality == 'Clown'){temp += 15}\", applied: 'offense' }, // If attacker personality is clown, + 15 damage\r\n { personality: \"Military\", bonus: \"if (players[attacker].wep.weapon == 'ranged'){temp += 5}\", applied: 'offense' }, // if weapon is ranged, + 5 damage\r\n { personality: \"Brain Dead\", bonus: \"if (randomInt(0, 10) < 5){temp -= 10}\", applied: 'offense' }, // if a number between 1 and 10 bellow 5, opponet shield += 10\r\n ]\r\n\r\n let random = randomInt(0, array.length);\r\n return array[random];\r\n}", "function sort_hand(hand_info) {\n\tfor(let i = 1; i < hand_size; i++) {\n\t\tlet key = hand_info.hand[i];\n\t\tlet j = i - 1;\n\t\twhile(j >= 0 && hand_info.hand[j].rank < key.rank) {\n\n\t\t\thand_info.hand[j+1] = hand_info.hand[j];\n\t\t\tj--;\n\t\t}\n\t\thand_info.hand[j+1] = key;\n\t}\n}", "function whoCanGo(people) {\n let allPeople = people;\n const movieAge = allPeople.map((myAge)=>{\n let movie = [];\n if (myAge.age >= 18) {\n movie.push(myAge.name + ' ' + 'can go to The Matrix'); \n }else{\n movie.push(myAge.name + ' ' + 'is under age!!');\n }\n console.log(movie);\n \n });\n}", "function STEP_survivalist() {\r\n\tfor (var i = 0; i < g.playerList.length; i++) {\r\n\t\tif (g.playerList[i].role == 4) {\r\n\t\t\tg.playerList[i].extraLives += 1;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "function hpChanger(){\n if(characterSelected[0].name===\"Liu Kang\"){\n document.getElementById(\"liuKangHealth\").innerHTML = characterSelected[0].hp\n } else if (characterSelected[1].name===\"Liu Kang\"){\n document.getElementById(\"liuKangHealth\").innerHTML = characterSelected[1].hp \n }\n if(characterSelected[0].name===\"Scorpion\"){\n document.getElementById(\"scorpionHealth\").innerHTML = characterSelected[0].hp\n } else if (characterSelected[1].name === \"Scorpion\"){\n document.getElementById(\"scorpionHealth\").innerHTML = characterSelected[1].hp\n }\n if(characterSelected[0].name===\"Sub Zero\"){\n document.getElementById(\"subZeroHealth\").innerHTML = characterSelected[0].hp\n } else if (characterSelected[1].name===\"Sub Zero\"){\n document.getElementById(\"subZeroHealth\").innerHTML = characterSelected[1].hp\n }\n\n}", "function oneIvITwo (data, pointsMap, item) {\n team.oneIvITwo(data.attacker_character_id, data.character_id, data.attacker_loadout_id, data.attacker_loadout_id, data.character_loadout_id, pointsMap);\n killfeedPlayer({\n winner: teamOneObject.members[data.attacker_character_id].name,\n winner_faction: teamOneObject.faction,\n winner_class_id: data.attacker_loadout_id,\n winner_net_score: teamOneObject.members[data.attacker_character_id].netEventScore,\n loser: teamTwoObject.members[data.character_id].name,\n loser_faction: teamTwoObject.faction,\n loser_class_id: data.character_loadout_id,\n loser_net_score: teamTwoObject.members[data.character_id].eventNetScore,\n weapon: item.name,\n is_kill: true\n });\n}", "function challenge(value, challenger) {\n return value[1] === challenger[0] &&\n value[2] === challenger[1] &&\n value[3] === challenger[2];\n }", "function ownerAHP(filterArr, priortyArr){\r\n\r\n let overnightFilter = 0; // 1 for yes, 0 for no\r\n let genderFilterSex = 1; // 1 for male, 2 for female\r\n let genderFilterAppeal = 1; // 1 for straight, 2 for bi/gay\r\n let petFilter = 3; // 0 no pet, 1 dog, 2 cat, 3 okay all\r\n let smokingFilter = 2; // 0 no smoke, 1 outdoor, 2 indoor/all\r\n //// priorities \r\n\r\n let priorities = {\r\n \"OG\": 1,\r\n \"OP\": 1,\r\n \"OS\": 1,\r\n \"GP\": 1,\r\n \"GS\": 1,\r\n \"PS\": 1\r\n };\r\n let priorityMatrix = [\r\n [1, priorities.OG, priorities.OP, priorities.OS], //rent\r\n [(1 / priorities.OG), 1, priorities.GP, priorities.GS], //location\r\n [(1 / priorities.OP), (1 / priorities.GP), 1, priorities.PS], //pets\r\n [(1 / priorities.OS), (1 / priorities.GS), (1 / priorities.PS), 1] //smoking\r\n ];\r\n\r\n function goAhp(compareArr, stdAvg) {\r\n\r\n //toplamlari\r\n let compareArrSums = [];\r\n for (let i in compareArr) {\r\n let sum = 0;\r\n for (let j in compareArr[i]) {\r\n sum += compareArr[j][i];\r\n }\r\n compareArrSums.push(sum);\r\n }\r\n\r\n\r\n // toplama böl\r\n for (let i in compareArr) {\r\n for (let j in compareArr[i]) {\r\n compareArr[i][j] = compareArr[i][j] / compareArrSums[j];\r\n }\r\n }\r\n\r\n // row ortalama hesabi\r\n let compareArrAvg = [];\r\n for (let i in compareArr) {\r\n let sum = 0;\r\n for (let j in compareArr[i]) {\r\n sum += compareArr[i][j];\r\n }\r\n compareArrAvg.push(sum / compareArr.length);\r\n }\r\n\r\n // ortalamalar x agirlik\r\n for (let i in compareArrAvg) {\r\n compareArrAvg[i] = compareArrAvg[i] * stdAvg;\r\n }\r\n return compareArrAvg;\r\n }\r\n function returnMaxIndex(array) {\r\n let max = 0;\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[max] <= array[i]) max = i;\r\n }\r\n return max;\r\n }\r\n\r\n ////////////////////////////\r\n\r\n\r\n //consistency check\r\n let matrixSum = [0, 0, 0, 0];\r\n for (let j in priorityMatrix) {\r\n let i = priorityMatrix[j];\r\n matrixSum[0] += i[0];\r\n matrixSum[1] += i[1];\r\n matrixSum[2] += i[2];\r\n matrixSum[3] += i[3];\r\n }\r\n\r\n let standardizeMatrix = [[], [], [], []];\r\n for (let i in priorityMatrix) {\r\n for (let j in priorityMatrix[i]) {\r\n standardizeMatrix[i].push(priorityMatrix[i][j] / matrixSum[j]);\r\n }\r\n }\r\n\r\n let stdAverages = [0, 0, 0, 0];\r\n for (let i in standardizeMatrix) {\r\n let sum = 0;\r\n for (let j in standardizeMatrix[i]) {\r\n sum += standardizeMatrix[i][j];\r\n }\r\n stdAverages[i] = sum / 4;\r\n }\r\n\r\n let lamdaMax = 0;\r\n for (let i in matrixSum) {\r\n lamdaMax += (matrixSum[i] * stdAverages[i]);\r\n }\r\n let CI = (lamdaMax - 4) / 3;\r\n let CR = CI / 0.9;\r\n if (CR < 0.1) {\r\n console.log(\"CONSISTENT - \", CR);\r\n }\r\n else {\r\n console.log(\"NOT CONSISTENT - \", CR);\r\n return -1;\r\n }\r\n\r\n\r\n\r\n ///////////////////////////////////////////////////\r\n let filteredArr = homes;\r\n // let filteredArr = homes.filter(h => h.bedroomInfo.rent.single > 300);\r\n // filteredArr = filteredArr.filter(h => h.bedroomInfo.rent.single < 310);\r\n\r\n\r\n // filteredArr.forEach(i =>{\r\n // console.log(i.occupants.gender);\r\n // })\r\n\r\n //AHP stuff\r\n\r\n // overnight ahp\r\n let overnightCompare = [];\r\n for (let i in filteredArr) {\r\n overnightCompare.push([]);\r\n for (let j in filteredArr) {\r\n let leftOvernight = filteredArr[i].bedroomInfo.overnight;\r\n let topOvernight = filteredArr[j].bedroomInfo.overnight;\r\n leftOvernight = (leftOvernight == 'yes') ? 1 : 0;\r\n topOvernight = (topOvernight == 'yes') ? 1 : 0;\r\n\r\n let leftControl = (leftOvernight == overnightFilter);\r\n let topControl = (topOvernight == overnightFilter);\r\n\r\n let point = -1;\r\n if (leftControl && topControl) point = 1;\r\n else if (leftControl && !topControl) point = 3;\r\n else if (!leftControl && topControl) point = 1 / 3;\r\n else if (!leftControl && !topControl) point = 1;\r\n\r\n if (i == j) point = 1;\r\n overnightCompare[i].push(point);\r\n }\r\n }\r\n\r\n let overnightCompareAvg = goAhp(overnightCompare, stdAverages[0]);\r\n\r\n\r\n //// gender ahp\r\n\r\n let genderCompare = [];\r\n for (let i in filteredArr) { \r\n genderCompare.push([]);\r\n for (let j in filteredArr) {\r\n let leftGender = filteredArr[i].occupants.gender;\r\n let topGender = filteredArr[j].occupants.gender;\r\n let sex = (genderFilterSex == 1) ? 'Male' : 'Female';\r\n let appeal = (genderFilterAppeal == 1) ? 'straight' : 'gay/bi';\r\n let les = (genderFilterAppeal == 1) ? 'straight' : 'lesbian/bi';\r\n\r\n if (typeof leftGender == 'object') {\r\n let flagArr = [];\r\n for (k in leftGender) {\r\n let flagSex = 0, flagAppeal = 0;\r\n if (leftGender[k].split(\", \")[0] == sex) flagSex = 1;\r\n if (leftGender[k].split(\", \")[1] == appeal || leftGender[k].split(\", \")[1] == les) flagAppeal = 1;\r\n flagArr.push((flagSex + flagAppeal));\r\n } \r\n let index = returnMaxIndex(flagArr);\r\n leftGender = leftGender[index]; \r\n }\r\n\r\n if (typeof topGender == 'object') {\r\n let flagArr = [];\r\n for (k in topGender) {\r\n let flagSex = 0, flagAppeal = 0;\r\n if (topGender[k].split(\", \")[0] == sex) flagSex = 1;\r\n if (topGender[k].split(\", \")[1] == appeal || leftGender[k].split(\", \")[1] == les) flagAppeal = 1;\r\n flagArr.push(flagSex + flagAppeal);\r\n }\r\n let index = returnMaxIndex(flagArr);\r\n topGender = topGender[index];\r\n }\r\n\r\n let sex1 = leftGender.split(\", \")[0];\r\n let appeal1 = leftGender.split(\", \")[1];\r\n let sex2 = topGender.split(\", \")[0];\r\n let appeal2 = topGender.split(\", \")[1];\r\n \r\n let sex1Control = (sex1 == sex);\r\n let appeal1Control = (appeal1 == appeal || appeal1 == les);\r\n let sex2Control = (sex2 == sex);\r\n let appeal2Control = (appeal2 == appeal || appeal1 == les);\r\n\r\n let pointSex = 0, pointAppeal = 0;\r\n \r\n if (sex1Control && sex2Control) pointSex = 1;\r\n else if (sex1Control && !sex2Control) pointSex = 3;\r\n else if (!sex1Control && sex2Control) pointSex = 1/3;\r\n else pointSex = 1;\r\n \r\n if (appeal1Control && appeal2Control) pointAppeal = 1;\r\n else if (appeal1Control && !appeal2Control) pointAppeal = 3;\r\n else if (!appeal1Control && appeal2Control) pointAppeal = 1/3;\r\n else pointAppeal = 1;\r\n\r\n let point=(pointSex+pointAppeal)/2; \r\n genderCompare[i].push(point);\r\n\r\n }\r\n }\r\n let genderCompareAvg = goAhp(genderCompare, stdAverages[1]);\r\n\r\n\r\n\r\n ///// pets ahp\r\n let petCompare = [];\r\n for (let i in filteredArr) {\r\n petCompare.push([]);\r\n for (let j in filteredArr) {\r\n let leftPet = filteredArr[i].occupants.pets;\r\n let topPet = filteredArr[j].occupants.pets;\r\n\r\n let filter;\r\n switch (petFilter) {\r\n case 0:\r\n filter = 'No cat or dog';\r\n break;\r\n case 1:\r\n filter = 'Have a dog';\r\n break;\r\n case 2:\r\n filter = 'Have a cat';\r\n break;\r\n case 3:\r\n filter = 'Have a cat and dog';\r\n break;\r\n }\r\n\r\n let leftControl = (leftPet == filter);\r\n let topControl = (topPet == filter);\r\n\r\n let point = -1;\r\n if (leftControl && topControl) point = 1;\r\n else if (leftControl && !topControl) point = 3;\r\n else if (!leftControl && topControl) point = 1 / 3;\r\n else if (!leftControl && !topControl) point = 1;\r\n if (i == j) point = 1;\r\n petCompare[i].push(point);\r\n }\r\n }\r\n let petCompareAvg = goAhp(petCompare, stdAverages[2]);\r\n\r\n\r\n ///// smoking ahp\r\n let smokingCompare = [];\r\n for (let i in filteredArr) {\r\n smokingCompare.push([]);\r\n for (let j in filteredArr) {\r\n let leftSmoking = filteredArr[i].occupants.smoking;\r\n let topSmoking = filteredArr[j].occupants.smoking;\r\n\r\n\r\n if (typeof leftSmoking == 'object') {\r\n if (leftSmoking.indexOf('Indoor smoker') != -1) leftSmoking = 'Indoor smoker';\r\n else if (leftSmoking.indexOf('Outdoor smoker' != -1)) leftSmoking = 'Outdoor smoker';\r\n }\r\n\r\n if (typeof topSmoking == 'object') {\r\n if (topSmoking.indexOf('Indoor smoker') != -1) topSmoking = 'Indoor smoker';\r\n else if (topSmoking.indexOf('Outdoor smoker' != -1)) topSmoking = 'Outdoor smoker';\r\n }\r\n\r\n let smokingControl = '';\r\n switch (smokingFilter) {\r\n case 0:\r\n smokingControl = 'Non-smoker';\r\n break;\r\n case 1:\r\n smokingControl = 'Outdoor smoker';\r\n break;\r\n case 2:\r\n smokingControl = 'Indoor smoker';\r\n break;\r\n }\r\n\r\n let leftControl = (leftSmoking == smokingControl);\r\n let topControl = (topSmoking == smokingControl);\r\n\r\n let point = -1;\r\n if (leftControl && topControl) point = 1;\r\n if (leftControl && !topControl) point = 3;\r\n if (!leftControl && topControl) point = 1 / 3;\r\n if (!leftControl && !topControl) point = 1;\r\n\r\n if (smokingFilter == 2){\r\n if(leftSmoking == 'Outdoor smoker' && topSmoking=='Non-smoker') point = 2;\r\n else if(leftSmoking=='Non-smoker' && topSmoking=='Outdoor smoker') point =1/2;\r\n else if(leftSmoking == 'Indoor smoker' && topSmoking=='Outdoor smoker') point = 2;\r\n else if(leftSmoking == 'Outdoor smoker' && topSmoking == 'Indoor smoker') point = 1/2;\r\n }\r\n\r\n if (i == j) point = 1;\r\n smokingCompare[i].push(point);\r\n }\r\n }\r\n let smokingCompareAvg = goAhp(smokingCompare, stdAverages[3]);\r\n\r\n\r\n\r\n let resultArr = [];\r\n for(i in overnightCompareAvg){\r\n resultArr.push([]);\r\n }\r\n for (let i in overnightCompareAvg) {\r\n resultArr[i].push(overnightCompareAvg[i] + genderCompareAvg[i] + smokingCompareAvg[i] + petCompareAvg[i]);\r\n resultArr[i].push(i);\r\n }\r\n\r\n resultArr.sort();\r\n resultArr.reverse();\r\n\r\n // console.log('\\ngirilen degerler:');\r\n // console.log('overnight: ', overnightFilter);\r\n // console.log('gender: ', genderFilterSex,'appeal: ', genderFilterAppeal);\r\n // console.log('pet: ', petFilter);\r\n // console.log('smoking: ', smokingFilter);\r\n\r\n // console.log('///////////////////////////////////////////');\r\n // console.log('///////////////////////////////////////////');\r\n\r\n\r\n // for (let i in resultArr) {\r\n // let index = resultArr[i][1];\r\n // let f = filteredArr[index];\r\n // console.log('point: ', resultArr[i]);\r\n // console.log('overnight ', f.bedroomInfo.overnight,overnightCompareAvg[index]); \r\n // console.log('gender: ', f.occupants.gender,genderCompareAvg[index]);\r\n // console.log('pets: ', f.occupants.pets, petCompareAvg[index]);\r\n // console.log('smoking: ', f.occupants.smoking, smokingCompareAvg[index]);\r\n // console.log('\\n===========================================\\n');\r\n // }\r\n\r\n let returnArr = [];\r\n for(i in resultArr){\r\n returnArr.push([]);\r\n }\r\n for(i in resultArr){\r\n returnArr[i].push(filteredArr[resultArr[i][1]]);\r\n returnArr[i].push(resultArr[i][0]);\r\n }\r\n let returnLength = returnArr.length;\r\n let finalArr = [];\r\n if(returnLength<20) return returnArr;\r\n else{\r\n for(let i = 0; i<20; i++){\r\n finalArr.push(returnArr[i]);\r\n }\r\n return finalArr;\r\n }\r\n \r\n}", "function enemyMortgage() {\n function mortgageUcards(obj) {\n if(obj.type == \"uCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgageU = propertyCards.filter(mortgageUcards);\n\n function mortgageVcards(obj) {\n if(obj.type == \"vCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgageV = propertyCards.filter(mortgageVcards);\n\n\n function mortgagePcards2(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 1 ){\n if(obj.color == \"darkblue\" || obj.color == \"purple\"){\n return true\n }\n }\n }\n var toMortgageP2 = propertyCards.filter(mortgagePcards2);\n\n\n function mortgagePcards3(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 1 ){\n if(obj.color !== \"darkblue\" || obj.color !== \"purple\"){\n return true\n }\n }\n }\n var toMortgageP3 = propertyCards.filter(mortgagePcards3);\n\n function mortgagePcards1(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\" && obj.numberOwnedOfSet == 2 ){\n if(obj.color !== \"darkblue\" || obj.color !== \"purple\"){\n return true\n }\n }\n }\n var toMortgageP1 = propertyCards.filter(mortgagePcards1);\n\n function mortgagePcardsRest(obj) {\n if(obj.type == \"pCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toMortgagePRest = propertyCards.filter(mortgagePcardsRest);\n\n if(toMortgageU.length>0){\n for(var i =0; i<toMortgageU.length; i++){\n toMortgageU[i].inPlay = \"no\";\n enemyCash += toMortgageU[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageU[i].name)\n }\n }else if(toMortgageV.length>0){\n for(var i =0; i<toMortgageU.length; i++){\n toMortgageV[i].inPlay = \"no\";\n enemyCash += toMortgageV[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageV[i].name)\n }\n }else if (toMortgageP2.length>0){\n for(var i =0; i<toMortgageP2.length; i++){\n toMortgageP2[i].inPlay = \"no\";\n enemyCash += toMortgageP2[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP2[i].name)\n }\n }else if (toMortgageP3.length>0){\n for(var i =0; i<toMortgageP3.length; i++){\n toMortgageP3[i].inPlay = \"no\";\n enemyCash += toMortgageP3[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP3[i].name)\n }\n }else if (toMortgageP1.length>0){\n for(var i =0; i<toMortgageP1.length; i++){\n toMortgageP1[i].inPlay = \"no\";\n enemyCash += toMortgageP1[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgageP1[i].name)\n }\n }else if (toMortgagePRest.length>0){\n for(var i =0; i<toMortgagePRest.length; i++){\n toMortgagePRest[i].inPlay = \"no\";\n enemyCash += toMortgagePRest[i].mortgage;\n updateCash();\n enemyUpdate(\"Enemy just mortgaged the \"+ toMortgagePRest[i].name)\n }\n }\n}", "function openOrSenior(data){\n return data.map(player => (player[0] > 54 && player[1] > 7) ? \"Senior\" : \"Open\");\n}", "function koukuAttack(sortieHp, enemyHp, kouku) {\n if (kouku.api_edam != null) {\n kouku.api_edam.forEach((damage, i) => {\n damage = Math.floor(damage)\n if (damage > 0) {\n enemyHp[i - 1] -= damage\n }\n })\n }\n if (kouku.api_fdam != null) {\n kouku.api_fdam.forEach((damage, i) => {\n damage = Math.floor(damage)\n if (damage > 0) {\n sortieHp[i - 1] -= damage\n }\n })\n }\n}", "function SortByAge() {\n var pl = [];\n pl = Object.age(players).sort()\n return pl.reverse();\n}", "function checkAces(hand) {\n // console.log(\"==========================================\");\n // hand = [\n // { Point: \"A\", Suit: \"s\", point: 1, suit: 1 },\n // { Point: \"A\", Suit: \"d\", point: 1, suit: 1000 },\n // { Point: \"K\", Suit: \"d\", point: 13, suit: 1000 },\n // { Point: \"K\", Suit: \"s\", point: 13, suit: 1 }\n // ];\n let suits = checkSuit(hand);\n let numOfAce = 0;\n\n for (let card in hand) {\n if (hand[card].Point == \"A\") {\n numOfAce++;\n }\n }\n if (numOfAce == 2) {\n // Magnum\n // Double-suited to both aces, and with a high pair, a connector, or 2 Broadway cards. For example:\n // AAJJ AA76 AAKQ\n if (suits == 2) {\n // high pair\n let hightcard = 0;\n let hightpair = false;\n for (let card of hand) {\n if (card.point >= 10) {\n if (!hightcard) {\n hightcard = card.point;\n } else {\n if (hightcard == card.point) {\n hightpair = true;\n }\n }\n }\n }\n if (hightpair) {\n return true; // showHand(hand, \"Magnum Aces with high pair\");\n }\n // connector\n let connectcard = 0;\n let connector = false;\n for (let card of hand) {\n if (card.point != 1) {\n if (!connectcard) {\n connectcard = card.point;\n } else {\n if (\n connectcard + 1 == card.point ||\n connectcard - 1 == card.point\n ) {\n connector = true;\n }\n }\n }\n }\n if (connector) {\n return true; // showHand(hand, \"Magnum Aces with connector\");\n }\n // two broadway\n let broadwaycard = 0;\n let braodway = false;\n for (let card of hand) {\n if (card.point >= 10) {\n broadwaycard++;\n }\n if (broadwaycard > 1) braodway = true;\n }\n\n if (braodway) return true; // showHand(hand, \"Magnum Aces with broadway\");\n }\n }\n}", "function UpdateArmory(){\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var servers = stripArray(ss.getRange(\"S4:S29\").getValues());\n var characters = stripArray(ss.getRange(\"B4:B29\").getValues());\n var rows = [4,5,7,8,9,10,12,13,14,15,16,17,19,20,21,22,23,24,26,27,28,29];\n var equip = [\"head\",\"neck\",\"shoulder\",\"back\",\"chest\",\"tabard\",\"wrist\",\"hands\",\"waist\",\"legs\",\"feet\",\"finger1\",\"finger2\",\"trinket1\",\"trinket2\",\"mainHand\"] \n\n for (var i = 0; i < characters.length; i++){\n var url = \"https://us.api.battle.net/wow/character/\"+ servers[i] + \"/\" + characters[i] +\"?fields=items&locale=en_US&apikey=x2qapsnqmsweaqftpcwzacs98vm6p2zx\";\n var playerJSON = UrlFetchApp.fetch(url);\n var player = JSON.parse(playerJSON.getContentText());\n var range = SpreadsheetApp.getActiveSpreadsheet().getRange(\"C\"+rows[i]+\":R\"+rows[i]);\n var ilvls = [[]];\n \n for(var j = 0; j < equip.length; j++){\n var slot = equip[j]; \n if(player.items[slot] == null){\n ilvls[0].push(1);\n }else{\n ilvls[0].push(player.items[slot].itemLevel);\n }\n } \n range.setValues(ilvls);\n\n }\n}", "function marcsCakewalk(calorie) {\n // Complete this function\n\n calorie.sort((a, b) => b - a);\n\n var miles = 0;\n\n for (var i = 0; i < calorie.length; i++) {\n miles = miles + calorie[i] * Math.pow(2, i);\n }\n\n return miles;\n}", "function charaterGen(){\n luke.AP = 5;\n luke.HP = 100;\n obiwan.AP = 9;\n obiwan.HP = 120;\n maul.AP = 13;\n maul.HP = 150;\n sidious.AP = 17;\n sidious.HP = 180;\n}", "function level1()\n{ h1=1\n var harryPotter=[\n {\n question:\"What does the scar on Harry’s head look like?\",\n ans:\"Lightening bolt\",\n answers:[\"broomstick\",\"owl\",\"straight\",\"Lightening bolt\"],\n },\n {\n question:\"At first Who tells harry that he is a wizard?\",\n ans:\"hagrid\",\n answers:[\"uncle Vernon\",\"hagrid\",\"Dumbledore\",\"hermione\"],\n },\n {\n question:\"What is the name of Harry’s snowy owl?\",\n ans:\"Hedwig\",\n answers:[\"Ron\",\"Hedwig\",\"scabbers\",\"pygmy puff\"]\n },\n {\n question:\"Which platform at King’s Cross station does the Hogwarts Express leave from?\",\n ans:\"Nine and three quaters\",\n answers:[\"seven and four quaters\",\"Ten\",\"Nine and three quaters\",\"six and five quaters\"]\n },\n {\n question:\"Which house is Harry Potter sorted into by the Sorting Hat?\",\n ans:\"Gryffinder\",\n answers:[\"Gryffinder\",\"slyderin\",\"raven claw\",\"Huffle Puff\"]\n },\n {\n question:\"which position does harry plays on his team?\",\n ans:\"seeker\",\n answers:[\"chaser\",\"seeker\",\"Beater\",\"keeper\"]\n },\n {\n question:\"Harry can speak and understand one of these animals?\",\n ans:\"snake\",\n answers:[\"Owl\",\"snake\",\"dragon\",\"Dementor\"]\n },\n {\n question:\"How many heads does fluffy has?\",\n ans:\"Three\",\n answers:[\"Five\",\"Four\",\"Three\",\"Six\"],\n },\n {\n question:\"who is the cousin of Harry\",\n ans:\"Dudley Dursley\",\n answers:[\"petunia Dusley\",\"Dudley Dursley\",\"Vernon Dusley\",\"Drace Dusley\"]\n },\n {\n question:\"Harrypotter film was directed based on novel written by_________?\",\n ans:\"J.K.Rowling\",\n answers:[\"J.K.Rowling\",\"crstopher columbus\",\"jacie collins\",\"maria semple\"],\n }]\n for(var i=0;i<harryPotter.length;i++)\n {\n var current=harryPotter[i];\n playGame(current.question,current.ans,current.answers[0],current.answers[1],current.answers[2],current.answers[3]);\n\n }\n levelone=score\n console.log(chalk.hex('#ff1a75').bold(\"YAAAY!you score in level1 is :\"+levelone))\n if(levelone>=5)\n {\n console.log(boom+\" \"+boom+\" \"+chalk.hex('#4dffff').bold(\"you have unlocked next level \"+clap+\" \"+clap));\n\n if(readlineSync.keyInYN(chalk.hex('#4dffff').bold(\"Are u ready to play level2?\")))\n {console.log(\"_____________________________________\")\n score=0\n level2();\n }\n else{\n if(readlineSync.keyInYN(chalk.green(\"Do u want to play other game?\")))\n {\n menu();\n }\n else\n {\n console.log(chalk.red(\"thank you! \")+smiley)\n \n }\n\n\n }\n }\n else\n {\n console.log(chalk.hex('#ff6666').bold(\"You need to score minimum 5 ponits for next level\"))\n \n if(readlineSync.keyInYN(chalk.hex('#ff6666').bold(\"Do u want to play again ? \"+smiley)))\n { score=0;\n level1();\n }\n else\n {\n if(readlineSync.keyInYN(chalk.hex('#ff6666').bold(\"Do u want to play other game?\")))\n {\n menu();\n }\n else\n {\n console.log(chalk.blue(\"thank you! \")+relaxed+\" \"+relaxed);\n \n }\n\n}\n\n}\n}//level1", "function findAgeLevel() {\n let weight = document.getElementById(\"weight\").value;\n weightInt = parseFloat(weight);\n let heightFeet = document.getElementById(\"heightFeet\").value;\n let heightInches = document.getElementById(\"heightInches\").value;\n\n var heightFeetInt = parseInt(heightFeet);\n var heightInchesInt = parseInt(heightInches);\n\n var TotalHeight = heightFeetInt * 12 + heightInchesInt;\n var ageLevel;\n\n if (weightInt < 120 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt < 120 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt < 120 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt >= 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Senior\";\n } else {\n ageLevel = \"Senior\";\n }\n\n return ageLevel;\n}", "function findTheRichKids(input){\n for (let i in input){\n if (input[i]['candies'] > 4){\n console.log(input[i]['name']);\n }\n }\n}", "function find_two_pairs(hand_info) { \n\tlet pair1 = false,\n\t\tpair2 = false;\n\tlet best_pairs = []; \n\n\tlet i = ace;\n\twhile(i >= 2 && pair1 == false) {\n\t\tif(hand_info.count_rank[i] >= 2) {\n\t\t\tpair1 = i;\n\t\t\tbest_pairs.push(pair1, pair1);\n\t\t}\n\t\ti--;\n\t}\n\n\twhile(i >= 2 && pair2 == false) {\n\t\tif(hand_info.count_rank[i] >= 2) {\n\t\t\tpair2 = i;\n\t\t\tbest_pairs.push(pair2, pair2);\n\t\t}\n\t\ti--;\n\t} \n\n\tif(pair1 && pair2){\n\t\tfor(let i = 0; i < hand_size; i++) {\n\t\t\tif(hand_info.hand[i].rank != pair1 && hand_info.hand[i].rank != pair2 ) {\n\t\t\t\tbest_pairs.push(hand_info.hand[i].rank);\n\t\t\t\thand_info.best_hands[two_pairs] = best_pairs;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "function houseOfCats(legs) {\n if (legs < 2) {\n return [0]\n }\n let humanLegs = []\n for (let i = 2; i <= legs; i += 2) {\n if (i % 4 !== 0) {\n humanLegs.push(i / 2)\n }\n }\n return humanLegs\n}", "function getPlayerCoach(player_list, player_picture,coach_list, coach_picture) {\n\tvar windowHeight = $(window).height();\n\tvar windowWidth = $('body').width();\n\tvar boxWidth = 120;\n\tvar boxHeight = 190;\n\tvar numOfColumns = Math.floor(windowWidth / boxWidth);\r\n\tvar numOfRows = Math.ceil(windowHeight / boxHeight);\r\n\tvar numOfDisplay = Math.min((numOfRows * numOfColumns), player_list.length);\r\n\t$('#wrap').width(boxWidth*numOfColumns);\n\n\tfor(var i = 0; i < player_list.length; i++) {\n\t\taddPeople($('.player-container'), player_list[i], player_picture[i]);\n\t}\n\tfor(var i=0;i<coach_list.length;i++){\n\t\taddPeople($('.coach-container'), coach_list[i], coach_picture[i]);\n\t}\n}", "function userWeapon(user, weapon) {\n // code here\n \n let listWeapon = [\n {name : 'redKnife', type : 'knife', attack : 100},\n {name : 'blackKnife', type : 'knife', attack : 300},\n {name : 'crimsonSword', type : 'katana', attack : 800},\n {name : 'moonLightSword', type : 'katana', attack : 400},\n {name : 'starKunai', type : 'kunai', attack : 80},\n {name : 'huumaShuriken', type : 'kunai', attack : 340},\n {name : 'emptyBracer', type : 'knuckle', attack : 20},\n {name : 'brokenArms', type : 'knuckle', attack : 40} \n ]\n \n let heroes = [\n {job : 'swordman', weapontype: 'knife, katana'},\n {job : 'ninja', weapontype: 'knife, kunai, katana'},\n {job : 'samurai', weapontype: 'knife, katana'},\n {job : 'monk', weapontype: 'knuckle'},\n ]\n\n\n for (let i = 0; i < listWeapon.length; i++) {\n for (let j = 0; j < heroes.length; j++) {\n if (weapon == listWeapon[i].name) {\n if (heroes[j].weapontype = listWeapon[i].type)\n return 'invalid weapon'\n }\n }\n }\n\n let weaponLama = 0\n let weaponBaru = 0 \n for (let i = 0; i < listWeapon.length; i++) {\n if (user.weapon == listWeapon[i].name) {\n weaponLama += listWeapon[i].attack\n }\n else if (weapon === listWeapon[i].name) {\n weaponBaru += listWeapon[i].attack\n }\n }\n\n let hasil = user.attack - weaponLama + weaponBaru\n return user.name + ' menggunakan senjata ' + weapon + ' attack menjadi ' + hasil\n}", "function makeBonusCards(cards){\r\n\r\n\tvar bonus1 = new BonusCard(\"bonusCard1\", \"\", 4, [[\"Earth\",\"Fire\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Fire\"]], g_images.bonusCard1); \r\n\tvar bonus2 = new BonusCard(\"bonusCard2\", \"\", 4, [[\"Water\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Air\"]], g_images.bonusCard2); \r\n\tvar bonus3 = new BonusCard(\"bonusCard3\", \"\", 4, [[\"Fire\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Fire\",\"Air\"]], g_images.bonusCard3); \r\n\tvar bonus4 = new BonusCard(\"bonusCard4\", \"\", 5, [[\"Air\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Air\",\"Nlights\"]], g_images.bonusCard4); \r\n\tvar bonus5 = new BonusCard(\"bonusCard5\", \"\", 5, [[\"Earth\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Nlights\"]], g_images.bonusCard5); \r\n\r\n\tvar bonus6 = new BonusCard(\"bonusCard6\", \"\", 3, [[\"Air\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Air\",\"Air\"]], g_images.bonusCard6); \r\n\tvar bonus7 = new BonusCard(\"bonusCard7\", \"\", 3, [[\"Water\",\"Water\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Water\"]], g_images.bonusCard7); \r\n\tvar bonus8 = new BonusCard(\"bonusCard8\", \"\", 3, [[\"Fire\",\"Fire\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Fire\",\"Fire\"]], g_images.bonusCard8); \r\n\tvar bonus9 = new BonusCard(\"bonusCard9\", \"\", 4, [[\"Earth\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Air\"]], g_images.bonusCard9); \r\n\tvar bonus10 = new BonusCard(\"bonusCard10\", \"\", 5, [[\"Water\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Nlights\"]], g_images.bonusCard10); \r\n\t\r\n\tvar bonus11 = new BonusCard(\"bonusCard11\", \"\", 4, [[\"Earth\",\"Water\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Water\"]], g_images.bonusCard11); \r\n\tvar bonus12 = new BonusCard(\"bonusCard12\", \"\", 6, [[\"Nlights\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Nlights\"]], g_images.bonusCard12); \r\n\tvar bonus13 = new BonusCard(\"bonusCard13\", \"\", 5, [[\"Water\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Water\"]], g_images.bonusCard13); \r\n\tvar bonus14 = new BonusCard(\"bonusCard14\", \"\", 5, [[\"Fire\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Fire\",\"Nlights\"]], g_images.bonusCard14); \r\n\tvar bonus15 = new BonusCard(\"bonusCard15\", \"\", 5, [[\"Fire\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Fire\"]], g_images.bonusCard15); \r\n\t\r\n\tvar bonus16 = new BonusCard(\"bonusCard16\", \"\", 5, [[\"Earth\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Earth\"]], g_images.bonusCard16); \r\n\tvar bonus17 = new BonusCard(\"bonusCard17\", \"\", 5, [[\"Air\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Air\"]], g_images.bonusCard17); \r\n\tvar bonus18 = new BonusCard(\"bonusCard18\", \"\", 2, [[\"Water\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Fire\"]], g_images.bonusCard18); \r\n\tvar bonus19 = new BonusCard(\"bonusCard19\", \"\", 3, [[\"Earth\",\"Earth\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Earth\"]], g_images.bonusCard19); \r\n\tvar bonus20 = new BonusCard(\"bonusCard20\", \"\", 4, [[\"Water\",\"Fire\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Fire\"]], g_images.bonusCard20); \r\n\r\n\t//Make a deck with 20 bonus point cards\r\n\tvar bonusDeckState = [\r\n\t\t\t\t\tbonus1, bonus2, bonus3, bonus4, bonus5, \r\n\t\t\t\t\tbonus6, bonus7, bonus8, bonus9, bonus10, \r\n\t\t\t\t\tbonus11, bonus12, bonus13, bonus14, bonus15, \r\n\t\t\t\t\tbonus16, bonus17, bonus18, bonus19, bonus20\r\n\t\t\t\t\t];\r\n\r\n\r\n\tvar bonusBoardState = [];\r\n\r\n\tfor (var i = 0; i < cards; i++) {\r\n\t\t//Draw a random card\r\n\t\tvar randomNumber = Math.floor(Math.random() * (numberOfBonusCards-1));\r\n\t\t//add that card to the game board\r\n\t\tbonusBoardState[i] = bonusDeckState[randomNumber];\r\n\t\t//remove that card from the deck\r\n\t\tbonusDeckState.splice(randomNumber,1);\r\n\t\tnumberOfBonusCards--;\r\n\t\t};\r\n\t \r\n\treturn bonusBoardState;\r\n}", "war(p1Hand, p2Hand){\n let p1War = p1Deck.splice(0, 3)\n let p2War = p2Deck.splice(0, 3)\n const p1WarHand = p1Deck.shift()\n const p2WarHand = p2Deck.shift()\n\n if (p1WarHand.value > p2WarHand.value) {\n console.log(\n \"Player 1: \" +\n p1WarHand.value + \" \" +\n p1WarHand.suit +\n \" \" +\n \"Player 2: \" +\n p2WarHand.value + \" \" +\n p2WarHand.suit\n )\n console.log(\"Player 1 Wins!\")\n\n p1Deck = [...new Set(p1Deck.concat(p1Hand, p2Hand, p1War, p2War, p1WarHand, p2WarHand))]\n \n console.log(\n \"Player 1 has: \" +\n p1Deck.length +\n \" cards\" +\n \" \" +\n \"Player 2 has: \" +\n p2Deck.length +\n \" cards\"\n )\n }\n else if (p2WarHand.value > p1WarHand.value) {\n console.log(\n \"Player 1: \" +\n p1WarHand.value + \" \" +\n p1WarHand.suit +\n \" \" +\n \"Player 2: \" +\n p2WarHand.value + \" \" +\n p2WarHand.suit\n )\n console.log(\"Player 2 Wins!\")\n p2Deck = [...new Set(p2Deck.concat(p1Hand, p2Hand, p1War, p2War, p1WarHand, p2WarHand))]\n \n console.log(\n \"Player 1 has: \" +\n p1Deck.length +\n \" cards\" +\n \" \" +\n \"Player 2 has: \" +\n p2Deck.length +\n \" cards\"\n )\n }\n else {\n this.war(p1Hand, p2Hand)\n }\n }", "function find_high_card(hand_info) {\n\tlet best_highcards = [];\n\n\tfor(let i = 0; i < 5; i++) {\n\t\tbest_highcards.push(hand_info.hand[i].rank); \n\t}\n\thand_info.best_hands[high_card] = best_highcards;\n}", "function makeList() {\n\t// Humanoids' part of the list\n\t\n\tvar len = humanoids.length;\n\t\n\tfor (var i = 0; i < len; i++) {\n\t\tvar race = humanoids[i][6]; // Get array's name of race\n\t\tvar info = humanoids[i][7]; // Get array's info on this race\n\t\tvar text = \"\"; \n\t\tvar alfa = 0;\n\t\tvar bravo = 0;\n\t\tvar a = 0;\n\t\tvar b = 0;\n\t\tfor (let j = 0; j < 6; j++) {\n\t\t\t// Every race has two bonuses - place them into alfa and brace\n\t\t\tif ((humanoids[i][j] > 0) && (a === 0)) { // a isn't filled yet\n\t\t\t\ta = humanoids[i][j]; // Get value (1 or 2)\n\t\t\t\talfa = abilities[j]; // Get placement (STR, DEX, etc)\n\t\t\t}\n\t\t\t\n\t\t\tif ((humanoids[i][j] > 0) && (a !== 0)) { // a has already been filled\n\t\t\t\tb = humanoids[i][j]; // Get value (1 or two)\n\t\t\t\tbravo = abilities[j]; // Get placement (STR, DEX, etc)\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (let k = 0; k < 5; k++) {\n\t\t\t// Makes the row of 5 \"divs\" for each humanoid race\n\t\t\tvar x = document.createElement(\"DIV\"); // Makes the cell div\n\t\t\tvar row = \"table__row__\" + i;\n\t\t\tvar column = \"table__column__\" + k;\n\t\t\tvar classes = \"data__1 \" + row + \" \" + column; // Concats the classes, since they can't seem to do so within the setAttribute parenthesis\n\t\t\tx.setAttribute(\"class\", classes); // Gives each cell its own combination of row and column classes, just like the table__0 to begin with\n\t\t\tif (k === 0) {\n\t\t\t\t// Inserts a column of radio-buttons in the first column\n\t\t\t\tvar t = document.createElement(\"input\"); // Creates an \"input\" element\n\t\t\t\t//t.setAttribute(\"class\", \"data__1--hidden\"); // Hides the buttons until they are needed\n\t\t\t\tt.setAttribute(\"type\", \"radio\");\n\t\t\t\tt.setAttribute(\"name\", \"race\"); // Having the same name is needed for getting the choice data, IIRC\n\t\t\t\tt.setAttribute(\"class\", \"data__1--hidden\"); // Don't show up yet\n\t\t\t\tt.setAttribute(\"value\", i); // AFAICS not used, but could be used for identifying which race is picked through value\n\t\t\t\t// t.setAttribute(\"id\", radioID);\n\t\t\t\tx.appendChild(t); // Places the \"input\" element inside the current \"div\" (x)\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Creates text element if it isn't in the radio button column\n\t\t\t\tif (k === 1) {var text = race;}\n\t\t\t\telse if (k === 2) {var text = alfa + \" +\" + a;}\n\t\t\t\telse if (k === 3) {var text = bravo + \" +\" + b;}\n\t\t\t\telse {var text = info;}\n\t\t\t\t\n\t\t\t\tvar t = document.createTextNode(text); // Sets the text-node to use the \"text\" set above\n\t\t\t\tx.appendChild(t); // Places the \"text\" <p> element into the \"div\" (x)\n\t\t\t}\n\t\t\tdocument.getElementById(\"table__1\").appendChild(x); // Finally places the \"div\" in the \"table__1\" element\n\t\t}\n\t}\n\t\n\t// Humanity's part of the list, 3 races\n\tfor (i = len; i < len+3; i++) {\n\t\t\n\t\tvar j = i-len;\n\t\tvar race = humanity[j][0];\n\t\tvar info = humanity[j][1];\n\t\n\t\tfor (let k = 0; k < 5; k++) {\n\t\t\t// Makes a row of 5 \"divs\" for each race in humanity\n\t\t\tvar x = document.createElement(\"DIV\"); // Makes the cell div\n\t\t\tvar row = \"table__row__\" + i;\n\t\t\tvar column = \"table__column__\" + k;\n\t\t\tvar classes = \"data__1 \" + row + \" \" + column; // Concats the classes, since they can't seem to do so within the setAttribute parenthesis\n\t\t\tx.setAttribute(\"class\", classes); // Gives each cell its own combination of row and column classes, just like the table__0 to begin with\n\t\t\tif (k === 0) {\n\t\t\t\t// Inserts the column of radio-buttons in the first column\n\t\t\t\tvar t = document.createElement(\"input\"); // Creates an \"input\" element\n\t\t\t\t//t.setAttribute(\"class\", \"data__1--hidden\"); // Hides the buttons until they are needed\n\t\t\t\tt.setAttribute(\"type\", \"radio\");\n\t\t\t\tt.setAttribute(\"name\", \"race\"); // Having the same name is needed for getting the choice data, IIRC\n\t\t\t\tt.setAttribute(\"class\", \"data__1--hidden\"); // Don't show up yet\n\t\t\t\tt.setAttribute(\"value\", i); // AFAICS not used, but could be used for identifying which race is picked through value\n\t\t\t\t// t.setAttribute(\"id\", radioID);\n\t\t\t\tx.appendChild(t); // Places the \"input\" element inside the current \"div\" (x)\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Creates text element if it isn't in the radio button column\n\t\t\t\tif (k === 1) {var text = race;}\n\t\t\t\telse if (k === 2) {var text = \"-\";}\n\t\t\t\telse if (k === 3 && j === 0) {var text = \"CHA +2\";}\n\t\t\t\telse if (k === 3) {var text = \"-\";}\n\t\t\t\telse {var text = info;}\n\t\t\t\t\n\t\t\t\tvar t = document.createTextNode(text); // Sets the text-node to use the \"text\" set above\n\t\t\t\tx.appendChild(t); // Places the \"text\" <p> element into the \"div\" (x)\n\t\t\t}\n\t\t\tdocument.getElementById(\"table__1\").appendChild(x); // Finally places the \"div\" in the \"table__1\" element\n\t\t}\n\t}\t\n}", "function checkObjectives() {\n // A Humble Beginning (1565 - 1650)\n if (((population.colonist.number * population.colonist.rate) + ((population.slave.number / population.slave.increment) * population.slave.rate) >= 10) && (population.merchant.rate2 >= 5)) {\n timePeriod[0].tracker[0] = 0;\n }\n if (population.number >= 50000) {\n timePeriod[0].tracker[2] = 0;\n }\n \n // War Is Too Expensive (1763 - 1775)\n if (population.minutemen.number >= 100) {\n timePeriod[2].tracker[3] = 0;\n }\n if (currency.colonialNotes.amount >= 2000000) {\n timePeriod[2].tracker[4] = 0;\n }\n}", "function allowedInBar(ages) {\n let twentyOneUp = [];\n for (let age of ages) {\n if (age >= 21) {\n twentyOneUp.push(age);\n }\n }\n return twentyOneUp;\n}", "get weightList() {\n return this.availableMinions().map((enemy) => {\n var _a, _b, _c;\n if (typeof enemy === 'string') {\n return 1;\n }\n else if (enemy.hasOwnProperty('pokemon')) {\n return (_a = enemy.options.weight) !== null && _a !== void 0 ? _a : 1;\n }\n else {\n return (_c = (_b = enemy.options) === null || _b === void 0 ? void 0 : _b.weight) !== null && _c !== void 0 ? _c : 1;\n }\n });\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 }", "function casual(){\n for(var i = 0; i < players.length; i++){\n if (players[i].difficulty === \"ca\"){\n display.push(players[i]);\n }\n }\n}", "render() {\n\n const pokemonsList = randomPokemons();\n // hand 1\n const handOne = [];\n let handOneTotalExp = 0;\n for (let i = 0; i < pokemonsList.length / 2; i++) {\n handOne.push(pokemonsList[i])\n handOneTotalExp += pokemonsList[i].base_experience;\n }\n // hand 2 \n let handTwoTotalExp = 0;\n const handTwo = [];\n for (let i = 3; i < pokemonsList.length - 1; i++) {\n handTwo.push(pokemonsList[i])\n handTwoTotalExp += pokemonsList[i].base_experience;\n\n }\n\n return (\n <div>\n {handOneTotalExp > handTwoTotalExp ?\n <div>\n Winner Is : <Pokedex team={handOne} totalExp={handOneTotalExp} />\n With total of {handOneTotalExp} exp! <br />\n Loser Is : <Pokedex team={handTwo} totalExp={handTwoTotalExp} />\n With total of {handTwoTotalExp} exp!\n </div>\n :\n <div>\n Winner Is : <Pokedex team={handTwo} totalExp={handTwoTotalExp} />\n With total of {handTwoTotalExp} exp! <br />\n Loser Is : <Pokedex team={handOne} totalExp={handOneTotalExp} />\n With total of {handOneTotalExp} exp!\n\n </div>\n }\n\n </div>\n );\n }", "attackableTiles(map, wlist = this.weapons)\n {\n let wlist2 = []\n for (let w of wlist)\n {\n if (this.canUseWeapon(w))\n {\n\twlist2.push(w)\n }\n }\n let p = inRange(this, this.getRange(wlist2), \"tiles\", map);\n p.setArt(\"C_atk\");\n return p;\n }", "function randomWeapon() {\r\n let array = [\r\n { weapon: \"Sword\", type: \"physical\", ability: \"randomInt(4, 12)\", deathNote: \"was sliced in half by a sword!\" },\r\n { weapon: \"Shovel\", type: \"physical\", ability:\"randomInt(3, 10)\", deathNote: \"got dugged by a shovel!\" },\r\n { weapon: \"Pistol\", type: \"ranged\", ability: \"randomInt(7, 20)\", deathNote: \"was shot by a pistol!\" },\r\n { weapon: \"Knife\", type: \"physical\", ability: \"randomInt(6, 9)\", deathNote: \"was stabbed in the throat!\" },\r\n { weapon: \"Shotgun\", type: \"ranged\", ability: \"randomInt(4, 12)\", deathNote: \"was blasted to rubble!\" },\r\n { weapon: \"Spear\", type: \"ranged\", ability: \"randomInt(1, 20) + randomInt(1, 10)\", deathNote: \"got pierced by a spear!\" },\r\n { weapon: \"Molotov\", type: \"ranged\", ability: \"randomInt(4, 7) + randomInt(4, 7)\", deathNote: \"screamed as fire from a broken molotov seared thy skin.\" },\r\n { weapon: \"Machine Gun\", type: \"ranged\", ability: \"randomInt(4, 5) + randomInt(6, 7) + randomInt(7, 8)\", deathNote: \"was ripped apart by bullets!\" },\r\n { weapon: \"Frying Pan\", type: \"magic\", ability: \"randomInt(10, 12)\", deathNote: \"was fried by a frying pan!\" },\r\n { weapon: \"Blood Magic\", type: \"magic\", ability: \"randomInt(0, 22)\", deathNote: \"was destroyed inside-out by inner blood turmoil!\" },\r\n { weapon: \"Laser Sword\", type: \"magic\", ability: \"randomInt(11, 13)\", deathNote: \"was cut in half by pure plasma!\" },\r\n { weapon: \"Grenade\", type: \"ranged\", ability: \"10\", deathNote: \"was blew up by a grenade!\" },\r\n { weapon: \"Shield\", type: \"physical\", ability: \"randomInt(7, 10) - 5\", deathNote: \"neck broke by getting bashed by a shield!\" },\r\n { weapon: \"Rocket Launcher\", type: \"physical\", ability: \"randomInt(20, 50) - 30\", deathNote: \"torn apart by a missle!\" },\r\n { weapon: \"Holy Cross\", type: \"magic\", ability: \"randomInt(1, 12) + 10\", deathNote: \"was smited by a holy might!\" },\r\n { weapon: \"Railgun\", type: \"ranged\", ability: \"randomInt(1, 100) - 40\", deathNote: \"was fried by a plasma beam!\" }\r\n ];\r\n\r\n let random = randomInt(0, array.length);\r\n return array[random];\r\n}", "function chillHop() {\n return [\n {\n name: \"Cruisin\",\n artist: \"Cloudchord, G Mills\",\n cover: \"https://chillhop.com/wp-content/uploads/2020/07/8404541e3b694d16fd79433b142ed910f36764dd.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#FFB1A7\",\"#FF184B\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=8200\",\n },\n {\n name: \"Bliss\",\n artist: \"Misha, Jussi Halme\",\n cover: \"https://chillhop.com/wp-content/uploads/2020/09/5bff1a6f1bd0e2168d29b4c841b811598135e457.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#2A416D\",\"#EB8086\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=9248\",\n },\n {\n name: \"Beaver Creek\",\n artist: \"Aso, Middle School, Aviino\",\n cover: \"https://chillhop.com/wp-content/uploads/2020/09/0255e8b8c74c90d4a27c594b3452b2daafae608d.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#FCC376\",\"#289490\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=10076\",\n },\n {\n name: \"Higher\",\n artist: \"Misha, Jussi Halme\",\n cover:\n \"https://chillhop.com/wp-content/uploads/2021/05/2473c60e471fe9b40e246bf7711c87d3d6ea69a7.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#E87274\", \"#2D385A\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=15088\",\n },\n {\n name: \"Clocks Forward\",\n artist: \"Psalm Trees, Guillaume Muschalle\",\n cover:\n \"https://chillhop.com/wp-content/uploads/2020/07/db956cc3e3bb2d3725d0ce3f9aaf7190671c9451.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#BB7970\", \"#F8D09F\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=8094\",\n },\n {\n name: \"Far From Home\",\n artist: \"Toonorth\",\n cover:\n \"https://chillhop.com/wp-content/uploads/2020/07/ad7fc4dda66ba986466fd2b1c416b0b12411ee28.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#537879\", \"#F5E4B7\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=8127\",\n },\n {\n name: \"Arcade\",\n artist: \"Yasper\",\n cover: \"https://chillhop.com/wp-content/uploads/2020/07/cd050898ca06fdfdb7fcf2313304d952c6dd8e41.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#8554B5\",\"#D88D6E\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=7987\",\n },\n {\n name: \"Going Back\",\n artist: \"Swørn\",\n cover: \"https://chillhop.com/wp-content/uploads/2020/10/737bb830d34592344eb4a2a1d2c006cdbfc811d9.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"##26444C\",\"#29375E\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=10310\",\n },\n {\n name: \"Waterfalls\",\n artist: \"G Mills, Molly McPhaul\",\n cover: \"https://chillhop.com/wp-content/uploads/2021/03/4f968562d372586b08590bf29066c638ee8fda64.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#892D42\",\"#FEA568\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=16195\",\n },\n {\n name: \"Rest Until Dark\",\n artist: \"Sleepy Fish\",\n cover: \"https://chillhop.com/wp-content/uploads/2020/09/c209a7df7b9bc133dfff73ce86ebc3c57c2b73dd.jpg\",\n id: uuidv4(),\n active: false,\n color: [\"#3090AE\",\"#2A3E5D\"],\n audio: \"https://mp3.chillhop.com/serve.php/?mp3=10015\",\n },\n ];\n}", "function Champion() {\n this.nome = 'nome';\n this.ap = 0;\n this.ad = 0;\n}", "function changePlayerMeters(energy = 0, hunger = 0, thirst = 0) {\n let values = [];\n for (i = 0; i < 3; i++) {\n changeMeter(playerMeters[i], arguments[i]);\n values.push(parseInt(playerMeters[i].innerHTML));\n }\n // Deplete energy if dehydrated, starving, or sleep deprived:\n if (values[1] == 0) changeMeter(playerMeters[0], -2);\n if (values[2] == 0) changeMeter(playerMeters[0], -4);\n if (timeAwake > 36) changeMeter(playerMeters[0], -2);\n // Increase energy if hunger and thirst are above half:\n if (playerAlive && (values[1] > 50 && values[2] > 50)) changeMeter(playerMeters[0], 1);\n // If energy drops to 0, player dies:\n if (values[0] == 0) playerDie();\n}", "function playWar() {\n for(let m = 0; m < player1.hand.length; m++) {\n for(let n = 0; n < player2.hand.length; n++) {\n // added player 1 win argument\n // if (player1.hand[m].value == undefined || player2.hand[n].value == undefined){\n // console.log('this is undefined')\n // }\n if(player1.hand[m].value > player2.hand[n].value) {\n console.log(\"Player 1 wins! Flawless Victory!\");\n player1.hand.push(player1.hand[m]);\n player1.hand.push(player2.hand[n]);\n player1.hand.shift();\n player2.hand.shift();\n console.log(player1.hand[m]);\n console.log(\"Player 1 has \" + player1.hand.length + \" left\");\n console.log(player2.hand[n]);\n console.log(\"Player 2 has \" + player2.hand.length + \" left\");\n\n // added player 2 win argument \n }else if(player1.hand[m].value < player2.hand[n].value) {\n console.log(\"Player 2 wins! Flawless Victory!\");\n player2.hand.push(player1.hand[m]);\n player2.hand.push(player2.hand[n]);\n player1.hand.shift();\n player2.hand.shift();\n console.log(player1.hand[m]);\n console.log(\"Player 1 has \" + player1.hand.length + \" left\");\n console.log(player2.hand[n]);\n console.log(\"Player 2 has \" + player2.hand.length + \" left\");\n\n // }else if((player1.hand[m].value = \"undefined\") || (player2.hand[n].value = \"undefined\")) {\n // console.log(\"Something went wrong fool!\")\n \n\n }else {\n console.log(\"Tie! Friendship!?\");\n player1.hand.push(player1.hand[m]);\n player2.hand.push(player2.hand[n]);\n player1.hand.shift();\n player2.hand.shift();\n console.log(player1.hand[m]);\n console.log(\"Player 1 has \" + player1.hand.length + \" left\");\n console.log(player2.hand[n]);\n console.log(\"Player 2 has \" + player2.hand.length + \" left\");\n // added game winner \n }\n if(player1.hand.length === 52) {\n alert(\"Player 1 Wins! Fatality!!! Player 2 You weak pathetic fool! You're Soul is mine!\");\n }else if(player2.hand.length === 52) {\n alert(\"Player 2 Wins! Fatality!!! Player 1 You weak pathetic fool! You're Soul is mine!\")\n } \n }\n \n }\n return playWar()\n \n}", "function isOldEnoughWithName() {\n for (var i = 0; i < peopleWhoWantToSeeMadMaxFuryRoad.length; i++) {\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].gender == \"male\"){\n pronoun = \"He's\";\n }\n else if (peopleWhoWantToSeeMadMaxFuryRoad[i].gender == \"female\"){\n pronoun = \"She's\";\n };\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].age >= 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is old enough to see Mad Max.\" + \" \" + pronoun + \" allowed into the movies.\")\n }\n else if(peopleWhoWantToSeeMadMaxFuryRoad[i].age < 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is to young to see Mad Max.\" + \" \" + pronoun + \" NOT allowed into the movies.\")\n };\n }\n}", "function checksutiedAce(hand) {\n let suit = false;\n let suitedAce = false;\n for (let card of hand) {\n if (card.Point == \"A\") {\n suit = card.Suit;\n suitedAce = true;\n break;\n }\n }\n if (suitedAce) {\n suitedAce = false;\n for (let card of hand) {\n if (card.Suit == suit && card.Point != \"A\") {\n suitedAce = true;\n break;\n }\n }\n\n if (suitedAce) {\n // pair\n let pair = false;\n for (let card of hand) {\n for (let walkcard of hand) {\n if (\n card.Point != \"A\" &&\n card.Point == walkcard.Point &&\n card.Suit != walkcard.Suit\n ) {\n pair = true;\n break;\n }\n }\n }\n if (pair) return true; //showHand(hand, \"Suited Ace with pair\");\n // two Broadway\n let broadwaycard = 0;\n let braodway = false;\n for (let card of hand) {\n if (card.point >= 10) {\n broadwaycard++;\n }\n if (broadwaycard > 1) braodway = true;\n }\n\n if (braodway) return true; // showHand(hand, \"Suited Ace with broadway\");\n\n // rundown\n let rundown = false;\n let downtown = [];\n for (let card of hand) {\n if (card.Point != \"A\") {\n downtown.push(card.point);\n }\n }\n if (downtown.length == 3) {\n downtown.sort((a, b) => {\n return a - b;\n });\n if (\n downtown[2] - downtown[0] < 4 &&\n downtown[1] != downtown[0] &&\n downtown[2] != downtown[1]\n ) {\n rundown = true;\n }\n }\n if (rundown) return true; // showHand(hand, \"Suited Ace with rundown\");\n }\n }\n}", "function AbiltyScores() {\n\tvar rolls = [FourDieSix(),FourDieSix(),FourDieSix(),FourDieSix(),FourDieSix(),FourDieSix()];\n\tswitch(OPC.build) {\n\t\tcase \"archer\":\n\t\t\tvar abilityPriority = [3,6,4,2,5,1];\n\t\t\tbreak;\n\t\tcase \"footman\":\n\t\t\tvar abilityPriority = [6,3,5,1,4,2];\n\t\t\tbreak;\n\t\tcase \"duelist\":\n\t\t\tvar abilityPriority = [2,6,4,3,1,5];\n\t\t\tbreak;\n\t\tcase \"brute\":\n\t\t\tvar abilityPriority = [6,4,5,1,2,3];\n\t\t\tbreak;\n\t\tcase \"dervish\":\n\t\t\tvar abilityPriority = [3,6,5,2,4,1];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tabilityPriority = [1,1,1,1,1,1];\n\t\t\tbreak;\n\t}\n\tfor(var i = 0; i < 6; i++) {\n\t\tOPC.abilityScores[ArrayFindPositionHighest(abilityPriority)] = rolls[ArrayFindPositionHighest(rolls)];\n\t\trolls[ArrayFindPositionHighest(rolls)] = 0;\n\t\tabilityPriority[ArrayFindPositionHighest(abilityPriority)] = 0;\n\t}\n}", "function Hand() {\n var cards = [];\n this.score = function() {\n var idx = cards.length;\n var score = 0;\n while (idx > 0) {\n score += cards[idx - 1].getValue();\n idx--;\n }\n return score;\n };\n this.init = function() {\n cards[0] = new deal();\n cards[1] = new deal();\n };\n this.hitme = function() {\n cards.push(new deal());\n };\n this.listCards = function() {\n var idx = cards.length;\n console.log(\"In your hand you have: \");\n while (idx > 0) {\n console.log(cards[idx - 1].getCardName() + \" of \" + cards[idx - 1].getSuitName());\n idx--;\n }\n };\n}", "getHands() {\n const hands = this.getFilteredHands();\n return hands.map((hand, playerHandIndex) => {\n const hasFollowSameSuit = this.hasSameSuitWithFirstCard(\n this.getFlatten(hand)\n // hand.flat()\n );\n const playerHand = this.offsetPlayers[playerHandIndex];\n\n return hand.map((each, index) => {\n let dummyPlayer = this.players[this.dummyIndex];\n let declarerPlayer = this.players[this.declarerIndex];\n let isPlayingState =\n this.table.gameState === GAME_STATE.playing;\n\n // if player is nither declarer nor dummy plaer\n let canBeClick =\n isPlayingState &&\n this.isCurrentUserAPlayer &&\n // current player is equal to south;\n this.currentTurnPlayer === playerHand &&\n playerHandIndex === 0;\n\n // current turn is dummay hand, and current login user is declare,\n // let current user can control dummy hand's card\n if (\n this.dummyMode &&\n this.isCurrentUserAPlayer &&\n dummyPlayer === this.currentTurnPlayer &&\n isPlayingState\n ) {\n if (\n this.currentUser.uid === declarerPlayer &&\n playerHandIndex === 2\n ) {\n canBeClick = true;\n }\n if (\n this.currentUser.uid === dummyPlayer &&\n playerHandIndex === 0\n ) {\n canBeClick = false;\n }\n }\n\n let flipUp =\n (isPlayingState ||\n playerHandIndex === this.currentUserIndex) &&\n (!this.isCurrentUserAPlayer ||\n playerHandIndex === this.currentUserIndex ||\n playerHandIndex === this.offsetDummyIndex);\n\n let allowClickEvt = card => {\n return (\n this.firstCard === null ||\n !hasFollowSameSuit ||\n Math.floor(card.value / TOTAL_TRICKS) ===\n Math.floor(this.firstCard.value / TOTAL_TRICKS)\n );\n };\n\n return each.map((cardItem, i) => {\n return Object.assign({}, cardItem, {\n pos: [index, i],\n flipUp: flipUp,\n canBeClick: canBeClick && allowClickEvt(cardItem)\n });\n });\n });\n });\n }", "function checkCheat(player, rival) {\n/*\tif (player.Name == \"cheat\") {\n\t\tif (rival.Name == \"code\") {\n\t\t\tfor (i=0; i<151; i++) {\n\t\t\t\t// getPokemonName\n\t\t\t\tvar pokemonNumber = i + 1;\n\t\t\t\tvar pokemonLevel = 1; // change to 100 // will this work if level 1 is set for all pokemon in var pokemonStats (FR_PKMN.js)?\n\t\t\t\tif (pokemonNumber < 10) {\n\t\t\t\t\tpokemonNumber = \"00\" + pokemonNumber;\n\t\t\t\t} else if (pokemonNumber < 100) {\n\t\t\t\t\tpokemonNumber = \"0\" + pokemonNumber;\n\t\t\t\t};\n\t\t\t\tpokemonNumber = String(pokemonNumber);\n\t\t\t\tvar pokemonName = getPokemonName(pokemonNumber);\n\t\t\t\tvar pokemon = new createPokemonWithNameLevel(pokemonName, pokemonLevel);\n\t\t\t\t// set pokemon as caught\n\t\t\t\tif (player.pokemonCaught[pokemon.Name] == 0) {\n\t\t\t\t\tplayer.pokemonCaught[pokemon.Name] = 1;\n\t\t\t\t};\n\t\t\t\t// Add pokemon to the pokedex counter\n\t\t\t\tsetPokemonCaught(player);\n\t\t\t};\n\t\t\t// add specific pokemon as activePokemon\n\t\t\tfor (i=0; 0<5; i++) {\n\t\t\t\tvar activePokemonNumber = i + 1;\n\t\t\t\tvar activePokemonCall = \"activePokemon\" + activePokemonNumber;\n\t\t\t\tif (activePokemonNumber == 1) {\n\t\t\t\t\t// Create Pokemon\n \t\t\t\t\t\t// C: Cloyster (/ Cubone/ Chansey/ Charizard)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 2) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// H: Hitmonlee (/ Horsea/ Haunter/ Hitmonchan/ Hypno)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 3) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// E: Electabuzz (/ Exeggutor/ Electrode)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 4) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// A: Arcanine (/ Articuno)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t} else if (activePokemonNumber == 5) {\n\t\t\t\t\t// Create Pokemon\n\t\t\t\t\t\t// T: Tangela (/ Tauros)\n\n\t\t\t\t\t// Set Pokemon as activePokemon\n\t\t\t\t\tplayer[activePokemonCall] = \"\";\n\t\t\t\t};\n\t\t\t\tsetActivePokemonText(player);\n\t\t\t};\t\t\t\t\t\n\t\t};\n\t};*/\n}", "function recruiter(internArr) {\n\n\t// Below is just to help show the syntax you need,\n\t// you'll need to process ALL of the hireables like this one and sort\n\tvar iname;\n\tvar idegr;\n\tvar igpa;\n\tvar iexp;\n\tvar iwage, ivalue, ibracket, imetric;\n\tvar astrology = [] // keep track of indices of astrology majors\n\tvar employable = 0 // keep track of employable non-astrology majors\n\n\tfor (i=0; i < internArr.length; i++){\n\t\tiname = internArr[i].name;\n\t\tidegr = internArr[i].degree;\n\t\tigpa = internArr[i].gpa;\n\t\tiexp = internArr[i].experiance;\n\n\t\t// Yep, you can use strings as an \"index\" (technically it's a property) in JavaScript\n\t\tidegr = idegr.toLowerCase();\n\t\tiwage = degreeSWage[idegr];\n\t\tif (iwage === undefined){\n\t\t\timetric = 0;\n\t\t}\n\t\t} else {\n\t\t\t// You should use these functions at some point\n\t\t\tif (idegr === \"astrology\"){\n\t\t\t\t// ensure astrology major's value to the company is lower than everybody else\n\t\t\t\tivalue = util.getValueFromWageAndExp(1,Math.floor(iexp));\n\t\t\t\tibracket = bracketFromGPA(igpa);\n\t\t\t\timetric = ivalue + .05*ibracket;\n\t\t\t\temployable++;\n\t\t\t} else {\n\t\t\t\tivalue = util.getValueFromWageAndExp(iwage, Math.floor(iexp));\n\t\t\t\tibracket = bracketFromGPA(igpa);\n\t\t\t\t//ivalue increases by .2\n\t\t\t\tif (ibracket != 0){\n\t\t\t\t\timetric = ivalue + .05*ibracket;\n\t\t\t\t\temployable++;\n\t\t\t\t} else {\n\t\t\t\t\timetric = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// We really want to add our sorting number \"metric\" to objects (it really is this easy)\n\t\tinternArr[i].metric = imetric;\n\t}", "function addAgeToSubArray(person){\n var died = person.died;\n var born = person.born;\n var age = died - born;\n if (died >= 1900 && died < 2000){\n agesByCentury.century20Ages.push(age);\n } else if (died >= 1800 && died < 1900){\n agesByCentury.century19Ages.push(age);\n } else if (died >= 1700 && died < 1800){\n agesByCentury.century18Ages.push(age);\n } else if (died >= 1600 && died < 1700){\n agesByCentury.century17Ages.push(age);\n } else if (died >= 1500 && died < 1600){\n agesByCentury.century16Ages.push(age);\n }\n}", "function addSwimmingPools(chainOfHotels) {\n\tvar chain = createHotels();\n\tvar hotelsWithSwimmingPools = [];\n\tvar i;\n\t//console.table(chainOfHotels);\n\t//console.log(chainOfHotels);\n\t//console.table(chain);\n\t//console.log(chain);\n\tfor (i = 0; i < chainOfHotels.length; i++) {\n\t\t//console.log(chainOfHotels[i]);\n\t\tif (chainOfHotels[i].rooms < 250) {\n\t\t\tchainOfHotels[i].swimmingPool = \"false\";\n\t\t\t//console.log(chainOfHotels[i]);\n\t\t} else if (chainOfHotels[i].rooms > 250) {\n\t\t\tchainOfHotels[i].swimmingPool = \"true\";\n\t\t\thotelsWithSwimmingPools.push(chainOfHotels[i]);\n\t\t\t//console.log(chainOfHotels[i]);\n\t\t}\n\t}\n\tfor (i = 0; i < chain.length; i++) {\n\t\tif (chain[i].rooms < 250) {\n\t\t\tchain[i].swimmingPool = \"false\";\n\t\t\t//console.log(chain[i]);\n\t\t} else if (chain[i].rooms > 250) {\n\t\t\tchain[i].swimmingPool = \"true\";\n\t\t\thotelsWithSwimmingPools.push(chain[i]);\n\t\t\t//console.log(chain[i]);\n\t\t}\n\t}\n\t//console.table(hotelsWithSwimmingPools);\n\t//use console.table to check the values in the array\n\n\t//return an array of hotels which have swimming pools\n\treturn hotelsWithSwimmingPools;\n}", "function horse(i,j,k){\r\n\r\n if(i>0 && j>1)\r\n {\r\n var compare = document.getElementById(`${i-1}${j-2}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i-1,j-2,k) == 1 || got_enemy(i-1,j-2,k) == 2))\r\n {\r\n array.push(`${i-1}${j-2}`);\r\n }\r\n\r\n }\r\n\r\n if(i>0 && j<6)\r\n {\r\n var compare = document.getElementById(`${i-1}${j+2}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i-1,j+2,k) == 1 || got_enemy(i-1,j+2,k) == 2))\r\n {\r\n array.push(`${i-1}${j+2}`);\r\n }\r\n }\r\n\r\n if(i<7 && j>1)\r\n {\r\n var compare = document.getElementById(`${i+1}${j-2}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i+1,j-2,k) == 1 || got_enemy(i+1,j-2,k) == 2))\r\n {\r\n array.push(`${i+1}${j-2}`);\r\n }\r\n\r\n }\r\n\r\n if(i<7 && j<6)\r\n { \r\n var compare = document.getElementById(`${i+1}${j+2}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i+1,j+2,k) == 1 || got_enemy(i+1,j+2,k) == 2))\r\n {\r\n array.push(`${i+1}${j+2}`);\r\n }\r\n }\r\n\r\n if(i>1 && j>0)\r\n {\r\n var compare = document.getElementById(`${i-2}${j-1}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i-2,j-1,k) == 1 || got_enemy(i-2,j-1,k) == 2))\r\n {\r\n array.push(`${i-2}${j-1}`);\r\n }\r\n }\r\n \r\n if(i<6 && j>0)\r\n {\r\n var compare = document.getElementById(`${i+2}${j-1}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i+2,j-1,k) == 1 || got_enemy(i+2,j-1,k) == 2))\r\n {\r\n array.push(`${i+2}${j-1}`);\r\n }\r\n }\r\n if(i>1 && j<7)\r\n {\r\n var compare = document.getElementById(`${i-2}${j+1}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i-2,j+1,k) == 1 || got_enemy(i-2,j+1,k) == 2))\r\n {\r\n array.push(`${i-2}${j+1}`);\r\n }\r\n }\r\n\r\n if(i<6 && j<7)\r\n {\r\n var compare = document.getElementById(`${i+2}${j+1}`).textContent;\r\n \r\n if(compare==\"_______\" || (got_enemy(i+2,j+1,k) == 1 || got_enemy(i+2,j+1,k) == 2))\r\n {\r\n array.push(`${i+2}${j+1}`);\r\n }\r\n }\r\n \r\n\r\n\r\n}", "chooseFaceUp(a){\n console.log(this.hand[a[0]],this.hand[a[1]],this.hand[a[2]]);\n this.faceup.push(this.hand[a[0]]);\n this.faceup.push(this.hand[a[1]]);\n this.faceup.push(this.hand[a[2]]);\n a.sort(function(a,b){ // Sort the index to be in order\n return a-b;\n });\n this.removeFromHand(a[2]);\n this.removeFromHand(a[1]);\n this.removeFromHand(a[0]);\n }", "function addCards(addHand) {\n var total = 0;\n var list = [];\n\n for (var i = 0; i < addHand.cards.length; i++) {\n\n if (addHand.cards[i].face != 'A') {\n list.unshift(addHand.cards[i]);\n }\n else {\n list.push(addHand.cards[i]);\n }\n }\n\n\n\n for (var i = 0; i < list.length; i++) {\n\n if (list[i].face != 'A') {\n total += list[i].value;\n }\n else {\n\n if (total < 11) {\n total += 11;\n }\n else {\n total += 1;\n }\n }\n }\n\n return total;\n}", "function sortInventorsByAge(inventorsList, exercise) {\n const ul = document.createElement('ul');\n const sortedByAge = inventorsList.sort((a, b) => a.year - b.year);\n\n exercise.appendChild(ul);\n\n sortedByAge.forEach((inventor) => {\n const li = document.createElement('li');\n li.textContent = `${inventor.first} ${inventor.last} was born in ${inventor.year}.`;\n ul.appendChild(li);\n });\n}", "function playercheck(){\n // checks for the player who goes first\n if(lastgamewinner = \"none\"){\n // first checks for last person won, if none goes to check hands\n var p1hi = 0;\n var p2hi = 0;\n\n // p1\n var arraylength = p1hand.length\n for(i=0; i < arraylength; i++){\n // take the individual cards\n // seperate them from their value\n // save the highest value\n\n var cutstring = p1hand[i].slice(2,arraylength);\n\n if(p1hi < cutstring){\n p1hi = cutstring;\n } else {\n }\n }\n\n arraylength = p2hand.length\n for(i=0; i < arraylength; i++){\n // take the individual cards\n // seperate them from their value\n // save the highest value\n var cutstring2 = p2hand[i].slice(2,arraylength);\n if(p2hi < cutstring2){\n p2hi = cutstring2;\n } else {\n }\n\n }\n // test for winner\n // take the biggest card\n // set lastgamewinner to that card\n // return lastgamewinner\n\n //return last player won\n if( p1hi > p2hi){\n lastgamewinner = \"player1\";\n }else{\n lastgamewinner = \"player2\";\n }\n return lastgamewinner;\n\n\n }\n}", "function people10(list, p, valor) {\n var number = tenList(list, p, valor);\n\n if (valor < 0 && p < 0.5) { // loyal bottom\n var listLess10 = list.filter(person => person.votes_with_party_pct <= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.votes_with_party_pct - m2.votes_with_party_pct;\n });\n return listLess10;\n\n } else if (valor < 0 && p > 0.5) { //loyal top\n var listLess10 = list.filter(person => person.votes_with_party_pct >= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.votes_with_party_pct - m2.votes_with_party_pct;\n });\n\n return listLess10.reverse();\n \n } else if (valor > 0 && p < 0.5) { // attendance bottom\n var listLess10 = list.filter(person => person.missed_votes_pct <= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.missed_votes_pct - m2.missed_votes_pct;\n });\n\n return listLess10;\n\n } else if (valor > 0 && p > 0.5) { //attendance top\n var listLess10 = list.filter(person => person.missed_votes_pct >= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.missed_votes_pct - m2.missed_votes_pct;\n });\n return listLess10.reverse();\n }\n return listLess10;\n }", "function ratings(chainOfHotels) {\n\tvar silverRatedHotels = [];\n\t//console.log(chainOfHotels.length);\n\tconsole.table(chainOfHotels);\n\tfor (i = 0; i < chainOfHotels.length; i++) {\n\t\t//console.log(chainOfHotels[i]);\n\t\tif (calculateScore(chainOfHotels[i]) > 3 && calculateScore(chainOfHotels[i]) < 7) {\n\t\t\tconsole.log(\"The hotels score is \" + calculateScore(chainOfHotels[i]));\n\t\t\tsilverRatedHotels.push(chainOfHotels[i]);\n\t\t}\n\t\t//console.log(calculateScore(chainOfHotels[i]));\n\t}\n\t//use console.table to check the values in the array\n\tconsole.log(silverRatedHotels);\n\t//return array of Silver rated hotels\n\treturn silverRatedHotels;\n}", "function generate_player_data(player_id) {\n\tvar cards = genShuffledDeck();\n\tvar i;\n\tvar pile = [];\n\tvar home = [];\n\tvar zones = [[],[],[],[]];\n\t\n/*\tfor (i=0; i<52; i++)\n\t\tif (cards[i] % 13 == 0) {\n\t\t\tvar t = cards[i];\n\t\t\tcards[i] = cards[3];\n\t\t\tcards[3] = t;\n\t\t\tbreak;\n\t\t}\n*/\n\n\tfor (i=0;i<13;i++) pile[i] = cards.pop();\n\tfor (i=0;i<35;i++) home[i] = cards.pop();\n\tfor (i=0;i<4;i++) zones[i][0] = cards.pop();\n\tvar player = {\n\t\tid: player_id,\n\t\tscore: 0,\n\t\tstandby: false,\n\t\trequested_end: false,\n\t\tpile: pile,\n\t\thome: home,\n\t\tcut: 32,//Player can see home[cut](top) to home[bot](bottom)\n\t\tbot: 34,\n\t\tzones: zones,\n\n\t\tget_overview: function(){\n\t\t\treturn {\n\t\t\t\tname: map_id_to_name[this.id],\n\t\t\t\tscore: this.score,\n\t\t\t\trequested_end: this.requested_end,\n\t\t\t\tpile: this.pile[this.pile.length-1],\n\t\t\t\tpile_count: this.pile.length,\n\t\t\t\thome_count: this.cut,\n\t\t\t\thomeside: this.home.slice(this.cut, this.bot+1).reverse(),\n\t\t\t\tzones: this.zones,\n\t\t\t};\n\t\t},\n\t\thomenext: function(){\n\t\t\tthis.bot = this.cut-1;\n\t\t\tif (this.cut == 0)\n\t\t\t\tthis.cut = this.home.length;\n\t\t\telse {\n\t\t\t\tthis.cut -= 3;\n\t\t\t\tif (this.cut < 0) this.cut = 0;\n\t\t\t}\n\t\t},\n\t\tmove: function(srcz, srcf, dstz){\n\t\t\tvar srccard = this.get_card_value(srcz, srcf);\n\t\t\tvar dstcard = this.zones[dstz][this.zones[dstz].length-1];\n\t\t\tconsole.log('move '+srccard+' to '+dstcard);\n\t\t\tif (dstcard >= 0 && dstcard <=51) {\n\t\t\t\tif ((srccard+1+39-dstcard)%26 != 0 || srccard % 13 == 12) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (srcz < 4) {\n\t\t\t\tthis.zones[dstz] = this.zones[dstz].concat(this.zones[srcz].splice(srcf, this.zones[srcz].length-srcf));\n\t\t\t}\n\t\t\telse if (srcz == 4) {\n\t\t\t\tthis.zones[dstz] = this.zones[dstz].concat(this.home.splice(this.cut, 1));\n\t\t\t\tif (this.bot > this.cut) this.bot -= 1;\n\t\t\t}\n\t\t\telse if (srcz == 5) {\n\t\t\t\tthis.zones[dstz].push(this.pile.pop());\n\t\t\t\tthis.score += 2;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tget_card_value: function(z, f){\n\t\t\tif (z < 4)\n\t\t\t\treturn this.zones[z][f];\n\t\t\telse if (z == 4)\n\t\t\t\treturn this.home[this.cut];\n\t\t\telse if (z == 5)\n\t\t\t\treturn this.pile[this.pile.length-1];\n\t\t},\n\t\tabandon: function(z){\n\t\t\tif (z < 4) {\n\t\t\t\tif (this.zones[z].length > 0) {\n\t\t\t\t\tthis.zones[z].pop();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (z == 4) {\n\t\t\t\tif (this.cut < home.length && this.cut >= 0) {\n\t\t\t\t\tthis.home.splice(this.cut, 1);\n\t\t\t\t\tif (this.bot > this.cut) this.bot -= 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if (z == 5) {\n\t\t\t\tif (this.pile.length > 0) {\n\t\t\t\t\tthis.pile.pop();\n\t\t\t\t\tthis.score += 2;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t}\n\t\t},\n\t};\n\treturn player;\n}", "function theChallenger() {\n const challenge = Math.floor(Math.random() * 150) + 1 ;\n const url = `https://pokeapi.co/api/v2/pokemon/${challenge}`;\n fetch(url)\n .then( e => {\n return e.json();\n })\n .then( data => {\n challenger = {\n id: data.id,\n name: data.name.toUpperCase(),\n image: data.sprites['front_default'],\n experience: data.base_experience,\n type: data.types.map( type => type.type.name).join(', '),\n }\n displayBattle(challenger);\n })\n \n}", "function doubleWealth() {\n listData = listData.map(el => {\n return {...el, wealth: el.wealth * 2}\n });\n renderList();\n}", "function itemStats(items, champion) {\n for (let i = 0; i < items.length; i++) {\n let itemWanted = itemSearch(items[i]);\n if (itemWanted != undefined) {\n if (itemWanted.FlatHPPoolMod != null) {\n champion.health += itemWanted.FlatHPPoolMod;\n champion.bonushealth += itemWanted.FlatHPPoolMod;\n }\n if (itemWanted.FlatArmorMod != null) {\n champion.armor += itemWanted.FlatArmorMod;\n champion.bonusArmor += itemWanted.FlatArmorMod;\n } \n if (itemWanted.FlatSpellBlockMod != null) {\n champion.mr += itemWanted.FlatSpellBlockMod;\n champion.bonusMR += itemWanted.FlatSpellBlockMod;\n }\n if (itemWanted.PercentAttackSpeedMod != null && champion.bAtkSpeed != null) {\n champion.bAtkSpeed += itemWanted.PercentAttackSpeedMod;\n }\n if (itemWanted.FlatPhysicalDamageMod != null) {\n champion.bonusAD += itemWanted.FlatPhysicalDamageMod;\n }\n if (itemWanted.FlatMagicDamageMod != null) {\n champion.bonusAP += itemWanted.FlatMagicDamageMod;\n }\n if (itemWanted.FlatCritChanceMod != null && champion.crit != null) {\n champion.crit += itemWanted.FlatCritChanceMod;\n }\n if (itemWanted.FlatMPPoolMod != null) {\n champion.mana += itemWanted.FlatMPPoolMod;\n }\n }\n }\n}", "function SnakesLadders() {\n this.p1 = 0, this.p2 = 0, this.turn = true, this.won = false;\n this.snakesAndLadders = [[16, 6], [49, 11], [62, 19], [46, 25], [74, 53], [64, 60], [89, 68], [92, 88], [95, 75], [99, 80], \n [7, 14], [15, 26], [8, 31], [2, 38], [21, 42], [36, 44], [51, 67], [28, 84], [71, 91], [87, 94], [78, 98]];\n}", "function sortByRankHoldem(communityCards, players){\n\tvar evalHands = [];\n\n for (var i = 0; i < players.length ; i++ ) {\n var playerHand = {};\n var hand = [];\n if(players[i] && !players[i].idleForHand ){\n hand.push(\n players[i].cards[0],\n players[i].cards[1],\n communityCards[0],\n communityCards[1],\n communityCards[2],\n communityCards[3],\n communityCards[4]\n );\n //console.log(hand);\n playerHand.playerInfo = players[i].id;\n playerHand.cards = hand;\n playerHand.hand = PokerEvaluator.evalHand(hand);\n evalHands.push(playerHand);\n }\n }\n\n evalHands = evalHands.sort(function(a,b){\n\t\tif(a.hand.value > b.hand.value)\n\t\t\treturn -1;\n else if (a.hand == b.hand)\n return 0;\n\t\treturn 1;\n\t});\n\n return getFullHandName(evalHands);\n}", "function getPoints() {\r\n // player\r\n var points = 0;\r\n for (var i = 0; i < players[0].Hand.length; i++) {\r\n points += players[0].Hand[i].Weight;\r\n }\r\n\r\n // if a player has an Ace (value of 11), it can be considered value 1 to prevent bust\r\n if (points > 21 && players[0].hasAce == 1) {\r\n points = points - 10;\r\n }\r\n\r\n players[0].Points = points;\r\n\r\n // dealer\r\n points = 0;\r\n for (var i = 0; i < dealers[0].Hand.length; i++) {\r\n points += dealers[0].Hand[i].Weight;\r\n }\r\n\r\n // if a dealer has an Ace (value of 11), it can be considered value 1 to prevent bust\r\n if (points > 21 && dealers[0].hasAce == 1) {\r\n points = points - 10;\r\n }\r\n\r\n dealers[0].Points = points;\r\n}", "function oldEnoughName(){\n for (var i = 0; i < peopleWhoWantToSeeMadMaxFuryRoad.length; i++){\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].age >= 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is of age to see Mad Max.\")\n }\n else if(peopleWhoWantToSeeMadMaxFuryRoad[i].age < 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is NOT of age to see Mad Max\")\n }\n }\n}", "function prefList(p, people) {\n let L = new Array(people.length);\n for (let i = 0; i < L.length; i++) {\n L[i] = i;\n }\n L.sort(function(i,j){ //careful with tie resolution here\n if (p.pref == 'x') return people[i].x >= people[j].x ? -1 : 1;\n else return people[i].y >= people[j].y ? -1 : 1;\n });\n return L;\n}", "function getStraights(hand) {\n var straights = [];\n //iterate sorted hand\n //if suits in row > 3 add to array\n return straights;\n }", "function mineData(userData) {\n if (userData) {\n var candidates = []; // candidates\n var candidateObs = []; // candidates\n var voters = []; // voters\n var voterObs = []; // Voter class objects\n var zipcodes = []; // zipcodes\n\n // ex: [{zipcode, candidate_username: number_of_voters, candidate_username: number_of_voters}, \n // {zipcode, candidate_username: number_of_voters, candidate_username: number_of_voters}, \n // etc...]\n //\n // top candidates at a zipcode is decided by:\n // - comparing each candidate with each voters survey\n // - deciding which candidates survey is the best match\n // - having the most number of best matches at a zipcode\n var topCandidatesAtZipcode = [];\n\n // seperate candidates from voters\n userData.forEach(user => {\n if (user.groups.includes('candidate') && user.survey.data !== 'No Survey!') {\n candidates.push(user);\n var tempCand = new Candidate(user.username);\n candidateObs.push(tempCand);\n zipcodes.push(user.survey.data[2]);\n }\n else {\n if (user.survey.data !== 'No Survey!') {\n var temp = new Voter(user.username, user.survey.data, 0, null, user.survey.data[2]);\n voterObs.push(temp);\n voters.push(user);\n zipcodes.push(user.survey.data[2]);\n } \n }\n });\n\n // uncomment to debug\n // console.log('candidates', candidates);\n console.log('voters objects', voterObs);\n // console.log('zipcodes', zipcodes);\n candidates.forEach(candidate => {\n //console.log(candidate);\n voterObs.forEach(voter => {\n // get the voteres zipcode\n // var voterZipcode = voter.survey.data[2];\n // console.log(\"hello\");\n\n // Best is an array with two entries [x,x]. Entry 1 is the candidate, entry 2 is the score\n var best = tempBestMatch(voter, candidate);\n //console.log(\"The voter is \" + voter.username + \"the array is \");\n // console.log(best);\n // console.log(\"Voter score is \" + voter.bestScore + \" AND best score is \" + best[1]);\n if(best[1] > voter.bestScore){\n console.log(\"UHFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\");\n voter.bestScore = best[1];\n voter.candidate = best[0];\n }\n // // get the voters best match candidate\n // var theBestMatch = bestMatch(voter, candidate);\n // console.log(\"The best match was \" + theBestMatch);\n // var bestMatchUsername = theBestMatch.username;\n });\n\n });\n // voters.forEach(voter => {\n \n // // get the voteres zipcode\n // var voterZipcode = voter.survey.data[2];\n\n // // get the voters best match candidate\n // var theBestMatch = bestMatch(voter, candidates);\n // console.log(\"The best match was \" + theBestMatch);\n // var bestMatchUsername = theBestMatch.username;\n\n // // \n // // adding to the array\n // //\n\n // // // case 1: this is the first voter in that zipcode\n // // if (!(topCandidatesAtZipcode.find(o => o.zipcode === voterZipcode))) {\n // // console.log(\"case 1\");\n\n // // topCandidatesAtZipcode.push(\n // // {\n // // zipcode : voterZipcode,\n // // candidates : \n // // {\n // // candidate : bestMatchUsername,\n // // matches : 1\n // // }\n // // }\n // // )\n // // } \n // // else {\n\n // // // case 2: this isn't the first voter at the zipcode\n // // // but is a new candidate at that zipcode\n // // if (!(topCandidatesAtZipcode.find(o => o.candidates.candidate === bestMatchUsername))) {\n // // topCandidatesAtZipcode[voterZipcode].candidates.push(\n // // {\n // // candidate : bestMatchUsername,\n // // matches : 1\n // // }\n // // )\n // // }\n\n // // // case 3: this isn't the first voter at the zipcode\n // // // and its an existing candidate\n // // else {\n // // console.log(\"case 3\", topCandidatesAtZipcode);\n // // //console.log('--', topCandidatesAtZipcode.find(o => o.candidates.candidate === bestMatchUsername));\n // // //topCandidatesAtZipcode[voterZipcode][bestMatchUsername] += 1;\n // // }\n // // }\n // });\n\n\n var returnArray = [];\n topCandidatesAtZipcode.forEach((zipcode, idx) => {\n returnArray[idx] = [zipcode.zipcode, Object.values(zipcode.candidates)];\n });\n\n // console.log(returnArray);\n\n // console.log(candidateObs);\n voterObs.forEach(voter => {\n console.log(\"The best score was \" + voter.bestScore + \" The best match was \");\n console.log(voter.candidate);\n });\n\n console.log(\" Size of candidates :\" + candidateObs.length);\n console.log(\" Size of Voters :\" + voterObs.length);\n candidateObs.forEach(candidate => {\n voterObs.forEach(voter => {\n // console.log(\"Candidate type = \" + candidate.username + \" Voter's candidate = \" + voter.candidate.username);\n // console.log(voter.candidate.username);\n if((voter.candidate !== null && voter.candidate.username !== null) && candidate.username === voter.candidate.username){\n console.log(\"SUFHBIUYSFGHIUSGFHIUSGIUGHSS\");\n candidate.results[voter.zipcode] += 1;\n }\n });\n });\n\n // console.log(candidateObs);\n\n var returnThis = [];\n candidateObs.forEach(candidate => {\n returnThis.push(candidate.username);\n returnThis.push(candidate.results);\n });\n\n console.log(returnThis);\n\n return JSON.stringify(returnThis);\n }\n }", "function sortLeaguesByTeamsByWins() {\n \n // Ejercicio muy parecido al 3, solo que en este caso, ordeno las ligas de mayor a menos segun las victorias de sus equipos\n const ligas = leaguesWithWins();\n\n return ligas.sort(compare).map(item => item.liga);\n\n}", "function Person(age, lunch) {\n\tvar ageOpt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102];\n\tvar lunchOpt=[\"8:00\",\"8:15\",\"8:30\",\"8:45\",\"9:00\",\"9:15\",\"9:30\",\"9:45\",\"10:00\",\"10:15\",\"10:30\",\"10:45\",\"11:00\",\"11:15\",\"11:30\",\"11:45\",\"12:00\",\"12:15\",\"12:30\",\"12:45\",\"1:00\",\"1:15\",\"1:30\",\"1:45\",\"2:00\",\"2:15\",\"2:30\",\"2:45\",\"3:00\"];\n\n\tthis.age=ageOpt[age];\n\tthis[\"lunch time\"]=lunchOpt[lunch];\n}", "function filterByNoOfAwardsxTeamxAge(noOfAwards, team, age) {\n var pl = [];\n let k = 0;\n for (let i of players) {\n if (i.awards.length >= noOfAwards && i.team == team && i.age < age) {\n pl[k++] = i;\n }\n }\n return pl;\n}", "function bestHandInOmaha(communityCards, player){\n var evalHands = [];\n for(var i = 0; i < 3; i++ ){\n for(var j = i + 1; j < 4 ; j++ ){\n var playerHand = {}\n var hand=[];\n hand.push(\n player.cards[i],\n player.cards[j],\n communityCards[0],\n communityCards[1],\n communityCards[2],\n communityCards[3],\n communityCards[4]\n );\n playerHand.cards = hand;\n playerHand.hand = PokerEvaluator.evalHand(hand);\n evalHands.push(playerHand);\n }\n }\n\n evalHands = evalHands.sort(function(a,b){\n if(a.hand.value > b.hand.value)\n return -1;\n else if (a.hand == b.hand)\n return 0;\n return 1;\n });\n return evalHands[0];\n}", "function ExamList() {\n this.list = [];\n\n this.add = (e) => {\n this.list.push(e);\n };\n\n this.find = (code) => {\n for (const c of this.list) {\n if (c.code === code) {\n return c;\n }\n }\n return undefined;\n };\n\n this.afterDate = (date) => {\n let v = [];\n for (let obj of this.list)\n if (obj.date.isAfter(date))\n v.push(obj);\n return v;\n //return this.list.filter((c)=>(c.date.isAfter(date)));\n };\n\n this.remap = (score) => {\n if (score >= 27) return 'A';\n else if (score >= 24) return 'B';\n else if (score >= 19) return 'C';\n else return 'D';\n }\n\n this.convertUs = () => {\n return this.list.map(({ score, ...e }) => ({ score: this.remap(score), ...e }));\n }\n}", "function getHarman() {\n peak_power = 61.9 * jump_height + 36.0 * body_mass - 1822;\n average_power = 21.2 * jump_height + 23 * body_mass - 1393;\n }", "getSuitHandArray() {\r\n return this.cards.map(card => card[1]);\r\n }", "function checkInteraction(mentor_list, inter, ment){\n var mentee = ment; \n var interact = inter; \n var new_mentor_list = []; \n if(inter.length > 1){\n new_mentor_list = mentor_list;\n filter_by_zip(new_mentor_list, mentee); \n }\n else{\n for(var i = 0; i < mentor_list.length; i++){\n\n var curr = mentor_list[i]; \n //if its the same or the mentor wants any type of interaction add them to the mentor list\n if(curr.interaction[0] === (interact) || mentor_list[i].interaction.length > 1){\n new_mentor_list.push(mentor_list[i]); \n }\n }\n if(interact === \"In Person\"){\n filter_by_zip(new_mentor_list, mentee); \n }\n }\n //check for people close to the mentee --> ANVITA!\n return new_mentor_list; \n }", "compare(range, baddies) {\n baddies.forEach((baddie) => {\n // the dead and dying can't hurt you (unless they come back as zombies, but that's in version 7):\n if (!baddie.isDying && !baddie.isDead) {\n const xDist = this.player.x - baddie.x;\n const yDist = this.player.y - baddie.y;\n const euclideanDist = (xDist ** 2 + yDist ** 2) ** 0.5;\n // When the player is within the proximity range, figure out the angles involved:\n if (euclideanDist < range) {\n // calculate the (signed) x-distance, and find which direction both sprites are facing:\n let deltaX = this.player.x - baddie.x;\n this.determineFacing(deltaX, yDist, euclideanDist, this.player, baddie);\n }\n }\n });\n }", "function hungryDog(weight, age) {\n \n if(age >= 1 && weight <= 5) {\n return weight * 0.05\n }else if(age >= 1 && weight <= 6 && weight <= 10) {\n return weight * 0.04\n }else if(age >= 1 && weight <= 11 && weight <= 15) {\n return weight * 0.03\n }else if(age >= 1 && weight <15) {\n return weight * 0.02\n }else if(age < .75 && age >= 0.583) {\n return weight * 0.\n }else if(age < .5 && age >= 0.333) {\n return weight * 0.05\n }else if(age < .33 && age >= 0.333) {\n return weight * 0.05\n }\n \n }", "function setChallenge(orig_challenges) {\n var num = orig_challenges.length;\n //crates a list we can use and update\n for (var i = 0; i < num; i++) {\n //will contain word and attribute like \"hidden\", \"Player1\" ect.\n var listOfWordObjects = [];\n var tempWordList = orig_challenges[i].split(' ');\n for (var j = 0; j < tempWordList.length; j++) {\n //set the fist one to active\n if (j == 0) {\n listOfWordObjects[j] = {word: tempWordList[j], attribute: \"active\"}\n }\n else {\n listOfWordObjects[j] = {word: tempWordList[j], attribute: \"hidden\"}\n }\n }\n superList[i] = listOfWordObjects;\n }\n\n //makes the challenge boxes update\n UpdateChallengeBoxes();\n\n } //intializes superlist.", "function higherPlayer(){\n //If there is only one player, return it if not busted\n if(Current.length === 1){\n if( user[Current[0]].score <= 21){\n return Current[0];\n } else {\n return null;\n }\n }\n //Both players are under 21pt, return the higher one\n if(!(user[Current[0]].score > 21) && !(user[Current[1]].score > 21)) {\n if (user[Current[0]].score > user[Current[1]].score) {\n return Current[0];\n } else {\n return Current[1];\n }\n }\n // both players are busted\n if((user[Current[0]].score > 21) && (user[Current[1]].score > 21)){\n return null;\n }\n // One of the player busted, return the other\n if((user[Current[0]].score > 21)){\n return Current[1];\n } else if((user[Current[1]].score > 21)) {\n return Current[0];\n }\n}", "function CheatSkill() {\n\tif (KeyPress == 53) PlayerAddSkill(\"Arts\", 1);\n\tif (KeyPress == 54) PlayerAddSkill(\"Fighting\", 1);\n\tif (KeyPress == 55) PlayerAddSkill(\"RopeMastery\", 1);\n\tif (KeyPress == 56) PlayerAddSkill(\"Seduction\", 1);\n\tif (KeyPress == 57) PlayerAddSkill(\"Sports\", 1);\n}", "function Person(name, race,item){\n this.name = name;\n this.race = race;\n\n this.item = item;\n this.currenthealth = 100;\n this.maxHealth = 100;\n \n this.min = 3;\n this.maxDamage = 20;\n this.maxHealing = 30;\n\n // To manage the players turns\n this.clicked = function(hitBtnPlayerClicking, healBtnPlayerClicking, yieldBtnPlayerClicking, playerClickingBtn, hitBtnPlayerNotClicking, healBtnPlayerNotClicking, yieldBtnPlayerNotClicking, playerNotClickingBtn) {\n hitBtnPlayerClicking.disabled = true;\n healBtnPlayerClicking.disabled = true;\n yieldBtnPlayerClicking.disabled = true;\n playerClickingBtn.style.opacity = \"50%\";\n hitBtnPlayerNotClicking.disabled = false;\n healBtnPlayerNotClicking.disabled = false;\n yieldBtnPlayerNotClicking.disabled = false;\n playerNotClickingBtn.style.opacity = \"100%\";\n }\n\n // Heal function\n this.heal = function(){\n this.currenthealth = this.currenthealth + healPlayer;\n if (this.currenthealth >= this.maxHealth) {\n this.currenthealth = this.maxHealth;\n }\n if (this.currenthealth == this.maxHealth) {\n gameLog.innerHTML += `${this.name} doesn't need healing ! </br>`\n } else if (this.currenthealth < this.maxHealth) {\n gameLog.innerHTML += `${this.name} healed for ${healPlayer}. HP ${this.currenthealth} / ${this.maxHealth} </br>`\n }\n };\n\n // Manage the damage of the players\n this.damage = function (){\n this.currenthealth = (this.currenthealth - playerAttack);\n if (this.currenthealth <= 0) {\n this.currenthealth = 0;\n document.getElementById(\"player1\").style.display = \"none\";\n document.getElementById(\"player2\").style.display = \"none\";\n document.getElementById(\"button-log\").style.display = \"none\";\n document.getElementById(\"button-refresh\").style.display = \"block\";\n }\n };\n\n this.yield = function(playerNotClicking) {\n document.getElementById(\"player1\").style.display = \"none\";\n document.getElementById(\"player2\").style.display = \"none\";\n document.getElementById(\"button-log\").style.display = \"none\";\n document.getElementById(\"button-refresh\").style.display = \"block\";\n document.getElementById(\"message-endgame\").innerHTML += `${playerNotClicking.name} won the game. Congratulations ! <br> ${this.name} lost the game... `\n document.getElementById(\"message-endgame\").style.display = \"block\";\n }\n\n this.endgame = function (playerNotClicking) {\n if (playerNotClicking.currenthealth <= 0) {\n document.getElementById(\"message-endgame\").innerHTML += `${this.name} won the game. Congratulations ! <br> ${playerNotClicking.name} lost the game...`\n document.getElementById(\"message-endgame\").style.display = \"block\";\n }\n };\n\n this.totalDamage = this.damage();\n\n // health is impacted by damagePlayer once before games starts, so to fix it :\n this.currenthealth = this.maxHealth;\n\n this.displayChar = function(){\n return console.log(`I am a ${this.race}, I wield a ${this.item}, my total health point are ${this.maxHealth}`);\n };\n\n // Items of Players\n this.itemOfPlayer = function (playerClicking, playerNotClicking) {\n healPlayer = Math.floor(Math.random()*(this.maxHealing))+ this.min;\n playerAttack = Math.floor(Math.random()*(this.maxDamage))+ this.min;\n console.log(playerAttack);\n console.log(healPlayer)\n if (this.item == \"Sword\") {\n playerAttack *= 1.3;\n console.log(playerAttack);\n } else if (this.item == \"Bow\") {\n let randomBow = Math.floor(Math.random()*(100))+ 1;\n if (randomBow <= 30) {\n playerNotClicking.damage();\n } \n } else if (playerNotClicking.item == \"Boots\") {\n let randomBoots = Math.floor(Math.random()*(100))+ 1;\n if (randomBoots <= 30) {\n playerAttack = 0;\n }\n } else if (playerClicking.item == \"Staff\") {\n healPlayer *= 1.2;\n console.log(healPlayer);\n }\n };\n\n\n // Races of Players\n if (this.race ==\"Orc\") {\n this.maxHealth *= 1.4;\n this.currenthealth = this.maxHealth;\n };\n\n this.raceOfPlayer = function (playerClicking, playerNotClicking) {\n if (playerNotClicking.race == \"Human\") {\n playerAttack *= 0.8;\n console.log(playerAttack);\n } else if (playerNotClicking.race == \"Elf\") {\n let randomElf = Math.floor(Math.random()*(100))+ 1; \n if (randomElf <= 30) {\n playerNotClicking.currenthealth += playerAttack;\n playerClicking.currenthealth -= (playerAttack*0.5);\n }\n } else if (playerClicking.race == \"Vampire\") {\n playerClicking.currenthealth += (playerNotClicking.currenthealth*0.1);\n playerNotClicking.currenthealth -= (playerNotClicking.currenthealth*0.1);\n if (playerClicking.currenthealth > playerClicking.maxHealth) {\n playerClicking.currenthealth = playerClicking.maxHealth;\n } \n } \n };\n\n}", "function getPower(shared, hands, players) {\n shared = strToCards(shared);\n return splitHands(strToCards(hands)).map(hand => {\n let handPower = getHandPower(hand,shared);\n let expectedValue = players*Math.pow(handPower,players-1);\n return {hand: hand, strength: handPower,ev:expectedValue.toFixed(2)};\n });\n}", "function definingHands(player) {\n console.log(`${player.name} wins!`)\n console.log(`${player1.name} has ${player1.hand.length}. ${player2.name} has ${player2.hand.length}.`)\n}", "function lowest_health_partymember() {\n var party = [];\n if (parent.party_list.length > 0) {\n for (id in parent.party_list) {\n var member = parent.party_list[id];\n\n var entity = parent.entities[member];\n\n if (member == character.name) {\n entity = character;\n }\n\n if (entity != null) {\n party.push({\n name: member,\n entity: entity\n });\n }\n }\n } else {\n //Add Self to Party Array\n party.push({\n name: character.name,\n entity: character\n });\n }\n\n //Populate health percentages\n for (id in party) {\n var member = party[id];\n if (member.entity != null) {\n member.entity.health_ratio = member.entity.hp / member.entity.max_hp;\n } else {\n member.health_ratio = 1;\n }\n }\n\n //Order our party array by health percentage\n party.sort(function(current, next) {\n return current.entity.health_ratio - member.entity.health_ratio;\n });\n\n\n //Return the lowest health\n return party[0].entity;\n}", "function printUnderagePeople(input) {\n var result = input.filter(function (item) {\n return item.age < 18;\n });\n\n result.forEach(function (item) {\n console.log(item);\n });\n}", "function gymnastics() {\n\n /////////////////// DO NOT MODIFY\n let total = 0; //// DO NOT MODIFY\n let scores = []; // DO NOT MODIFY\n /////////////////// DO NOT MODIFY\n\n /*\n * NOTE: The 'total' variable should be representative of the sum of all\n * six of the judges' scores.\n */\n\n /*\n * NOTE: You need to add each score (valid or not) to the 'scores' variable.\n * To do this, use the following syntax:\n *\n * scores.push(firstScore); // your variable names for your scores\n * scores.push(secondScore); // will likely be different than mine\n */\n\tlet i=1;\n\twhile(i<=6){\n\t\tlet inputScore=Number(prompt(\"Enter your score\"));\n\t\tif (inputScore>=1 && inputScore<=10 && Number.isInteger(inputScore)){\n\t\t\tscores.push(inputScore);\n\t\ti++;\n\t\t}\n\t}\n\tscores.sort(function(a,b){return a-b;})\n\tlet max=scores[5];\n\tlet min=scores[0];\n\tlet revisedScores=[];\n\tfor(let j=1;j<5;j++){\n\t\trevisedScores.push(scores[j]);\n\t}\n\tlet averageScore=((revisedScores[0]+revisedScores[1]+revisedScores[2]+revisedScores[3])/4).toFixed(2);\n\tdocument.getElementById(\"gymnastics-output\").innerHTML=\"Discarded: \"+min+\", \"+max+\"</br>Score: \"+averageScore;\n /////////////////////////////// DO NOT MODIFY\n check('gymnastics', scores); // DO NOT MODIFY\n /////////////////////////////// DO NOT MODIFY\n}", "function interpretBMI(age, z_bmi){\n\n if (age > 1857) { //above 5 years old\n return z_bmi > 2 ? \"Obese\" : z_bmi > 1 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age > 730 && age < 1858){ //ages 2 - 5\n return z_bmi > 3 ? \"Obese\" : z_bmi > 1.35 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age < 731){\n return \"Not for age < 2\"\n }\n \n }", "processClaimAward(data) {\n this.currentGame.turn++;\n\n var tile = parseInt(data.tile);\n var claimType = parseInt(data.claimType);\n var winType = parseInt(data.winType);\n\n this.log('${this.name} was allowed to form a ${Constants.setNames[claimType]} with tile ${tile}');\n\n // figure out what we were actually awarded\n var tiles = false;\n if (tile !== Constants.NOTILE) {\n if(claimType <= Constants.CHOW3) {\n if(claimType === Constants.CHOW1) { tiles = [tile,tile+1,tile+2]; }\n if(claimType === Constants.CHOW2) { tiles = [tile-1,tile,tile+1]; }\n if(claimType === Constants.CHOW3) { tiles = [tile-2,tile-1,tile]; }\n }\n else if(claimType === Constants.PUNG) { tiles = [tile, tile, tile]; }\n else if(claimType === Constants.KONG) { tiles = [tile, tile, tile, tile]; }\n else if(claimType === Constants.WIN) {\n if(winType === Constants.PAIR) { tiles = [tile, tile]; }\n if(winType === Constants.CHOW1) { tiles = [tile,tile+1,tile+2]; }\n if(winType === Constants.CHOW2) { tiles = [tile-1,tile,tile+1]; }\n if(winType === Constants.CHOW3) { tiles = [tile-2,tile-1,tile]; }\n if(winType === Constants.PUNG) { tiles = [tile, tile, tile]; }\n if(winType === Constants.KONG) { tiles = [tile, tile, tile, tile]; }\n }\n\n // process and reveal the tiles\n this.tiles.push(tile);\n this.revealed.push(tiles);\n tiles.forEach(t => {\n let pos = this.tiles.indexOf(t);\n this.tiles.splice(pos,1);\n });\n\n if (claimType === Constants.KONG) {\n this.connector.publish('kong-request', { tiles });\n }\n }\n\n return tiles;\n }", "playerHandValue () {\n let value = 0;\n let acePlayerArray = [];\n for (let i = 0; i < this.playerHand.length; i++){\n if(this.playerHand[i].icon === \"ace\"){\n if(value > 21 || value + 11 > 21){\n value += this.playerHand[i].value[0];\n }\n else{\n value += this.playerHand[i].value[1];\n acePlayerArray.push(this.playerHand[i].value[1]);\n }\n }\n else {\n value += this.playerHand[i].value;\n }\n }\n while (value > 21 && acePlayerArray.length > 0){\n value -= 10;\n acePlayerArray.splice(0, 1);\n }\n return value;\n }", "function displayWeapons(chest, options)\r\n{\r\n\t\r\n\t// establish types\r\n\tvar conf = {\r\n\t\t\"Melee Weapon\":{\r\n\t\t\tattrs:[\"name\", \"cat\", \"atk\", \"par\", \"dmg\", \"hands\", \"weight\", \"val\", \"desc\"],\r\n\t\t\talign:[\"left\", \"left\", \"right\", \"right\", \"right\", \"center\", \"right\", \"right\", \"left\"],\r\n\t\t\tid:\"MeleeWeaponsTable\",\r\n\t\t\ttooltips:[],\r\n\t\t\ttotalNumber:0, // of weapons of that type in the chest\r\n\t\t\ttotalVal:0,\r\n\t\t\ttotalWeight:0\r\n\t\t},\r\n\t\t\"Ranged Weapon\":{\r\n\t\t\tattrs:[\"name\", \"cat\", \"min\", \"max\", \"atk\", \"par\", \"dmg\", \"hands\", \"weight\", \"val\", \"desc\"],\r\n\t\t\talign:[\"left\", \"left\", \"right\", \"right\", \"right\", \"right\", \"right\", \"center\", \"right\", \"right\", \"left\"],\r\n\t\t\tid:\"RangedWeaponsTable\",\r\n\t\t\ttooltips:[],\r\n\t\t\ttotalNumber:0,\r\n\t\t\ttotalVal:0,\r\n\t\t\ttotalWeight:0\r\n\t\t},\r\n\t\t\"Armor\":{\r\n\t\t\tattrs:[\"name\", \"cat\", \"dexmod\", \"dmg\", \"weight\", \"val\", \"desc\"],\r\n\t\t\talign:[\"left\", \"left\", \"right\", \"right\", \"right\", \"right\", \"left\"],\r\n\t\t\tid:\"ArmorTable\",\r\n\t\t\ttooltips:[],\r\n\t\t\ttotalNumber:0,\r\n\t\t\ttotalVal:0,\r\n\t\t\ttotalWeight:0\r\n\t\t}\r\n\t}\r\n\tfor (var c in conf)\r\n\t{\r\n\t\tfor (var n in conf[c].attrs)\r\n\t\t\tconf[c].tooltips.push(getItemHelpText(conf[c].attrs[n]))\r\n\t}\r\n\tconf[\"Armor\"].tooltips.dmg = getItemHelpText(\"prot\")\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// first pass\r\n\t\r\n\tvar wpCount = {}\r\n\tvar totalVal = 0\r\n\tvar totalWeight = 0\r\n\tvar nbOfType = {}\r\n\t\r\n\tvar i = 0\r\n\twhile (i<chest.length)\r\n\t{\r\n\t\ttotalVal+=chest[i].val\r\n\t\ttotalWeight+=chest[i].weight\r\n\t\tconf[chest[i].type].totalVal+=chest[i].val\r\n\t\tconf[chest[i].type].totalWeight+=chest[i].weight\r\n\t\tconf[chest[i].type].totalNumber++\r\n\t\t\r\n\t\t// deduplication\r\n\t\tif (typeof(wpCount[chest[i].name]) === \"undefined\")\r\n\t\t{\r\n\t\t\twpCount[chest[i].name] = 1\r\n\t\t\ti++\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twpCount[chest[i].name]++\r\n\t\t\tchest.splice(i,1)\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar zebraIndexOfType = {}\r\n\tvar types = Object.keys(conf)\r\n\tfor (var ty in types)\r\n\t{\r\n\t\tif (conf[types[ty]].totalNumber == 0)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tvar t=document.getElementById(conf[types[ty]].id)\r\n\t\t\tvar tr=document.createElement(\"tr\")\r\n\t\t\tvar td = document.createElement(\"td\")\r\n\t\t\ttd.innerHTML=\"<i>No \"+types[ty].toLowerCase()+\"s</i>\"\r\n\t\t\ttd.colSpan=conf[types[ty]].attrs.length\r\n\t\t\ttr.appendChild(td)\r\n\t\t\ttr.className=\"gray\"\r\n\t\t\tt.appendChild(tr)\r\n\t\t}\r\n\t\telse\r\n\t\t\tzebraIndexOfType[types[ty]] = 0\r\n\t}\r\n\t\r\n\t// adding elements\r\n\t\r\n\tvar curCat = \"\"\r\n\tvar color = \"\"\r\n\tfor (var w in chest)\r\n\t{\r\n\t\tvar t=document.getElementById(conf[chest[w].type].id)\r\n\t\tvar tr=document.createElement(\"tr\")\r\n\t\ttr.className=\"weaponRow\"\r\n\t\t\r\n\t\t\r\n\t\tif (options && (options.perweapon || options.colors) && curCat != chest[w][\"cat\"].toString())\r\n\t\t{\r\n\t\t\tcurCat = chest[w][\"cat\"].toString()\r\n\t\t\tcolor = getLightRGBfromString(chest[w][\"cat\"].toString())\r\n\t\t\tif (options.perweapon)\r\n\t\t\t{\r\n\t\t\t\tvar sep = document.createElement(\"tr\")\r\n\t\t\t\tsep.style.height = \"1em\"\r\n\t\t\t\tt.appendChild(sep)\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (wpCount[chest[w].name] > 1)\r\n\t\t{\r\n\t\t\tchest[w].weight = \"<b style=\\\"color:#C00\\\">\"+wpCount[chest[w].name]*chest[w].weight +\"</b> <br>(\"+chest[w].weight+\")\"\r\n\t\t\tchest[w].val = \"<b style=\\\"color:#C00\\\">\"+wpCount[chest[w].name]*chest[w].val +\"</b> <br>(\"+chest[w].val+\")\"\r\n\t\t\tchest[w].name = \"<b style=\\\"color:#C00\\\">\"+wpCount[chest[w].name]+\"x</b> \"+chest[w].name\r\n\t\t}\r\n\t\t\r\n\t\tvar n = 0\r\n\t\twhile (n < conf[chest[w].type].attrs.length)\r\n\t\t{\r\n\t\t\tvar td = document.createElement(\"td\")\r\n\t\t\tif (options && options.perweapon && !chest[w].appliedModifier && conf[chest[w].type].attrs[n]==\"name\")\r\n\t\t\t{\r\n\t\t\t\tvar a = document.createElement(\"a\")\r\n\t\t\t\ta.href = window.location.pathname+\"#\"+chest[w][\"name\"].replace(/\\ /g, \"_\").toLowerCase()\r\n\t\t\t\ta.innerHTML=chest[w][\"name\"]\r\n\t\t\t\ta.id=chest[w][\"name\"].replace(/\\ /g, \"_\").toLowerCase()\r\n\t\t\t\ttd.appendChild(a)\r\n\t\t\t}\r\n\t\t\telse if (options && options.colors && conf[chest[w].type].attrs[n]==\"cat\")\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\ttd.style.backgroundColor=color\r\n\t\t\t\t\r\n\t\t\t\tif (chest[w][conf[chest[w].type].attrs[n]].length>1)\r\n\t\t\t\t{\r\n\t\t\t\t\tfor (var ca in chest[w].cat)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tvar sp = document.createElement(\"span\")\r\n\t\t\t\t\tsp.style.backgroundColor = getLightRGBfromString(chest[w].cat[ca])\r\n\t\t\t\t\tsp.innerHTML = chest[w].cat[ca]\r\n\t\t\t\t\ttd.appendChild(sp)\r\n\t\t\t\t\tif (ca < chest[w].cat.length-1)\r\n\t\t\t\t\t\ttd.innerHTML+=\", \"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\ttd.innerHTML=chest[w][conf[chest[w].type].attrs[n]]\r\n\t\t\t}\r\n\t\t\telse if (conf[chest[w].type].attrs[n]==\"dmg\")\r\n\t\t\t{\r\n\t\t\t\ttd.innerHTML=getWebDiceDisplay(chest[w][\"dmg\"])\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\ttd.innerHTML=chest[w][conf[chest[w].type].attrs[n]]\r\n\t\t\t\r\n\t\t\ttd.style.textAlign=conf[chest[w].type].align[n]\r\n\t\t\ttd.title=conf[chest[w].type].tooltips[n]\r\n\t\t\t\r\n\t\t\t// skip following absent values\r\n\t\t\twhile (typeof(chest[w][conf[chest[w].type].attrs[parseInt(n)+1]]) === \"undefined\" && parseInt(n)+1 < conf[chest[w].type].attrs.length)\r\n\t\t\t{\r\n\t\t\t\t//console.log(n, attrs[parseInt(n)], attrs[parseInt(n)+1])\r\n\t\t\t\t// yup, that parseint is required. Else n=0 => string\r\n\t\t\t\t// if using for (var n in attrs), that is\r\n\t\t\t\ttd.colSpan++\r\n\t\t\t\tn++\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttr.appendChild(td)\r\n\t\t\tn++\r\n\t\t}\r\n\t\t\r\n\t\tif (options && options.perweapon && !chest[w].appliedModifier)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tzebraIndexOfType[chest[w].type]=0\r\n\t\t\tvar color = getLightRGBfromString(chest[w][\"cat\"].toString())\r\n\t\t\t//tr.style.borderTop=\"1px solid black;\"\r\n\t\t\tt.appendChild(document.createElement(\"tr\"))\r\n\t\t\ttr.style.backgroundColor=color\r\n\t\t}\r\n\t\telse if (zebraIndexOfType[chest[w].type]%2 == 0)\r\n\t\t\ttr.className+=\" gray\"\r\n\t\tzebraIndexOfType[chest[w].type]++\r\n\t\tt.appendChild(tr)\r\n\t}\r\n\t\r\n\tif (options && options.total)\r\n\t{\r\n\t\tvar t=document.getElementById(conf[\"Armor\"].id)\r\n\t\tvar tr=document.createElement(\"tr\")\r\n\t\tvar tdt = document.createElement(\"td\")\r\n\t\ttdt.innerHTML=\"Total (weapons)\"\r\n\t\ttdt.colSpan=4\r\n\t\ttr.appendChild(tdt)\r\n\t\tvar tdw = document.createElement(\"td\")\r\n\t\ttdw.innerHTML=totalWeight\r\n\t\ttdw.id=\"totalWeaponsWeight\"\r\n\t\ttdw.style.textAlign=\"right\"\r\n\t\ttr.appendChild(tdw)\r\n\t\tvar tdv = document.createElement(\"td\")\r\n\t\ttdv.innerHTML=totalVal\r\n\t\ttdv.id=\"totalWeaponsVal\"\r\n\t\ttdv.style.textAlign=\"right\"\r\n\t\ttr.appendChild(tdv)\r\n\t\t//tr.appendChild(document.createElement(\"td\"))\r\n\t\ttr.style.backgroundColor=\"#DDF\"\r\n\t\ttr.style.fontWeight=\"bold\"\r\n\t\tt.appendChild(tr)\r\n\t}\r\n}", "baseAmount() {return inChallenge(\"m\",11)?player.points:player.l1.points}", "function autoLevelEquipment() {\n //if((game.jobs.Miner.locked && game.global.challengeActive != 'Metal') || (game.jobs.Scientist.locked && game.global.challengeActive != \"Scientist\"))\n //return;\n var Best = {\n 'healthwood': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'healthmetal': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'attackmetal': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n },\n 'blockwood': {\n Factor: 0,\n Name: '',\n Wall: false,\n Status: 'white'\n }\n };\n var enemyDamage = getEnemyMaxAttack(game.global.world + 1, 30, 'Snimp', .85);\n var enemyHealth = getEnemyMaxHealth(game.global.world + 1);\n \n //below challenge multiplier not necessarily accurate, just fudge factors\n if(game.global.challengeActive == \"Toxicity\") {\n //ignore damage changes (which would effect how much health we try to buy) entirely since we die in 20 attacks anyway?\n if(game.global.world < 61)\n enemyDamage *= 2;\n enemyHealth *= 2;\n }\n if(game.global.challengeActive == 'Lead') {\n enemyDamage *= 2.5;\n enemyHealth *= 7;\n }\n //change name to make sure these are local to the function\n var enoughHealthE = !(doVoids && voidCheckPercent > 0) && (baseHealth * 4 > 30 * (enemyDamage - baseBlock / 2 > 0 ? enemyDamage - baseBlock / 2 : enemyDamage * 0.2) || baseHealth > 30 * (enemyDamage - baseBlock > 0 ? enemyDamage - baseBlock : enemyDamage * 0.2));\n var enoughDamageE = (baseDamage * 4 > enemyHealth);\n \n if (game.global.world == 200) { //&& ((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) > 10 && ((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) < 20){\t\t\n enoughHealthE = false;\t\t\n enoughDamageE = false;\t\t\n }\n\n for (var equipName in equipmentList) {\n var equip = equipmentList[equipName];\n // debug('Equip: ' + equip + ' EquipIndex ' + equipName);\n var gameResource = equip.Equip ? game.equipment[equipName] : game.buildings[equipName];\n // debug('Game Resource: ' + gameResource);\n if (!gameResource.locked) {\n document.getElementById(equipName).style.color = 'white';\n var evaluation = evaluateEquipmentEfficiency(equipName);\n // debug(equipName + ' evaluation ' + evaluation.Status);\n var BKey = equip.Stat + equip.Resource;\n // debug(equipName + ' bkey ' + BKey);\n\n if (Best[BKey].Factor === 0 || Best[BKey].Factor < evaluation.Factor) {\n Best[BKey].Factor = evaluation.Factor;\n Best[BKey].Name = equipName;\n Best[BKey].Wall = evaluation.Wall;\n Best[BKey].Status = evaluation.Status;\n }\n\n document.getElementById(equipName).style.borderColor = evaluation.Status;\n if (evaluation.Status != 'white' && evaluation.Status != 'yellow') {\n document.getElementById(equip.Upgrade).style.color = evaluation.Status;\n }\n if (evaluation.Status == 'yellow') {\n document.getElementById(equip.Upgrade).style.color = 'white';\n }\n if (evaluation.Wall) {\n document.getElementById(equipName).style.color = 'yellow';\n }\n\n //Code is Spaced This Way So You Can Read It:\n if (\n evaluation.Status == 'red' &&\n (\n ( getPageSetting('BuyWeaponUpgrades') && equipmentList[equipName].Stat == 'attack' ) \n ||\n ( getPageSetting('BuyWeaponUpgrades') && equipmentList[equipName].Stat == 'block' )\n ||\n ((getPageSetting('BuyArmorUpgrades') && ((equipmentList[equipName].Resource != 'metal')\n || ((gameResource.prestige+5 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 50 && armorTempValue < 100)|| armorValue < 1000))\n || (gameResource.prestige+4 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 20 && armorTempValue < 50)|| armorValue < 500))\n || (gameResource.prestige+3 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 10 && armorTempValue < 20)|| armorValue < 200))\n || (gameResource.prestige+2 <= (game.global.world-5)/5 && game.global.soldierHealth > 0 && ((armorTempValue > 1 && armorTempValue < 10)|| armorValue < 100)))\n || gameResource.prestige < 5 || game.global.world == 200 ) && (equipmentList[equipName].Stat == 'health'))\n && \n //Only buy Armor prestiges when 'DelayArmorWhenNeeded' is on, IF:\n (\n (game.global.world == 200) // not in level 200\n ||\n\t\t\t(getPageSetting('DelayArmorWhenNeeded') && !shouldFarm) // not during \"Farming\" mode \n || // or\n (getPageSetting('DelayArmorWhenNeeded') && enoughDamage) // has enough damage (not in \"Wants more Damage\" mode)\n || // or \n (getPageSetting('DelayArmorWhenNeeded') && !enoughDamage && !enoughHealth) // if neither enough dmg or health, then tis ok to buy.\n || \n (getPageSetting('DelayArmorWhenNeeded') && equipmentList[equipName].Resource == 'wood')\n || \n !getPageSetting('DelayArmorWhenNeeded') //or when its off.\n )\n )\n )\n ) \n {\n var upgrade = equipmentList[equipName].Upgrade;\n if (upgrade != \"Gymystic\")\n debug('Upgrading ' + upgrade + \" - Prestige \" + game.equipment[equipName].prestige, '*upload');\n else\n debug('Upgrading ' + upgrade + \" # \" + game.upgrades[upgrade].allowed, '*upload');\n buyUpgrade(upgrade, true, true);\n }\n }\n }\n preBuy();\n game.global.buyAmt = 1;\n for (var stat in Best) {\n if (Best[stat].Name !== '') {\n var eqName = Best[stat].Name;\n var DaThing = equipmentList[eqName];\n document.getElementById(Best[stat].Name).style.color = Best[stat].Wall ? 'orange' : 'red';\n //If we're considering an attack item, we want to buy weapons if we don't have enough damage, or if we don't need health (so we default to buying some damage)\n if (getPageSetting('BuyWeapons') && DaThing.Stat == 'attack' && (!enoughDamageE || enoughHealthE)) {\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) {\n debug('Leveling equipment ' + eqName, '*upload3');\n buyEquipment(eqName, null, true);\n }\n }\n //If we're considering a health item, buy it if we don't have enough health, otherwise we default to buying damage\n if (getPageSetting('BuyArmor') && (DaThing.Stat == 'health' || DaThing.Stat == 'block') && !enoughHealthE) {\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) {\n debug('Leveling equipment ' + eqName, '*upload3');\n buyEquipment(eqName, null, true);\n }\n }\n if (getPageSetting('BuyArmor') && (DaThing.Stat == 'health') && getPageSetting('AlwaysArmorLvl2') && game.equipment[eqName].level < 2){\n if (DaThing.Equip && !Best[stat].Wall && canAffordBuilding(eqName, null, null, true)) { \n debug('Leveling equipment ' + eqName + \" (AlwaysArmorLvl2)\", '*upload3');\n buyEquipment(eqName, null, true);\n } // ??idk?? && (getPageSetting('DelayArmorWhenNeeded') && enoughDamage)\n }\n }\n }\n postBuy();\n}", "function sortedOfAge(arr){\n var over18 = []\n arr.filter((person) => {\n if (person.age > 18){\n over18.push(person)\n }\n })\n var inOrder = over18.sort((a, b) => {\n var nameA = a.lastName\n var nameB = b.lastName\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0\n })\n var finalArr = []\n inOrder.map((person) => {\n finalArr.push(\"<li>\" + person.firstName + \" \" + person.lastName + \" is \" + person.age + \"</li>\")\n })\n return finalArr\n }", "function getCanCalcTingList(conf) {\n var ret = [];\n\n var pushCanCalcCard = function (card) {\n // if (!dictCntRiverAndPile[card] || dictCntRiverAndPile[card] < 4) {\n ret.push(card);\n // }\n };\n\n for (var i = 0; i <= 26; i++) {\n pushCanCalcCard(i);\n }\n\n pushCanCalcCard(27);\n pushCanCalcCard(31);\n pushCanCalcCard(35);\n pushCanCalcCard(39);\n pushCanCalcCard(43);\n pushCanCalcCard(47);\n pushCanCalcCard(51);\n\n if (conf.type == cc.GAMETYPE.JDMJ) {\n pushCanCalcCard(52);\n }\n else if (conf.wanfa.indexOf(WanFaType.DaiPeiZi) != -1) {\n pushCanCalcCard(52);\n }\n else {\n pushCanCalcCard(-1);\n }\n\n return ret;\n}", "function sortUserHand(){\n var hearts = [],\n clubs = [],\n diamonds = [],\n spades = [],\n tempHand = [],\n secondTempHand = [];\n\n for(var i = 0; i < userHand.length; i++){\n var card = userHand[i];\n \n switch(card.suit){\n case 'hearts':\n hearts.push(card);\n break;\n case 'clubs':\n clubs.push(card);\n break;\n case 'diamonds':\n diamonds.push(card);\n break;\n case 'spades':\n spades.push(card);\n }\n }\n tempHand.push(hearts, clubs, diamonds, spades);\n\n for(var s = 0; s < tempHand.length; s++){\n var tempSuitHand = [];\n for(var v = 0; v < tempHand[s].length; v++){\n if(tempSuitHand.length === 0){\n tempSuitHand.push(tempHand[s][v]);\n }else{\n for(var l = 0; l < tempSuitHand.length; l++){\n if(tempHand[s][v].valueNum > tempSuitHand[l].valueNum){\n tempSuitHand.splice(l, 0, tempHand[s][v]);\n break;\n }else if(l === tempSuitHand.length - 1){\n tempSuitHand.push(tempHand[s][v]);\n break;\n } \n }\n }\n }\n tempHand[s] = tempSuitHand;\n }\n\n for(var s = 0; s < tempHand.length; s++){\n for(var v = 0; v < tempHand[s].length; v++){\n secondTempHand.push(tempHand[s][v]);\n }\n }\n userHand = secondTempHand;\n}" ]
[ "0.5311189", "0.53063136", "0.5296378", "0.5296378", "0.5295549", "0.5282417", "0.5261605", "0.525584", "0.52294946", "0.5224053", "0.52170104", "0.5216957", "0.52089393", "0.52032685", "0.5198814", "0.5182998", "0.51767015", "0.51743245", "0.51622224", "0.51450825", "0.51442766", "0.5117292", "0.5116267", "0.5076126", "0.5067721", "0.50635445", "0.50539184", "0.5051618", "0.5050932", "0.5048833", "0.5039416", "0.50390863", "0.50319093", "0.5012687", "0.5012416", "0.49935332", "0.49913058", "0.49762934", "0.4956397", "0.49455017", "0.49434903", "0.49408937", "0.49356696", "0.4934718", "0.49260962", "0.4920404", "0.49202", "0.49158338", "0.49155518", "0.49091563", "0.49011865", "0.48856422", "0.48813814", "0.48808262", "0.4872895", "0.48708004", "0.4870548", "0.48651952", "0.48550162", "0.48408377", "0.48243615", "0.4822081", "0.48220316", "0.48217693", "0.48213187", "0.48210913", "0.48208883", "0.4819851", "0.4817491", "0.47928807", "0.47867686", "0.4782753", "0.4781001", "0.47792995", "0.47773775", "0.47764465", "0.4773172", "0.47632378", "0.47630724", "0.47552085", "0.4753186", "0.4752194", "0.474992", "0.47464907", "0.47420034", "0.4740345", "0.47401765", "0.47401482", "0.47391993", "0.47327045", "0.47306758", "0.47276062", "0.47228664", "0.47208992", "0.47207215", "0.4719501", "0.47155374", "0.471426", "0.4711527", "0.4710531", "0.47104037" ]
0.0
-1
This is our `update` function that will get triggered by the `requestUpdate` method. Any time we set a property on this element, we'll also trigger an update.
update() { console.log('updating!'); this.shadowRoot.innerHTML = ` <div>value of a: ${this.a}</div> <div>value of b: ${this.b}</div> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(name!==void 0){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===void 0){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "async _enqueueUpdate(){this._updateState|=STATE_UPDATE_REQUESTED;let e,t;const n=this._updatePromise;this._updatePromise=new Promise((n,r)=>{e=n,t=r});try{// Ensure any previous update has resolved before updating.\n// This `await` also ensures that property changes are batched.\nawait n}catch(t){}// Ignore any previous errors. We only care that the previous cycle is\n// done. Any error should have been handled in the previous update.\n// Make sure the element has connected before updating.\nthis._hasConnected||(await new Promise(e=>this._hasConnectedResolver=e));try{const e=this.performUpdate();// If `performUpdate` returns a Promise, we await it. This is done to\n// enable coordinating updates with a scheduler. Note, the result is\n// checked to avoid delaying an additional microtask unless we need to.\nnull!=e&&(await e)}catch(n){t(n)}e(!this._hasRequestedUpdate)}", "function update() {\n var n, changed = false;\n for( n in _properties ) {\n changed |= _properties[n].update();\n }\n \n if( changed ) {\n self.valueChanged();\n } else {\n window.clearInterval( _interval );\n _interval = -1;\n }\n }", "_requestUpdate(e,t){let n=!0;// If we have a property key, perform property update steps.\nif(e!==void 0){const r=this.constructor,a=r._classProperties.get(e)||defaultPropertyDeclaration;r._valueHasChanged(this[e],t,a.hasChanged)?(!this._changedProperties.has(e)&&this._changedProperties.set(e,t),!0===a.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,a))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}", "requestUpdateInternal(name,oldValue,options){let shouldRequestUpdate=true;// If we have a property key, perform property update steps.\nif(name!==undefined){const ctor=this.constructor;options=options||ctor.getPropertyOptions(name);if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue);}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(options.reflect===true&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===undefined){this._reflectingProperties=new Map();}this._reflectingProperties.set(name,options);}}else {// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=false;}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._updatePromise=this._enqueueUpdate();}}", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "update() {\n // Subclasses should override\n }", "function update() {\n // ... no implementation required\n }", "willUpdate() {\n }", "update() {\n\t\tif (this.hasChangedBesidesElement_() && this.shouldUpdate(this.changes_)) {\n\t\t\tthis.patch();\n\t\t\tthis.eventsCollector_.detachUnusedListeners();\n\t\t\tthis.disposeUnusedSubComponents_();\n\t\t}\n\t}", "set foo(newVal) { \n let oldVal = this.foo;\n console.log('setting foo from', oldVal, 'to', newVal);\n this.setAttribute('foo', newVal);\n this.requestUpdate('foo', oldVal).then(\n result => console.log('updateComplete:', result)\n );\n }", "updated(changedProperties) {\n super.updated(changedProperties);\n const event = new CustomEvent('updated', {\n bubbles: true,\n cancelable: true\n });\n this.dispatchEvent(event);\n }", "function update() {}", "performUpdate() {\n var _a2, _b2;\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent$1 === null || debugLogEvent$1 === void 0 ? void 0 : debugLogEvent$1({ kind: \"update\" });\n if (!this.hasUpdated) {\n {\n const shadowedProperties = [];\n (_a2 = this.constructor.__reactivePropertyKeys) === null || _a2 === void 0 ? void 0 : _a2.forEach((p) => {\n var _a3;\n if (this.hasOwnProperty(p) && !((_a3 = this.__instanceProperties) === null || _a3 === void 0 ? void 0 : _a3.has(p))) {\n shadowedProperties.push(p);\n }\n });\n if (shadowedProperties.length) {\n throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${shadowedProperties.join(\", \")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`);\n }\n }\n }\n if (this.__instanceProperties) {\n this.__instanceProperties.forEach((v, p) => this[p] = v);\n this.__instanceProperties = void 0;\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n (_b2 = this.__controllers) === null || _b2 === void 0 ? void 0 : _b2.forEach((c) => {\n var _a3;\n return (_a3 = c.hostUpdate) === null || _a3 === void 0 ? void 0 : _a3.call(c);\n });\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n shouldUpdate = false;\n this.__markUpdated();\n throw e;\n }\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }", "async _enqueueUpdate(){// Mark state updating...\nthis._updateState=this._updateState|STATE_UPDATE_REQUESTED;let resolve,reject;const previousUpdatePromise=this._updatePromise;this._updatePromise=new Promise((res,rej)=>{resolve=res;reject=rej});try{// Ensure any previous update has resolved before updating.\n// This `await` also ensures that property changes are batched.\nawait previousUpdatePromise}catch(e){}// Ignore any previous errors. We only care that the previous cycle is\n// done. Any error should have been handled in the previous update.\n// Make sure the element has connected before updating.\nif(!this._hasConnected){await new Promise(res=>this._hasConnectedResolver=res)}try{const result=this.performUpdate();// If `performUpdate` returns a Promise, we await it. This is done to\n// enable coordinating updates with a scheduler. Note, the result is\n// checked to avoid delaying an additional microtask unless we need to.\nif(null!=result){await result}}catch(e){reject(e)}resolve(!this._hasRequestedUpdate)}", "update() {\n this.forceUpdate();\n }", "update() {\n this.forceUpdate();\n }", "_update() {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update(_changedProperties) {\n super.update();\n }", "update () {}", "update(e){this._reflectingProperties!==void 0&&0<this._reflectingProperties.size&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}", "updated(_changedProperties) { }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "update()\n {\n \n }", "update() {\n \n }", "async _enqueueUpdate() {\n // Mark state updating...\n this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n let resolve;\n const previousUpdatePromise = this._updatePromise;\n this._updatePromise = new Promise((res) => resolve = res);\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await previousUpdatePromise;\n // Make sure the element has connected before updating.\n if (!this._hasConnected) {\n await new Promise((res) => this._hasConnectedResolver = res);\n }\n // Allow `performUpdate` to be asynchronous to enable scheduling of updates.\n const result = this.performUpdate();\n // Note, this is to avoid delaying an additional microtask unless we need\n // to.\n if (result != null &&\n typeof result.then === 'function') {\n await result;\n }\n resolve(!this._hasRequestedUpdate);\n }", "update() {\n this._checkEvents();\n }", "updated(changedProperties) {\n }", "update() {\n // ...\n }", "updated(_changedProperties) {\n }", "function update() {\n\n\tupdateFocus();\n\tupdateFamilyTooltip();\n\tupdateHighlights();\n}", "update() { }", "update() { }", "apply() {\n this.update();\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 }", "updated(_changedProperties){}", "updated(_changedProperties){}", "set onUpdate(func) {\n this.postUpdate = func;\n }", "enableUpdating(_requestedUpdate) {\n }", "function update() {\n\t\t\n\t}", "update(...props) {\n if (this.onUpdate && this._) {\n return this.onUpdate(...props);\n }\n }", "update() {\n }", "update() {\n }", "update() {\n }", "function update() {\n \n}", "function handleUpdate() {\n const suffix = this.dataset.sizing || ''; // const suffix gets the suffix for our CSS variables. These value is link to data-sizing in our HTML\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix); //Sets the property to our element (--spacing, --blur), sets the value (10,20,) + and the suffix (px)\n}", "onCustomWidgetBeforeUpdate(oChangedProperties) {\n\n \n\n\n }", "onCustomWidgetBeforeUpdate(oChangedProperties) {\n \n \n\n\t\t}", "onCustomWidgetBeforeUpdate(changedProperties) {\r\n\r\n\t\t}", "update () {\n /* istanbul ignore else */\n if (this.lazy) {\n this.dirty = true;\n } else if (this.sync) {\n this.run();\n } else {\n queueWatcher(this);\n }\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "_$didUpdate(changedProperties) {\n var _a2;\n (_a2 = this.__controllers) === null || _a2 === void 0 ? void 0 : _a2.forEach((c) => {\n var _a3;\n return (_a3 = c.hostUpdated) === null || _a3 === void 0 ? void 0 : _a3.call(c);\n });\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (this.isUpdatePending && this.constructor.enabledWarnings.indexOf(\"change-in-update\") >= 0) {\n issueWarning$2(\"change-in-update\", `Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`);\n }\n }", "async _enqueueUpdate() {\n // Mark state updating...\n this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n let resolve;\n let reject;\n const previousUpdatePromise = this._updatePromise;\n this._updatePromise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await previousUpdatePromise;\n }\n catch (e) {\n // Ignore any previous errors. We only care that the previous cycle is\n // done. Any error should have been handled in the previous update.\n }\n // Make sure the element has connected before updating.\n if (!this._hasConnected) {\n await new Promise((res) => this._hasConnectedResolver = res);\n }\n try {\n const result = this.performUpdate();\n // If `performUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n }\n catch (e) {\n reject(e);\n }\n resolve(!this._hasRequestedUpdate);\n }", "update() {\n }", "update() {\n }", "async update() {}", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "function handleUpdate() {\n // in a function declaration, this is undefined ... (?)\n const suffix = this.dataset.sizing || \"\";\n // dataset is an object returning DOMstringMap {sizing: \"px\"}\n // which is the custom data attribute we created in the html\n // the pipe || prevents us to see \"undefined\" for the color picker which has no suffix (no custom data-thing)\n console.log(\"name\", this.name);\n // console.log(\"documentelement\", document.documentElement);\n document.documentElement.style.setProperty(\n `--${this.name}`,\n this.value + suffix\n );\n //Document.documentElementrenvoie l'Element qui est l'élément racine du document (par exemple, l'élément <html> pour les documents HTML).\n // ici c'est bien ce qu'on veut : les variables :root en début de CSS qui s'appliquent à tout le html\n // object.setProperty (propertyName, propertyValue, priority);\n // If a property with the same name exists on the current style object, then it modifies its value.\n console.log(\"value\", this.value);\n //\n}", "_onChange () {\n this.forceUpdate()\n }", "_requestUpdate(name, oldValue) {\n let shouldRequestUpdate = true;\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n const ctor = this.constructor;\n const options = ctor.getPropertyOptions(name);\n if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {\n if (!this._changedProperties.has(name)) {\n this._changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `_reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (options.reflect === true &&\n !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {\n if (this._reflectingProperties === undefined) {\n this._reflectingProperties = new Map();\n }\n this._reflectingProperties.set(name, options);\n }\n }\n else {\n // Abort the request if the property should not be considered changed.\n shouldRequestUpdate = false;\n }\n }\n if (!this._hasRequestedUpdate && shouldRequestUpdate) {\n this._updatePromise = this._enqueueUpdate();\n }\n }", "didUpdate() {}", "update () {\n }", "update() {\n setTimeout(this._update.bind(this));\n }", "_requestUpdate(name, oldValue) {\n let shouldRequestUpdate = true;\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n const ctor = this.constructor;\n const options = ctor._classProperties.get(name) || defaultPropertyDeclaration;\n if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {\n if (!this._changedProperties.has(name)) {\n this._changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `_reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (options.reflect === true &&\n !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {\n if (this._reflectingProperties === undefined) {\n this._reflectingProperties = new Map();\n }\n this._reflectingProperties.set(name, options);\n }\n }\n else {\n // Abort the request if the property should not be considered changed.\n shouldRequestUpdate = false;\n }\n }\n if (!this._hasRequestedUpdate && shouldRequestUpdate) {\n this._enqueueUpdate();\n }\n }", "elementUpdated() {\n this.model.trigger('el:change');\n }", "onCustomWidgetBeforeUpdate(oChangedProperties) {\n\n\t\t}", "function runUpdate(){\n people.forEach(function(element){\n element.update();\n });\n }", "updated() {}", "updated(changedProperties) {\n if (super.updated) {\n super.updated(changedProperties);\n }\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"link\") {\n this.remoteLinkURL = this[propName];\n }\n /* notify example\n // notify\n if (propName == 'format') {\n this.dispatchEvent(\n new CustomEvent(`${propName}-changed`, {\n detail: {\n value: this[propName],\n }\n })\n );\n }\n */\n /* observer example\n if (propName == 'activeNode') {\n this._activeNodeChanged(this[propName], oldValue);\n }\n */\n /* computed example\n if (['id', 'selected'].includes(propName)) {\n this.__selectedChanged(this.selected, this.id);\n }\n */\n });\n }", "function handleUpdate() {\n // 2.1 Create a suffix to select the dimention of the var e.g. px or ''\n const suffix = this.dataset.sizing || '' ;\n // console.log(this.dataset);\n // console.log(suffix);\n\n // 2.2 Select a variable\n // console.log(this.name);\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix);\n}", "updated(changedProperties) {\n // this value is a Map; a special kind of JS object that we break out into old value\n // and name of the property. This way we know what something WAS and can use this.whatever\n // to get what it is currently\n changedProperties.forEach((oldValue, propName) => {\n // see if play changed; this also allows us to set play to automatically\n // happen on page load because it is a stateful value as opposed to purely\n // event (click) driven\n if (propName === 'play') {\n // if it's true, we should play our track\n if (this.play) {\n // disable to prevent F spamming\n this.disabled = true;\n // set old icon as a tempory value\n this._oldIcon = this.icon;\n // change icon to be an audio indicator of playing sound\n this.icon = 'image:audiotrack';\n // actually play the sound\n this.playF();\n }\n // make sure we actually have an old value, so it used to be true or false\n // this helps avoid initial setup issues with defaults or undefined values\n else if (oldValue !== undefined) {\n // enable the button again\n this.disabled = false;\n // set the icon back to what it was\n this.icon = this._oldIcon;\n // this is a timing \"hack\". Javascript works off of a concept of microtasks / time\n // this effectively delays execution until the current loop / microtask finishes\n // this slight delay is enough to ensure that the this.disabled value\n // being reflected above, is removed from the element so that we can focus()\n // our tag again. If we don't delay a microtask, the call to focus runs\n // prior to Lit updating the disabled attribute and it's not possible to focus\n // a disabled item\n setTimeout(() => {\n this.shadowRoot.querySelector('button').focus();\n }, 0);\n }\n }\n });\n }", "updated(changedProperties) {\n if (super.updated) {\n super.updated(changedProperties);\n }\n changedProperties.forEach((oldValue, propName) => {\n if (\n [\"optionsPerRow\", \"icons\", \"allowNull\", \"__iconList\"].includes(propName)\n ) {\n clearTimeout(this.__rebuild);\n this.__rebuild = setTimeout(() => {\n this._getOptions();\n }, 0);\n }\n if (propName == \"value\") {\n /**\n * fires when value changes\n * @event value-changed\n */\n this.dispatchEvent(\n new CustomEvent(\"value-changed\", {\n detail: {\n value: this[propName],\n },\n })\n );\n }\n });\n }", "function handleUpdate() {\n const dataSize = this.dataset.sizing || '';\n document.documentElement.style.setProperty(`--${this.name}`, this.value + dataSize)\n}", "update() {\n if (!this.valid) {\n if (this.width > 0 && this.height > 0) {\n this.valid = true;\n this.dispatchEvent(Event_1.Event.getEvent(\"loaded\"));\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('loaded', this);\n // this.emit('update', this);\n }\n }\n else {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('update', this);\n }\n }", "update(...args) {\n this.__notify(EV.BEFORE_UPDATE);\n this._update(...args);\n this.__notify(EV.UPDATED);\n }", "async _enqueueUpdate(){this._updateState=this._updateState|STATE_UPDATE_REQUESTED;try{// Ensure any previous update has resolved before updating.\n// This `await` also ensures that property changes are batched.\nawait this._updatePromise;}catch(e){// Ignore any previous errors. We only care that the previous cycle is\n// done. Any error should have been handled in the previous update.\n}const result=this.performUpdate();// If `performUpdate` returns a Promise, we await it. This is done to\n// enable coordinating updates with a scheduler. Note, the result is\n// checked to avoid delaying an additional microtask unless we need to.\nif(result!=null){await result;}return !this._hasRequestedUpdate;}", "didUpdate() { }" ]
[ "0.72600305", "0.7251511", "0.721216", "0.7181032", "0.6965474", "0.6944794", "0.69033456", "0.6891705", "0.68641025", "0.6856583", "0.68506217", "0.6839065", "0.6777387", "0.6771238", "0.6762954", "0.67552245", "0.67552245", "0.67259544", "0.66938925", "0.66938925", "0.66938925", "0.66856825", "0.66856825", "0.66856825", "0.66856825", "0.66856825", "0.66856825", "0.66856825", "0.66856825", "0.66856825", "0.667005", "0.66297513", "0.6627797", "0.6619406", "0.65865296", "0.65805084", "0.65718234", "0.6570302", "0.6568451", "0.6560394", "0.65424925", "0.65328735", "0.65292734", "0.6526519", "0.6526519", "0.65057874", "0.6503498", "0.6497491", "0.6497491", "0.64964306", "0.6491657", "0.6479687", "0.6473206", "0.64669263", "0.64669263", "0.64669263", "0.6426107", "0.6422096", "0.64183843", "0.6407982", "0.6406459", "0.6365777", "0.636326", "0.636326", "0.636326", "0.636326", "0.636326", "0.636326", "0.636326", "0.63630027", "0.63492364", "0.6339791", "0.6339791", "0.6333403", "0.63322365", "0.63322365", "0.63322365", "0.63322365", "0.63322365", "0.63322365", "0.63322365", "0.6323499", "0.6320815", "0.6297721", "0.6293092", "0.62895906", "0.6289327", "0.6277654", "0.6275227", "0.6270533", "0.6269202", "0.6258611", "0.62333655", "0.62184334", "0.62171894", "0.6208722", "0.6190106", "0.6185414", "0.61834687", "0.61809623", "0.6172612" ]
0.0
-1
called once when instanced
function setup() { resetParameters(); loadShader("plasma"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__previnit(){}", "static ready() { }", "_reflow() {\n this._init();\n }", "initialize() { this._saveInstanceProperties(); }", "function init() {\n\t \t\n\t }", "init() {\n }", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "initialize(){// ensures first update will be caught by an early access of\n// `updateComplete`\nthis._saveInstanceProperties(),this._requestUpdate()}", "init(){\n\t\tthis._active = true\n\t}", "initialize(){this._saveInstanceProperties();// ensures first update will be caught by an early access of\n// `updateComplete`\nthis._requestUpdate()}", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this._requestUpdate();\n }", "function _init() {\n }", "started() {\n\t\tthis.clearStats();\n\n\t}", "load () {\n\t\tthis.instanciable = false;\n\t\tconsole.log(this.name + \" loaded\");\n\t}", "initialize() {\n //\n }", "__init6() {this._lastActivity = new Date().getTime();}", "ready() {\n super.ready();\n\n\n }", "transient private protected internal function m182() {}", "init() {\n this.sick = false;\n }", "init() {\r\n this.readyCount = 0;\r\n }", "function init() {\r\n\r\n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "onInitialize() {}", "didInit() { }", "init () {}", "init () {}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "transient private internal function m185() {}", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "function init() {\n }", "transient final protected internal function m174() {}", "function init() {\n\n\n\n\t}", "function init() {\n\n }", "function init() {\n\n }", "initializing() {\n this.log('initializing');\n }", "function init() {\r\n }", "constructor() {\n\t\tlet self=this;\n\t\tself.ready=false;\n\t}", "transient protected internal function m189() {}", "_initialize() {\n\n }", "init() {\n\t\tDebug.success(`${this.name} initialized`);\n\t}", "_initializeProperties(){}// prevent user code in connected from running", "async init () {\r\n return;\r\n }", "constructor() {\n super();\n this._init();\n }", "ready() {\r\n\t\t// Override this\r\n\t\tthis.updateTitle();\r\n\t}", "init () {\n }", "initialize_() {\n this.initialize();\n this.initialized_ = true;\n }", "onConstructed() {}", "onConstructed() {}", "function init(){\n\n }", "async init () {\r\n debug.log('called init');\r\n return;\r\n }", "function priv () {\n\t\t\t\n\t\t}", "private public function m246() {}", "initialize(instance) {\n this.instance = instance;\n }", "started () {}", "constructor () {\r\n\t\t\r\n\t}", "initialize()\n {\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "init() {\n }", "init() {\n }", "init() {\n }", "connectedCallback(){super.connectedCallback();// ensure singleton is set\nwindow.Hal9000=window.Hal9000||{};window.Hal9000.instance=this}", "init () {\n\n }", "onload() {\n this.init();\n }", "__init7() {this._isEnabled = false;}", "private internal function m248() {}", "monitor() {\n this.init();\n }", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}" ]
[ "0.67417896", "0.6684072", "0.66159546", "0.658373", "0.65639436", "0.655552", "0.6543187", "0.65427786", "0.6523542", "0.64546514", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64436275", "0.64365524", "0.6435069", "0.6435069", "0.642378", "0.64114386", "0.6410045", "0.639684", "0.6394217", "0.639133", "0.63876134", "0.6379319", "0.6372596", "0.6328624", "0.63261044", "0.63261044", "0.63261044", "0.63261044", "0.63261044", "0.63261044", "0.6322142", "0.6305569", "0.6299512", "0.6299512", "0.6298997", "0.6298997", "0.6298997", "0.6298997", "0.6298997", "0.62985325", "0.6296348", "0.6296348", "0.6296348", "0.6295898", "0.6282604", "0.62705225", "0.6264808", "0.6264808", "0.6261663", "0.6261089", "0.6260969", "0.6256372", "0.62461394", "0.62420636", "0.62420547", "0.6236046", "0.6221347", "0.6217454", "0.62167275", "0.6213683", "0.6200687", "0.6200687", "0.6195501", "0.61760545", "0.6173386", "0.6158909", "0.6157476", "0.6151018", "0.6147949", "0.61375076", "0.6134982", "0.61312515", "0.61312515", "0.61312515", "0.6127257", "0.6127257", "0.6127257", "0.61267793", "0.6123661", "0.61149067", "0.61025524", "0.6095744", "0.6088608", "0.6082746", "0.6082746", "0.6082746", "0.6082746", "0.6082746", "0.6082746", "0.6082746" ]
0.0
-1
classNuToText converts enum to class label.
function classNumToText (props){ const {colIndex, rowIndex,grid} = props; let num = grid[colIndex][rowIndex]; switch (num){ case 1: return "black"; case 2: return "red"; case 11: return "black wins"; case 12: return "red wins"; default: return "white"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _makeLabel (n) {\n if (Array.isArray(n)) return _arrayToVec(n);\n if (typeof n === 'object') return 'fa_' + (n._id);\n else return n.toFixed(6);\n}", "static labelOf(t) {\n const label= !t.desc ? Filters.titlecase(t.name.replace(/[-_]/g, ' ')) /* friendlyish name */ :\n (typeof t.desc === 'string') ? t.desc :\n t.desc.label;\n return label;\n }", "function textLabelForClassName(className) {\n return `${className} score`;\n}", "__getTypeLabel() {\n return this.constructor.LabelSingular;\n }", "get enumDisplayNames() {}", "function label(type) {\n return labels[map(type)] || 'Unknown';\n }", "function stat2label(status) {\n\n var label;\n\n switch (status) {\n case OPEN:\n label = 'label-open';\n break;\n case ASSIGN:\n label = 'label-assign';\n break;\n case ACK:\n label = 'label-ack';\n break;\n case CLOSED:\n label = 'label-closed';\n break;\n case EXPIRED:\n label = 'label-expired';\n break;\n case UNKNOWN:\n label = 'label-unknown';\n break;\n default:\n label = '';\n }\n status = status.charAt(0).toUpperCase() + status.slice(1).toLowerCase();\n\n return('<span class=\"label ' + label + '\">' + status + '</span>');\n}", "function intToLabel(n) {\n\tvar label = '';\n\tdo {\n\t\tlabel = charset.charAt(n % charset.length) + label;\n\t\tn = Math.floor(n / charset.length);\n\t} while(n);\n\treturn label;\n}", "function Get_ClassString(eProp)\n{\n\t//switch on the class\n\tswitch (eProp)\n\t{\n\t\tcase __NEMESIS_CLASS_FORM:\n\t\t\treturn \"Form\";\n\t\tcase __NEMESIS_CLASS_MDIFORM:\n\t\t\treturn \"MDIForm\";\n\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\treturn \"Edit\";\n\t\tcase __NEMESIS_CLASS_LABEL:\n\t\t\treturn \"Label\";\n\t\tcase __NEMESIS_CLASS_LINK:\n\t\t\treturn \"Link\";\n\t\tcase __NEMESIS_CLASS_HOTSPOT:\n\t\t\treturn \"HotSpot\";\n\t\tcase __NEMESIS_CLASS_PUSH_BUTTON:\n\t\t\treturn \"PushButton\";\n\t\tcase __NEMESIS_CLASS_IMAGE_BUTTON:\n\t\t\treturn \"ImageButton\";\n\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\treturn \"ComboBox\";\n\t\tcase __NEMESIS_CLASS_FIELDSET:\n\t\t\treturn \"FieldSet\";\n\t\tcase __NEMESIS_CLASS_GROUP_BOX:\n\t\t\treturn \"GroupBox\";\n\t\tcase __NEMESIS_CLASS_RADIO_BUTTON:\n\t\t\treturn \"RadioButton\";\n\t\tcase __NEMESIS_CLASS_CHECK_BOX:\n\t\t\treturn \"CheckBox\";\n\t\tcase __NEMESIS_CLASS_TAB_CONTROL:\n\t\t\treturn \"TabControl\";\n\t\tcase __NEMESIS_CLASS_TAB_SHEET:\n\t\t\treturn \"TabSheet\";\n\t\tcase __NEMESIS_CLASS_STATUSBAR:\n\t\t\treturn \"StatusBar\";\n\t\tcase __NEMESIS_CLASS_TOOL_BAR:\n\t\t\treturn \"ToolBar\";\n\t\tcase __NEMESIS_CLASS_TREE_VIEW:\n\t\t\treturn \"TreeView\";\n\t\tcase __NEMESIS_CLASS_LIST_BOX:\n\t\t\treturn \"ListBox\";\n\t\tcase __NEMESIS_CLASS_LIST_VIEW:\n\t\t\treturn \"ListView\";\n\t\tcase __NEMESIS_CLASS_TREE_GRID:\n\t\t\treturn \"TreeGrid\";\n\t\tcase __NEMESIS_CLASS_NAV_BAR:\n\t\t\treturn \"NavBar\";\n\t\tcase __NEMESIS_CLASS_POPUP_MENU:\n\t\t\treturn \"Popup\";\n\t\tcase __NEMESIS_CLASS_WEB_BROWSER:\n\t\t\treturn \"Browser\";\n\t\tcase __NEMESIS_CLASS_MDIFRAME:\n\t\t\treturn \"MDIFrame\";\n\t\tcase __NEMESIS_CLASS_CFOS:\n\t\t\treturn \"CFOS\";\n\t\tcase __NEMESIS_CLASS_IMAGE:\n\t\t\treturn \"Image\";\n\t\tcase __NEMESIS_CLASS_TRACK_BAR:\n\t\t\treturn \"TrackBar\";\n\t\tcase __NEMESIS_CLASS_VIDEO_PLAYER:\n\t\t\treturn \"VideoPlayer\";\n\t\tcase __NEMESIS_CLASS_ULTRAGRID:\n\t\t\treturn \"UltraGrid\";\n\t\tdefault:\n\t\t\t//use unknown\n\t\t\treturn \"Unknown\";\n\t}\n}", "static get LABEL_NONE () {return 'none';}", "toString() {\n return `${this.classString}: ${this.count}`;\n }", "labelClass () {\n let klass = ''\n\n if (this.state.error) {\n klass += ' usa-input-error-label'\n }\n\n if (this.state.checked) {\n klass += ' checked'\n }\n\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n return klass.trim()\n }", "function tm_label(d) {\n\tvar res = \"\";\n\tvar words = d.Team.split(\" \");\n\twords.forEach(function(w) {\n\t\tres += w + \"\\n\";\n\t});\n\treturn res;\n}", "getStatusClass(status) {\n const statusMap = {\n \"Not Bidding\": \"danger\",\n \"Complete\": \"success\",\n \"Bidding\": \"warning\",\n };\n\n return `text-${statusMap[status]}`;\n }", "function classType(type) {\r\n\tswitch (type) {\r\n\tcase \"Lecture\": return \"L\";\r\n\tcase \"Lab\": return \"B\";\r\n\tcase \"Recitation\": return \"C\";\r\n\tcase \"Hybrid\": return \"H\";\r\n\tcase \"Emporium\": return \"E\";\r\n\tcase \"Online\": return \"O\";\r\n\tcase \"Independent Study\": return \"I\";\r\n\tcase \"Research\": return \"R\";\r\n\tdefault: return \"bug\";\r\n\t}\r\n}", "getClassText(value) {\n if (parseFloat(value) > 0.0) {\n return \"text-success\"\n } else {\n return \"text-danger\"\n }\n }", "function formatEnumValue(value) {\n value = value.split('_');\n\n if (value[1]) {\n value = value[1].toLowerCase();\n return value.charAt(0).toUpperCase() + value.slice(1);\n }\n\n return value[0].toLowerCase();\n} //* ** Enum Dropdown ***/", "function getNumClass(num) {\n var numToWords = ['empty', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'];\n return numToWords[num];\n\n}", "function tnfToString(tnf) {\n var value = tnf;\n\n switch (tnf) {\n case ndef.TNF_EMPTY:\n value = \"Empty\";\n break;\n case ndef.TNF_WELL_KNOWN:\n value = \"Well Known\";\n break;\n case ndef.TNF_MIME_MEDIA:\n value = \"Mime Media\";\n break;\n case ndef.TNF_ABSOLUTE_URI:\n value = \"Absolute URI\";\n break;\n case ndef.TNF_EXTERNAL_TYPE:\n value = \"External\";\n break;\n case ndef.TNF_UNKNOWN:\n value = \"Unknown\";\n break;\n case ndef.TNF_UNCHANGED:\n value = \"Unchanged\";\n break;\n case ndef.TNF_RESERVED:\n value = \"Reserved\";\n break;\n }\n return value;\n}", "function classString(classInfo){var o=[];for(var name in classInfo){var v=classInfo[name];if(v){o.push(name);}}return o.join(' ');}", "toString() {\n return Array.from(this.classes.keys()).join(' ');\n }", "function pluralLabel(type) {\n type = map(type);\n return type in pluralLabels ? labels[type] : labels[type] + 's';\n }", "function classToString(obj) {\n return internalToString.call(obj);\n }", "function classToString(obj) {\n return internalToString.call(obj);\n }", "function getClass() {\n //Roll 1d20 for the class\n let d20 = roll('d20');\n //Now go through the options\n if (d20 <= 1) return \"Barbarian\";\n else if (d20 <= 2) return \"Bard\";\n else if (d20 <= 4) return \"Cleric\";\n else if (d20 <= 5) return \"Druid\";\n else if (d20 <= 7) return \"Fighter\";\n else if (d20 <= 8) return \"Monk\";\n else if (d20 <= 9) return \"Paladin\";\n else if (d20 <= 10) return \"Ranger\";\n else if (d20 <= 14) return \"Rogue\";\n else if (d20 <= 15) return \"Sorcerer\";\n else if (d20 <= 16) return \"Warlock\";\n else return \"Wizard\";\n}", "getClass(){\n if(this.state.cat=='Underweight' || this.state.cat == 'Overweight')\n return 'info1'\n else if(this.state.cat == 'Obese')\n return 'danger1'\n return 'success1'\n }", "function team2class(team) {\n var class_name = team;\n class_name = (class_name === '76ers') ? 'philly' : class_name;\n class_name = (class_name === 'Trail Blazers') ? 'Blazers' : class_name;\n return class_name;\n }", "set enumDisplayNames(value) {}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "function labelNames(units) {\n switch (units) {\n case 'Car/ Light Van':\n return {Type: \"Car/ Light Van\" ,distance: \"Miles\", mileage: \"CO2 used\", cost: \"Cost\", evcost: \"Cost\"};\n case 'Medium Van':\n return {Type: \"Medium Van\", distance: \"Miles\", mileage: \"CO2 used\", cost: \"Cost\", evcost: \"Cost\"};\n case 'Large Van':\n return {Type: \"Large Van\", distance: \"Miles\", mileage: \"CO2 used\", cost:\"Cost\", evcost: \"Cost\"};\n default:\n return {Type: \"Car/ Light Van\", distance: \"Miles\", mileage: \"CO2 used\", cost:\"Cost\", evcost: \"Cost\"};\n }\n}", "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "function value_label(n) {\n if (n > 1000000) {\n return format1dp(n / 1000000) + 'Bn'\n //return Number(Math.round(n / 100000) / 10) + 'Bn';\n } else if (n > 1000) {\n return format1dp(n / 1000) + 'M'\n return Number(Math.round(n / 100) / 10) + 'M';\n }\n else {return 0;}\n}", "function codeClass(status){return Number(String(status).charAt(0)+'00');}", "toStringEnum() {\n return toStringEnumInternal(this.keys);\n }", "function classOf(o){\n if(o === null) return \"Null\";\n if(o === undefined) return \"Undefined\";\n return Object.prototype.toString.call(o).slice(8, -1);\n}", "function convertClassNumber(classNumber){\n\n switch(classNumber){\n case 1:\n return 'Warrior';\n case 2:\n return 'Paladin';\n case 3:\n return 'Hunter';\n case 4:\n return 'Rogue';\n case 5:\n return 'Priest';\n case 6:\n return 'DeathKnight';\n case 7:\n return 'Shaman';\n case 8:\n return 'Mage';\n case 9:\n return 'Warlock';\n case 10:\n return 'Monk';\n case 11:\n return 'Druid';\n };\n\n }", "function config2foldLabel(config) {\n var _s=\" \";\n var _r=config2oneAndTwo(config);\n var _m=config2foldType(config);\n var _tmp=_r[0]+_s+_m+_s+_r[1]; \n return _tmp;\n}", "function getLabelType() {\n return properties.label_type;\n }", "function mapClassLanguage(langCode) {\r\n\tif (languageMap[langCode]) return (languageMap[langCode]['classname']);\r\n\telse return ('unknown');\r\n}", "getClassTextFromPercentage(percentage) {\n let formatted = percentage\n formatted = formatted.toString().replace('%', '');\n\n if (parseFloat(formatted) > 0.0) {\n return \"text-success\"\n } else {\n return \"text-danger\"\n }\n }", "function getClassStr(classes) {\n var str = '';\n\n for( var i = 0; i < classes.length; i++ ) {\n var className = classes[i];\n str += className;\n if(i !== classes.length - 1) {\n str += ' ';\n }\n }\n\n return str;\n }", "function fieldLabel(field) { return [field, \"Label\"].join(\"\"); }", "getUserFriendlyStatusLabels(status) {\n if (status === 'UNDER_SUBMISSION' || status === 'UNDER_SUMMARY_STATS_SUBMISSION'\n || status === 'PUBLISHED_WITH_SS') {\n return 'CLOSED'\n }\n if (status === 'ELIGIBLE') {\n return 'OPEN FOR SUBMISSION'\n }\n if (status === 'PUBLISHED') {\n return 'OPEN FOR SUMMARY STATISTICS SUBMISSION'\n }\n }", "function getClass(d) {\n\t\t\t\tif (word === d.word) return 'selected';\n\t\t\t\tif (word && edges[word] && edges[word].hasOwnProperty(d.word)) return 'related' + Math.min(8, Math.round(Math.sqrt(edges[word][d.word])));\n\t\t\t\treturn 'plain';\n\t\t\t}", "function nbToTxt (n){\n\tvar txt = \"\";\n\tif (n >= 1000){\n\t\ttxt = txt + \"one thousand\";\n\t\tn -= 1000;\n\t}\n\tif (n >= 100){\n\t\tvar nbHundred = Math.floor(n / 100);\n\t\ttxt = txt + nbs[nbHundred - 1] +\" hundred\";\n\t\tn -= nbHundred * 100;\n\t\tif (n !== 0){\n\t\t\ttxt = txt +\" and \";\n\t\t}\n\t}\n\tif (n > 19 || n === 10){\n\t\tvar nbDecade = Math.floor(n / 10);\n\t\ttxt = txt + decades[nbDecade - 1];\n\t\tn -= nbDecade * 10;\n\t\tif (n !== 0){\n\t\t\ttxt = txt +\"-\";\n\t\t}\n\t}\n\tif (n > 10){\n\t\tvar nbException = n - 10;\n\t\ttxt = txt + exceptions[nbException - 1];\n\t\tn -= nbException + 10;\n\t}\n\tif (n > 0){\n\t\ttxt = txt + nbs[n - 1];\n\t}\n\n\treturn txt;\n}", "toHumanString() {\n if (this.amount === 0) {\n return fmtUnit(0, this.unit);\n }\n if (constructs_1.Token.isUnresolved(this.amount)) {\n return `<token> ${this.unit.label}`;\n }\n let millis = convert(this.amount, this.unit, TimeUnit.Milliseconds, { integral: false });\n const parts = new Array();\n for (const unit of [TimeUnit.Days, TimeUnit.Hours, TimeUnit.Hours, TimeUnit.Minutes, TimeUnit.Seconds]) {\n const wholeCount = Math.floor(convert(millis, TimeUnit.Milliseconds, unit, { integral: false }));\n if (wholeCount > 0) {\n parts.push(fmtUnit(wholeCount, unit));\n millis -= wholeCount * unit.inMillis;\n }\n }\n // Remainder in millis\n if (millis > 0) {\n parts.push(fmtUnit(millis, TimeUnit.Milliseconds));\n }\n // 2 significant parts, that's totally enough for humans\n return parts.slice(0, 2).join(' ');\n function fmtUnit(amount, unit) {\n if (amount === 1) {\n // All of the labels end in 's'\n return `${amount} ${unit.label.substring(0, unit.label.length - 1)}`;\n }\n return `${amount} ${unit.label}`;\n }\n }", "function addLabelText(element, d, direction) {\n element\n .append('tspan')\n .attr('class', function() {\n // If no type in any direction default class \"text\"\n var classConst = '';\n\n if (d.typeTo !== undefined || d.typeFrom !== undefined) {\n classConst = classConst.concat('mainText');\n } else {\n classConst = classConst.concat('text');\n }\n\n /* Adds additional classes according to the properties. */\n switch (d.propertyTo) {\n case 'external':\n classConst = classConst.concat(' white');\n return classConst;\n default:\n }\n\n switch (d.propertyFrom) {\n case 'external':\n classConst = classConst.concat(' white');\n return classConst;\n default:\n }\n\n return classConst;\n })\n .text(function() {\n var value;\n if (direction === 'to') {\n value = d.valueTo;\n } else if (direction === 'from') {\n value = d.valueFrom;\n } else {\n value = d.valueTo ? d.valueTo : d.valueFrom;\n }\n return value.toString().truncate(LABEL_WIDTH);\n });\n }", "get text(){ return this.__label.text; }", "getAccountTypesLabel(accountTypes) {\n const { isFarmer, isDistributor, isRetailer, isConsumer } = accountTypes;\n return isFarmer\n ? \"Farmer\"\n : isDistributor\n ? \"Distributor\"\n : isRetailer\n ? \"Retailer\"\n : isConsumer\n ? \"Consumer\"\n : \"\";\n }", "function convertClassValue(sStyleClass)\n{\n\t//Declare return string.\n\tvar sConvertedClassValue = '';\n\n\t//If it is a changable value get representation.\n\tif (sStyleClass.indexOf('-') != -1)\n\t{\n\t\tsConvertedClassValue = sStyleClass.substring(sStyleClass.indexOf('-') + 1);\n\t}\n\t//Otherwise simply assign it as 1.\n\telse\n\t{\n\t\tsConvertedClassValue = 1;\n\t}\n\n\treturn sConvertedClassValue;\n}", "function getLabel(t) {\n //console.log(t)\n\n var _label = t.data.label || null;\n\n return _label\n }", "textComp() {\n switch (true) {\n case this.props.detectorUp && this.props.detectorDown:\n return this.props.english ? 'Full' : 'Llena';\n case !this.props.detectorUp && this.props.detectorDown:\n return this.props.english ? 'Ordinary level' : 'Nivel normal';\n case !this.props.detectorUp && !this.props.detectorDown:\n return this.props.english ? 'Empty' : 'Vacía';\n case this.props.detectorUp && !this.props.detectorDown:\n return 'Error';\n }\n }", "function charClass(cc) {\n switch(cc) {\n case 0:\n cc = \"Barbarian\";\n break;\n case 1:\n cc = \"Bard\";\n break;\n case 2:\n cc = \"Cleric\";\n break;\n case 3:\n cc = \"Druid\";\n break;\n case 4:\n cc = \"Fighter\";\n break;\n case 5:\n cc = \"Monk\";\n break;\n }\n return cc;\n}", "displayTypeUpper() {\n console.log(this.type.toUpperCase());\n }", "getFieldLabels() {\n return {\n \"company\": t(\"Организация\"),\n \"date\": t(\"Дата создания\"),\n \"period\": t(\"Период отчета\"),\n \"type\": t(\"Тип отчета\"),\n \"email\": t(\"Адрес email\")\n }\n }", "function renderStatusLabel(key, codes, options={}) {\n\n let text = null;\n let label = null;\n\n // Find the entry which matches the provided key\n for (var name in codes) {\n let entry = codes[name];\n\n if (entry.key == key) {\n text = entry.value;\n label = entry.label;\n break;\n }\n }\n\n if (!text) {\n console.error(`renderStatusLabel could not find match for code ${key}`);\n }\n\n // Fallback for color\n label = label || 'bg-dark';\n\n if (!text) {\n text = key;\n }\n\n let classes = `badge rounded-pill ${label}`;\n\n if (options.classes) {\n classes += ` ${options.classes}`;\n }\n\n return `<span class='${classes}'>${text}</span>`;\n}", "function getLabelRhetType(type){\n switch(type){\n case \"sro:Abstract\": \n case \"http://salt.semanticauthoring.org/ontologies/sro#Abstract\": \n return (\"Abstract\");\n case \"deo:Materials\": \n return (\"Materials\");\n case \"deo:Introduction\":\n case \"http://purl.org/spar/deo/Introduction\":\n return (\"Introduction\");\n case \"deo:Results\": \n return (\"Results\");\n case \"deo:Methods\": \n return (\"Methods\");\n case \"sro:Discussion\": \n return (\"Discussion\");\n case \"sro:Conclusion\": \n case \"http://salt.semanticauthoring.org/ontologies/sro#Conclusion\":\n return (\"Conclusion\");\n default: {\n return type\n }\n }\n}", "function toEnumName(value) {\n var result = '';\n var wasLower = false;\n for (var i = 0; i < value.length; i++) {\n var c = value.charAt(i);\n var isLower = /[a-z]/.test(c);\n if (!isLower && wasLower) {\n result += '_';\n }\n result += c.toUpperCase();\n wasLower = isLower;\n }\n if (!isNaN(value[0])) {\n result = '_' + result;\n }\n result = result.replace(/[^\\w]/g, '_');\n result = result.replace(/_+/g, '_');\n return result;\n}", "function toString() {\n\t\t// Add namespace\n\t\tvar\tname = settings.ns + this.name,\n\t\t\tclassList = resolveClassName(name);\n\n\t\t// Add modifiers\n\t\tclassList = this.mods.reduce(function(classList, modObject) {\n\t\t\tvar modArray = objectToArray(modObject);\n\n\t\t\tif ( modArray.length ) {\n\t\t\t\tmodArray = modArray.map(function (mod) {\n\t\t\t\t\treturn resolveClassName(name + mod);\n\t\t\t\t});\n\n\t\t\t\tmodArray.unshift('');\n\t\t\t\tclassList += modArray.join(space);\n\t\t\t}\n\n\t\t\treturn classList;\n\t\t}, classList);\n\n\t\t// Mix with another classes\n\t\tif ( this.mixes.length ) {\n\t\t\tclassList += space + this.mixes.join(space);\n\t\t}\n\n\t\t// Add states\n\t\tvar states = this.states;\n\t\tclassList = Object.keys(states).reduce(function(classList, state) {\n\t\t\treturn classList += states[state] ? space + is + state : '';\n\t\t}, classList);\n\n\t\treturn classList;\n\t}", "function getPriorityClassName(todo, classes) {\n return classes[`${todo.priority.toLowerCase()}PriorityText`];\n}", "getDisplayClassName(){\n\t\treturn this._display_class_name;\n\t}", "function getAnnotationLabel(type) {\n switch (type) {\n case \"hasAuthor\": return (\"Author\");\n case \"hasPublicationYear\": return (\"Publication Year\");\n case \"hasTitle\": return (\"Title\");\n case \"hasDOI\": return (\"DOI\");\n case \"hasURL\": return (\"URL\");\n case \"hasComment\": return (\"Comment\");\n case \"denotesRethoric\":\n case \"denotesRhetoric\": return (\"Rhetorica\");\n case \"cites\": return (\"Citation\");\n default: {\n console.log(\"Something goes wrong with getAnnotationLabel()\");\n return error;\n }\n }\n}", "function enumFormatter(cell, row, enumObject) {\n return enumObject[cell];\n }", "translatePlayerStateEnumToString(state) {\n if (YouTubeVideo.ytToVAPIPlayerStates[state]) {\n return YouTubeVideo.ytToVAPIPlayerStates[state];\n }\n else {\n const msg = `translatePlayerStateEnumToString():> Unknown state=${state}`;\n logger.fatal(msg);\n throw new UnknownState_1.UnknownStateException(msg);\n }\n }", "getTaskGroupTextCssClass(taskStatusName) {\n var className;\n switch (taskStatusName) {\n case \"Holding\":\n className = \"text-secondary\";\n break; //gray\n case \"Prioritized\":\n className = \"text-primary\";\n break; //blue\n case \"Started\":\n className = \"text-info\";\n break; // light blue\n case \"Finished\":\n className = \"text-success\";\n break; //green\n case \"Reverted\":\n className = \"text-danger\";\n break; //red\n }\n return className;\n }", "function reName() {\n\tvar counter = 65; //65 = ascii A\n\tvar shortClasses = {};\n\tObject.keys(minStruct).forEach((state) => {\n\t\tvar longClass = minStruct[state].newClass;\n\t\tif (!shortClasses[longClass]){\n\t\t\tshortClasses[longClass] = String.fromCharCode(counter);\n\t\t\tcounter++\n\t\t}\n\t});\n\t\n\t\n\tconsole.log(shortClasses);\n\t\n\n\tObject.keys(minStruct).forEach((state) => {\n\t\tvar shortClass = shortClasses[minStruct[state].newClass];\n\t\tminStruct[state].class=shortClass;\n\t\tminStruct[state].newClass=null;\n\t});\n\t\n\n\tconsole.log(\"new class count =\" +(counter-65));\n\treturn (counter-65);\n}", "getClassNames() {\n let classNames = ['thread-ListItem'];\n\n return classNames.join(' ');\n }", "get enumNames() {}", "chooseClass(data) {\n if (data == \"R\"){\n return \"republican votesPercentageText\";\n }\n else if (data == \"D\"){\n return \"democrat votesPercentageText\";\n }\n else if (data == \"I\"){\n return \"independent votesPercentageText\";\n }\n }", "function classList(classes) {\n return Object\n .entries(classes)\n .filter(entry => entry[1])\n .map(entry => entry[0])\n .join(' ');\n}", "get label() {\n return this.getLabel();\n }", "function tokenLabel(tokType) {\n if (hasTokenLabel(tokType)) {\n return tokType.LABEL;\n }\n else {\n return tokType.name;\n }\n}", "function getLabelDescriptions () {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'text' : 'Walk'\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'text' : 'Bus Stop Sign'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'text' : 'One-leg Stop Sign'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'text' : 'Two-leg Stop Sign'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'text' : 'Column Stop Sign'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'text' : 'Not provided'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'text' : 'Bus Stop Shelter'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'text' : 'Bench'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'text' : 'Trash Can / Recycle Can'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'text' : 'Mailbox / News Paper Box'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'text' : 'Traffic Sign / Pole'\n }\n }\n}", "function getLocalizedNodeLabel(localizedNodeLabel, hasMinDepth) {\r\n\t return `<span class='node-label__world node-label__value'>{WORLD}</span><br>\r\n ${localizedNodeLabel.depth}<span class='node-label__value' style='color:{DEPTH_COLOR}'>{DEPTH}</span>\r\n ${hasMinDepth ? \" <span class='node-label__value' style='color:{MIN_DEPTH_COLOR}'>({MIN_DEPTH})</span>\" : \"\"}<br>\r\n ${localizedNodeLabel.author}<span class='node-label__value'>{AUTHOR}</span><br>\r\n ${localizedNodeLabel.versionAdded}<span class='node-label__value'>{VERSION_ADDED}</span>`;\r\n\t}", "getclassname() {\n return \"Text\";\n }", "function getDeptName(classCode){\r\n\tswitch(classCode){\r\n\t\tcase \"ART\":\r\n\t\tcase \"GDES\":\r\n\t\tcase \"IDES\":\r\n\t\tcase \"THTR\":\r\n\t\tcase \"VCD\":\r\n\t\t\treturn \"AD\";\r\n\t\t\t\r\n\t\tcase \"ATRN\":\r\n\t\t\treturn \"AT\";\r\n\t\t\t\r\n\t\tcase \"ACCT\":\t\t\r\n\t\tcase \"BA\":\r\n\t\tcase \"BUS\":\r\n\t\tcase \"ECON\":\r\n\t\tcase \"EUIS\":\r\n\t\tcase \"FIN\":\r\n\t\tcase \"ITM\":\r\n\t\tcase \"MGMT\":\r\n\t\tcase \"MIS\":\r\n\t\tcase \"MRKT\":\r\n\t\tcase \"SMGT\":\r\n\t\t\treturn \"BA\";\r\n\t\t\t\r\n\t\tcase \"BE\":\r\n\t\tcase \"BEBL\":\r\n\t\tcase \"BECE\":\r\n\t\tcase \"BEGE\":\r\n\t\tcase \"BEGS\":\r\n\t\tcase \"BENT\":\r\n\t\tcase \"BEOT\":\r\n\t\tcase \"BEPH\":\r\n\t\tcase \"BEPT\":\r\n\t\tcase \"BEST\":\r\n\t\tcase \"BETH\":\r\n\t\t\treturn \"BE\";\r\n\t\t\t\r\n\t\tcase \"BEBS\":\r\n\t\tcase \"BEDU\":\r\n\t\tcase \"BEHI\":\r\n\t\tcase \"BTAT\":\r\n\t\tcase \"BTBL\":\r\n\t\tcase \"BTBS\":\r\n\t\tcase \"BTCM\":\r\n\t\tcase \"BTGE\":\r\n\t\tcase \"BTGS\":\r\n\t\tcase \"BTHT\":\r\n\t\tcase \"BTNT\":\r\n\t\tcase \"BTOT\":\r\n\t\tcase \"BTPA\":\r\n\t\tcase \"XBGE\":\r\n\t\tcase \"XBHI\":\r\n\t\tcase \"EGGN\":\r\n\t\t\treturn \"BI\";\r\n\t\t\r\n\t\tcase \"CA\":\r\n\t\tcase \"COM\":\r\n\t\tcase \"COMM\":\r\n\t\tcase \"EMTC\":\r\n\t\tcase \"JOUR\":\r\n\t\t\treturn \"CA\";\r\n\t\t\t\r\n\t\tcase \"CEBE\":\r\n\t\tcase \"CEEE\":\r\n\t\tcase \"CEEM\":\r\n\t\tcase \"CELG\":\r\n\t\tcase \"CENS\":\r\n\t\t\treturn \"CE\";\r\n\t\t\t\r\n\t\tcase \"BRDM\":\r\n\t\tcase \"DCCM\":\r\n\t\tcase \"PWID\":\r\n\t\tcase \"TPC\":\r\n\t\t\treturn \"CM\";\r\n\t\t\r\n\t\tcase \"ECS\":\r\n\t\tcase \"ECSP\":\r\n\t\tcase \"ED\":\r\n\t\tcase \"EDA\":\r\n\t\tcase \"EDEC\":\r\n\t\tcase \"EDMC\":\r\n\t\tcase \"EDR\":\r\n\t\tcase \"EDSE\":\r\n\t\tcase \"EDSP\":\r\n\t\tcase \"EDU\":\r\n\t\tcase \"EDUC\":\r\n\t\t\treturn \"ED\";\r\n\t\t\r\n\t\tcase \"CS\":\r\n\t\tcase \"EG\":\r\n\t\tcase \"EGCP\":\r\n\t\tcase \"EGEE\":\r\n\t\tcase \"EGME\":\r\n\t\t\treturn \"EG\";\r\n\t\t\r\n\t\tcase \"AT\":\r\n\t\tcase \"CCHG\":\r\n\t\tcase \"ES\":\r\n\t\tcase \"ESS\":\r\n\t\tcase \"ESSE\":\r\n\t\tcase \"EXSC\":\r\n\t\tcase \"MAHE\":\r\n\t\tcase \"MAPE\":\r\n\t\tcase \"PASS\":\r\n\t\tcase \"PEAE\":\r\n\t\tcase \"PEAI\":\r\n\t\tcase \"PEAS\":\r\n\t\tcase \"PEAT\":\r\n\t\tcase \"PEH\":\r\n\t\tcase \"PEM\":\r\n\t\tcase \"SES\":\r\n\t\t\treturn \"ES\";\r\n\t\t\r\n\t\tcase \"ANTH\":\r\n\t\tcase \"CRJU\":\r\n\t\tcase \"DCHG\":\r\n\t\tcase \"GEO\":\r\n\t\tcase \"GSS\":\r\n\t\tcase \"HIST\":\r\n\t\tcase \"INTL\":\r\n\t\tcase \"POLS\":\r\n\t\tcase \"PUAD\":\r\n\t\tcase \"SOC\":\r\n\t\tcase \"SS\":\r\n\t\tcase \"SSED\":\r\n\t\tcase \"UNIV\":\r\n\t\t\treturn \"HG\";\r\n\t\t\r\n\t\tcase \"COLL\":\r\n\t\tcase \"GLBL\":\r\n\t\tcase \"HON\":\r\n\t\tcase \"ID\":\r\n\t\tcase \"LART\":\r\n\t\t\treturn \"ID\";\r\n\t\t\r\n\t\tcase \"ALHL\":\r\n\t\tcase \"DCPF\":\r\n\t\tcase \"ESED\":\r\n\t\tcase \"PEAF\":\r\n\t\tcase \"PEAL\":\r\n\t\tcase \"PEAR\":\r\n\t\tcase \"PEAX\":\r\n\t\tcase \"PEF\":\r\n\t\tcase \"XPEF\":\r\n\t\t\treturn \"KH\";\r\n\t\t\r\n\t\tcase \"ARBC\":\r\n\t\tcase \"CHN\":\r\n\t\tcase \"DCLT\":\r\n\t\tcase \"EAP\":\r\n\t\tcase \"ENG\":\r\n\t\tcase \"FILM\":\r\n\t\tcase \"FREN\":\r\n\t\tcase \"GER\":\r\n\t\tcase \"LANG\":\r\n\t\tcase \"LING\":\r\n\t\tcase \"LIT\":\r\n\t\tcase \"LL\":\r\n\t\tcase \"SPAN\":\r\n\t\t\treturn \"LL\";\r\n\t\t\r\n\t\tcase \"AES\":\r\n\t\tcase \"MIL\":\r\n\t\t\treturn \"MS\";\r\n\t\t\r\n\t\tcase \"CDMU\":\r\n\t\tcase \"CHMU\":\r\n\t\tcase \"CLMU\":\r\n\t\tcase \"DCHU\":\r\n\t\tcase \"EDMU\":\r\n\t\tcase \"GMUS\":\r\n\t\tcase \"HLMU\":\r\n\t\tcase \"HUM\":\r\n\t\tcase \"KPMU\":\r\n\t\tcase \"MU\":\r\n\t\tcase \"MUED\":\r\n\t\tcase \"PFMU\":\r\n\t\tcase \"PLMU\":\r\n\t\tcase \"THMU\":\r\n\t\tcase \"TYMU\":\r\n\t\tcase \"WSHP\":\r\n\t\tcase \"XHUM\":\r\n\t\t\treturn \"MU\";\r\n\t\t\r\n\t\tcase \"DCNS\":\r\n\t\tcase \"NS\":\r\n\t\tcase \"NSG\":\r\n\t\t\treturn \"NS\";\r\n\t\t\r\n\t\tcase \"PHAR\":\r\n\t\tcase \"PPHR\":\r\n\t\t\treturn \"PH\";\r\n\t\t\r\n\t\tcase \"DCPY\":\r\n\t\tcase \"PY\":\r\n\t\tcase \"PYCH\":\r\n\t\t\treturn \"PY\";\r\n\t\t\r\n\t\tcase \"BIO\":\r\n\t\tcase \"BIOA\":\r\n\t\tcase \"BIOE\":\r\n\t\tcase \"CHEM\":\r\n\t\tcase \"DEV\":\r\n\t\tcase \"ENVS\":\r\n\t\tcase \"ESCI\":\r\n\t\tcase \"FORS\":\r\n\t\tcase \"GBIO\":\r\n\t\tcase \"GEOA\":\r\n\t\tcase \"GEOG\":\r\n\t\tcase \"GEOL\":\r\n\t\tcase \"GMTH\":\r\n\t\tcase \"GSCI\":\r\n\t\tcase \"MATH\":\r\n\t\tcase \"MTED\":\r\n\t\tcase \"PHYS\":\r\n\t\tcase \"SCED\":\r\n\t\tcase \"SM\":\r\n\t\tcase \"XGBI\":\r\n\t\t\treturn \"SM\";\r\n\t\t\r\n\t\tcase \"SWK\":\r\n\t\t\treturn \"SW\";\r\n\r\n\t\tdefault:\r\n\t\t\treturn \"NULL\";\r\n\t}\r\n}", "get directionClass() {\n switch (this.direction) {\n case TransitionDirection.In: return \"in\";\n case TransitionDirection.Out: return \"out\";\n }\n return \"\";\n }", "function NameForStatusCode(aStatusCode)\n{\n switch (aStatusCode)\n {\n case 0:\n return \"NS_OK\";\n case kStatusReadFrom:\n case kStatusReadFrom_Status:\n return \"NET_STATUS_READ_FROM\";\n case kStatusWroteTo:\n case kStatusWroteTo_Status:\n return \"NET_STATUS_WROTE_TO\";\n case kStatusReceivingFrom:\n case kStatusReceivingFrom_Status:\n return \"NET_STATUS_RECEIVING_FROM\";\n case kStatusSendingTo:\n case kStatusSendingTo_Status:\n return \"NET_STATUS_SENDING_TO\";\n case kStatusWaitingFor:\n case kStatusWaitingFor_Status:\n return \"NET_STATUS_WAITING_FOR\";\n case kStatusResolvingHost:\n case kStatusResolvingHost_Status:\n return \"NET_STATUS_RESOLVING_HOST\";\n case kStatusConnectedTo:\n case kStatusConnectedTo_Status:\n return \"NET_STATUS_CONNECTED_TO\";\n case kStatusConnectingTo:\n case kStatusConnectingTo_Status:\n return \"NET_STATUS_CONNECTING_TO\";\n case kStatusHTTP:\n return \"See HTTP response\";\n case kErrorBindingFailed:\n return \"BINDING_FAILED\";\n case kErrorBindingAborted:\n return \"BINDING_ABORTED\";\n case kErrorBindingRedirected:\n return \"BINDING_REDIRECTED\";\n case kErrorBindingRetargeted:\n return \"BINDING_RETARGETED\";\n case kErrorMalformedURI:\n return \"MALFORMED_URI\";\n case kNetBase + 11: // netCore.h\n return \"ALREADY_CONNECTED\";\n case kNotConnected:\n return \"NOT_CONNECTED\";\n case kConnectionRefused:\n return \"CONNECTION_REFUSED\";\n case kNetTimeout:\n return \"NET_TIMEOUT\";\n case kInProgress:\n return \"IN_PROGRESS\";\n case kOffline:\n return \"OFFLINE\";\n case kNetBase + 17: // netCore.h\n return \"NO_CONTENT\";\n case kNetBase + 18: // netCore.h\n return \"UNKNOWN_PROTOCOL\";\n case kPortAccessNotAllowed:\n return \"PORT_ACCESS_NOT_ALLOWED\";\n case kNetReset:\n return \"NET_RESET\";\n case kStatusFTPLogin:\n return \"FTP_LOGIN\";\n case kStatusFTPCWD:\n return \"FTP_CWD\";\n case kStatusFTPPassive:\n return \"FTP_PASV\";\n case kStatusFTPPWD:\n return \"FTP_PWD\";\n case kUnknownHost:\n return \"UNKNOWN_HOST or NO_CONNECTION_OR_TIMEOUT\";\n case kUnknownProxyHost:\n return \"UNKNOWN_PROXY_HOST\";\n case kErrorFTPAuthNeeded:\n return \"FTP auth needed (?)\";\n case kErrorFTPAuthFailed:\n return \"FTP auth failed (?)\";\n case kStatusBeginFTPTransaction:\n return \"NET_STATUS_BEGIN_FTP_TRANSACTION\";\n case kStatusEndFTPTransaction:\n return \"NET_STATUS_END_FTP_TRANSACTION\";\n case kNetBase + 61:\n return \"NET_CACHE_KEY_NOT_FOUND\";\n case kNetBase + 62:\n return \"NET_CACHE_DATA_IS_STREAM\";\n case kNetBase + 63:\n return \"NET_CACHE_DATA_IS_NOT_STREAM\";\n case kNetBase + 64:\n return \"NET_CACHE_WAIT_FOR_VALIDATION\"; // XXX error or status?\n case kNetBase + 65:\n return \"NET_CACHE_ENTRY_DOOMED\";\n case kNetBase + 66:\n return \"NET_CACHE_READ_ACCESS_DENIED\";\n case kNetBase + 67:\n return \"NET_CACHE_WRITE_ACCESS_DENIED\";\n case kNetBase + 68:\n return \"NET_CACHE_IN_USE\";\n case kErrorDocumentNotCached:\n return \"NET_DOCUMENT_NOT_CACHED\";//XXX error or status? seems to be error\n case kFilesBase + 1: // nsError.h\n return \"UNRECOGNIZED_PATH\";\n case kFilesBase + 2: // nsError.h\n return \"UNRESOLABLE SYMLINK\";\n case kFilesBase + 4: // nsError.h\n return \"UNKNOWN_TYPE\";\n case kFilesBase + 5: // nsError.h\n return \"DESTINATION_NOT_DIR\";\n case kFilesBase + 6: // nsError.h\n return \"TARGET_DOES_NOT_EXIST\";\n case kFilesBase + 8: // nsError.h\n return \"ALREADY_EXISTS\";\n case kFilesBase + 9: // nsError.h\n return \"INVALID_PATH\";\n case kDiskFull:\n return \"DISK_FULL\";\n case kFilesBase + 11: // nsError.h\n return \"FILE_CORRUPTED (justice department, too)\";\n case kFilesBase + 12: // nsError.h\n return \"NOT_DIRECTORY\";\n case kFilesBase + 13: // nsError.h\n return \"IS_DIRECTORY\";\n case kFilesBase + 14: // nsError.h\n return \"IS_LOCKED\";\n case kFilesBase + 15: // nsError.h\n return \"TOO_BIG\";\n case kNoDeviceSpace:\n return \"NO_DEVICE_SPACE\";\n case kNameTooLong:\n return \"NAME_TOO_LONG\";\n case kFileNotFound:\n return \"FILE_NOT_FOUND\";\n case kFilesBase + 19: // nsError.h\n return \"READ_ONLY\";\n case kFilesBase + 20: // nsError.h\n return \"DIR_NOT_EMPTY\";\n case kAccessDenied:\n return \"ACCESS_DENIED\";\n default:\n for (a in Components.results)\n if (Components.results[a] == aStatusCode)\n return a;\n return String(aStatusCode);\n }\n}" ]
[ "0.6098353", "0.58898973", "0.5831838", "0.5758314", "0.57263845", "0.5697312", "0.56697494", "0.56542087", "0.55759615", "0.5569282", "0.5538657", "0.5526886", "0.55071956", "0.5488564", "0.54478127", "0.543742", "0.5306785", "0.5294057", "0.5286106", "0.527915", "0.52445894", "0.5240966", "0.5239611", "0.5239611", "0.5222918", "0.5210549", "0.5202034", "0.5191478", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5161627", "0.5158441", "0.5135079", "0.5125624", "0.51150596", "0.50903594", "0.507869", "0.50772417", "0.50736886", "0.5055305", "0.50498724", "0.50430274", "0.50323206", "0.50306153", "0.5021043", "0.50043076", "0.50043005", "0.5001223", "0.49766475", "0.49715903", "0.49703276", "0.4962682", "0.4958224", "0.49556622", "0.49491614", "0.49455634", "0.4945303", "0.4931829", "0.49312943", "0.49256784", "0.49141675", "0.4895211", "0.48901567", "0.4884692", "0.48783976", "0.48763883", "0.48645753", "0.4862954", "0.48620412", "0.48566672", "0.48526213", "0.48422614", "0.48380354", "0.48293486", "0.4828272", "0.48254427", "0.48210454", "0.48200178", "0.48196197", "0.48068267" ]
0.61397135
0
Se carga la lista de departamentos y municipios
async function obtenerDepartamentos() { try { let response = await axios.get(URL_departamentos) let data = response.data.items let result = [] // Opcion por defecto result.push(<option value={0} key={0}>Seleccione una Opción</option>) for (let index in data) { result.push(<option value={data[index].codigo} key={data[index].codigo}>{data[index].nombre}</option>) } setDepartamentos(result) // Se obtiene el municipio por defecto a partir del departamento por defecto recalcularMunicipios() } catch (error) { console.log('Fallo obteniendo los departamentos / municipios' + error) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDepartamentosDropdown() {\n $http.post(\"Departamentos/getDepartamentosTotal\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.listaDepartamentos.data = r.data.d.data;\n \n }\n })\n }", "function cargar_municipios(datos_municipios) {\r\n\tvar texto_aconvertir = \"{'municipios':\" + datos_municipios + \"}\";\r\n\tvar objeto_respuesta = eval('(' + texto_aconvertir + ')');\r\n\tvar lista_muni = document.getElementById(\"municipios\");\r\n\tlista_muni.options.length = 0;\r\n\tvar posiciones = objeto_respuesta.municipios.length;\r\n\tfor (var i = 0; i < posiciones; i++) {\r\n\t\topcion = document.createElement('option');\r\n\t\ttexto_opcion = document\r\n\t\t\t\t.createTextNode(objeto_respuesta.municipios[i].municipio);\r\n\t\topcion.appendChild(texto_opcion);\r\n\t\topcion.value = objeto_respuesta.municipios[i].codigoMunicipio;\r\n\t\tlista_muni.appendChild(opcion);\r\n\t}\r\n}", "function consultarMunicipios(){ \n\tvar selector = $('#selectDepartaments').val();\n\t$.post(\"gestionEspectro/php/consultasConsultasBD.php\", { consulta: 'municipios', idConsulta: selector }, function(data){\n\t\t$(\"#municipios\").html(data);\n\t\t$(\"#tipoAsignacion\").html(\"La asignación es a nivel municipal\");\n\t}); \n}", "function consultarDepartamentos(){ \n\tvar selector = $('#selectTerritorialDivision').val();\n\t$.post(\"gestionEspectro/php/consultasConsultasBD.php\", { consulta: 'departamentos', idConsulta: selector }, function(data){\n\t\t$(\"#departamentos\").html(data);\n\t\t$(\"#municipios\").html(\"\");\n\t\t$(\"#tipoAsignacion\").html(\"La asignación es a nivel departamental\");\n\n\t}); \n}", "function getDepartments() {\n Department.getAll()\n .then(function (departments) {\n $scope.departments = departments;\n })\n ['catch'](function (err) {\n Notification.error('Something went wrong with fetching the departments, please refresh the page.')\n });\n }", "function deplist(){\n return $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen',\n dataType:'json',\n type:'post'\n });\n }", "async function recalcularMunicipios() { \n \n try {\n let URL = URL_municipios\n URL += watch('departamento') \n let response = await axios.get(URL)\n let data = await response.data.items\n let result = []\n \n // Opcion por defecto\n result.push(<option value={0} key={0}>Seleccione una Opción</option>)\n\n for (let index in data) { \n result.push(\n <option value={data[index].codigo} key={data[index].codigo}>{data[index].nombre}</option>\n )\n }\n setMunicipios(result) \n \n } catch (error) {\n console.log('Fallo obteniendo los municipios' + error)\n } \n }", "function departamento(iddepartamento) {\n var tipoeleccion = $('#TIPOELECCION').val()\n var id =0;\n\n let dept;\n let municipios;\n let template ='';\n\n tipoeleccion=parseInt(tipoeleccion)\n id = parseInt(iddepartamento);\n\n console.log(tipoeleccion);\n console.log(id);\n //los casos especiales son 5, 12, 14, 19 que son los que tienen elecciones municipales\n switch (id) {\n case 0:\n dept = JSON.stringify(NACIONAL)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n case 1:\n dept = JSON.stringify(GUATEMALA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 2:\n dept = JSON.stringify(SACATEPEQUEZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 3:\n dept = JSON.stringify(CHIMALTENANGO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n console.log(template);\n\n });\n break;\n\n case 4:\n dept = JSON.stringify(ELPROGRESO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 5:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(ESCUINTLA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun5)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n break;\n\n case 6:\n dept = JSON.stringify(SANTAROSA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 7:\n dept = JSON.stringify(SOLOLA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 8:\n dept = JSON.stringify(TOTONICAPAN)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 9:\n dept = JSON.stringify(QUETZALTENANGO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 10:\n dept = JSON.stringify(SUCHITEPEQUEZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 11:\n dept = JSON.stringify(RETALHULEU)\n municipios = JSON.parse(dept)\n\n par.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 12:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(SANMARCOS)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun12)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n\n break;\n case 13:\n dept = JSON.stringify(HUEHUETENANGO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n case 14:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(QUICHE)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun14)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n break;\n\n case 15:\n dept = JSON.stringify(BAJAVERAPAZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 16:\n dept = JSON.stringify(ALTAVERAPAZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 17:\n dept = JSON.stringify(PETEN)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 18:\n dept = JSON.stringify(IZABAL)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 19:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(ZACAPA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun19)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n\n break;\n\n case 20:\n dept = JSON.stringify(CHIQUIMULA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 21:\n dept = JSON.stringify(JALAPA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 22:\n dept = JSON.stringify(JUTIAPA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 23:\n dept = JSON.stringify(USA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n }\n $('#MUN').html(template)\n\n }", "function getDepartamentoEmpleados(id) {\n $http.post(\"Departamentos/getDepartamentoEmpleados\", { id: id }).then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.lista.data = r.data.d.getDepartamentoEmpleados;\n vm.lista.disp = [].concat(vm.lista.data);\n }\n })\n }", "function getAvailableDepartments() {\n departmentService.getAllDepartments().then(function(departments) {\n $scope.departments = departments.data;\n })\n }", "async function Municipios() {\n alertaCargando(\"Por favor espere\", \"Cargando datos\");\n /**\n * Esta línea de código llama a la función que limpia la capa de organismos de cuenca\n */\n await limpiarMunicipio();\n const query = await concatMunicipio();\n if (query !== \"\") {\n /**\n * @type {string}\n * Se crea una cadena que es la que se va a enviar por medio de Ajax,\n * este contiene tanto el query anteriormente descrito como la acción que va realizar en el controlador de mapa\n */\n const cadena = \"query=\" + query + \"&Accion=Acuiferos(Muni)\";\n var data = [];\n /**\n * Se manda a llamar por medio de Ajax a la función de estados en el controlador de mapa\n */\n $.ajax({\n type: \"POST\",\n url: \"/aplicacion/controlador/mapa.php\",\n data: cadena,\n /**\n * @param resp\n * Si el controlador devuelve la consulta se procederá con el proceso de interpretación de los datos\n */\n success: function (resp) {\n /**\n * Primero se recorre el array con todos los estados devueltos por el controlador.\n */\n\n $.each(JSON.parse(resp), function (index, item) {\n /**\n * Por medio del plugin de multiselect, podemos agregar los objetos del array al select de acuiferos\n */\n data.push({\n name: item.nombre,\n value: item.id_acuifero,\n checked: false,\n });\n });\n $(\"#Acuiferos\").multiselect(\"loadOptions\", data);\n },\n }).always(function () {\n Swal.close();\n });\n } else {\n Swal.close();\n }\n}", "function cmbdepartemen(typ,dep){\n var u= dir2;\n var d='aksi=cmb'+mnu2;\n ajax(u,d).done(function (dt) {\n var out='';\n if(dt.status!='sukses'){\n out+='<option value=\"\">'+dt.status+'</option>';\n }else{\n if(dt.departemen.length==0){\n out+='<option value=\"\">kosong</option>';\n }else{\n $.each(dt.departemen, function(id,item){\n out+='<option '+(dep==item.replid?' selected ':'')+' value=\"'+item.replid+'\">'+item.nama+'</option>';\n });\n }\n if(typ=='filter'){ // filter (search)\n $('#departemenS').html(out);\n cmbtahunajaran('filter','');\n }else{ // form (edit & add)\n $('#departemenDV').text(': '+dt.departemen[0].nama);\n }\n }\n });\n }", "function getEmpleadosDropdown() {\n $http.post(\"lateral/getNombresDropdown\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.listaEmpleados.data = r.data.d.data;\n \n }\n })\n }", "function cambiarCiudad(id_p){\n\t$.post(\"/contacts/get_city\",{id_pais:id_p},function(data){\n\t\tvar obj_int = jQuery.parseJSON(data);\n\t\tvar opciones = \"\";\n\t\tif(obj_int){\n\t\t\t$.each(obj_int, function(i, item) {\t\n\t\t\t\t//console.log(item);\n\t\t\t\topciones += '<option value=\"'+item.id+'\">'+item.name+'</option>';\n\t\t\t});\n\n\t\t}\t\n\t\t$(\".cbo-city\").html(opciones);\n\t\t\n\t\t\n\t});\n}", "function getList() {\n return fetch(\n 'https://5f91384ae0559c0016ad7349.mockapi.io/departments',\n ).then((data) => data.json());\n }", "function loadDeparturesData() {\n\n //add a empty option\n // let departureOption = document.createElement('option');\n // departureOption.text = '';\n // document.querySelector('#slcDepartures').add(departureOption);\n\n for (let i = 0; i < airports.length; i++) {\n let departureOption = document.createElement('option');\n departureOption.text = airports[i].departure;\n document.querySelector('#slcDepartures').add(departureOption);\n }\n\n loadDestinationsData();\n}", "function chargerDomaines() {\n return $.ajax({\n url: urlServiceWeb +'domainesEmploi/' + langue,\n dataType: 'JSON',\n success: function(retour) {\n for(var i = 0; i < retour.items.length; i++) {\n listeDomaines = listeDomaines + '<option value=\"' + retour.items[i].valeur + '\">' + retour.items[i].nom + '</option>';\n }\n },\n error: function() {\n $('#manitouSimplicite').html(messages.erreurs.chargementDomainesEmploi);\n }\n });\n }", "function carregarListaUnidadesCadastradas(){\n\tDWRUtil.removeAllOptions(\"comboUnidade\");\n\tFacadeAjax.getListaUnidadesSuporte(function montaComboUnidadeCadastradas(listBeans){\n\t\tDWRUtil.removeAllOptions(\"comboUnidade\");\n\t\tDWRUtil.addOptions(\"comboUnidade\", listBeans, \"idUsuario\",\"nome\");\n\t});\n}", "function cmbdepartemen(){\n $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen',\n dataType:'json',\n type:'post',\n success:function(dt){\n var out='';\n if(dt.status!='sukses'){\n out+='<option value=\"\">'+dt.status+'</option>';\n }else{\n $.each(dt.departemen, function(id,item){\n out+='<option value=\"'+item.replid+'\">'+item.nama+'</option>';\n });\n //panggil fungsi viewTB() ==> tampilkan tabel \n viewTB(dt.departemen[0].replid); \n }$('#departemenS').html(out);\n cmbtahunajaran(dt.departemen[0].replid);\n }\n });\n }", "function getDepartments() {\n return $http.get(API.sailsUrl + '/departments')\n .then(function success(res) {\n if(res.data) {\n return res.data.data;\n } else {\n return $q.reject(res.data);\n }\n }).catch(function error(reason) {\n return $q.reject({\n error: 'Error with API request.',\n origErr: reason\n });\n });\n }", "function getAll(req, res) {\n tipocliente.findAll().then(tipo_cliente => {\n return res.status(200).json({\n ok: true,\n tipo_cliente\n });\n }).catch(err => {\n return res.status(500).json({\n message: 'Ocurrió un error al buscar los departamentos'\n });\n });\n}", "function cmbdepartemenS(){\n deplist().done(function(res){\n var opt='';\n if(res.status!='sukses'){\n notif(res.status,'red');\n }else{\n $.each(res.departemen, function(id,item){\n opt+='<option value=\"'+item.replid+'\">'+item.nama+'</option>'\n });\n $('#departemenS').html(opt);\n cmbprosesS($('#departemenS').val());\n }\n });\n }", "function loadDeparturesWithCountrycode(countrycode) {\n vm.loading = true;\n datacontext.getDepartureTerminalsByCountryCode(countrycode).then(function(resp) {\n //console.log(resp);\n\n try {\n vm.departureTerminals = resp.Items;\n } catch (exception) {\n swal(\"please try again later!\");\n }\n\n\n\n // console.log(vm.departureTerminals[0]);\n vm.loading = false;\n }, function(err) {\n console.log(err);\n vm.loading = false;\n });\n }", "function obtener_ciudades(){\n var combo = $('[name=ciudad]');\n var codigo_estado = $('[name=estado]').val();\n $.ajax({\n url: \"terceros_controller/obtener_ciudades\",\n type: 'POST',\n data: {\n codigo_estado: codigo_estado\n },\n success: function(response) {\n var respuesta = $.parseJSON(response);\n if (respuesta.success === true) {\n combo.empty();\n combo.append('<option value=\"\">Seleccione</option>')\n var cantidad = respuesta.ciudades.length\n item = respuesta.ciudades[cantidad-1]\n combo.append('<option value=\"'+item[\"muncodigo\"]+'\">'+item[\"munnombre\"]+'</option>');\n for (var i = 0; i < cantidad-1; i++) {\n var item = respuesta.ciudades[i];\n combo.append('<option value=\"'+item[\"muncodigo\"]+'\">'+item[\"munnombre\"]+'</option>');\n }\n }\n }\n });\n}", "function PopularLocaisAgendamento(locaisagendamento) {\r\n // Popula a DDL de inserir/editar agendamento [locais de agendamento]\r\n var $ddl_localagendamento = $('select[name=idlocal]');\r\n $ddl_localagendamento.empty();\r\n $ddl_localagendamento.append('<option value=\"\">Selecione</option>');\r\n $.each(locaisagendamento, function (n, localagend) {\r\n var $op = $('<option>');\r\n $op.val(localagend.idlocal).text(localagend.nome);\r\n $ddl_localagendamento.append($op);\r\n });\r\n}", "function firerpt_provincesChange(){\n loadLocationData()\n var provinceDropDown = document.getElementById('rpt_provinces');\n var provinceSlug = provinceDropDown.options[provinceDropDown.selectedIndex].id.split('_')[0]\n var districtDropDown = document.getElementById('rpt_districts');\n var facilityDropDown = document.getElementById('rpt_facilities');\n\n // reload district combo\n clearDropDown(districtDropDown);\n var childDistricts = []\n for(index in _allDistricts){\n if(provinceSlug === \"All\" ||\n provinceSlug ===_allDistricts[index][0].split('_')[0]\n || _allDistricts[index][0] === \"All\"){\n childDistricts.push(_allDistricts[index]);\n }\n }\n fillList(districtDropDown, childDistricts)\n\n // reload facility combo\n clearDropDown(facilityDropDown);\n var childFacilities = []\n for(index in _allFacilities){\n if(provinceSlug === \"All\" ||\n provinceSlug === _allFacilities[index][0].split('_')[0] ||\n _allFacilities[index][0] === \"All\"){\n childFacilities.push(_allFacilities[index]);\n } \n }\n fillList(facilityDropDown, childFacilities)\n}", "function cargarDepartamentos() {\n\n //consume el ws para obtener los datos\n $.ajax({\n url: 'wscargar_datos.asmx/cargarDepartamentos',\n data: '',\n type: 'POST',\n contentType: 'application/json; charset=utf-8',\n beforeSend: function () {\n },\n success: function (msg) {\n $.each(msg.d, function () {\n $('#departamento').append('<option value=\"' + this.id + '\">' + this.descripcion + '</option>')\n });\n }\n });\n\n}", "function get_select_departments_countrys($selected) {\n\n $.ajax({\n url: './fullSelectCountry',\n type: 'GET',\n data: {},\n dataType: 'json',\n success: function(result) {\n\n\n $('#selectPais').find('option').remove().end();\n\n $('#selectPais').append($('<option>', { value: 'disabled', text: 'Seleccione un país' }));\n\n if ($selected === undefined) {\n\n $.each(result, function(k, v) {\n $('#selectPais').append($('<option>', { value: v.CODIGO_PAIS, text: v.NOMBRE }));\n });\n\n } else {\n\n $.each(result, function(k, v) {\n\n var id = v.CODIGO_PAIS;\n var name = v.NOMBRE;\n\n $(\"#selectPais\").append(\"<option value='\" + id + \"'>\" + name + \"</option>\");\n\n if (id === $selected) {\n\n $(\"#selectPais\").attr('selected', 'selected').val(id);\n }\n\n });\n\n }\n },\n error: function(result) {\n //handle errors\n alert('error...' + result);\n }\n });\n}", "function findMunTorreviejaData(municipios){\n var munData = null;\n for(var key in municipios){\n var actMun = (municipios[key].nombre).toLowerCase();\n if(actMun == \"torrevieja\"){\n munData = municipios[key];\n break;\n }\n }\n console.log(munData);\n return munData;\n }", "function getUnidades() {\n return $http({\n method: 'GET',\n url: APP.apiHost + '/api/unidades'\n }).then(function success(res) {\n return res.data // jshint ignore:line\n }, function error(res) {\n return $q.reject(res.data);\n });\n }", "function BuscarMuni(departamento){\n $.ajax({\n url:'/admins/municipios/',\n datatype: 'JSON',\n type: 'POST',\n data: {\n departamento: departamento,\n csrfmiddlewaretoken: $('input:hidden[name=csrfmiddlewaretoken]').val()\n },\n success: (data) => {\n data = data.toString();\n res = data.replace(/\\(\\'|\\'\\,\\)/g, \"/\");\n res = res.split(\"/\")\n res = res.filter(e => e !== '');\n opt = new String();\n $.each(res, (i,v) => {\n opt+=\"<option value = \"+(i+1)+\">\"+v+\"</option>\";\n });\n $(\"#sl_muni\").html(opt);\n },\n error: (error, e) => {\n console.log(error + \" \" + e);\n }\n })\n}", "function llenarOrganizaciones( organizaciones ){\n\n // Borro los marcadores del mapa\n $(\".leaflet-marker-icon\").remove(); $(\".leaflet-popup\").remove();\n $(\".leaflet-pane.leaflet-shadow-pane\").remove();\n\n let divOrganizaciones = $('.listaOrganizaciones');\n divOrganizaciones.html('');\n\n //SI NO HAY ORGANIZACIONES CON NO LAS CARGO\n if( organizaciones.length < 1){\n divOrganizaciones.html(\n `<div class=\"alert alert-danger\" role=\"alert\">\n No se encontraron resultados\n </div>`\n );\n }\n else{\n\n moment.locale('es');\n organizaciones.forEach(org => {\n\n if(org.necesidades.length>0){\n let cardOrganizacion = `\n <div class=\"card cardOrganizacion cardOrganizacion${org.idUsuario} shadow-sm my-2\" style=\"display: block; opacity: 1;\">\n <div class=\"card-header d-flex flex-row px-2 justify-content-star detalleOrganizacion align-items-center\">\n <img class=\"rounded-circle imgPerfilOrg\" src=\"${org.urlFotoPerfilUsuario || 'assets/img/imgUserProfile.png'}\" alt=\"Avatar de la org ${org.razonSocial}\">\n <div id=\"card-org-name\" class=\"ml-2\">\n <a href=\"organizacion/${org.idUsuario}\">${org.razonSocial}</a>\n <a href=\"#\">${org.nombreTipoOrganizacion}</a>\n </div>\n </div>\n <div class=\"card-body p-0 listaNecesidades${org.idUsuario}\">\n\n </div>\n <div class=\"card-footer py-0 bg-transparent\">\n <a href=\"/organizacion/${org.idUsuario}\" class=\"btn btn-sm w-100 btn-link ml-auto text-decoration-none text-muted\">Ver todas</a>\n </div>\n </div>`\n\n divOrganizaciones.append( cardOrganizacion );\n org.necesidades.forEach( need => {\n\n $category = need.nombreCategoria.split(' ')[0].toLowerCase();\n $diffDate = moment(need.fechaCreacionNecesidad, \"YYYY-MM-DD HH:mm:ss\").startOf('day').fromNow();\n\n $(`.listaNecesidades${org.idUsuario}`).append(`\n <div class=\"need ${$category}\">\n <div class=\"card-body py-2 px-3\">\n <div class=\"card-title\"><a title=\"${$category}\" href=\"#\" class=\"card-category\">${capitalize(need.nombreCategoria)}</a></div>\n <div class=\"card-subtitle text-muted\">${capitalize(need.descripcionNecesidad)}</div>\n </div>\n <div class=\"card-footer d-flex align-items-center p-0\">\n <small class=\"ml-3 mr-auto align-items-center\">${$diffDate}</small>\n <button class=\"btn btn-link btn-sm btnDetalleOrg btnDetalleOrg${need.idNecesidad} text-decoration-none pl-0\" data-toggle=\"modal\" data-target=\"#modalDetalleNecesidad\">Me interesa</button>\n </div>\n </div>\n `);\n\n $(`.btnDetalleOrg${need.idNecesidad}`).on('click', function(){\n cargarDatosModalDetalleNecesidad(need);\n })\n\n\n })\n\n cargarOrgEnMapa(org);\n }\n })\n }\n agregarPaginacionListaOrganizaciones();\n}", "function cargarLocalidades(id) {\n $.get('/Localidades/mostrar/' + id, function(data) {\n $('select[name=CliLocId').empty();\n var texto = \"\";\n\n for (var i = 0; i < data.length; i++) {\n texto = '<option value=\"' + data[0].LocId + '\">' + data[0].DesLoc + \" - \" + data[0].NomLoc + '</option>'\n $('select[name=CliLocId').append(texto);\n }\n });\n}", "function template_actualizar_ciudad(nomElemento) {\n\tvar indexEstado = -1;\n\tvar arrayEstados = Array(\"template_venta_estado\", \"template_renta_estado\", \"template_rentaVac_estado\");\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\");\n\t\n\tindexEstado = arrayEstados.indexOf(nomElemento);\n\t\n\tif (indexEstado > -1) {\n\t\tobjEstado = $(\"#\"+nomElemento);\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexEstado]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexEstado]);\n\t\t\n\t\t\n\t\tobjMunicipio.find(\"li.lista ul\").html(\"\");\n\t\tobjMunicipio.find(\"p\").attr(\"data-value\", -1);\n\t\tobjMunicipio.find(\"p\").text(\"\");\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: objEstado.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjMunicipio.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjMunicipio.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjMunicipio.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjMunicipio.find(\"p\").text($(this).text());\n\t\t\t\t\t\ttemplate_actualizar_colonia(objMunicipio.prop(\"id\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}", "function getDepartments() {\n const query = \"SELECT * FROM department\";\n return queryDB(query);\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 loadAll() {\n var cidades = eurecaECBrasil.filtrarCidadeTextoService();\n return cidades.split(/, +/g).map( function (cidade) {\n return {\n value: cidade.toLowerCase(),\n display: cidade\n }; \n });\n }", "function obtenerArbolDepartamentos(s, d, e) {\n if(s) {\n $('form[name=frmGestionPerfil] .arbolDepartamento').append(procesarArbolDep(d));\n $('form[name=frmGestionPerfil] .arbolDepartamento').genTreed(); // Añade clases y imagenes a la lista html para hacerla interactiva\n\n $('form[name=frmGestionPerfil] .arbolDepartamento.tree li').dblclick(function (e) {\n let me = $(this);\n $('form[name=frmGestionPerfil] .tree li').each(function () {\n $(this).removeClass('filaSeleccionada');\n });\n me.addClass('filaSeleccionada');\n\n Moduls.app.child.templateParamas.template.Forms.frmGestionPerfil.set({\n p_objtiv: me.attr('id')\n });\n\n $('form[name=frmGestionPerfil] [name=nomdep]').val(me.attr('name'));\n $('form[name=frmGestionPerfil] [name=nomdep]').change();\n $('form[name=frmGestionPerfil] .arbolDepartamento').addClass('dn');\n return false;\n });\n } else {\n validaErroresCbk(d, true);\n }\n}", "function fetchAllDepartments() {\n $.ajax({\n url: '/api/Counselor/AllDepartments',\n contentType: \"application/json\",\n dataType: \"json\",\n async: true,\n type: \"GET\",\n success: function (req) {\n ////////console.log(req);\n config.generalInfo.allDepartments = req;\n\n for (var i = 0; i < config.generalInfo.allDepartments.length; i++) {\n if (config.generalInfo.allDepartments[i] == config.department) {\n continue;\n }\n if (i + 1 < config.generalInfo.allDepartments.length) {\n fetchSummary(config.generalInfo.allDepartments[i]);\n }\n else {\n fetchSummary(config.generalInfo.allDepartments[i], setGENERAL);\n }\n }\n\n\n },\n error: function (xhr) {\n ////////console.log(xhr);\n alert(\"数据获取失败,请检查网络!\");\n }\n });\n}", "function getDepartments(school){\n\n\t$.getJSON(\"/api/departments/\" + school, function (data) {\n\t\tvar depts =[];\n\t\tdepts = data.departments;\n\t\tvar deptDropdown = [];\n\n\t\tfor (var i = 0; i < depts.length; i++){\n\t\t\tdeptDropdown.push('<option>' + depts[i] + '</option>');\n\t\t}\n\n\t\t$( \"<select/>\", {\n\t\t\t\"class\": \"deptSelector\",\n\t\t\t\"id\": \"dept\",\n\t\t\t\"style\": \"display:inline\",\n\t\t\t\"name\": \"department\",\n\t\t\thtml: deptDropdown.join( \"\" )\n\t\t }).appendTo( \"body\" );\n\n\n\t});\n}", "function template_actualizar_ciudad(nomElemento, idCiudad, idColonia) {\n\tvar indexEstado = -1;\n\tvar arrayEstados = Array(\"template_venta_estado\", \"template_renta_estado\", \"template_rentaVac_estado\", \"template_busqueda_estado\");\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\", \"template_busqueda_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\", \"template_busqueda_colonia\");\n\t\n\tindexEstado = arrayEstados.indexOf(nomElemento);\n\t\n\tif (indexEstado > -1) {\n\t\tobjEstado = $(\"#\"+nomElemento);\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexEstado]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexEstado]);\n\t\t\n\t\t\n\t\tobjMunicipio.find(\"li.lista ul\").html(\"\");\n\t\tobjMunicipio.find(\"p\").attr(\"data-value\", -1);\n\t\tobjMunicipio.find(\"p\").text(\"\");\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: objEstado.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjMunicipio.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjMunicipio.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjMunicipio.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjMunicipio.find(\"p\").text($(this).text());\n\t\t\t\t\t\ttemplate_actualizar_colonia(objMunicipio.prop(\"id\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif ((idCiudad != null) && (idCiudad != -1)) {\n\t\t\t\t\tobjMunicipio.find(\"li.lista li[data-value='\"+idCiudad+\"']\").click();\n\t\t\t\t\tobjMunicipio.find(\"li.lista\").hide();\n\t\t\t\t\t\n\t\t\t\t\tif ((idColonia != null) && (idColonia != -1)) {\n\t\t\t\t\t\ttemplate_actualizar_colonia(objMunicipio.prop(\"id\"), idColonia);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function ciudades (){\nvar uniqueStorage = removeDuplicates(Storage, \"Ciudad\");\nvar atributos = Array();\n \n if( uniqueStorage.length > 0 ) {\n for( var aux in uniqueStorage )\n atributos.push(uniqueStorage[aux].Ciudad);\n }\n return atributos;\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "function obtener_estados() {\n var combo = $('[name=estado]');\n var codigo_pais = $('[name=pais]').val();\n $.ajax({\n url: \"terceros_controller/obtener_estados\",\n type: 'POST',\n data: {\n codigo_pais: codigo_pais\n },\n success: function(response) {\n var respuesta = $.parseJSON(response);\n if (respuesta.success === true) {\n combo.empty();\n combo.append('<option value=\"\">Seleccione</option>')\n var cantidad = respuesta.estados.length\n item = respuesta.estados[cantidad-1]\n combo.append('<option value=\"'+item[\"depcodigo\"]+'\">'+item[\"depnombre\"]+'</option>');\n for (var i = 0; i < cantidad-1; i++) {\n var item = respuesta.estados[i];\n combo.append('<option value=\"'+item[\"depcodigo\"]+'\">'+item[\"depnombre\"]+'</option>');\n }\n }\n }\n });\n}", "function cambiarCiudadEditar(id_p, seleccionado){\n\t$.post(\"/contacts/get_city\",{id_pais:id_p},function(data){\n\t\tvar obj_int = jQuery.parseJSON(data);\n\t\tvar opciones = \"\";\n\t\tif(obj_int){\n\t\t\t$.each(obj_int, function(i, item) {\n\t\t\t\tvar sel = \"\";\n\t\t\t\tif(item.id == seleccionado){\n\t\t\t\t\tsel = \"selected\";\n\t\t\t\t}\n\t\t\t\topciones += '<option value=\"'+item.id+'\" '+sel+'>'+item.name+'</option>';\n\t\t\t});\n\n\t\t}\t\n\t\t$(\".cbo-city\").html(opciones);\n\t\t\n\t\t\n\t});\n}", "function limpiarSeleccion() {\n \"use strict\";\n\n var i;\n\n map.setView(new L.LatLng(4.5, -73.0), 6);\n map.eachLayer(function (layer) {\n map.removeLayer(layer);\n });\n map.addLayer(Stamen_Watercolor);\n map.addLayer(positronLabels);\n map.addLayer(DptosLayer);\n\n document.getElementById('selDepartamento').value = 'all';\n document.getElementById('selMunicipio').value = 'all';\n document.getElementById('selTipoAccion').value = 'all';\n document.getElementById('selTipoLider').value = 'all';\n document.getElementById('selResponsable').value = 'all';\n document.getElementById('buscarPalabra').value = '';\n\n fechaInicial = startFechaTotal;\n fechaFinal = endFecha;\n cb(startFechaTotal, endFecha);\n\n if (document.getElementById('selMunicipio').options.length > 1) {\n for (i = document.getElementById('selMunicipio').options.length - 1; i >= 1; i--) {\n document.getElementById('selMunicipio').remove(i);\n }\n }\n\n // Recupera el listado inicial\n filtroDataDpto = JSON.parse(JSON.stringify(violencia_selectiva_departamento));\n $(\"#total_places\").text(0);\n\n $(\".divinfo\")[0].hidden = false;\n\n violencia_selectiva_departamento_layer = renderMarkersData(violencia_selectiva_departamento_geo, 5);\n map.addLayer(violencia_selectiva_departamento_layer);\n map.fitBounds(violencia_selectiva_departamento_layer.getBounds());\n}", "function provinces() {\r\n let results = ecuador.data.provinces;\r\n let provincias = [];\r\n for (var key in results) {\r\n provincias.push(results[key].name);\r\n }\r\n return provincias;\r\n}", "function carregaNacionalidades() {\n\n\t\tnacionalidadeService.findAll().then(function(retorno) {\n\n\t\t\tcontroller.nacionalidades = angular.copy(retorno.data);\n\n\t\t\tnewOption = {\n\t\t\t\tid : \"\",\n\t\t\t\tdescricao : \"Todas\"\n\t\t\t};\n\t\t\tcontroller.nacionalidades.unshift(newOption);\n\n\t\t});\n\n\t}", "function carregaOpcoesUnidadeSuporte(){\n\tcarregaTipoGerencia();\t\n\tcarregaTecnicos();\n\tcarregaUnidadesSolicitantes();\t\n\tcarregaEdicaoTipos();//no arquivo tipoSubtipo.js\n\tcarregaComboTipo();//no arquivo tipoSubtipo.js\n}", "getListaDoctoresOrganizacion(state){\n return state.listarDoctoresOrganizacion\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 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 get_select_cities_departments($selected) {\n\n $.ajax({\n url: './fullSelectCities',\n type: 'GET',\n data: {},\n dataType: 'json',\n success: function(result) {\n\n\n $('#selectDepartamento').find('option').remove().end();\n\n $('#selectDepartamento').append($('<option>', { value: 'disabled', text: 'Seleccione un departamento' }));\n\n if ($selected === undefined) {\n\n $.each(result, function(k, v) {\n $('#selectDepartamento').append($('<option>', { value: v.CODIGO_DEPARTAMENTO, text: v.NOMBRE }));\n });\n\n } else {\n\n $.each(result, function(k, v) {\n\n var id = v.CODIGO_DEPARTAMENTO;\n var name = v.NOMBRE;\n\n $(\"#selectDepartamento\").append(\"<option value='\" + id + \"'>\" + name + \"</option>\");\n\n if (id === $selected) {\n\n $(\"#selectDepartamento\").attr('selected', 'selected').val(id);\n }\n\n });\n\n }\n },\n error: function(result) {\n //handle errors\n alert('error...' + result);\n }\n });\n}", "function Consultar_sector(){\n\n\t$.ajax({\n\t\t\ttype:\"POST\",\n\t\t\turl:\"../../backend/ajax/query_select_direccion/sector.php\",\n\t\t\tdata:\"cod_mun=\" + $('#municipio').val(),\n\t\t\tsuccess:function(r){\n\t\t\t\t$('#sector').html(r);\n\n\t\t\t\t\t}\n\t\t\t\t});\n}", "function thnlist(dep){\n return $.ajax({\n url:dir3,\n data:'aksi=cmbproses&departemen='+dep,\n dataType:'json',\n type:'post'\n });\n }", "function ListaTipoZona(){\n DoPostAjax({\n url: \"Citas/CtrlCitas/ListarTipoZona\"\n }, function(err, data) {\n if (err) {\n Notificate({\n titulo: 'Ha ocurrido un error',\n descripcion: 'Error con la lista de los tipo de zona.',\n tipo: 'error',\n duracion: 4\n });\n } else {\n let respuesta=JSON.parse(data);\n $(\"#SltComuna\").html(\"<option value='-1'>Seleccione una comuna.</option>\");\n\n for (var val in respuesta) {\n $(\"#SltComuna\").append(\"<option value='\"+respuesta[val].idTipoZona+\"'>\"+respuesta[val].descripcionTipozona+\"</option>\");\n }\n }\n });\n}", "function getEmpleadosTabla() {\n $http.post(\"EmpleadosTabla/getEmpleadosTabla\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.lista.data = r.data.d.tablaEmpleado\n vm.lista.disp = [].concat(vm.lista.data);\n }\n })\n }", "function consultarDatosPuntos() {\n $.ajax({\n type: 'POST',\n dataType: 'json',\n url: url + \"ReporteAPH/ctrlLocalizacionLesiones/ListarDatosPuntos\",\n data: {\"idReporteAPH\": idReporteAPH}\n }).done(function (res) {\n\n var puntoTemp = [];\n\n // Recorro el json res por cada iteración creo un objeto temporal\n // y lo agrego al arreglo de lesiones\n $.each(res , function (indexPunto , valorPunto) {\n\n var lesionesTemp = [];\n var datosLesiones = valorPunto.datosLesiones;\n\n // Se encarga de recorrer las lesiones y agregarlos a lesionesTemp\n $.each(datosLesiones , function (indexLesiones , valorLesiones) {\n\n var objLesiones = {\n 'nombre': valorLesiones.descripcionCIE10,\n 'cie10' : valorLesiones.codigoCIE10,\n 'id' : valorLesiones.idLesion,\n 'especificacion' : (valorLesiones.especificacionLesion != null) ? valorLesiones.especificacionLesion : ''\n };\n\n lesionesTemp.push(objLesiones);\n\n });\n\n // Construye objeto con las lesiones y las cordenadas x - y del punto\n var objPunto = {\n\n \"infoLesion\" : lesionesTemp,\n\n \"infoPunto\" : {\n 'posX' : valorPunto.datosPunto.posX,\n 'posY' : valorPunto.datosPunto.posY\n }\n\n };\n\n\n // Agrego al arreglo puntoTemp el objeto temporal objPunto\n puntoTemp.push(objPunto);\n\n // Almacena la cantidad de puntos que hay en el cuerpo\n canLesiones++;\n\n // Arma la estructura del #id\n var idLesion = 'Puntolesion_' + canLesiones;\n // i apunta al indice de la lesion ==> lesion[i]\n var i = puntoTemp.length - 1;\n\n // Creación de un punto en el DOM\n $(\"#cont_cuerpo\").append(\"<div class='lesion' id='\"+ idLesion +\"' onclick='consultarLesion(\"+ i +\" , this.id, event)'></div>\");\n\n\n // Ubicar el punto en las cordenadas correspondientes\n $(\"#\" + idLesion).css({\n top : objPunto.infoPunto.posY + '%',\n left : objPunto.infoPunto.posX + '%'\n });\n\n });\n\n // Setear arreglo lesiones con puntoTemp\n lesiones = puntoTemp;\n\n }).fail(function () {\n\n // alerta de error\n Notificate({\n tipo: 'error',\n titulo: 'Error $Ajax',\n descripcion: 'ReporteAPH/ctrlLocalizacionLesiones/ListarDatosPuntos',\n duracion: 4\n });\n\n });\n }", "function getLieuFromRegionFirst(region,edNumber) {\n $.ajax({ \n url: '../json/ED'+edNumber+'/PositionsPoints'+edNumber+'.json', \n data: \"\",\n dataType: 'json', \n success: function(data)\n {\n $output = \"<div class='form-group'><label>\"+lieuDefi+\" :</label><select name='lieu' class='form-control' required><option disabled selected value></option>\";\n\n $.each(data, function(i, item) {\n if (typeof(data[i].lieu) != \"undefined\" && data[i].region == region) {\n $output += \"<option value=\"+data[i].lieu+\">\"+data[i].lieu+\"</option>\";\n }\n });\n $output += \"</select></div>\";\n $('#LieuList').html($output);\n $('#LieuList > div > select').val(dataRes.lieu);\n } \n });\n }", "function getDepartments(data) {\n if (data.jobs.job[0]) {\n return data.jobs.job[0].company.company_departments.department;\n }\n}", "function initProvinces() {\n\t\t// Marcar/desmarcar todas\n\t\tdocument.getElementById(\"checkall\").onclick = function(e) {\n\t\t\tvar cname = this.className;\n\t\t\tvar check = (cname!=\"on\");\n\t\t\tthis.textContent = (check ? \"Desmarcar\" : \"Marcar\") + \" Todas\";\n\t\t\tthis.className = check ? \"on\" : \"\";\n\t\t\tprovs = document.getElementById(\"province\").getElementsByTagName(\"li\");\n\t\t\tfor (var i=2,il=provs.length; i<il; i++) {\n\t\t\t\tcheckProvince(provs[i], check);\t// Marca/desmarca todas las provincias\n\t\t\t}\n\t\t\tupdateAll();\n\t\t\treturn stopEvent(e);\n\t\t};\n\t\t// Excluir Ceuta, Melilla, Canarias\n\t\tdocument.getElementById(\"hide\").onclick = function(e) {\n\t\t\tvar cname = this.className;\n\t\t\tvar check = (cname!=\"on\"); \n\t\t\tthis.className = check ? \"on\" : \"\";\n\t\t\tskip = check;\n\t\t\tvar lis = document.getElementById(\"province\").getElementsByTagName(\"li\");\n\t\t\tfor (var l=0, ll=lis.length; l<ll; l++) {\n\t\t\t\tvar li = lis[l];\n\t\t\t\tli.style.display = skipProv(li.textContent) ? \"none\" : \"block\";\n\t\t\t}\n\t\t\tupdateAll();\n\t\t\treturn stopEvent(e);\n\t\t}\n\t\t// Explicación \n\t\tvar why = document.getElementById(\"whyhide\");\n\t\twhy.onmouseover = function(e) {\n\t\t\tdocument.getElementById(\"hide\").style.height = \"250px\";\n\t\t}\n\t\twhy.onmouseout = function() {\n\t\t\tdocument.getElementById(\"hide\").style.height = \"\";\n\t\t}\n\t\t// Selector de provincias en TOOL\n\t\tinitProvLinks(\"province\", function(e) {\n\t\t\tcheckProvince(this);\n\t\t\tupdateAll();\n\t\t\treturn stopEvent(e);\n\t\t});\n\t\t// desplegar la lista de provincias\n\t\tdocument.getElementById(\"prov-list\").onclick = dropList;\n\t}", "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 getOrganizaciones(){\n fetch('/getOrganizaciones/')\n .then(response => response.json())\n .then(data => {\n let organizaciones = data.organizaciones;\n llenarOrganizaciones( organizaciones );\n })\n}", "async function limpiarEstados() {\n /**\n * Llamos a limpiar acuifero\n */\n $(\"#Municipios\").multiselect(\"reset\");\n await limpiarMunicipio();\n}", "function cargarProvincias() {\n $.ajax({\n dataType: 'json', //recibe un objeto tipo json\n url: URLWS + \"/consultar/provincias/lista\", //Direccion del webservice + la accion que se desea realizar (consultar(listar) datos del cliente)\n type: \"POST\", //Por medio de POST se cargan los datos\n success: function (data) {\n for (i = 0; i < data.length; i++) {\n //Cargar las provincias en el combo respectivo\n $(\"select[id=provincia]\").append(new Option(data[i][\"DSC_PROVINCIA\"], data[i][\"COD_PROVINCIA\"]));\n }\n }\n });\n}", "function getDeparturePlaces() {\n $.get(\"order/GetAllRoutes\", function (routes) {\n //Gets all routes from database\n initialPlaces(routes);\n });\n}", "function getallDeptByOfficeData(ofcid) {\n\t\t\t\n\t\t\t\tif(ofcid==\"\")\n\t\t\t\t{\t\t\t\t\n\t\t\t\t$('#deptlstSendTo').empty();\n\t\t\t\t $(\"#deptlstSendTo_div\").hide();\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tshowAjaxLoader();\n\t\t\t\t$.ajax({\n\t\t\t\t\t\turl : 'checkofficetype.htm',\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata : {\n\t\t\t\t\t\t\tofcid : ofcid,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess : function(response) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*var html=\"<option value=''>---Select---</option>\"*/\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(response!=\"\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$.each(response, function(index, value) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(value.ofctype==\"HO\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$(\"#deptlstSendTo_div\").show();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t $(\"#deptlstSendTo_div\").hide();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t getallEmpBySendTo(\"DO\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\thideAjaxLoader();\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t},\n\t\t\t\t\t\terror:function(error)\n\t\t\t\t\t {\n\t\t\t\t\t \t\thideAjaxLoader();\n\t\t\t\t\t }\n\t\t\t\t});\n\t\t\t\n\t\t\t};\n\t\t\t}", "function deptList() {\n return connection.query(\"SELECT id, dept_name FROM departments\");\n}", "function mostrarCargoDepartamento(id){\n\n $.get('CargosDepartamentosMostrar/'+id, function (data) { \n $(\"#tabla_DepartamentoCargo\").html(\"\");\n $.each(data, function(i, item) { //recorre el data \n cargartablaCargoDepartamento(item); // carga los datos en la tabla\n }); \n });\n \n}", "function generateDepartments() {\n const query = \"SELECT ID, department FROM department\";\n connection.query(query, (err, res) => {\n departments.splice(0, departments.length);\n departmentsId.splice(0, departmentsId.length);\n for (const j in res) {\n departments.push(res[j].departments);\n departmentsId.push(res[j].ID)\n }\n })\n}", "_getDataByTipoPersona() {\n let id = this.config.layer_id_dc\n // let feature_dc = this.layersMap.getLayerInfoById(id);\n let query = new Query();\n query.where = `${this.field_tipo_persona} IS NOT NULL`;\n query.returnGeometry = false;\n query.returnDistinctValues = true;\n query.outFields = [this.field_tipo_persona];\n\n self_cw.feature_dc.layerObject.queryFeatures(query, function(results) {\n let features = results.features;\n if (features.length) {\n features.forEach(i => {\n let opt = document.createElement(\"option\");\n opt.value = i.attributes[self_cw.field_tipo_persona];\n opt.text = i.attributes[self_cw.field_tipo_persona];\n self_cw.select_tipo_persona_cw.add(opt);\n });\n let opt = document.createElement(\"option\");\n opt.value = '';\n opt.text = 'Todos';\n opt.selected = true;\n self_cw.select_tipo_persona_cw.add(opt);\n } else {\n self_cw._showMessage(self_cw.nls.error_tipo_persona_count)\n }\n }, function(error) {\n self_cw._showMessage(`${self_cw.nls.error_tipo_persona}\\n${error.message}`, type = 'error')\n })\n }", "obtenerTodosCiudad() {\n return axios.get(`${API_URL}/v1/ciudad`);\n }", "function getAllGrupoAcademicoLst() {\n $.ajax({\n dataType: DATA_TYPE_JSON,\n contentType: CONTEN_TYPE_JSON,\n type: METHOD_GET,\n url: GRUPOACADEMICO_URL_LISTAR,\n success: function(data) {\n $(\"#slnGrupoAcademico\").html('');\n $(\"#slnGrupoAcademico\").append(\"<option value='0' selected='selected'> Todos </option>\");\n $.each(data, function(key, value) {\n var newrow = \"<option value='\" + value['codGrupoAcademico'] + \"'>\" +\n value['idGrado'] + \"° \" +\n value['codSeccion'] + \" - \" +\n value['anio'] +\n \"</option>\";\n $(\"#slnGrupoAcademico\").append(newrow);\n });\n },\n error: function(data) {\n console.log(data);\n }\n });\n}", "function GetProvincesForRegisterForm() {\n\n $http({\n method: \"GET\",\n url: \"/Public/Home/GetProvinces\"\n\n }).success(function (data, status, headers, config) {\n if (data.ErrorMessage != null) {\n // خطای سمت سرور\n showMessageBox(\"هەلە\", data.ErrorMessage, \"error\");\n $scope.provinces = null;\n } else {\n $scope.provinces = data;\n }\n\n }).error(function (data, status, headers, config) {\n $scope.message = 'هەڵە لە پەیوەندی بە سیرڤر';\n showMessageBox(\"هەلە\", $scope.message, \"error\");\n\n $scope.cities = null;\n\n });\n }", "function loadMembersSetForDep() {\n\t\n $.ajax(\"res/raw/staff.xml\").done(function(data) {\n \t\n \tvar depInfo = $(data).find(\"department[name=\\\"\"+decodeURI(getUrlVars().dep)+\"\\\"]\");\t//info del departamento seleccionado\n \t\n \t//generamos un acordeon con cada uno de los cargos del departamento\n \t$(depInfo).find(\"charge\").each(function(){\n \t\t\n \t\t$(\"#membersSet\").append(\"<div data-role=\\\"collapsible\\\">\"\n \t\t\t\t\t\t\t\t\t+ \"<h2>\" + $(this).attr(\"name\") + \"<span class=\\\"ui-li-count\\\">\" + $(this).find(\"member\").length + \"</span></h2>\"\n \t\t\t\t\t\t\t\t\t+ \"<ul class=\\\"membersList\\\" data-role=\\\"listview\\\"></ul></div>\");\n \t});\n \t$(\"#membersSet\").collapsibleset(\"refresh\");\t\t\n });\n}", "function Ajax_Aldeas_Municipios(Municipio, multi) {\n $.ajax({\n type: \"post\",\n url: \"/Incorporaciones/Reportes/Mostrar_Aldeas/\",\n data: { 'municipio': Municipio },\n success: function (response) {\n AldeasCb.ClearItems()\n CaserioCb.ClearItems()\n var ResponseParser = JSON.parse(response)\n if (JSON.parse(response).length != 0 && multi ==1)\n {\n AldeasCb.AddItem(\"TODOS\", \"00\")\n } \n for (i = 0 ; i < ResponseParser.length; i++) {\n AldeasCb.AddItem(ResponseParser[i][\"desc_aldea\"], ResponseParser[i][\"cod_aldea\"])\n }\n }\n })\n}", "populateEdificiNames() {\n services_1.Services.getAllBuildings().then(edificiResponse => {\n $.each(edificiResponse, (key, item) => {\n if (item.Stato === \"Disponibile\") {\n $('#selectEdificio').append(`<option name = \"${item.Nome}\" value = \"${item.ID_Edificio}\"> ${item.Nome}</option>`);\n }\n });\n });\n }", "function Ajax_Municipio_Departamento(departamento,multi) {\n\n $.ajax({\n type: 'post',\n url: '/Incorporaciones/Reportes/Mostrar_Municipios/',\n data: { 'departamento': departamento },\n success: function (response) {\n\n AldeasCb.ClearItems()\n CaserioCb.ClearItems()\n MuniCb.ClearItems()\n var ResponseParse = JSON.parse(response)\n if (JSON.parse(response).length != 0 && multi ==1)\n {\n MuniCb.AddItem(\"TODOS\", \"00\")\n }\n \n for (i = 0; i < ResponseParse.length ; i++) {\n MuniCb.AddItem(ResponseParse[i][\"desc_municipio\"], ResponseParse[i][\"cod_municipio\"])\n }\n }\n })\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 iniciar(){\n for(var i = 1; i <= 31; i ++){\n var dezena = diaSorteService.montaDezena(i);\n vm.dezenas.push(dezena);\n }\n }", "function cadastrarUmaUnidade(){\n\tvar unidadeSelecionadaBDTRE = DWRUtil.getValue(\"comboUnidadeTRE\"); \n\tif(unidadeSelecionadaBDTRE==null || unidadeSelecionadaBDTRE==''){\n\t\talert(\"Selecione uma unidade a ser cadastrada.\");\n\t}else{\n\t\tvar loginGerente = DWRUtil.getValue(\"loginGerenteUnidade\");\n\t\tvar matriculaGerente = DWRUtil.getValue(\"matriculaGerente\"); \n\t\tFacadeAjax.cadastrarUnidadeSuporte(unidadeSelecionadaBDTRE,loginGerente,matriculaGerente);\n\t\tcarregarCamposUnidades();\n\t}\n}", "function cargarListas(objeto,procedimiento) {\n\t $.post(\"../../controlador/fachada.php\", {\n\t clase: 'clsUtilidades',\n\t oper: 'cargarListas',\n\t objeto: objeto,\n\t procedimiento: procedimiento\n\t }, function(data) {\n\t if (data !== 0) {\n\t formarOptionValueLista(data,objeto);\n\t }\n\t else {\n\t alert('error');\n\t }\n\t }, \"json\");\n\t}", "function fillOrganizationList() {\n $(\"select\").each(function () {\n var isOrgList = $(this).data(\"organization\");\n if (isOrgList == null || isOrgList == undefined || isOrgList == false) {\n return;\n }\n var select = $(this);\n ajaxGetAllOrganizations(select)\n });\n}", "function getProvis(){ \n services.get('components', 'search','firstdrop').then(function (response) {\n $scope.provinces = response;\n \n }); \n }", "function respuesta_municipios() {\r\n\tif (peticion_municipios.readyState == 4) {\r\n\t\tif (peticion_municipios.status == 200) {\r\n\t\t\tcargar_municipios(peticion_municipios.responseText);\r\n\t\t}\r\n\t}\r\n}", "function retornarEstabelecimentosMaisBaratos(){\t\n\n\tvar idLista = parseInt(window.localStorage.idListaClicada);\n\t\n\t$.ajax({\n type: 'POST'\n , url: \"http://192.168.1.102/Servidor/ListaDeProdutos.asmx/buscarOfertas\"\n\t\t, crossDomain:true\n , contentType: 'application/json; charset=utf-8'\n , dataType: 'json'\n , data: \"{idUsuario:'\"+ID_USUARIO+\"',token:'\"+TOKEN+\"',idLista:'\"+idLista+\"'}\"\n\t\t, success: function (data, status){ \n\t\t\tvar estabelecimentos = $.parseJSON(data.d);\n\t\t\t\n\t\t\t//------------ ordenar -----------------//\n\t\t\tvar i, j, preco,oferta,guardar;\n\t\t\tfor (i = 1; i < estabelecimentos.length; i++) {\n\t\t\t preco = estabelecimentos[i].precoDaLista;\n\t\t\t guardar = estabelecimentos[i];\n\t\t\t oferta = estabelecimentos[i].itensEncontrados;\n\t\t\t j = i;\n\t\t\t while((j>0) && \n\t\t\t (oferta>estabelecimentos[j-1].itensEncontrados || (preco<estabelecimentos[j-1].precoDaLista && oferta==estabelecimentos[j-1].itensEncontrados)))\n\t\t\t {\n\t\t\t\t\testabelecimentos[j] = estabelecimentos[j-1];\n\t\t\t\t\tj = j-1;\n\t\t\t }\n\t\t\t estabelecimentos[j] = guardar;\n\t\t\t}\n\t\t\t//------------------------------------------//\n\n\t\t\tdocument.getElementById(\"referenciaEstab\").innerHTML = \"\";\n\t\t\tfor(var i=0 ;i<estabelecimentos.length ;i++){\n\t\t\t\tlistaEstiloEstab(estabelecimentos[i]); \n\t\t\t}\t\t\t\n }\n , error: function (xmlHttpRequest, status, err) {\n alert('Ocorreu um erro no servidor');\n }\n });\t\n}", "function fnCargaPartidaCvePptoServicios(orden, tagref, cpeprod) {\n var regresadatos= false;\n\n dataObj = { \n option: 'mostrarPartidaCvePpto',\n dato: cpeprod,\n datotagref: tagref\n };\n\n $.ajax({\n async:false,\n cache:false,\n method: \"POST\",\n dataType: \"json\",\n url: url,\n data: dataObj\n\n }).done(function(data) {\n \n if (data.result) {\n dataJson = data.contenido.datos;\n //console.log( \"dataJson: \" + JSON.stringify(dataJson) );\n var contenidoCvePresupuestal = \"\";\n\n for (var info in dataJson) {\n contenidoCvePresupuestal += \"<option value='\" + dataJson[info].cvePresupuestal + \"'>\" + dataJson[info].cvePresupuestal + \"</option>\";\n regresadatos= true;\n }\n\n /*$(\"#selectCveArticulo\" + orden).empty();\n $(\"#selectCveArticulo\" + orden).append('<option value=\"0\">Cve ...</option>');\n fnFormatoSelectGeneral(\"#selectCveArticulo\" + orden);\n $(\"#selectCveArticulo\" + orden).multiselect('rebuild');\n\n $(\"#selectArticulo\" + orden).empty();\n $(\"#selectArticulo\" + orden).append('<option value=\"0\">Articulo ...</option>');\n fnFormatoSelectGeneral(\"#selectArticulo\" + orden);\n $(\"#selectArticulo\" + orden).multiselect('rebuild');*/\n\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).empty();\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).append(contenidoCvePresupuestal);\n fnFormatoSelectGeneral(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden);\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).multiselect('rebuild');\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).prop(\"readonly\", true);\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).attr('disabled', 'disabled');\n\n //$(\"#selectCveArticulo\" + orden).html('<option value=\"0\">Cve ...</option>');\n //$(\"#selectArticulo\" + orden).html('<option value=\"0\">Articulo ...</option>');\n //$(\"#addedUMArticulo\" + orden).html(\"\");\n //$(\"#addedCantidadArticulo\" + orden).val(0);\n //$(\"#addedPEArticulo\" + orden).val(0);\n\n $(\"#idCvePresupuestal\" + orden).removeClass(\"hide\");\n \n ocultaCargandoGeneral();\n\n if (!regresadatos) {\n muestraMensaje(\"No existen clave presupuestal registrada para la partida \"+cpeprod);\n }\n }\n }).fail(function(result) {\n ocultaCargandoGeneral();\n console.log(\"ERROR\");\n console.log(result);\n //alert(result);\n });\n\n return regresadatos;\n}", "function cargarAlumnos() {\n console.trace(\"cargarAlumnos\");\n const url = endpoint + \"personas/\";\n const promesa = ajax(\"GET\", url, undefined);\n promesa\n .then((data) => {\n console.trace(\"promesa resolve\");\n personas = data;\n maquetarLista(personas);\n })\n .catch((error) => {\n console.warn(\"promesa rejectada\");\n alert(error);\n });\n}", "function getDashAtendimentoPadraoMeuDepartamentoAJAX() {\n return new Promise((resolve, reject) => {\n $.ajax({\n url: APP_HOST + '/atendimento/getRegistroAJAX',\n data: {\n operacao: 'getListaControle',\n dataInicial: '2020-01-01',\n dataFinal: (new Date()).toISOString().split('T')[0],\n departamento: $('#template_user_cargo').data('id'),\n paginaSelecionada: 1,\n registroPorPagina: 16,\n situacao: 10\n },\n type: 'post',\n dataType: 'json'\n }).done(function (resultado) {\n resolve(resultado);\n }).fail(function () {\n reject();\n });\n }).then(function (retorno) {\n return retorno;\n }).catch(function () {\n return [];\n });\n}", "function CargarProvinciasUtil(depa, obj, rowDefault) {\n var select = obj;\n CargarComboDefectoUtil(select, rowDefault);\n $.getJSON('solicitud.htm?action=selectUbigeo&tipo=PR&codigoUbigeo='+depa, function(json){\n var select = obj;\n json.forEach(function(item, num){\n select.append($('<option/>', {\n value : item.ID,\n text : item.UBIGEO\n }));\n });\n });\n}", "function filtroCiudad(){\n $.ajax({\n url:\"./ciudades.php\"\n }).done(function(data){\n var datos= JSON.parse(data);\n\n var ciudades= []\n for (var i=0;i<datos.length;i++)\n {\n var items= datos[i];\n var c= items.Ciudad;\n ciudades.push(c);\n }\n ciudades=ciudades.filter(function (x,i,a) {\n return a.indexOf(x) == i;\n });\n\n for(var i=0; i<ciudades.length;i++){\n $(\"#selectCiudad\").append(`<option value= ${ciudades[i]} selected>${ciudades[i]}</option>`)\n }\n })\n}", "function ciudad(){\n\n $.ajax({\n url: 'data-1.json', \n type: 'post', \n dataType: \"json\",\n success: function (data) {\n \n var obj = data\n \n $.each(obj, function(key, value) {\n\n $(\"#selectCiudad\").each(function(){//recorremos el select\n\n if($(this).text() != value.Ciudad){ // validacion si el opcion ya existe en el\n $(\"#selectCiudad\").append('<option name=\"' + key.Id+ '\" value=\"' + value.Id+ '\">' + value.Ciudad + '</option>')\n } \n });\n });\n }\n });\n}", "function consultar_sector(){\n$.ajax({\n\t\t\ttype:\"POST\",\n\t\t\turl:\"../../backend/ajax/query_direccion/sector.php\",\n\t\t\tdata:\"cod_mun=\" + $('#municipio').val(),\n\t\t\tsuccess:function(r){\n\t\t\t\t$('#sector').html(r);\n\n\t\t\t\t\t}\n\t\t\t\t});\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 actualizarGetPuntosTipoSelecciondado(){\n // no se realizo la busqueda de tipo de puntos\n if(vm.nameTipoSeleccionado == null){\n return;\n }\n // volvemos a realizar la busqueda de puntos para mantener actualizada la lista de edicion\n if((vm.nameTipoSeleccionado.nombre == \"todos\")||(vm.nameTipoSeleccionado.nombre == vm.tipoSeleccionado.nombre)){\n console.log(\"[EDIT]: va a traer los ptoInteres\");\n getTipoPuntos();\n }\n else{\n console.log(\"[EDIT]: lo deja como esta, no busca puntos\");\n }\n \n }", "function crearListaAreasPanelUsuariosSistema() {\n\n axios.get('/areas')\n .then(response => {\n\n if (response.data.success) {\n\n $(\"#areaslistPanelPrincipalUsuariosSistema\").find('option')\n .remove()\n .end();\n\n $(\"#admin-chosen-select\").find('option')\n .remove()\n .end();\n \n\n \n response.data.data.forEach(area => {\n \n $('<option>', {\n value: area.id,\n text: area.nombre,\n }).appendTo('#areaslistPanelPrincipalUsuariosSistema');\n\n\n $('<option>', {\n value: area.id,\n text: area.nombre,\n }).appendTo('#admin-chosen-select');\n\n \n });\n \n \n\n let myAreaValue = $('#areaslistPanelPrincipalUsuariosSistema').val(); \n crearListaDepartamentosUsuariosSistema(myAreaValue)\n\n } else {\n \n }\n\n })\n .catch( function (error) {\n\n }); \n\n}", "function getVuelos() {\n $.ajax({\n url: '/api/search/trip-options',\n dataType: 'json',\n data: {\n 'fromCity': currentTrip.fromCity.code,\n 'toCity': currentTrip.toCity.code,\n 'startDate': currentTrip.startDate,\n 'endDate': currentTrip.endDate,\n 'offset': 0, //TODO falta paginación!\n 'limit': 5\n },\n success: function (data) {\n $(\"#cargandoVuelos\").hide();\n airports = data.airports;\n airlines = data.airlines;\n var datalen = data.items.length;\n if (datalen > 0) {\n $(\"#sinVuelos\").hide();\n $(\"#lstVuelos\").show();\n $(\"#lstVuelos .list-group\").html('');\n opcionesViaje = data.items;\n var i = 0;\n var line;\n \n// \tEsto es par limpiar los marcadores que vengan en el mapa de un modal abierto anteriormennte\n if (markersVuelos.length > 0) {\n \tconsole.log(\"TIENE MARKERS, LIMPIO\");\n for (i in markersVuelos) {\n \tmarkersVuelos[i].setMap(null);\n }\n markersVuelos.length = 0;\n }\n if (lineasVuelos.length > 0) {\n \tconsole.log(\"TIENE Lineas, LIMPIO\");\n for (i in lineasVuelos) {\n \tlineasVuelos[i].setMap(null);\n }\n lineasVuelos.length = 0;\n }\n \n for (i = 0; i < datalen; i++) {\n $(\"#listaVuelos\").append(templateVuelo(i, data.items[i]));\n }\n $(\"div[role=opciones-vuelo]\").hide();\n $(\"a[role=ver-detalle-vuelo]\").click(function (event) {\n $(\"div[role=opciones-vuelo][vuelo!=\" + $(this).attr(\"vuelo\") + \"]\").hide();\n $(\"div[role=opciones-vuelo][vuelo!=\" + $(this).attr(\"vuelo\") + \"]\").children(\"input[type=radio]\").prop(\"disabled\", true);\n $(\"div[role=opciones-vuelo][vuelo=\" + $(this).attr(\"vuelo\") + \"]\").toggle();\n $(\"div[role=opciones-vuelo][vuelo=\" + $(this).attr(\"vuelo\") + \"]\").children(\"input[type=radio]\").prop(\"disabled\", false);\n });\n $(\"input[type=radio][alternativa]\").click(function (event) {\n var i_vuelo = $(this).parents(\"div[role=opciones-vuelo]\").attr(\"vuelo\");\n var i_alternativa = $(this).attr('alternativa');\n var i_type = $(this).parents(\"div[role=opciones-vuelo]\").attr(\"type\");\n var airportdata = new Array();\n\n if (i_type == \"ida\") {\n currentTrip.outbound = opcionesViaje[i_vuelo].outbound_choices[i_alternativa];\n var tam = currentTrip.outbound.segments.length - 1; //Maxima posicion de segmento\n\n for (var x in airports) {\n if (airports[x].code == currentTrip.outbound.segments[0].from) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n for (var x in airports) {\n if (airports[x].code == currentTrip.outbound.segments[tam].to) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n } else {\n currentTrip.inbound = opcionesViaje[i_vuelo].inbound_choices[i_alternativa];\n var tam = currentTrip.inbound.segments.length - 1;\n\n for (var x in airports) {\n if (airports[x].code == currentTrip.inbound.segments[0].from) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n for (var x in airports) {\n if (airports[x].code == currentTrip.inbound.segments[tam].to) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n }\n drawFlightRoute(airportdata);\n currentTrip.price = opcionesViaje[i_vuelo].price_detail;\n if (currentTrip.isReady()) {\n $(\"#btnViajar\").show();\n }\n });\n }\n else {\n $(\"#cargandoVuelos\").hide();\n $(\"#lstVuelos\").show();\n $(\"#sinVuelos\").show();\n }\n\n },\n error: function () {\n $(\"#cargandoVuelos\").hide();\n $(\"#lstVuelos\").show();\n $(\"#sinVuelos\").show();\n \n }\n });\n}", "function getDepartmentData() {\n cmbDepartment.empty();\n $.ajax({\n url: VIS.Application.contextUrl + \"VAT/Common/GetDepartmentData\",\n success: function (result) {\n result = JSON.parse(result);\n if (result && result.length > 0) {\n for (var i = 0; i < result.length; i++) {\n cmbDepartment.append(\" <option value=\" + result[i].ID + \">\" + result[i].Value + \"</option>\");\n }\n cmbDepartment.prop('selectedIndex', 0);\n }\n },\n error: function (eror) {\n console.log(eror);\n }\n\n });\n }", "getDepartments() {\n return this.departments;\n }", "async departments(args) {\n // Empty array is initialized to store the generated response\n let departmentDataList = new Array();\n let queryCondition=(args.q==undefined)?\"\":args.q;\n\n // API call to fetch the Department data\n const departmentReq = await fetch(`${baseURL}?q=${queryCondition}`);\n if (departmentReq.status !== 200) throw new ApolloError(\"Couldn't process the Department API request\")\n\n const departmentData = await departmentReq.json();\n\n\n // loop through the office data to fetch relevant\n // office address and office contact group data\n for (let i = 0; i < departmentData.content.length; i += 1) {\n\n let newDepartmentData = departmentData.content[i]\n\n // API call to fetch employees of department data\n const employeeReq = await fetch(`${baseURL}/${newDepartmentData.deptId}/employees`);\n if (employeeReq.status !== 200) throw new ApolloError(\"Couldn't process the Deparment API request\")\n const employeeData = await employeeReq.json()\n\n // API call to fetch projects of department data\n const projectReq = await fetch(`${baseURL}/${newDepartmentData.deptId}/projects`);\n if (projectReq.status !== 200) throw new ApolloError(\"Couldn't process the Department API request\")\n const projectData = await projectReq.json()\n\n // assigning the reponse of office address & office contact group to the office data\n newDepartmentData.employees = employeeData.content\n newDepartmentData.projects = projectData.content\n\n // pushing the newly generated data into an array\n departmentDataList.push(newDepartmentData)\n }\n return departmentDataList;\n }" ]
[ "0.6734986", "0.66602004", "0.653661", "0.64129394", "0.63565135", "0.63446254", "0.62949705", "0.62602603", "0.6212332", "0.6197748", "0.6147786", "0.6145449", "0.6130968", "0.6126239", "0.60202247", "0.60123444", "0.60041565", "0.59630895", "0.5961104", "0.5932889", "0.58754265", "0.5839152", "0.5830168", "0.58194137", "0.58188725", "0.580503", "0.578109", "0.57687336", "0.57645524", "0.57559174", "0.5752774", "0.57444304", "0.5728459", "0.57228166", "0.57054496", "0.57008743", "0.5694743", "0.5692093", "0.5670332", "0.56664574", "0.5652736", "0.5643367", "0.5635152", "0.56337273", "0.5629426", "0.56280404", "0.56243163", "0.56049824", "0.55890965", "0.5583316", "0.55832666", "0.55589575", "0.5553934", "0.5550257", "0.5543869", "0.5542557", "0.55382717", "0.5534325", "0.5521639", "0.5516063", "0.5513152", "0.54974526", "0.5495891", "0.5489685", "0.5478503", "0.5477552", "0.54769754", "0.54744625", "0.5467838", "0.5467478", "0.5465215", "0.5455433", "0.54548347", "0.5454407", "0.54509634", "0.54494303", "0.54486185", "0.5447867", "0.5445651", "0.5438257", "0.5436169", "0.5424684", "0.54224485", "0.54152197", "0.5403497", "0.53983724", "0.5396828", "0.53925794", "0.53909713", "0.5388179", "0.5383635", "0.5376428", "0.5373664", "0.5367148", "0.5363952", "0.5363834", "0.53577864", "0.53572017", "0.5355985", "0.5355001" ]
0.73978484
0
Funcion para consultar en base de datos los nombres y apellidos a partir del numero de documento
async function obtenerNombreCompleto() { // Se valida si se ha diligenciado el campo documento if (watch('documento') !== ''){ try { let URL = URL_nombre_completo URL += watch('documento') let response = await axios.get(URL) let result = await response.data setNombreCompleto(result); } catch (error) { console.log('Fallo obteniendo los nombres y apellidos' + error) } } else { setNombreCompleto("Se autocompleta con el No. de documento..."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remplirLesDonnees(data) {\n lesDocuments = data.lesDocuments;\n for (const documents of lesDocuments){\n afficherDocument(documents)\n }\n}", "function buscarModulos(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Modulo.find({}, 'nombre tipo estado usuario') // envamos un obj vacio y buscamos por nombre enail y role \n .or([{ 'nombre': regex }, { 'tipo': regex }]) // envio un array de condiciones , busco por dos tipos \n .populate('usuario', 'nombre email') // se pueden poner mas populate de otras colecciones\n .exec((err, modulos) => {\n\n if (err) {\n reject('error al cargar modulos', err)\n } else {\n // modulos ira comno respuesta en el array respuesta[0]\n resolve(modulos) // devuelve los modulos encontrados en el find\n }\n })\n });\n}", "function buscar(arg){\n\tquery = \"SELECT * FROM tabla WHERE nombre LIKE '%\"+arg+\"%' OR apellido LIKE '%\"+arg+\"%'\";\n\tloadData(query);\n}", "function nombres(nombre, apellido) {\n if (apellido) {\n return \"nombre de usuario: \" + nombre;\n }\n else {\n return \"nombre de usuario: \" + nombre + \" \" + apellido;\n }\n}", "function buscarUsuarios(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n // al poner 2do argumento , no traigo el pass\n Usuario.find({}, 'nombre imagen ') // enviamos un obj vacio y buscamos por nombre email etc : es lo que quiero traer , es lo que va a mostrar \n .or([{ 'nombre': regex }, { 'email': regex }]) // en cambio aqui envio un array de condiciones para buscar, busco por email y nombre\n .exec((err, usuarios) => {\n\n if (err) {\n reject('error al cargar usuarios', err)\n } else {\n // usuarios ira como respuesta en el array respuesta[2]\n resolve(usuarios) // devuelve los usuarios encontrados en el find\n }\n })\n });\n}", "function rellenoBusqueda()\n{\tcampoId\t\t= this.id;\n\tcampoId\t\t= $('#'+campoId).attr('campo');\n\tcampoVal \t= this.title;\n\tprocesando(\"Buscando Informacions ...\");\n\ttabla\t= $(\"#tabla\").attr('value');\n\tcadena\t= \"sstm__tabla=\"+tabla+\"&campoId=\"+campoId+\"&campoVal=\"+campoVal;\n\t// Lanzo el Ajax para Insertar Registro\n\tajaxTablas\t= $.ajax({\n \turl: 'index.php?ctr=FormularioAcciones&acc=getId',\n \ttype: 'POST',\n \tasync: true,\n \tdata: cadena,\n\tsuccess: cargarConsulta\n\t}); // dataType: 'json',\n}", "static list_DiagnosticoTratameinto(req, res){ \n const { id_internacion } = req.params\n diagnostico_tratamientos.findAll({\n where: { id_internacion: id_internacion }\n }).then((data) => {\n res.status(200).json(data);\n }); \n }", "function busquedaPrincipalPorDefecto(){\n construirFiltros(\"HideDuplicateItems\", \"true\");\n buscarPorClave(\"Deporte\",12,1);\n search(\"Sports\",null,1,\"customerRating\",\"desc\",12);\n}", "static oneSalaNombre(req, res){\n var especialidad = req.params.especialidad;\n Salas.findAll({\n where: {nombre : especialidad}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((data) => {\n res.status(200).json(data);\n });\n }", "function peiticionLibro(title){\n title = title.replace(/\\s/g,\"+\");\n //console.log(title);\n request.get(`http://openlibrary.org/search.json?q=/${title}/`,(err,response,body) =>{\n //console.log(err);\n //console.log(response.statusCode);\n const json = JSON.parse(body);\n console.log(json.docs[0].title);\n console.log('Authors');\n json.docs[0].author_name.forEach(element => console.log(element));\n\n });\n }", "async function lookForPeople(phonebook, header, searchFields, searchFilter) {\n let noMatch = true; // ali je sploh katera oseba v imeniku najdena?\n phonebook.forEach(person => {\n // Preleti osebe v imeniku, in glede na izbrana iskalna polja in filtre isci in izpisuj\n let personPrint = \"\"; // String katerega sestavljamo za osebo, ce je bilo kaj najdeno\n let personMatch = false; // Ali se iskani niz pojavi pri osebi?\n for (var col in header) {\n let i = header[col]; // index stolpca \n if (searchFields.includes(col)) {\n // Uporabnik zeli iskati po tem polju\n\n // Spremeni v string in indeksiraj stringe\n person[i] = person[i].toString()\n let pos = 0;\n let oldPos = 0;\n let indices = [];\n // Isci po celem stringu kje se nahajajo pozicije\n while ((pos = person[i].indexOf(searchFilter, oldPos)) > -1) {\n indices.push(pos);\n oldPos = pos + searchFilter.length;\n }\n oldPos = 0;\n // Barvaj stringe, kjer so bile najdene pozicije\n for (let j=0; j<indices.length; j++) {\n personMatch = true;\n noMatch = false;\n // Pridobi substr od nepobarvanega dela\n personPrint += person[i].substr(oldPos, indices[j] - oldPos);\n // Pridobi del, ki ga je treba pobarvat\n personPrint += chalk.yellow(\n chalk.underline(\n chalk.bold(\n chalk.bgMagenta(\n person[i].substr(indices[j], searchFilter.length)\n ))));\n // Popravi staro pozicijo na zaden char zapisan v newPerson\n oldPos = indices[j] + searchFilter.length;\n }\n // V kolikor je za zadnjo najdeno pozicijo se kaj, dodaj v string (nepobarvano)\n if (oldPos < person[i].length) {\n personPrint += person[i].substr(oldPos, person[i].length - oldPos);\n }\n personPrint += \" \"\n } else {\n // Vseeno dodaj stolpec v string, v primeru da se isce po ostalih stolpcih\n personPrint += person[i] + \" \";\n }\n }\n if (personMatch) {\n // Izpisi trenuten personPrint kot zadetek (pobarvani deli vkljuceni)\n console.log(personPrint);\n }\n });\n // Obvesti ali je bil kdo najden\n let result = {\"noMatch\": noMatch};\n return result;\n}", "function buscarAdministrativo(regex){\n return new Promise((resolve,reject)=>{\n Administrativo.find({}, 'identificacion nombres apellidos correo telefono programa cargo estado rol')\n .or([ {'identificacion':regex}, {'nombres':regex}, {'apellidos':regex}, {'telefono':regex}, {'correo':regex}, {'cargo': regex}])\n .populate('rol programa').exec((err,usuarios)=>{\n if(err){\n reject('Error al cargar los usuarios',err);\n }else{\n resolve(usuarios);\n }\n });\n });\n}", "function find(){\r\nCustomer.find({dni:\"32111114-D\"}, (err, ret) => {\r\n\t\r\n\tif(err) {\r\n\t\tconsole.error(err);\r\n\t\t\r\n\t} else {\r\n\t\tconsole.log(\"Los dueños que coinciden con el criterio de busqueda son: \", ret);\r\n\t\tconsole.log(\"Todo correcto!!\");\r\n\t\t\r\n\t}\r\n\r\n});\r\n\r\n}", "function obt_medicines(queryData, funcion){\n\tconsole.log(\"Realiza funcion obtener medicinas...\");\n\tdb.medicines.find({ enable: '0' },{ medicine: '0', _id: 0 },function(err, data){\n\t\tvar m = [];\n\t\tfor(var i in data){\n\t\t\tm.push(data[i].medicine);\n\t\t}\n\t\tfuncion(err,m)\n\t});\n}", "function search() {\n let regex_no = `^${req.params.query}.*`;\n let regex_name = `${req.params.query}.*`;\n User.find( {$or: [{username: {$regex: regex_name, $options: 'i'} }, \n {phone_number: {$regex: regex_no, $options: 'i'} } ]}, (err, users) => {\n if (err) res.send(err); \n else {\n res.json(users); \n }\n });\n }", "function buscarAlumno(buscado) {\n var index = -1\n for (var i = 0; i < objectList.length; i++) {\n var buscadoUp = buscado.toUpperCase()\n var nombre = objectList[i].firstName.toUpperCase()\n var apellido = objectList[i].lastName.toUpperCase()\n if (nombre.indexOf(buscadoUp) != -1 || apellido.indexOf(buscadoUp) != -1) {\n index = i\n break\n }\n }\n return index\n}", "function SearchByAuthorPre(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE Author = \"'+word+'\";',func);\r\n}", "function buscador (documento,valor){ //documneto a ser buscado e o que buscar\n let teste\n db.collection(documento).get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n // console.log(`${doc.id} => ${doc.data().nome}=>${doc.data().endereço}=>${doc.data().observacao}`)\n if (valor == doc.id) {\n result.innerHTML = `<h3>fone:${doc.id} <br>nome: ${doc.data().nome}<br> endereço:${doc.data().endereço}<br>obs:${doc.data().observacao}</h3>`\n teste = 1\n } else {\n if (teste != 1) {\n result.innerHTML = `<h3>nada encontrado</h3>`\n }\n }\n\n })\n})}", "function buscarUsuario(busqueda, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find({}, 'nombre email role') // para que solo se muestre esos campos\n .or([{ 'nombre': regex }, { 'email': regex }])\n .exec((err, usuarios) => {\n if (err) {\n reject('error al cargar usuarios');\n\n } else {\n resolve(usuarios);\n }\n });\n\n });\n\n}", "function buscarAutor() {\n let autores = listados.getAutores();\n let pregunta = rl.question(\"Introduce el autor a buscar :\");\n\n if (autores.length > 0)\n for (let autor of autores) {\n if (pregunta === autor.nombre) {\n console.log(\"Nombre : \" + autor.nombre);\n console.log(\"Apellidos : \" + autor.apellidos + \"\\n\");\n }\n\n }\n else {\n console.log(\"No hay resultados\\n\");\n return;\n }\n}", "function getInfoDeDocumento(datos, rostro) {\n console.log('====================datos para analizar=====');\n console.log(datos);\n console.log('=============================================');\n\n //regresa false si no es el documento, regresa la info analizada si es el documento en cuestion\n let stsIne = ine.getInfoFromIne(datos, rostro);\n let stsCfe = cfe.getInfoFromCfe(datos, rostro);\n let stsTelmex = telmex.getInfoFromTelmx(datos, rostro);\n let stsAxtel = axtel.getInfoFromAxt(datos, rostro);\n let stsPassMx = passMx.getInfoFromPasspMX(datos, rostro);\n let stsFormMigrtMx = formMigrtMx.getInfoFromFormMigMX(datos, rostro);\n let stsDni = dni.getInfoFromDni(datos, rostro);\n // let stsLicDeCondCmdx = licDeCondCdmxs.getInfoFromLicDeCondCdmx(datos, rostro);\n\n if (stsIne != false) return stsIne;\n if (stsCfe != false) return stsCfe;\n if (stsTelmex != false) return stsTelmex;\n if (stsAxtel != false) return stsAxtel;\n if (stsPassMx != false) return stsPassMx;\n if (stsFormMigrtMx != false) return stsFormMigrtMx;\n if (stsDni != false) return stsDni;\n // if (stsLicDeCondCmdx != false) return stsLicDeCondCmdx;\n\n return getInfoFromUnkn(datos); //si ningun documento es reconocido se envia vacio\n}", "function buscar_por_temas(req, res) {\n var temas = req.params.temas\n var params = req.body\n LR.find({ temas: { $regex: temas, $options: 'i' } }, (err, encontrado) => {\n if (err) return res.status(500).save({ message: \"Error en la peticion de busqueda por temas\" });\n if (!encontrado) return res.status(404).save({ message: \"Lo que solicita no coincide con los criterios de busqueda\" })\n return res.status(200).send({ Se_encontro: encontrado })\n })\n}", "function mostrarEstAlumnosParaDocente(){\r\n let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno\r\n let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno\r\n let alumnoSeleccionado = document.querySelector(\"#selEstAlumnos\").value;\r\n let posicionUsuario = alumnoSeleccionado.charAt(1);\r\n let usuario = usuarios[posicionUsuario];\r\n let nivelAlumno = usuario.nivel;\r\n for (let i = 0; i < ejercicios.length; i++){\r\n const element = ejercicios[i].Docente.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n if(ejercicios[i].nivel === nivelAlumno){\r\n contadorEjXNivel ++;\r\n }\r\n }\r\n }\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuario.nombreUsuario){\r\n if(entregas[i].Ejercicio.nivel === nivelAlumno){\r\n contadorEntXNivel++;\r\n }\r\n }\r\n }\r\n document.querySelector(\"#pMostrarEstAlumnos\").innerHTML = `El alumno ${usuario.nombre} tiene ${contadorEjXNivel} ejercicios planteados para su nivel (${nivelAlumno}) sobre los cuales a realizado ${contadorEntXNivel} entrega/s. `;\r\n}", "function getNames(passwordentered, ligue) {\n\n // Use data from spreadsheet. Enter spreadsheet I here\n var ss = SpreadsheetApp.openById(CONTACTS_SS);\n \n var SHEETNAME = CONTACTS_SHEET1;\n if (ligue == \"Ligue de double\") SHEETNAME = CONTACTS_SHEET2;\n var sheet = ss.getSheetByName(SHEETNAME);\n\n var data = sheet.getRange(3,1,sheet.getLastRow()-1,6).getValues();\n\n // http://stackoverflow.com/questions/6490343/sorting-2-dimensional-javascript-array NOTE: [x] is column to sort on\n // Sort standard\n // data.sort(function(a, b) { return ( a[0] < b[0] ? -1 : (a[0] > b[0] ? 1 : 0)); });\n\n // Sort colonne 4 inverse, ensuite colonne 0 \n data.sort( function(a,b) { return ( a[4] == b[4] ? ( a[0] < b[0] ? -1 \n : (a[0] > b[0] ? 1 \n : 0) ) \n : (a[4] > b[4] ? -1 \n : 1 ) ); });\n\n // Get id and name in arrays (column A = ID, column B = name)\n var record = {};\n var list = [];\n var j = 0;\n for (var i = 0; i < data.length; i++) {\n\n if (data[i][1].substr(0,1) != \" \") {\n record = {name: data[i][0], tel: data[i][1], cell: data[i][2], email: data[i][3], categ: data[i][4], niveau: data[i][5]};\n list[j] = record;\n j++;\n }\n }\n\n // Get password from spreadsheet and verify if it is correct\n // NOTE: password must be in cell B1 \n var passwordinfile = sheet.getRange(\"B1:B1\").getValue(); \n \n if (passwordentered == passwordinfile) {\n return list;\n } else {\n return null;\n }\n \n}", "function buscar_palabras_clave(req, res) {\n var params = req.body\n var palabras = req.params.palabrasClave\n\n LR.find({ palabras_clave: { $regex: palabras, $options: \"i\" } }, (err, encontrado) => {\n if (err) return res.status(500).save({ message: \"Error en la peticion de busqueda por palabras clave\" });\n if (!encontrado) return res.status(404).save({ message: \"Lo que solicita no coincide con los criterios de busqueda\" })\n return res.status(200).send({ Se_encontro: encontrado })\n })\n}", "function searchAll(req, res) {\n\n var busqueda = req.params.search;\n //expresión regular para que la busqueda sea insensible a mayusculas y minusculas\n var regex = new RegExp(busqueda, 'i');\n\n // promesa para buscar simultaneamente en diferentes partes de la BD\n Promise.all( [ \n buscarSdrs(busqueda, regex), \n buscarUsuarios(busqueda, regex) ])\n .then( respuestas => {\n res.status(200).json({ \n sdrs: respuestas[0],\n users: respuestas[1]\n });\n });\n\n \n}", "function buscarUsuarios(termino, regex) {\n\n return new Promise((resolve, reject) => {\n\n Usuario.find()\n // .or - para buscar en dos propiedades de la misma coleccion\n .or([ { 'nombre' : regex }, { 'email' : regex } ])\n .exec((error, usuariosEncontrados) => {\n\n if(error) {\n reject('Error al cargar los usuarios', error);\n } else {\n resolve(usuariosEncontrados);\n }\n\n });\n });\n }", "function getListas(req, res){\n var claseId = req.params.clase;\n \n if(!claseId){\n //Sacar todos las listas de la BD\n var find = Lista.find({}).sort('nro_lista');\n }else{\n //Sacar las lista de una clase en concreto de la BD\n var find = Lista.find({clase: claseId}).sort('anio'); \n }\n \n find.populate({path: 'clase'}).exec((err, lista) => {\n if(err){\n res.status(500).send({message: 'Error en la peticion'});\n }else{\n if(!lista){\n res.status(404).send({message: 'No hay listas'});\n }else{\n res.status(200).send({lista});\n }\n }\n });\n }", "function getDoctors(data,callback){\n MongoClient.connect(uri, function (err, db) {\n assert.equal(null, err);\n var conditions;\n if(data === \"all\"){\n conditions = null;\n }else {\n conditions = {\n $text: {\n $search: data,\n $language: \"en\",\n $caseSensitive: false,\n $diacriticSensitive: false\n }\n };\n }\n db.collection('doctors').find(conditions).toArray(function(err, docs){\n assert.equal(null, err);\n callback(docs);\n db.close();\n });\n\n });\n}", "function search() {\n // get input blank content\n var wid = $(\"#head-buttons\").children(\"input\").eq(0).val();\n var name = $(\"#head-buttons\").children(\"input\").eq(1).val();\n\n // if nothing in blank, return\n if (wid === \"\" && name === \"\") {\n alert(\"未输入查询内容!\");\n return;\n }\n // declare object array, wid array, name array\n var arr = $(\"tbody\").children();\n var idArr = new Array();\n var nameArr = new Array();\n\n // iterate thru all data and get name and id array\n for (var i = 0; i < arr.length; i++) {\n idArr[i] = $(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(1).text();\n nameArr[i] = $(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(2).text();\n }\n\n if (wid !== \"\" && name === \"\") {\n // search by wid\n for (var i = 0; i < arr.length; i++) {\n if (idArr[i] == wid) {\n alert(`查询结果:\n 工号:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(1).text()}\n 姓名:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(2).text()}\n 性别:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(3).text()}\n 密码:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(4).text()}\n 年龄:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(5).text()}\n 出生日期:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(6).text()}\n `);\n return;\n } \n }\n alert(\"查询失败:未找到该结果\");\n } else if (wid === \"\" && name !== \"\") {\n // search by name\n for (var i = 0; i < arr.length; i++) {\n if (nameArr[i] == name) {\n alert(`查询结果:\n 工号:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(1).text()}\n 姓名:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(2).text()}\n 性别:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(3).text()}\n 密码:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(4).text()}\n 年龄:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(5).text()}\n 出生日期:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(6).text()}\n `);\n return;\n } \n }\n alert(\"查询失败:未找到该结果\");\n } else {\n // search by both wid and name\n for (var i = 0; i < arr.length; i++) {\n if (idArr[i] == wid && nameArr[i] == name) {\n alert(`查询结果:\n 工号:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(1).text()}\n 姓名:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(2).text()}\n 性别:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(3).text()}\n 密码:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(4).text()}\n 年龄:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(5).text()}\n 出生日期:${$(\"tbody\").children(\"tr\").eq(i).children(\"td\").eq(6).text()}\n `);\n return;\n } \n }\n alert(\"查询失败:未找到该结果\");\n }\n}", "function buscarNombreOEti(pData) {\n //Si hay productos con ese nombre, los trae\n if (pData.data.length > 0) {\n crearListadoProductos(pData);\n //Si no encontró por nombre, busca por etiquetas\n } else {\n filtrarProductosXEtiqueta();\n }\n}", "getPersonasPorSala(sala) {\n\n }", "authorLookupSurname() {\n this.fieldsChanged();\n const itemAuthorSurname = sanitize($(\"#item_author_surname\").val());\n if (itemAuthorSurname.length > 3) {\n const pos = itemAuthorSurname.length;\n $.getJSON(\"/author_search/?\" + $.param({ \"first_name\": \"\", \"surname\": itemAuthorSurname }), function (data) {\n const x = data[\"authors\"][0];\n if (x) {\n const author = new Author(x[\"id\"], x[\"first_name\"], x[\"surname\"], x[\"date_birth\"], x[\"date_death\"]);\n $(\"#item_author_id\").val(x.id);\n $(\"#item_author_first_name\").val(x.first_name);\n $(\"#item_author_surname\").val(x.surname);\n $(\"#item_author_surname\").caretTo(pos);\n }\n })\n .fail(function () {\n alert(\"Problem in author lookup\");\n });\n }\n }", "function buscar() {\r\n var nombreBuscar = document.getElementById('buscar').value;\r\n //Buscar en tabla de Mujeres\r\n db.collection(\"AlumnosMujeres\").where(\"nombre\", \"==\", nombreBuscar)\r\n .get()\r\n .then(function (querySnapshot) {\r\n querySnapshot.forEach(function (doc) {\r\n // doc.data() is never undefined for query doc snapshots\r\n console.log(doc.id, \" => \", doc.data());\r\n // alert(\"Nombre: \"+doc.data().nombre+\", Edad: \"+doc.data().edad+\", Sexo: \"+doc.data().sexo+\", Promedio: \"+doc.data().promedio);\r\n tablaMujeres.innerHTML = `\r\n <tr>\r\n \r\n <th scope=\"col\">${doc.data().matricula}</th>\r\n <td>${doc.data().nombre}</td>\r\n <td>${doc.data().edad}</td>\r\n <td>${doc.data().sexo}</td>\r\n <td>${doc.data().promedio}</td>\r\n <td><button class=\"btn btn-danger\" onclick=\"eliminarMujeres('${doc.id}')\"><span><i class=\"fas fa-trash-alt\"></i></span></button></td>\r\n <td><button class=\"btn btn-warning\" onclick=\"modificarMujeres('${doc.id}','${doc.data().matricula}','${doc.data().nombre}','${doc.data().edad}','${doc.data().promedio}')\"><span><i class=\"fas fa-edit\"></i></span></button></td>\r\n </tr>\r\n `\r\n });\r\n })\r\n .catch(function (error) {\r\n alert(\"Error el dato no existe: \", error);\r\n });\r\n\r\n //Buscar por matricula Mujeres\r\n db.collection(\"AlumnosMujeres\").where(\"matricula\", \"==\", nombreBuscar)\r\n .get()\r\n .then(function (querySnapshot) {\r\n querySnapshot.forEach(function (doc) {\r\n // doc.data() is never undefined for query doc snapshots\r\n console.log(doc.id, \" => \", doc.data());\r\n // alert(\"Nombre: \"+doc.data().nombre+\", Edad: \"+doc.data().edad+\", Sexo: \"+doc.data().sexo+\", Promedio: \"+doc.data().promedio);\r\n tablaMujeres.innerHTML = `\r\n <tr>\r\n <th scope=\"col\">${doc.data().matricula}</th>\r\n <td>${doc.data().nombre}</td>\r\n <td>${doc.data().edad}</td>\r\n <td>${doc.data().sexo}</td>\r\n <td>${doc.data().promedio}</td>\r\n <td><button class=\"btn btn-danger\" onclick=\"eliminarHombres('${doc.id}')\"><span><i class=\"fas fa-trash-alt\"></i></span></button></td>\r\n <td><button class=\"btn btn-warning\" onclick=\"modificarHombres('${doc.id}','${doc.data().matricula}','${doc.data().nombre}','${doc.data().edad}','${doc.data().promedio}')\"><span><i class=\"fas fa-edit\"></i></span></button></td>\r\n </tr>\r\n `\r\n });\r\n })\r\n .catch(function (error) {\r\n console.log(\"El dato no existe\");\r\n alert(\"Error el dato no existe \", error);\r\n });\r\n\r\n //Buscar por nombre En tabla de hombres\r\n db.collection(\"AlumnosHombres\").where(\"nombre\", \"==\", nombreBuscar)\r\n .get()\r\n .then(function (querySnapshot) {\r\n querySnapshot.forEach(function (doc) {\r\n // doc.data() is never undefined for query doc snapshots\r\n console.log(doc.id, \" => \", doc.data());\r\n // alert(\"Nombre: \"+doc.data().nombre+\", Edad: \"+doc.data().edad+\", Sexo: \"+doc.data().sexo+\", Promedio: \"+doc.data().promedio);\r\n tablaHombres.innerHTML = `\r\n <tr>\r\n <th scope=\"col\">${doc.data().matricula}</th>\r\n <td>${doc.data().nombre}</td>\r\n <td>${doc.data().edad}</td>\r\n <td>${doc.data().sexo}</td>\r\n <td>${doc.data().promedio}</td>\r\n <td><button class=\"btn btn-danger\" onclick=\"eliminarHombres('${doc.id}')\"><span><i class=\"fas fa-trash-alt\"></i></span></button></td>\r\n <td><button class=\"btn btn-warning\" onclick=\"modificarHombres('${doc.id}','${doc.data().matricula}','${doc.data().nombre}','${doc.data().edad}','${doc.data().promedio}')\"><span><i class=\"fas fa-edit\"></i></span></button></td>\r\n </tr>\r\n `\r\n });\r\n })\r\n .catch(function (error) {\r\n console.log(\"El dato no existe\");\r\n alert(\"Error el dato no existe \", error);\r\n });\r\n\r\n //Buscar por matricula en tabla de Hombres\r\n db.collection(\"AlumnosHombres\").where(\"matricula\", \"==\", nombreBuscar)\r\n .get()\r\n .then(function (querySnapshot) {\r\n querySnapshot.forEach(function (doc) {\r\n // doc.data() is never undefined for query doc snapshots\r\n console.log(doc.id, \" => \", doc.data());\r\n // alert(\"Nombre: \"+doc.data().nombre+\", Edad: \"+doc.data().edad+\", Sexo: \"+doc.data().sexo+\", Promedio: \"+doc.data().promedio);\r\n tablaHombres.innerHTML = `\r\n <tr>\r\n <th scope=\"col\">${doc.data().matricula}</th>\r\n <td>${doc.data().nombre}</td>\r\n <td>${doc.data().edad}</td>\r\n <td>${doc.data().sexo}</td>\r\n <td>${doc.data().promedio}</td>\r\n <td><button class=\"btn btn-danger\" onclick=\"eliminarHombres('${doc.id}')\"><span><i class=\"fas fa-trash-alt\"></i></span></button></td>\r\n <td><button class=\"btn btn-warning\" onclick=\"modificarHombres('${doc.id}','${doc.data().matricula}','${doc.data().nombre}','${doc.data().edad}','${doc.data().promedio}')\"><span><i class=\"fas fa-edit\"></i></span></button></td>\r\n </tr>\r\n `\r\n });\r\n })\r\n .catch(function (error) {\r\n console.log(\"El dato no existe\");\r\n alert(\"Error el dato no existe \", error);\r\n });\r\n}", "function ConsultaItems(tx) {\n\t\ttx.executeSql('select id_empresa,nom_empresa from publicempresa order by nom_empresa', [], ConsultaItemsCarga,errorCB);\n}", "function searchMedicos(toSearch, regex) {\n return new Promise((resolve, reject) => {\n Medico.find({ name: regex })\n .populate('user', 'name surname email')\n .populate('hospital')\n .exec((err, medicos) => {\n if (err) {\n reject('Error al buscar medicos errors: ', err);\n } else {\n resolve(medicos);\n }\n });\n });\n }", "busqueda(termino, parametro) {\n // preparacion de variables //\n // ------ Uso de la funcion to lower case [a minusculas] para evitar confuciones en el proceso\n // ------/------ La busqueda distingue mayusculas de minusculas //\n termino = termino.toLowerCase();\n parametro = parametro.toLowerCase();\n // variable busqueda en la que se almacenara el dato de los usuarios que se buscara //\n var busqueda;\n // [Test] variable conteo para registar el numero de Usuarios que coinciden con la busqueda //\n var conteo = +0;\n // Se vacia el conjunto de objetos [users] para posteriormente rellenarlos con los usuarios que coincidan con la busqueda //\n this.users = [], [];\n // [forEach] = da un recorrido por los objetos de un conjunto en este caso, selecciona cada usuario del conjunto \"usuarios\" //\n this.usuarios.forEach(item => {\n // Bifurcador de Seleccion [switch] para detectar en que dato del usuario hacer la comparacion de busqueda //\n switch (parametro) {\n //------En caso de que se ingrese la opcion por defecto, es decir, no se haya tocado el menu de selecicon\n case 'null':\n {\n // Se hace un llamado a la funcion \"getUsers\" que carga los usuarios almacenados en el servidor //\n this.getUsers();\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Nombre\n case 'nombre':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion apellido\n case 'apellido':\n {\n console.log('entro en apellido...');\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.apellido.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion apellido: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cedula\n case 'cedula':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cedula.replace('-', '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion cedula: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion cuenta\n case 'cuenta':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n //------ En caso de que se ingrese la opcion Buscar en Todo\n case 'todo':\n {\n // Se asigna a la variable \"busqueda\" el resultado del dato establecido dentro del objeto de \"usuarios\" ajustado a la forma optima para la busqueda //\n //------ Se realiza un replace para borrar los espacios y un toLowerCase para convertir los datos en minusculas //\n busqueda = item.nombre.replace(/ /g, '').toLowerCase() + item.apellido.replace(/ /g, '').toLowerCase() + item.cedula.replace('-', '').toLowerCase() + item.cuenta.replace(/ /g, '').toLowerCase();\n // Bifurcador para determinar que la variable \"busqueda\" contenga una o varias partes del termino a buscar //\n if (busqueda.indexOf(termino, 0) >= 0) {\n // En caso de que encuentre coincidencias dentro del conjunto de objetos, el objeto completo se almacena devuelta en la variable \"users\" //\n this.users.push(item);\n // [Test] aumento de 1 en la variable conteo para saber cuantos objetos coincidieron con la busqueda //\n conteo = conteo + 1;\n // [Test] impresion en la consola de los resultados de la comparacion de busqueda //\n console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n }\n // Se termina la Ejecucion del bifurcador Switch //\n break;\n }\n ;\n }\n // if (parametro == 'null') {\n // console.log('dentro de null');\n // this.getUsers();\n // this.test = 'Ingrese un Campo de busqueda!!..';\n // }\n // if (parametro == 'nombre') {\n // // preparacion de variables:\n // busqueda = item.nombre.replace(/ /g, '').toLowerCase();\n // if (busqueda.indexOf(termino, 0) >= 0) {\n // this.users.push(item);\n // conteo = conteo +1;\n // console.log('<br> comprobacion nombre: ' + busqueda + ', termino: ' + termino);\n // }\n // }\n // if (parametro == 'apellido') {\n // console.log('dentro de apellido');\n // }\n // if (parametro == 'cedula') {\n // console.log('dentro de cedula');\n // }\n // if (parametro == 'cuenta') {\n // console.log('dentro de cuenta');\n // }\n // if (parametro == 'todo') {\n // console.log('dentro de todo');\n // }\n });\n if (this.users.length >= 1) {\n console.log('existe algo.... Numero de Registros: ' + conteo);\n return;\n }\n else if (this.users.length <= 0) {\n this.getUsers();\n }\n }", "function SearchByPublisherPre(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE ID IN (SELECT ID FROM books_detail WHERE Publisher = \"'+word+'\");',func);\r\n}", "function buscarHospitales(regex){\n return new Promise((resolve,reject)=>{\n Hospital.find({ nombre: regex }).populate('usuario','nombre apellido').exec((err,hospitales)=>{\n if(err){\n reject('Error al cargar hospitales',err);\n }else{\n resolve(hospitales);\n }\n });\n });\n}", "readAll() {\n var objectStore = db.transaction('person').objectStore('person');\n\n objectStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n\n if (cursor) {\n console.log('Id: ' + cursor.key);\n console.log('Name: ' + cursor.value.name);\n console.log('Age: ' + cursor.value.age);\n console.log('Email: ' + cursor.value.email);\n cursor.continue();\n } else {\n console.log('No hay más datos');\n }\n };\n }", "function loadAll() {\n var cidades = eurecaECBrasil.filtrarCidadeTextoService();\n return cidades.split(/, +/g).map( function (cidade) {\n return {\n value: cidade.toLowerCase(),\n display: cidade\n }; \n });\n }", "function obtenerEmpresas(req, res) {\n Empresa.find((err, empresasEncontradas) => {\n if (err) {\n return res.status(500).send({ ok: false, message: 'Hubo un error en la petición.' });\n }\n\n if (!empresasEncontradas) {\n return res.status(404).send({ ok: false, message: 'Error en la consulta o no existen datos.' })\n }\n\n return res.status(200).send({ ok: true, empresasEncontradas });\n });\n}", "async function getPreguntasByKey(req, res) {\n try {\n // validamos que lo que se ha escrito es correcto\n const { key } = req.params;\n const schema = Joi.string();\n await schema.validateAsync(key);\n const key2 = '%'+key+'%';\n \n const [clave] = await database.pool.query('SELECT * FROM preguntas WHERE titulo like ? or cuerpo like ?',[key2,key2]);\n \n if (!clave || !clave.length) {\n // devolvemos 404 Not Found si no lo encontramos en la en base de datos.\n res.status(404);\n\n return res.send({ error: 'la busqueda no produjo ningun resultado' });\n }\n \n return res.send(clave);\n\n } catch (err) {\n // enviamos el error al cliente\n res.status(400);\n res.send({ error: err.message });\n }\n}", "function cargarDirectores(req, res) {\n var peticionsql = 'SELECT * FROM director';\n \n conexionBaseDeDatos.query( peticionsql, function(error, resultado, campos) {\n if(error) {\n console.log('Hubo un error en la consulta', error.message);\n return res.status(500).send('Hubo un error en la consulta');\n };\n res.status(200).send(JSON.stringify(resultado));\n })\n}", "static async search(name) {\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n middle_name AS \"middleName\",\n last_name AS \"lastName\", \n phone, \n notes \n FROM customers\n WHERE UPPER(first_name) = $1 OR UPPER(middle_name) = $1 OR UPPER(last_name) = $1`,\n [name.toUpperCase()]\n );\n return results.rows.map(c => new Customer(c));\n }", "function validarform() {\r\n var x = document.forms[\"buscarform\"][\"search\"].value;\r\n\r\n if (x !== \"\") {\r\n //NO SIRVEEEEEE\r\n let search = db.collection(\"cursos\").where(\"cursoNombre\", \"==\", x)\r\n console.log(search.get());\r\n search.get().then(function(querySnapshot) {\r\n querySnapshot.forEach(function(doc) {\r\n container.innerHTML += `\r\n <div class='four columns content-box'>\r\n <div class='card'>\r\n <img src='${doc.data().cursoImagen}' class='imagen-curso u-full-width' id='img-curso'>\r\n <div class='info-card'>\r\n <div class='card-styles'>\r\n <h4 id='nombre-curso'>${doc.data().cursoNombre}</h4>\r\n <p class='autor-curso'>${doc.data().cursoAutor}</p>\r\n <p class='estrellas-curso' id='calificacion-curso'><span>${doc.data().cursoCalificacion} </span> Estrellas</p>\r\n <p class='precio' id='precio-curso'>$${doc.data().cursoValor} <span class='u-pull-right'>$15</span></p>\r\n </div>\r\n <a href='#' class='u-full-width button-primary button input agregar-carrito' data-id='${doc.id}'>Agregar Al Carrito</a>\r\n </div>\r\n </div>\r\n </div>`;\r\n });\r\n })\r\n .catch(function(error) {\r\n console.log(\"Error getting documents: \", error);\r\n });\r\n\r\n return false;\r\n }else{\r\n \r\n return false;\r\n }\r\n}", "function listar(ok,error){\n console.log(\"Funcionlistar DAO\")\n helper.query(sql,\"Maestro.SP_SEL_ENTIDAD_FINANCIERA\",[],ok,error)\n}", "function searchNames() {\r\n\r\n Word.run(function (context) {\r\n\r\n // Mettez en file d'attente une commande pour obtenir la selection actuelle, puis\r\n // creez un objet de plage proxy avec les resultats.\r\n var body = context.document.body;\r\n context.load(body, 'text');\r\n\r\n // Empties the politicians already found since we \"relaunch\" the search.\r\n alreadyFoundPoliticians = {};\r\n\r\n $('#politicians').empty(); // Empties all the content of the panel.\r\n\r\n return context.sync().then(function () {\r\n\r\n var wholeText = body.text; // Get the whole text of the body as a String\r\n\r\n // Launch the search\r\n inspectText(wholeText, context);\r\n\r\n }).then(context.sync);\r\n })\r\n .catch(errorHandler);\r\n\r\n }", "function retorna_documento(){\n\n\t$('#documento_nome').val(\"\");\n\t$('.so').val(\"\");\n\n\t$.post('retorna_documentos.php',{documento_id:$('#documento_id').val()}).done(function(data){\n\n\t\tdata = JSON.parse(data);\n\t\t\n\n\t\t$('#documento_nome').val(data.documento_nome);\n\n\t\t$('.diretorio_documentos').each(function(chave,valor){\t\n\n\t\t//console.log(valor);\t\t\n\n\t\tfor(i=0; i< data.so.length; i++){\n\n\t\t\tif($(this).find('input').attr('data-id') == data.so[i].diretorio_id_sistema_operacional){\n\n\t\t\t\tconsole.log(data.so[i]);\n\n\t\t\t\t$(this).find('input').val(data.so[i].diretorio_documentos);\n\n\n\n\t\t\t}\n\t\t}\t\n\t})\n\t})\n}", "function consultarglobal(tbl,id,num = false,buscar=\"none\"){\n//tbl el nombre de la tabla que se tomara, id 1 si quiere mostrar el id en la consulta 0 si no quiere mostrarlo en la consulta.\nconsole.log(\"ACA no hay nada\");\ndocument.getElementById(\"datos\").innerHTML = \" \";\nvar db;\nif(tbl==\"paquete\"){\n db = firebase.database().ref(\"Productos\");\n}else{\n console.log(\"algo aunksea3\");\n if(tbl==\"Foto\"){\n console.log(\"algo aunksea2\");\n db = firebase.database().ref(\"Ventas\"); \n //console.log(\"algo aunksea22\");\n }else{\n db = firebase.database().ref(tbl); //se crea instancia de la base datos centrandonos en usuarios\n }\n \n}\nif(buscar!=\"none\" && obtener(\"criterio\").length > 0){\n db = db.orderByChild(buscar).equalTo(obtener(\"criterio\"));\n}\n\ndb.once(\"value\",function(snap){ //se consulta usando .once y crendo funcion snap\n var aux = snap.val(); //se crea un auxiliar que tomara los datos de ese snap\n var tabla = \"\"; //se crea la variable donde se guardara la tabla entera\n var tmp,tmpax;\n var cont=0;\n for(var documento in aux){ //se hace un for por cada id dentro de usuarios osea por cada usuario\n console.log(\"--\"+documento);\n if(tbl==\"paquete\"){\n if(documento.substring(0,4)==\"Paqu\"){\n cont++;\n tmp =Object.values(aux[documento]); \n tmpax = tmp;\n if(id){\n tmpax.push(documento);\n }\n for(var i=0;i<tmpax.length;i++){//para reordenar las cosas\n if(id){\n if(i==0){\n tmp[0]=documento;\n }else{\n tmp[i]=tmpax[i-1];\n }\n }else{\n tmp[i]=tmpax[i];\n }\n }\n console.log(tmp);\n\n if(num){\n tabla += filltablav2(tmp,1,documento,tbl,cont);\n }else{\n tabla += filltablav2(tmp,1,documento,tbl);\n }\n }\n }else{\n \n if(tbl==\"Foto\"){\n console.log(\"algo aunksea\");\n if(documento.substring(0,4)==\"Foto\"){\n cont++;\n tmp =Object.values(aux[documento]); \n tmpax = tmp;\n if(id){\n tmpax.push(documento);\n }\n for(var i=0;i<tmpax.length;i++){//para reordenar las cosas\n if(id){\n if(i==0){\n tmp[0]=documento;\n }else{\n tmp[i]=tmpax[i-1];\n }\n }else{\n tmp[i]=tmpax[i];\n }\n }\n console.log(tmp);\n /* tabla+= filltabla(documento,aux[documento].Nombre, //a la variable tabla se agregara cada vez el id (Documento) seguido de sus demas elementos de cada id (usuario) existente en Usuarios\n aux[documento].pass,aux[documento].tipo);*/\n if(num){\n tabla += filltablav2(tmp,1,documento,tbl,cont);\n }else{\n tabla += filltablav2(tmp,1,documento,tbl);\n }\n }\n }else if(tbl==\"Productos\"){\n if(documento.substring(0,4)==\"Prod\"){\n cont++;\n tmp =Object.values(aux[documento]); \n tmpax = tmp;\n if(id){\n tmpax.push(documento);\n }\n for(var i=0;i<tmpax.length;i++){//para reordenar las cosas\n if(id){\n if(i==0){\n tmp[0]=documento;\n }else{\n tmp[i]=tmpax[i-1];\n }\n }else{\n tmp[i]=tmpax[i];\n }\n }\n console.log(tmp);\n\n if(num){\n tabla += filltablav2(tmp,1,documento,tbl,cont);\n }else{\n tabla += filltablav2(tmp,1,documento,tbl);\n }\n }\n }else if(tbl==\"Ventas\"){\n if(documento.substring(0,4)==\"Vent\"){\n cont++;\n tmp =Object.values(aux[documento]); \n tmpax = tmp;\n if(id){\n tmpax.push(documento);\n }\n for(var i=0;i<tmpax.length;i++){//para reordenar las cosas\n if(id){\n if(i==0){\n tmp[0]=documento;\n }else{\n tmp[i]=tmpax[i-1];\n }\n }else{\n tmp[i]=tmpax[i];\n }\n }\n console.log(tmp);\n\n if(num){\n tabla += filltablav2(tmp,1,documento,tbl,cont);\n }else{\n tabla += filltablav2(tmp,1,documento,tbl);\n }\n }\n }else{\n cont++;\n tmp =Object.values(aux[documento]); \n tmpax = tmp;\n if(id){\n tmpax.push(documento);\n }\n for(var i=0;i<tmpax.length;i++){//para reordenar las cosas\n if(id){\n if(i==0){\n tmp[0]=documento;\n }else{\n tmp[i]=tmpax[i-1];\n }\n }else{\n tmp[i]=tmpax[i];\n }\n }\n console.log(tmp);\n /* tabla+= filltabla(documento,aux[documento].Nombre, //a la variable tabla se agregara cada vez el id (Documento) seguido de sus demas elementos de cada id (usuario) existente en Usuarios\n aux[documento].pass,aux[documento].tipo);*/\n if(num){\n tabla += filltablav2(tmp,1,documento,tbl,cont);\n }else{\n tabla += filltablav2(tmp,1,documento,tbl);\n }\n }\n \n\n } \n }\n fillparte(\"datos\",tabla);//finalmente se inserta en el html con la funcion creada\n});\n}", "function filterBiblio() {\n let texto = document.querySelector(\"#textBuscar\");\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.titulo.indexOf(texto.value.charAt(0).toUpperCase() + texto.value.toLowerCase().slice(1)) > -1;\n });\n texto.value=\"\"\n texto.focus()\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n}", "getIngredientByName(req, res) {\n if (req.query.nom) {\n const nom = req.query.nom;\n if (nom.length < 3) {\n const message = `le terme rechecher doit contenir au moin 3 caractère`;\n return res.status(400).json({ message });\n }\n return Ingredients.findAndCountAll({\n where: {\n nom: {\n [Op.like]: `%${nom}%`,\n },\n },\n order: [\"nom\"],\n include: \"Timers\",\n }).then(({ count, rows }) => {\n const message = `il a ${count} correspondant au terme de recherche ${nom}`;\n res.json({ message, data: rows });\n });\n } else {\n Ingredients.findAll({ order: [\"nom\"] })\n .then((ingredients) => {\n const message = `Ok !!!!`;\n res.json({ message, data: ingredients });\n })\n .catch((error) => {\n const message = `La liste des ingrédients n'a pas pu être récupéré`;\n res.status(500).json({ message, data: error });\n });\n }\n }", "function searchCollection( req, res) {\n var busqueda = req.params.search;\n var tabla = req.params.table;\n var regex = new RegExp(busqueda, 'i');\n\n var promesa;\n\n switch ( tabla ){\n \n case 'users':\n promesa = buscarUsuarios(busqueda, regex);\n break;\n\n case 'sdrs':\n promesa = buscarSdrs(busqueda, regex);\n break;\n\n default:\n return res.status(400).json({\n mensaje: 'Los tipos de busqueda sólo son: usuarios y sdrs',\n error: { message: 'Tipo de tabla/colección no válido'}\n });\n }\n\n promesa.then( data => {\n res.status(200).json({\n [tabla]: data\n });\n });\n}", "function obtenerPersonas(res){\n var personas = [];\n tb_persona.connection.query('SELECT * FROM persona', function(err, rows){\n if(err) throw err;\n rows.forEach(function(result){\n personas.push(result);\n });\n res.send(personas);\n });\n}", "function collect() {\n let docs = {};\n\n for (let ta of $$('.doc textarea')) {\n let [k, num] = ta.id.split('_');\n let val = ta.value.trim();\n\n if (!docs[num])\n docs[num] = {\n \"cont\": \"\",\n \"date\": \"\",\n \"int\": \"\",\n \"num\": num,\n \"pet\": \"\",\n \"place\": \"\",\n \"text\": \"\"\n };\n if (k === 'pet' || k === 'int')\n val = val.split('\\n').map(x => x.trim()).filter(Boolean).sort();\n docs[num][k] = val;\n }\n\n return Object.keys(docs).sort((x, y) => x - y).map(num => docs[num]);\n}", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "find(req,res){\n let id = req.params.id;\n parroquias.findAll({\n attributes: ['cod_par', 'nom_par', 'coo_par'],\n where: {\n cod_mun: id\n }\n }).then(result => {\n if (result.length > 0) {\n res.status(200).json({\n sucess: true,\n messages: 'Consulta Correcta',\n errors: null,\n data: result\n });\n } else {\n res.status(200).json({\n sucess: false,\n messages: 'Sin parroquias',\n errors: null,\n data: result\n });\n }\n });\n }", "function nombreApellido(nombre, apellido){\n console.log(nombre + \" \" + apellido);\n}", "function ordenar(as){\n\tvar indexedDB=window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n\tvar openRequest = indexedDB.open(\"DBLibros\", version-1);\n\tvar data=[];\n\topenRequest.onsuccess = function(e) {\n\t\tvar transaction = e.target.result.transaction(['libros'], \"readwrite\");\n\t\tvar store = transaction.objectStore('libros');\n\t\tvar request = store.openCursor();\n\t\trequest.onsuccess = function (event) {\n \t\tvar cursor = event.target.result;\n \t\tif (cursor) {\n\t\t\t\t//guardo la info de DB a l'array data.\n \t\t data.push(cursor.value);\n \t\t cursor.continue();\n \t\t} else {\n\t\t\t\t//aqui miro si as, que es la info del comboBox, es titol o num i ordenarlo segons sigui un o l'altre.\n\t\t\t\tif(as==\"titulo\"){\n\t\t\t\t\tif(aa==0){//si es igual a 0, ascendent.\n\t\t\t\t\t\tdata.sort(function(a,b){//funcio sencilla per comparar camps d'objectes, el sort s'ocupa de fer el bucle per ordenarlo.\n\t\t\t\t\t\t\tif (a.titulo < b.titulo){\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (a.titulo > b.titulo){\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\taa=1;//si s'ha fet ascendent la proxima vegada es fa descendent.\n\t\t\t\t\t}else{//sino ordena descendent.\n\t\t\t\t\t\tdata.sort(function(b,a){//repetició, es podria fer la function per separat per evitarlo...\n\t\t\t\t\t\t\tif (a.titulo < b.titulo){\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (a.titulo > b.titulo){\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\taa=0;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(aa==0){//igual que abans per ordenat per numero...\n\t\t\t\t\t\tdata.sort(function(a,b){\n\t\t\t\t\t\t\tif (a.num < b.num){\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (a.num > b.num){\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\taa=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdata.sort(function(b,a){\n\t\t\t\t\t\t\tif (a.num < b.num){\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (a.num > b.num){\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t});\n\t\t\t\t\t\taa=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar html=\"\";\n\t\t\t\tfor(var i=0;i<data.length;i++){\n\n\t\t\t\t\thtml+=\"<div class=\\\"tablaI\\\"><div class=\\\"indexI\\\">\"+data[i].num+\n\t\t\t\t\t\"</div><div class=\\\"imagenI\\\"><img src=\\\"\" +\n \t\t\t\tdata[i].img +\n \t\t\t\t\"\\\"\\/></div><div class=\\\"tituloI\\\">\" +\n \t\t\t\tdata[i].titulo +\n\t\t\t\t\t\"</div><div class=\\\"autorI\\\">\" +\n \t\t\t\tdata[i].autor +\n \t\t\t\t\"</div><div class=\\\"descipcionI\\\">\" +\n \t\t\t\tdata[i].desc +\n \t\t\t\t\"</div></div>\";\n\n\t\t\t\t}\n\n\t\t\t\tdocument.getElementById(\"DataBase\").innerHTML=html;\n\n\t\t\t}\n\t\t};\n\t};\n}", "function obtenerClientes() {\n\t\tconst conexion = window.indexedDB.open('crm', 1);\n\n\t\tconexion.onerror = () => console.log('Hubo un error');\n\n\t\tconexion.onsuccess = () => {\n\t\t\tDB = conexion.result;\n\n\t\t\tconst objectStore = DB.transaction('crm').objectStore('crm');\n\n\t\t\tobjectStore.openCursor().onsuccess = (e) => {\n\t\t\t\tconst cursor = e.target.result;\n\n\t\t\t\tif (cursor) {\n\t\t\t\t\tconst { nombre, empresa, email, telefono, id } = cursor.value;\n\n\t\t\t\t\tconst listado = document.querySelector('#listado-clientes');\n\n\t\t\t\t\tlistado.innerHTML += `\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200\">\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-5 font-medium text-gray-700 text-lg font-bold\"> ${nombre} </p>\n\t\t\t\t\t\t\t\t<p class=\"text-sm leading-10 text-gray-700\"> ${email} </p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 \">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-700\">${telefono}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 leading-5 text-gray-700\">\n\t\t\t\t\t\t\t\t<p class=\"text-gray-600\">${empresa}</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5\">\n\t\t\t\t\t\t\t\t<a href=\"editar-cliente.html?id=${id}\" class=\"text-teal-600 hover:text-teal-900 mr-5\">Editar</a>\n\t\t\t\t\t\t\t\t<a href=\"#\" data-cliente=\"${id}\" class=\"text-red-600 hover:text-red-900 eliminar\">Eliminar</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t`;\n\t\t\t\t\tcursor.continue();\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('No hay más registros');\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}", "constructor(id,nombres,documento,profesion) {\n if (id) {\n this.id = id; \n } \n this.nombres = nombres;\n this.documento = documento;\n this.profesion = profesion;\n }", "function SearchByID(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE ID = \"'+word+'\";',func);\r\n}", "function buscarMedicos(termino, regex) {\n\n return new Promise((resolve, reject) => {\n\n Medico.find({ nombre : regex })\n .populate('usuario', 'nombre email')\n .populate('hospital')\n .exec((error, medicosEncontrados) => {\n\n if(error) {\n reject('Error al cargar los medicos', error);\n } else {\n resolve(medicosEncontrados);\n }\n })\n });\n }", "function agregarPendientes(QueContacta,Contactado,idContacto,atendido){\n var nombreQueContacta;\n var numeroQueContacta;\n var nombreContactado;\n var numeroContactado;\n if(QueContacta && Contactado && !atendido){\n var userQueContacta = refUser.doc(QueContacta);\n userQueContacta.get().then(function(doc) {\n if (doc.exists) {\n nombreQueContacta = doc.data().nombre + doc.data().apellido;\n numeroQueContacta = doc.data().numTelefono;\n console.log(\"Document data:\", doc.data());\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n }).catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n\n // obteniendo datos del usuario\n var userContactado = refUser.doc(Contactado);\n userContactado.get().then(function(doc) {\n if (doc.exists) {\n nombreContactado = doc.data().nombre + doc.data().apellido;\n numeroContactado = doc.data().numTelefono;\n\n // colocamos aqui esta inserción de datos por que la funcion es asincrona y nodara udifined\n document.getElementById('tablaNotificaciones').innerHTML += `\n <tr>\n <td scope=\"col\">${nombreQueContacta}</td>\n <td scope=\"col\">${numeroQueContacta}</td>\n <td scope=\"col\">${nombreContactado}</td>\n <td scope=\"col\">${numeroContactado}</td>\n <td scope=\"col\">\n <button onclick=\"si_contacto('${idContacto}')\" type=\"button\" name=\"button\">Si</button>\n <button onclick=\"no_contacto('${idContacto}')\" type=\"button\" name=\"button\">Cancelar</button>\n </td>\n </tr>\n `;\n console.log(\"Document data:\", doc.data());\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document y o ya esta atendido\");\n }\n }).catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n }else{\n console.log(\"error al consegir datos de contacto funcntion ver_notificacion() quizas Contacdato este vacio XD\");\n }\n}", "busquedaUsuario(termino, seleccion) {\n termino = termino.toLowerCase();\n termino = termino.replace(/ /g, '');\n this.limpiar();\n let count = +0;\n let busqueda;\n this.medidoresUser = [], [];\n this.usersBusq = [], [];\n for (let index = 0; index < this.usuarios.length; index++) {\n const element = this.usuarios[index];\n switch (seleccion) {\n case 'nombres':\n busqueda = element.nombre.replace(/ /g, '').toLowerCase() + element.apellido.replace(/ /g, '').toLowerCase();\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n case 'cedula':\n busqueda = element.cedula.replace('-', '');\n termino = termino.replace('-', '');\n if (busqueda.indexOf(termino, 0) >= 0) {\n this.usersBusq.push(element), count++;\n }\n break;\n default:\n count = -1;\n break;\n }\n }\n if (count < 1) {\n this.usersBusq = null;\n }\n this.conteo_usuario = count;\n }", "async getDatosAcopio() {\n let query = `SELECT al.almacenamientoid, ca.centroacopioid, ca.centroacopionombre, \n concat('Centro de Acopio: ', ca.centroacopionombre, ' | Propietario: ', pe.pernombres, ' ', pe.perapellidos) \"detalles\"\n FROM almacenamiento al, centroacopio ca, responsableacopio ra, persona pe\n WHERE al.centroacopioid = ca.centroacopioid AND ca.responsableacopioid = ra.responsableacopioid AND ra.responsableacopioid = pe.personaid;`;\n let result = await pool.query(query);\n return result.rows; // Devuelve el array de json que contiene todos los controles de maleza realizados\n }", "function cnsFrn_retorno(){\n\t$('#search_fornec').attr('pesquisa',objFornecedor.fornecAbrev);\n\t$('#search_fornec').val(objFornecedor.fornecAbrev);\n\t$('#search_fornec').attr('fornec_number',objFornecedor.fornecNum);\n\t$('#search').focus();\n}", "function search(entry, onFound = (res)=>{console.log(\"Found [\"+entry+\",\"+res+\"] in phonebook\");}, onNotFound = ()=>{console.error(\"Could not find [\"+entry+\"] in phonebook\");},field=\"name\"){\r\n\r\n\treadFile((res)=>{\r\n\t\tvar found = false;\r\n\t\tvar contactList = JSON.parse(res);\r\n\t\tcontactList.forEach((item,index)=>{\r\n\t\t\t//console.log(\"Comparing \"+item.name.toUpperCase()+\" to \"+entry.toUpperCase());\r\n\t\t\tif(field===\"name\" && item.name.toUpperCase()===entry.toUpperCase()){\r\n\t\t\t\tonFound(item);\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(field===\"number\" && item.number===entry){\r\n\t\t\t\tonFound(item);\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(found===false) onNotFound();\r\n\t});\r\n}", "function getInfoFournisseur(idFourn, idContact){\n var ret = null;\n var sheet = SpreadsheetApp.openById(CLSID).getSheetByName(SHEET_PARAM_FOURNISSEUR);\n var idrow = onSearchFournisseurwithID(idFourn);\n var nomc='';\n var emailc='';\n var telc='';\n if (idrow != -1) {\n if (idContact != '') {\n if (sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_NOM+1).getValue() == idContact) {\n nomc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_NOM+1).getValue();\n emailc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_EMAIL+1).getValue();\n telc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_TEL+1).getValue();\n }\n if (sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_NOM+1).getValue() == idContact) {\n nomc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_NOM+1).getValue();\n emailc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_EMAIL+1).getValue();\n telc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_TEL+1).getValue();\n }\n }\n ret= {id:idFourn,\n sigle:sheet.getRange(idrow,COLUMN_FOUR_SIGLE+1).getValue(),\n adresse:sheet.getRange(idrow,COLUMN_FOUR_ADRESSE+1).getValue(),\n tel:sheet.getRange(idrow,COLUMN_FOUR_TEL+1).getValue(),\n fax:sheet.getRange(idrow,COLUMN_FOUR_FAX+1).getValue(),\n siret:sheet.getRange(idrow,COLUMN_FOUR_SIRET+1).getValue(),\n ape:sheet.getRange(idrow,COLUMN_FOUR_APE+1).getValue(),\n nomcontact:nomc,\n telcontact:telc,\n emailcontact:emailc\n };\n // Log des informations du Fournisseur\n Log_Info(\"getInfoFournisseur\", Utilities.formatString(\"ret=%s\",Utilities.jsonStringify(ret)));\n }\n if(ret==null) throw 'Aucun fournisseur associé avec la référence suivante :'+idFourn;\n return ret;\n}", "function findObj() {\n var search = db.collection('search');\n search.find({\n }, {\n \"_id\" : 1,\n \"link\" : 1,\n \"id\" : 1,\n \"title\" : 1\n }).limit(pagNum).toArray(function(err, results) {\n if (err) throw err;\n console.log(\"Returned #\" + results.length + \" documents\");\n res.send({results});\n });\n } // end: find documents in mongodb", "function SearchByTitlePre(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE Title = \"'+word+'\";', func);\r\n}", "function listando_todos_os_contatos_001(){ \n try{ \n \n var linha_recebida = lista_de_contatos.split(\"@\"); \n for( var i = ( linha_recebida.length - 1 ); i >= 0; i-- ) {\n if( linha_recebida[i].includes(\"-\") ){\n var web_id;\n var web_comando;\n var web_usuario_logado;\n \n var web_contato_email;\n var web_contato_nome;\n var web_contato_nome_meio;\n var web_contato_ultimo_nome;\n\n var argumentos = linha_recebida[i].split(\"j\");\n for( var j = 0; j < argumentos.length; j++ ) {\n if(j === 0){ \n web_id = argumentos[j];\n }\n else if(j === 1){\n web_comando = argumentos[j];\n }\n else if(j === 2){\n web_usuario_logado = argumentos[j];\n }\n else if(j === 3){\n web_contato_email = argumentos[j];\n }\n else if(j === 4){\n web_contato_nome = argumentos[j];\n }\n else if(j === 5){\n web_contato_nome_meio = argumentos[j];\n }\n else if(j === 6){\n web_contato_ultimo_nome = argumentos[j];\n }\n }\n\n //Verificar se este contato é deste usuário\n var nome_principal = \"\"; try{ nome_principal = converter_base64(web_contato_nome).trim(); }catch(Exception){}\n var web_contato_email_str = importar_Para_Alfabeto_JM( web_contato_email ).trim().toUpperCase();\n \n percorrer_todas_as_conversas( web_id, web_contato_email_str, nome_principal );\n }\n } \n }catch(Exception){\n \n document.getElementById(\"ul_meus_contatos\").innerHTML = \"consultar_contato_antes_de_cadastrar_003 -- \" + Exception;\n }finally { \n \n //alert(\"Acabou\");\n setTimeout(function(){ \n \n //alert(\"Reiniciando\");\n if( carregado === 1 ){\n \n _01_controle_loop_sem_fim();\n }\n else if( carregado === 0 ){\n \n carregado = 0;\n document.getElementById(\"ul_meus_contatos\").style.display = 'block';\n \n document.getElementById(\"contato_tabela_xy_01\").style.display = 'none';\n document.getElementById(\"contato_tabela_xy_01\").innerHTML = \"\";\n \n _01_controle_loop_sem_fim();\n }\n \n }, 1000);\n }\n \n }", "function searchDoctor(param, regExp) {\n\n return new Promise((resolve, reject) => {\n Doctor\n .find( { name: regExp })\n .populate( 'user', 'name email' )\n .populate( 'hospital' )\n .exec((err, result) => {\n if (err) {\n reject('ERROR cargando hospitales ' , err);\n } else {\n resolve(result);\n }\n })\n })\n\n}", "function getRucForName (req,res)\n{\n let razonSocial=req.query.razonSocial\n let limite=req.query.limit\n let order=req.query.order\n order=parseInt(order)\n\n //Convierte el limite en int\n if(limite!=null)\n {\n limite=parseInt(limite)\n \n }\n //Convierte el limite en int y le pasa el valor default 20\n if(limite==null)\n {\n limite=parseInt(limite)\n limite=20;\n \n }\n //Pasa el valor por default a order = 1 \n if(order!=-1&&order!=0)\n {\n order=1;\n }\n //Valida que razon Social que no traiga valores null\n if (razonSocial==null)\n {\n return res.status(404).send({message:\"error\"})\n }\n //Valida que el string de la razon social no se menor a 4\n if(razonSocial.length<2)\n {\n return res.status(404).send({message:`error: String length ${razonSocial.length}<2`})\n }\n else\n { //Vaalida que el limite no sea mayor 50\n if(limite>50)\n {\n return res.status(404).send({message:`error limite superado. ${limit} debe ser =<50`}) \n }\n else\n {\n //Validacion para envidar documetos sin ordenamiento\n if(order==0)\n {\n razonSocial=razonSocial.toUpperCase();\n Ruc.find({razon_social: { $regex: razonSocial } }, function(error,success)\n {\n if(error)\n {\n return res.status(500).send({message:`Error al realizar petición: ${error}`}) \n }\n if(success==\"\")\n {\n return res.status(404).send({message:\"No existe la Razon Social\"})\n }\n res.status(200).send({success, limite,order})\n }).limit(limite)\n }\n else\n //Validacion para envidar documetos con ordenamiento\n {\n razonSocial=razonSocial.toUpperCase();\n Ruc.find({razon_social: { $regex: razonSocial } }, function(error,success)\n {\n if(error)\n {\n return res.status(500).send({message:`Error al realizar petición: ${error}`}) \n }\n if(success==\"\")\n {\n return res.status(404).send({message:`No existe la Razon Social: ${razonSocial}`})\n }\n res.status(200).send({success, limite,order})\n }).sort({razon_social:order}).limit(limite)\n }\n }\n\n }\n}", "function getIdPerson(txtPerson)\n{\n var idPerson = 0;\n urllib.request('https://api.pipedrive.com/v1/persons?/find?term=' + txtOrganitation + '&api_token=' + token, function (err, data, res) {\n var httpResults = data.toString();\n var strJson = JSON.parse(httpResults);\n for (var i = 0; i < strJson['data'].length; i++)\n {\n return idEmpresa = strJson['data'][i]['id'];\n }\n });\n\n}", "static OneCuaderno(req, res){ \n const { id } = req.params\n Cuadernos.findAll({\n where: {id: id}\n //attributes: ['id', ['description', 'descripcion']]\n }).then((one) => {\n res.status(200).json(one);\n }); \n }", "function getAnagraficaPartecipanti(request) {\n\n var nickname = ' ';\n if(request.body.nickname){\n nickname = request.body.nickname;\n }\n\n var queryText = 'SELECT ' +\n 'id, nickname, email_address, password_value ' +\n 'FROM pronolegaforum.anagrafica_partecipanti ';\n if(nickname !== ' '){\n queryText = queryText + 'WHERE nickname = ' + '\\'' + nickname + '\\'';\n } else {\n queryText = queryText + 'ORDER BY nickname';\n } \n\n return db.any(queryText);\n\n}", "search() {\n return db.many(`\n SELECT *\n FROM parks p\n WHERE p.borough LIKE '%ook%'\n `);\n }", "function getDocuments(){\n document.getElementById('response-box').innerHTML = \"\";\n //split the input text into separate paragraphs\n parahs = input_text.split('\\n\\n\\n');\n //generate unique document id\n for(let i=0; i<parahs.length; i++){\n var doc_id = \"docid_\" + String(i+1);\n document_id[doc_id] = i;\n }\n //display ids and documents in response box\n for(let i=0; i<parahs.length; i++){\n document.getElementById('response-box').insertAdjacentHTML('beforeend',Object.keys(document_id)[i]+\": \"+parahs[i]+\"\\n\\n\");\n }\n}", "authorLookupFirstName() {\n this.fieldsChanged();\n const itemAuthorFirstName = sanitize($(\"#item_author_first_name\").val());\n if (itemAuthorFirstName.length > 3) {\n const pos = itemAuthorFirstName.length;\n $.getJSON(\"/author_search/?\" + $.param({ \"first_name\": itemAuthorFirstName, \"surname\": \"\" }), function (data) {\n const x = data[\"authors\"][0];\n if (x) {\n const author = new Author(x[\"id\"], x[\"first_name\"], x[\"surname\"], x[\"date_birth\"], x[\"date_death\"]);\n $(\"#item_author_id\").val(x.id);\n $(\"#item_author_first_name\").val(x.first_name);\n $(\"#item_author_surname\").val(x.surname);\n $(\"#item_author_firstname\").caretTo(pos);\n }\n })\n .fail(function () {\n alert(\"Problem in author lookup\");\n });\n }\n }", "async function listarCurso(){\n // api/Cursos?numeroPage=4&sizePage=10\n const numeroPage = 2; \n const sizePage = 10;\n\n // -----------------------------------------------------------------------------------\n // OPERADORES DE COMPARACION\n // eq (equal, igual)\n // ne (not equal, no igual)\n // gt (greater than, mayor o igual que)\n // gte (greater than or equal to, mayor o igual que)\n // lt (less than, menor que)\n // lte (less than or equal to, menor o igual que)\n // in \n // nin (not in)\n // ----------------------------------------------------------------------------------\n // OPERADORES LOGICOS\n // or\n // and\n const cursos = await Curso\n // OPERADORES DE COMPARACION\n // {mayor a 10 menor a 30}\n // .find({precio : {$gte: 10, lte: 30}})\n // Se le dice unicamente los precios que desea [10, 15, 25]\n // .find({precio: {$in: [10, 15, 25]}})\n\n // OPERADORES LOGICOS \n // .find()\n // .or([{autor : 'Emanuel'}, {publicado : true}])\n // .and([{autor : 'Emanuel'}, {publicado : true}])\n\n // Expresiones regulares\n // Cuando empiece en\n // .find({ autor:/^Ju/})\n // Cuando termine en\n // .find({autor: /uan$/}) \n // Cuando un campo tiene contenido especifico \n // .find({ autor: /.*Ju*/})\n \n\n // {adentro se le puede dar procesos para mostrar dicha informacion}\n // .find({autor: 'Emanuel'})\n .find()\n .skip((numeroPage - 1) * sizePage)\n // Limite de datos\n .limit(sizePage)\n // 1 muestra el dato de forma ascendente y -1 de forma descendente.\n .sort({autor: 1})\n // unicamente muestra los datos que se coloquen\n .select({autor : 1, nombre: 1, etiquetas:1});\n console.log(cursos); \n}", "static One_Consulta_id(req, res){ \n var id = req.params.id_consulta; \n Consultas.findAll({\n where: {id: id}, \n //attributes: ['id', ['description', 'descripcion']]\n \n }).then((data) => {\n res.status(200).json(data);\n }); \n }", "function getByName(bookTitle) {\n\n var bookId = -1;\n for (let i = 0; i < data.length; i++) {\n if (data[i].title.toLowerCase() == bookTitle.value.toLowerCase()) {\n bookId = data[i]._id;\n }\n }\n if (bookId == -1) {\n alert(\"Sorry, this book isn't in the database\");\n }\n else {\n bookTitle.value = '';\n detailsOfBook(bookId);\n }\n\n}", "function getAlumnos(req, res){\n var listaId = req.params.lista;\n\n if(!listaId){\n var find = Alumno.find({}).sort('rut');\n }else{\n var find = Alumno.find({lista: listaId}).sort('rut');\n }\n\n find.populate({\n path: 'lista',\n populate: {\n path: 'clase',\n model: 'Clase'\n }\n }).exec(function(err, alumnos){\n if(err){\n res.status(500).send({message: 'Error en la petición'});\n }else{\n if(!alumnos){\n res.status(404).send({message:'No hay alumnos'});\n }else{\n res.status(200).send({alumnos});\n }\n }\n });\n}", "async GetAlunoNotas(req, res) {\n try {\n const cpf = req.params.cpf;\n if (req.cargo === 'Aluno' && cpf !== req.cpf)\n return res.status(403).send(\"Não tente olhar as notas dos outros alunos\");\n const query = {\n name: \"get-grades\",\n text: \"SELECT meta, nota FROM notas WHERE cpf_aluno = $1\",\n values: [cpf]\n };\n const result = await connection_1.default.query(query);\n if (result.error)\n return res.status(500).send(\"Bad Request\");\n res.send(result.rows);\n }\n catch (err) {\n console.log(err);\n res.status(500).send(\"Bad Request\");\n }\n }", "function journalNames() {\n// read in the external file and split out the individual rows of data:\n// See https://mirror.hmc.edu/ctan/macros/latex/contrib/mnras/mnras_guide.pdf regarding journal letters\n// that have a designation of \"L\" in front of the page numbers.\n var lines = (GM_getResourceText(astroJournals).trim()).split('\\n');\n var iLine = 0;\n var nextFields = [];\n var fields = []; // holds the columns of data for a particular line in the file\n var rWords = [];\n var xWords = '';\n var xSupp = '';\n var nChar = 0;\n var clipHere = [];\n var indexMatch = -1;\n var pubNames = [];\n var pubAbbrev = [];\n var pagePref = [];\n var matchArr = [];\n var i = -1;\n var j = -1;\n var k = -1;\n var prevMatch = '';\n var pubFull = '';\n var findPub = '';\n var eachWord = [];\n var tmp = '';\n var nLet = -1;\n var reqLet = '';\n var matchCnt = 0;\n var sp = '';\n// clip out data table from any comments blocks\n clipHere = lines.reduce(function(x1,x2,x3) {if (x2.match(/\\={20,}/)) {x1.push(x3);} return x1;}, []); \n if (clipHere.length >= 2) {\n lines = lines.slice(clipHere[0]+1,clipHere[1]);\n } else if (clipHere.length == 1) {\n lines = lines.slice(clipHere[0]+1); }\n while (iLine < lines.length) {\n lines[iLine] = (lines[iLine].trim().replace(/ +/g,' ')).trim(); // get rid of any repeated spaces\n// split out each line in fileName.txt into separate columns/fields. Whitespace is the delimiter\n fields = lines[iLine].split(' ');\n// Turn any field that is equal to just \"|\" into \"\"\n fields = fields.map(z => z.replace(/^\\|$/,''));\n// Clean up the full name (in case some undesirable characters were included):\n fields[0] = fields[0].replace(/\\&/g, \" and \").replace(/\\./g, \" \").replace(/\\W/g, \" \").replace(/\\_/g, \" \").trim();\n// construct the regex. Example: if full name is \"the Astronomical Journal\", then the regex that will\n// capture all possibilities without allowing false-positives is the following:\n// ^(?:(?:the\\s)|(?:th\\s)|t\\s)?a\\s?(?:(?:stronomical\\s)|(?:stronomica\\s)|(?:stronomic\\s)|(?:stronomi\\s)|(?:stronom\\s)|\n// (?:strono\\s)|(?:stron\\s)|(?:stro\\s)|(?:str\\s)|(?:st\\s)|s\\s)?j\\s?(?:(?:ournal\\s)|(?:ourna\\s)|(?:ourn\\s)|(?:our\\s)|\n// (?:ou)|o)?$\n findPub = '';\n// now start going thru each word in the full journal name. If the word has no required letters, then the entire\n// word is optional and should end with a ?. If the word has required letters, allow the word to appear as\n// illustrated in the following example for AstroPhysics:\n// Astrophysics, Astrophysic, Astrophysi, Astrophys, Astrophy, Astroph, Astrop, Ap\n// Note that we start dropping letters at the end up to the first required letter\n// encoutered, and then the only additional allowed combo would be the required letters only\n eachWord = fields[0].split(\" \");\n for (j = 0; j < eachWord.length; j++) {\n sp = / /.source;\n if (j == eachWord.length -1) {sp = '';}\n tmp = '';\n reqLet = '';\n for (k = eachWord[j].length; k > 0; k--) {\n if (eachWord[j].charAt(k-1) === eachWord[j].charAt(k-1).toUpperCase()) {\n reqLet = eachWord[j].charAt(k-1).toLowerCase() + reqLet;}\n if (!reqLet && k > 1) {\n tmp = tmp + '(?:' + eachWord[j].substr(0,k).toLowerCase() + sp + ')|';\n } else if (!reqLet && k == 1) {\n tmp = '(?:' + tmp + eachWord[j].charAt(0).toLowerCase() + sp + ')?';}\n// once you hit the first required letter from the right side of the word, then you\n// stop building the regex, but continue collecting any remaining required letters in\n// the word:\n }\n if (sp) {sp = sp + '?';}\n if (reqLet.length > 1) {\n tmp = '(?:' + tmp + '(?:' + reqLet.toLowerCase() + sp + '))';\n } else if (reqLet) {\n tmp = '(?:' + tmp + reqLet.toLowerCase() + sp + ')'; }\n findPub = findPub + tmp;\n }\n xLtr.push({\"reg\":findPub, \"type\":\"journal\", \"priority\":\"1\", \n \"name\":fields[0], \"abb\": fields[1], \"pagePref\": fields[2],\n \"indx\":function(text, startPos) {\n this.endMatch = \"-1\";\n text = text.slice(startPos).replace(/\\&/g,\" and \").replace(/\\./g,\" \").replace(/\\W/g,\" \").replace(/ +/g,\" \");\n text = text.toLowerCase();\n t = JSON.parse(filterTheText(this.reg, text)); \n m = t[0].match(new RegExp('\\^' + this.reg));\n if (m) {\n// found a match to the journal name\n this.endMatch = t[1][m[0].length-1] + 1 + startPos;\n// return the full journal name (the abbreviation and page pref are accessible via the provided field names)\n return this.name.toLowerCase();\n } else {return \"\"; } }})\n iLine = iLine + 1;\n }\n return;\n }", "function ResumenOrden()\r\n\t{\r\n\t var buffer = '';\r\n\t \r\n\t if (_orden.length == 0)\r\n\t {\r\n\t \t$(\"#search\").focus();\r\n\t }\r\n\t \r\n\t buffer += '<h1 class=\"titulo_resumen\">Resumen de la orden</h1>';\r\n\t \r\n\t \r\n\t buffer += '<table class=\"table\" id=\"seleccion_producto\">';\r\n\t var contadorMonto=0;\r\n\t var SimboloMoneda = $(\"#Moneda\").val();\r\n\t _total_adicionales=0;\r\n\t for (x in _orden)\r\n\t {\r\n\t \t\r\n\t var adicionales = '';\r\n\t if (_orden[x].adicionales.length > 0) {\r\n\t \t\r\n\t adicionales += '<b>Agregar:</b>';\r\n\t \r\n\t adicionales += '<ul>';\t \r\n\t for (y in _orden[x].adicionales) {\r\n\t \t\r\n\t \tadicionales += \"<li>\" + _orden[x].adicionales[y].item + \" \"+SimboloMoneda +\" \"+ _orden[x].adicionales[y].precio+\"</li>\";\r\n\t \t_total_adicionales += parseFloat(_orden[x].adicionales[y].precio);\r\n\t }\t \r\n\t adicionales += '</ul>';\r\n\r\n\t }\r\n\t \r\n\t var quitar = '';\t \r\n\t if (_orden[x].ingredientes.length > 0) {\r\n\t quitar += '<b>Quitar:</b>';\r\n\t quitar += '<ul>';\r\n\t \r\n\t for (y in _orden[x].ingredientes) {\r\n\t quitar += '<li>' + _orden[x].ingredientes[y].nombre_m + '</li>';\r\n\t }\t \r\n\t quitar += '</ul>';\t \r\n\t }\r\n\r\n\t var nota = '';\t \r\n\t if (_orden[x].llevar.abc==\"1\") {\t \t\r\n\t nota += '<b>Nota:</b>';\r\n\t nota += '<ul>';\r\n\t \r\n\t for (y in _orden[x].llevar) {\r\n\t nota += '<li>Para Llevar</li>';\r\n\t }\t \r\n\t nota += '</ul>';\t \r\n\t }\r\n\t \r\n\t contadorMonto += parseFloat(_orden[x].precio);\r\n\t buffer += '<tr ID_orden=\"' + x + '\">';\r\n\t buffer += '<td>' + (parseInt(x)+1) + '</td>';\r\n\t buffer += '<td><div style=\"color:blue;font-weight:bold;\">' + _orden[x].detalle + '</div><div>' + adicionales + '</div><div>' + quitar + nota+ '</div></td>';\r\n\t buffer += '<td>' +SimboloMoneda +' '+ _orden[x].precio + '</td>';\r\n\t buffer += '<td><button class=\"btn_eliminar_pedido\">Eliminar</button></td>';\r\n\t buffer += '</tr>';\r\n\t \r\n\t }\t \r\n\t buffer += '<tr><td>#</td><td></td><td>Total = '+ SimboloMoneda+' '+ (contadorMonto+_total_adicionales)+'</td><td></td></tr>';\r\n\t buffer += '</table>';\r\n\t \r\n\t \r\n\t //_orden[x].precio;\r\n\r\n\t if($(\"#resumen\").html() != \"\"){\r\n\t \t$(\"#scroller\").show();\r\n\t \t$(\"#resumen\").empty();\r\n\t }else{\r\n\t \t$(\"#resumen\").html(buffer);\r\n\t \t$(\"#scroller\").hide();\r\n\t }\t \r\n\t}", "function loadPersonsInSearch(){\n\t$('#oPersons').html(\"\");\n\t$.ajax({\n\t\ttype: 'GET',\n\t\turl: '/employerDB/busqueda-personas'\n\t}).done(function(data){\n\t\tfor(let i=0; i<data.length; i++){\n\t\t\t$('#oPersons').append(\n\t\t\t\"<div class='card'><div class='card-header'>\"+\"Id: \" +JSON.stringify(data[i].email) +\"</div><div class=\"+\"card-body\"+\">\" + \n\t\t\t\"<h5 class=\"+\"card-title\"+\">\" + JSON.stringify(data[i].name) + \"</h5>\"+\n\t\t\t\"<p class=\"+\"card-text\"+\">\" + JSON.stringify(data[i].skills) +\"</p>\"+\n\t\t\t\"</div></div><br>\");\n\t\t}\n\t});\n}", "function traerusuario(documentobus, tipodocumentobus) {\n while (logdocumento.hasChildNodes()) {\n logdocumento.removeChild(logdocumento.firstChild);\n }\n var data = {\n tipodocumento: tipodocumentobus,\n documento: documentobus\n };\n fetch('/buscar/usuario/documento', {\n method: 'POST', // or 'PUT'\n body: JSON.stringify(data), // data can be `string` or {object}!\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(res => res.json())\n .catch(error => console.error('Error:', error))\n .then(response => {\n console.log(response);\n logdocumento.innerHTML = \"\";\n for (let a = 0; a < response.length; a++) {\n document.getElementById('nombre').value = response[a]['name'];\n document.getElementById('email').value = response[a]['email'];\n document.getElementById('telefono').value = response[a]['telefono'];\n document.getElementById('direccion').value = response[a]['direccion'];\n }\n });\n}", "static async search(name) {\n if (name.trim() === \"\") {\n throw new Error(\"Please enter a name.\");\n }\n\n let searchTerms = name.trim().split(' ');\n if (searchTerms.length === 2) {\n\n let searchFirst = `%${searchTerms[0]}%`;\n let searchLast = `%${searchTerms[1]}%`;\n\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n last_name AS \"lastName\", \n phone, \n notes\n FROM customers\n WHERE (first_name ILIKE $1 AND last_name ILIKE $2)\n OR (first_name ILIKE $2 AND last_name ILIKE $1)\n ORDER BY last_name, first_name`,\n [searchFirst, searchLast]\n );\n if (results.rows.length === 0) {\n throw new Error(\"Customer not found.\")\n }\n return results.rows.map(c => new Customer(c));\n }\n\n else if (searchTerms.length === 1) {\n let searchTerm = `%${searchTerms[0]}%`;\n\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n last_name AS \"lastName\", \n phone, \n notes\n FROM customers\n WHERE first_name ILIKE $1 OR last_name ILIKE $1\n ORDER BY last_name, first_name`,\n [searchTerm]\n );\n if (results.rows.length === 0) {\n throw new Error(\"Customer not found.\")\n }\n return results.rows.map(c => new Customer(c));\n }\n\n else {\n throw new Error('Please enter one or two search terms.');\n }\n }", "async findByIdLivro(req, res) {\n const query = ['idlivro', '==', req.params.id];\n await firebaseHelper.firestore\n .queryData(db, 'reserva', query)\n .then(doc => res.status(200).send(doc))\n }", "static lista_emergencia (req,res){\n const { id_medico } = req.params\n Citas_Medicas.findAll({\n where : { id_medico : id_medico, estado: 'true', especialidad: 'CONSUL. EMERGENCIA' }, // el url es para identificar si es emergencia o consulta medica\n //attributes: ['id','estado','codigo_p','hora','especialidad'],\n include: [\n {model: Pacientes, attributes: ['id','nombre', 'apellidop','apellidom'] }\n ]\n }).then(users => {\n res.status(200).send(users)\n }) \n }", "function getMedicamentosPaciente(req, res){\r\n console.log('- GET MEDICAMENTOS PACIENTE -');\r\n var query = Paciente.findById(req.params.idPaciente);\r\n \r\n query.populate({\r\n path: 'medicamentos',\r\n model: 'Medicamento'\r\n })\r\n .exec(function (err, paciente) {\r\n if (err) {\r\n return res.status(400).json({\r\n title: 'An error occurred',\r\n error: err\r\n });\r\n }\r\n if (!paciente) {\r\n return res.status(404).json({\r\n title: 'Error',\r\n error: 'Paciente no encontrado'\r\n });\r\n }\r\n res.status(200).json({\r\n message: 'Success',\r\n obj: paciente.medicamentos\r\n }); \r\n });\r\n \r\n \r\n\r\n\r\n\r\n /*console.log(\"El paciente: \"+paciente);\r\n //preguntar como itero y obtengo los valores..\r\n console.log(\"id paciente: \"+paciente._id+\" Consumicion paciente: \"+paciente.consumiciones);\r\n\r\n \r\n paciente.consumiciones.forEach(element => {\r\n Medicamento.findById(element.medicamento, function (err, medicamentos) {\r\n if (err) {\r\n return res.status(400).json({\r\n title: 'Error',\r\n error: err\r\n });\r\n }\r\n if (!medicamentos) {\r\n return res.status(404).json({\r\n title: 'Error',\r\n error: err\r\n });\r\n }\r\n res.status(200).json({\r\n message: 'Success',\r\n obj: medicamentos\r\n });\r\n });\r\n });*/\r\n \r\n \r\n}", "function convertirProductoEnPedido(buffer_de_orden, cantidad)\r\n\t{\t\r\n\t cantidad = cantidad || 1;\r\n\t for (var i=0; i < cantidad; i++) {\r\n\t _orden.push(buffer_de_orden);\r\n\t }\r\n\t miniResumenOrden();\r\n\t $(\"#search\").focus();\r\n\t}//end", "searchDoc(ch){\n switch (ch) {\n case 1:\n var j=1, key =-1, flag = false ;\n var dname = readline.question('Enter Doctor full name : ');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (this.dfile.Doctors[i].DoctorName == dname) {\n key = i;\n flag = true;\n }\n }\n if (flag) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[key].DoctorName+'\\t\\t|'+this.dfile.Doctors[key].Specialization+'\\t\\t|'+this.dfile.Doctors[key].Availability+'\\t\\t\\t|'+this.dfile.Doctors[key].DocID); \n \n }\n else{\n console.log('Doctor not found or please check input again.........');\n \n }\n break;\n \n case 2:\n var j=1;\n var speciality = readline.question('Enter Specialization : \\n');\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (speciality == this.dfile.Doctors[i].Specialization) {\n \n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n case 3:\n var j=1;\n var id = readline.question('Enter Doctor ID : \\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (id == this.dfile.Doctors[i].DocID) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n case 4:\n var j=1;\n var avail = readline.question('Enter Availablity Type \"AM, PM, or Both\" : \\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (avail == this.dfile.Doctors[i].Availability) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n }\n\n }", "function findMunTorreviejaData(municipios){\n var munData = null;\n for(var key in municipios){\n var actMun = (municipios[key].nombre).toLowerCase();\n if(actMun == \"torrevieja\"){\n munData = municipios[key];\n break;\n }\n }\n console.log(munData);\n return munData;\n }", "function listarTodosFiltroAprendiz(){\r\n\t\r\n\tvar identificacionFiltro = $(\"#txtIdentificacionAprendizFiltro\").val();\r\n\tvar nombreCompletoFiltro = $.trim($(\"#txtNombreCompletoAprendizFiltro\").val());\r\n\tvar idFichaFiltro = $(\"#selectFichaAprendizFiltro\").val();\r\n\tvar idDetalleEstadoFiltro = $(\"#selectDetalleEstadoAprendizFiltro\").val();\r\n\t\r\n\t\r\n\tlistarTodosAprendizGenerico(\"listarTodosFiltro?identificacion=\"+identificacionFiltro+\"&nombreCompleto=\"+nombreCompletoFiltro+\"&idFicha=\"+idFichaFiltro+\"&idDetalleEstado=\"+idDetalleEstadoFiltro);\t\t\t\t\r\n}", "async index(req, res) {\n let { sort = 'createdAt', termo = '' } = req.query;\n const search = {\n $or: [\n { nome: { $regex: '.*' + termo + '.*' } }\n ]\n }\n sort = sort ? sort : 'createdAt'\n const medico = await Medico.paginate(search, { sort: `-${sort}`});\n return res.json(medico)\n }", "function consultarMalla(done) {\n Malla.findOne({id:req.param('id')})\n\t\t\t.populate('nivel')\n\t\t\t.populate('cursos')\n\t\t\t.populate('logros')\n\t\t\t.exec(function mallasFounded(err, mallaFounded ){\n\n\t\t\t\tif (err) {\n\t\t\t\t\tmensaje.error= \"Error al consultar docente\"\n\t\t\t\t\treturn res.json(mensaje.error)\n\t\t\t\t}\n\t\t\t\tmalla1=mallaFounded\n\t\t\t\tdone()\n\n\t\t\t})\n }", "function getTypesComplain(req, res) {\n /**Nota\n * mandar por la url el filtro para obtenerna; por id, por nombre.\n */\n var filtro = req.params.filtro;\n var dato = req.params.dato;\n var connection = dbConnection();\n switch (filtro) {\n case \"id\":\n connection.query(\"SELECT * FROM tipo_queja WHERE id_tipo_queja=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n case \"descripcion\":\n dato = \"'\" + dato + \"'\"\n connection.query(\"SELECT * FROM tipo_queja WHERE descripcion=\" + dato, function(err, result, fields) {\n if (err) return res.status(500).send({ message: `Error al realizar la consulta : ${err}` });\n if (result == \"\") return res.status(404).send({ message: `El usuario no existe` });\n res.status(200).send({ message: result });\n connection.destroy();\n });\n break;\n\n }\n\n}" ]
[ "0.5559556", "0.5538495", "0.553293", "0.5397457", "0.53570396", "0.53490955", "0.5326134", "0.5321139", "0.52882993", "0.5284173", "0.5243029", "0.5240028", "0.52252537", "0.5212058", "0.5206271", "0.51986694", "0.5192781", "0.51623863", "0.515546", "0.5148614", "0.5133019", "0.5127165", "0.51235956", "0.5116324", "0.5109968", "0.51025575", "0.51007795", "0.5099263", "0.50763", "0.5070089", "0.50692594", "0.5060821", "0.50501126", "0.50459296", "0.5043894", "0.5035876", "0.50265926", "0.5024579", "0.5017635", "0.5017188", "0.50166464", "0.5013717", "0.50123775", "0.5010299", "0.5003753", "0.49973336", "0.4991629", "0.49900818", "0.49897236", "0.49812767", "0.49750337", "0.49724984", "0.49622285", "0.49605176", "0.49604565", "0.49586287", "0.4957237", "0.49529734", "0.4946547", "0.49437132", "0.49314997", "0.4929201", "0.49213535", "0.49162248", "0.49158165", "0.49156368", "0.4914416", "0.49124134", "0.4907061", "0.49039984", "0.49012452", "0.48992714", "0.48972934", "0.4896312", "0.48940602", "0.4892043", "0.4888674", "0.48876703", "0.488608", "0.4885583", "0.48839137", "0.48821494", "0.48801792", "0.4876601", "0.4874369", "0.4870594", "0.48641345", "0.48552448", "0.4853329", "0.48449594", "0.48412007", "0.4836682", "0.4832016", "0.48279798", "0.48175812", "0.48123685", "0.48101535", "0.48084986", "0.48073086", "0.48056456" ]
0.5905101
0
Recalcular listado de municipios con base al departamento seleccionado
async function recalcularMunicipios() { try { let URL = URL_municipios URL += watch('departamento') let response = await axios.get(URL) let data = await response.data.items let result = [] // Opcion por defecto result.push(<option value={0} key={0}>Seleccione una Opción</option>) for (let index in data) { result.push( <option value={data[index].codigo} key={data[index].codigo}>{data[index].nombre}</option> ) } setMunicipios(result) } catch (error) { console.log('Fallo obteniendo los municipios' + error) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function obtenerDepartamentos() {\n try {\n let response = await axios.get(URL_departamentos)\n let data = response.data.items\n let result = []\n\n // Opcion por defecto\n result.push(<option value={0} key={0}>Seleccione una Opción</option>)\n \n for (let index in data) { \n result.push(<option value={data[index].codigo} key={data[index].codigo}>{data[index].nombre}</option>)\n }\n setDepartamentos(result)\n \n // Se obtiene el municipio por defecto a partir del departamento por defecto\n recalcularMunicipios()\n\n } catch (error) {\n console.log('Fallo obteniendo los departamentos / municipios' + error)\n } \n }", "function consultarMunicipios(){ \n\tvar selector = $('#selectDepartaments').val();\n\t$.post(\"gestionEspectro/php/consultasConsultasBD.php\", { consulta: 'municipios', idConsulta: selector }, function(data){\n\t\t$(\"#municipios\").html(data);\n\t\t$(\"#tipoAsignacion\").html(\"La asignación es a nivel municipal\");\n\t}); \n}", "function getDepartamentosDropdown() {\n $http.post(\"Departamentos/getDepartamentosTotal\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.listaDepartamentos.data = r.data.d.data;\n \n }\n })\n }", "function cargar_municipios(datos_municipios) {\r\n\tvar texto_aconvertir = \"{'municipios':\" + datos_municipios + \"}\";\r\n\tvar objeto_respuesta = eval('(' + texto_aconvertir + ')');\r\n\tvar lista_muni = document.getElementById(\"municipios\");\r\n\tlista_muni.options.length = 0;\r\n\tvar posiciones = objeto_respuesta.municipios.length;\r\n\tfor (var i = 0; i < posiciones; i++) {\r\n\t\topcion = document.createElement('option');\r\n\t\ttexto_opcion = document\r\n\t\t\t\t.createTextNode(objeto_respuesta.municipios[i].municipio);\r\n\t\topcion.appendChild(texto_opcion);\r\n\t\topcion.value = objeto_respuesta.municipios[i].codigoMunicipio;\r\n\t\tlista_muni.appendChild(opcion);\r\n\t}\r\n}", "function firerpt_provincesChange(){\n loadLocationData()\n var provinceDropDown = document.getElementById('rpt_provinces');\n var provinceSlug = provinceDropDown.options[provinceDropDown.selectedIndex].id.split('_')[0]\n var districtDropDown = document.getElementById('rpt_districts');\n var facilityDropDown = document.getElementById('rpt_facilities');\n\n // reload district combo\n clearDropDown(districtDropDown);\n var childDistricts = []\n for(index in _allDistricts){\n if(provinceSlug === \"All\" ||\n provinceSlug ===_allDistricts[index][0].split('_')[0]\n || _allDistricts[index][0] === \"All\"){\n childDistricts.push(_allDistricts[index]);\n }\n }\n fillList(districtDropDown, childDistricts)\n\n // reload facility combo\n clearDropDown(facilityDropDown);\n var childFacilities = []\n for(index in _allFacilities){\n if(provinceSlug === \"All\" ||\n provinceSlug === _allFacilities[index][0].split('_')[0] ||\n _allFacilities[index][0] === \"All\"){\n childFacilities.push(_allFacilities[index]);\n } \n }\n fillList(facilityDropDown, childFacilities)\n}", "async function Municipios() {\n alertaCargando(\"Por favor espere\", \"Cargando datos\");\n /**\n * Esta línea de código llama a la función que limpia la capa de organismos de cuenca\n */\n await limpiarMunicipio();\n const query = await concatMunicipio();\n if (query !== \"\") {\n /**\n * @type {string}\n * Se crea una cadena que es la que se va a enviar por medio de Ajax,\n * este contiene tanto el query anteriormente descrito como la acción que va realizar en el controlador de mapa\n */\n const cadena = \"query=\" + query + \"&Accion=Acuiferos(Muni)\";\n var data = [];\n /**\n * Se manda a llamar por medio de Ajax a la función de estados en el controlador de mapa\n */\n $.ajax({\n type: \"POST\",\n url: \"/aplicacion/controlador/mapa.php\",\n data: cadena,\n /**\n * @param resp\n * Si el controlador devuelve la consulta se procederá con el proceso de interpretación de los datos\n */\n success: function (resp) {\n /**\n * Primero se recorre el array con todos los estados devueltos por el controlador.\n */\n\n $.each(JSON.parse(resp), function (index, item) {\n /**\n * Por medio del plugin de multiselect, podemos agregar los objetos del array al select de acuiferos\n */\n data.push({\n name: item.nombre,\n value: item.id_acuifero,\n checked: false,\n });\n });\n $(\"#Acuiferos\").multiselect(\"loadOptions\", data);\n },\n }).always(function () {\n Swal.close();\n });\n } else {\n Swal.close();\n }\n}", "function consultarDepartamentos(){ \n\tvar selector = $('#selectTerritorialDivision').val();\n\t$.post(\"gestionEspectro/php/consultasConsultasBD.php\", { consulta: 'departamentos', idConsulta: selector }, function(data){\n\t\t$(\"#departamentos\").html(data);\n\t\t$(\"#municipios\").html(\"\");\n\t\t$(\"#tipoAsignacion\").html(\"La asignación es a nivel departamental\");\n\n\t}); \n}", "function departamento(iddepartamento) {\n var tipoeleccion = $('#TIPOELECCION').val()\n var id =0;\n\n let dept;\n let municipios;\n let template ='';\n\n tipoeleccion=parseInt(tipoeleccion)\n id = parseInt(iddepartamento);\n\n console.log(tipoeleccion);\n console.log(id);\n //los casos especiales son 5, 12, 14, 19 que son los que tienen elecciones municipales\n switch (id) {\n case 0:\n dept = JSON.stringify(NACIONAL)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n case 1:\n dept = JSON.stringify(GUATEMALA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 2:\n dept = JSON.stringify(SACATEPEQUEZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 3:\n dept = JSON.stringify(CHIMALTENANGO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n console.log(template);\n\n });\n break;\n\n case 4:\n dept = JSON.stringify(ELPROGRESO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 5:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(ESCUINTLA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun5)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n break;\n\n case 6:\n dept = JSON.stringify(SANTAROSA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 7:\n dept = JSON.stringify(SOLOLA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 8:\n dept = JSON.stringify(TOTONICAPAN)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 9:\n dept = JSON.stringify(QUETZALTENANGO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 10:\n dept = JSON.stringify(SUCHITEPEQUEZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 11:\n dept = JSON.stringify(RETALHULEU)\n municipios = JSON.parse(dept)\n\n par.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 12:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(SANMARCOS)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun12)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n\n break;\n case 13:\n dept = JSON.stringify(HUEHUETENANGO)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n case 14:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(QUICHE)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun14)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n break;\n\n case 15:\n dept = JSON.stringify(BAJAVERAPAZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 16:\n dept = JSON.stringify(ALTAVERAPAZ)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 17:\n dept = JSON.stringify(PETEN)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 18:\n dept = JSON.stringify(IZABAL)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 19:\n if (tipoeleccion == 1) {\n dept = JSON.stringify(ZACAPA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n } else {\n parseado = JSON.stringify(mun19)\n response = JSON.parse(parseado)\n\n response.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n }\n\n break;\n\n case 20:\n dept = JSON.stringify(CHIQUIMULA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 21:\n dept = JSON.stringify(JALAPA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 22:\n dept = JSON.stringify(JUTIAPA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n\n case 23:\n dept = JSON.stringify(USA)\n municipios = JSON.parse(dept)\n\n municipios.forEach(dep => {\n template += `<option class=\"success\"value=\"${dep.ID}\">${dep.NAME}</option>`\n });\n break;\n }\n $('#MUN').html(template)\n\n }", "function limpiarSeleccion() {\n \"use strict\";\n\n var i;\n\n map.setView(new L.LatLng(4.5, -73.0), 6);\n map.eachLayer(function (layer) {\n map.removeLayer(layer);\n });\n map.addLayer(Stamen_Watercolor);\n map.addLayer(positronLabels);\n map.addLayer(DptosLayer);\n\n document.getElementById('selDepartamento').value = 'all';\n document.getElementById('selMunicipio').value = 'all';\n document.getElementById('selTipoAccion').value = 'all';\n document.getElementById('selTipoLider').value = 'all';\n document.getElementById('selResponsable').value = 'all';\n document.getElementById('buscarPalabra').value = '';\n\n fechaInicial = startFechaTotal;\n fechaFinal = endFecha;\n cb(startFechaTotal, endFecha);\n\n if (document.getElementById('selMunicipio').options.length > 1) {\n for (i = document.getElementById('selMunicipio').options.length - 1; i >= 1; i--) {\n document.getElementById('selMunicipio').remove(i);\n }\n }\n\n // Recupera el listado inicial\n filtroDataDpto = JSON.parse(JSON.stringify(violencia_selectiva_departamento));\n $(\"#total_places\").text(0);\n\n $(\".divinfo\")[0].hidden = false;\n\n violencia_selectiva_departamento_layer = renderMarkersData(violencia_selectiva_departamento_geo, 5);\n map.addLayer(violencia_selectiva_departamento_layer);\n map.fitBounds(violencia_selectiva_departamento_layer.getBounds());\n}", "function carregaUnidadesSolicitantes(){\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tcarregarListaNaoSolicitantes();\n\tcarregarListaSolicitantes();\n}", "function PopularLocaisAgendamento(locaisagendamento) {\r\n // Popula a DDL de inserir/editar agendamento [locais de agendamento]\r\n var $ddl_localagendamento = $('select[name=idlocal]');\r\n $ddl_localagendamento.empty();\r\n $ddl_localagendamento.append('<option value=\"\">Selecione</option>');\r\n $.each(locaisagendamento, function (n, localagend) {\r\n var $op = $('<option>');\r\n $op.val(localagend.idlocal).text(localagend.nome);\r\n $ddl_localagendamento.append($op);\r\n });\r\n}", "async function limpiarEstados() {\n /**\n * Llamos a limpiar acuifero\n */\n $(\"#Municipios\").multiselect(\"reset\");\n await limpiarMunicipio();\n}", "function template_actualizar_ciudad(nomElemento) {\n\tvar indexEstado = -1;\n\tvar arrayEstados = Array(\"template_venta_estado\", \"template_renta_estado\", \"template_rentaVac_estado\");\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\");\n\t\n\tindexEstado = arrayEstados.indexOf(nomElemento);\n\t\n\tif (indexEstado > -1) {\n\t\tobjEstado = $(\"#\"+nomElemento);\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexEstado]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexEstado]);\n\t\t\n\t\t\n\t\tobjMunicipio.find(\"li.lista ul\").html(\"\");\n\t\tobjMunicipio.find(\"p\").attr(\"data-value\", -1);\n\t\tobjMunicipio.find(\"p\").text(\"\");\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: objEstado.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjMunicipio.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjMunicipio.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjMunicipio.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjMunicipio.find(\"p\").text($(this).text());\n\t\t\t\t\t\ttemplate_actualizar_colonia(objMunicipio.prop(\"id\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}", "function deplist(){\n return $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen',\n dataType:'json',\n type:'post'\n });\n }", "function updateTransactionList() {\n\n var f_instance = M.FormSelect.getInstance($('#fundingType'));\n var c_instance = M.FormSelect.getInstance($('#categories'));\n\n let funding_round_types = f_instance.getSelectedValues();\n let catagory_codes= c_instance.getSelectedValues();\n\n directoryChart.cities = [];\n directoryChart.update();\n }", "function cmbdepartemen(typ,dep){\n var u= dir2;\n var d='aksi=cmb'+mnu2;\n ajax(u,d).done(function (dt) {\n var out='';\n if(dt.status!='sukses'){\n out+='<option value=\"\">'+dt.status+'</option>';\n }else{\n if(dt.departemen.length==0){\n out+='<option value=\"\">kosong</option>';\n }else{\n $.each(dt.departemen, function(id,item){\n out+='<option '+(dep==item.replid?' selected ':'')+' value=\"'+item.replid+'\">'+item.nama+'</option>';\n });\n }\n if(typ=='filter'){ // filter (search)\n $('#departemenS').html(out);\n cmbtahunajaran('filter','');\n }else{ // form (edit & add)\n $('#departemenDV').text(': '+dt.departemen[0].nama);\n }\n }\n });\n }", "function obtener_estados() {\n var combo = $('[name=estado]');\n var codigo_pais = $('[name=pais]').val();\n $.ajax({\n url: \"terceros_controller/obtener_estados\",\n type: 'POST',\n data: {\n codigo_pais: codigo_pais\n },\n success: function(response) {\n var respuesta = $.parseJSON(response);\n if (respuesta.success === true) {\n combo.empty();\n combo.append('<option value=\"\">Seleccione</option>')\n var cantidad = respuesta.estados.length\n item = respuesta.estados[cantidad-1]\n combo.append('<option value=\"'+item[\"depcodigo\"]+'\">'+item[\"depnombre\"]+'</option>');\n for (var i = 0; i < cantidad-1; i++) {\n var item = respuesta.estados[i];\n combo.append('<option value=\"'+item[\"depcodigo\"]+'\">'+item[\"depnombre\"]+'</option>');\n }\n }\n }\n });\n}", "async function limpiarOrganismos() {\n /**\n * Limpia la capa de la cual dependen de organismos\n */\n $(\"#Estados\").multiselect(\"reset\");\n await limpiarEstados();\n}", "function obtener_ciudades(){\n var combo = $('[name=ciudad]');\n var codigo_estado = $('[name=estado]').val();\n $.ajax({\n url: \"terceros_controller/obtener_ciudades\",\n type: 'POST',\n data: {\n codigo_estado: codigo_estado\n },\n success: function(response) {\n var respuesta = $.parseJSON(response);\n if (respuesta.success === true) {\n combo.empty();\n combo.append('<option value=\"\">Seleccione</option>')\n var cantidad = respuesta.ciudades.length\n item = respuesta.ciudades[cantidad-1]\n combo.append('<option value=\"'+item[\"muncodigo\"]+'\">'+item[\"munnombre\"]+'</option>');\n for (var i = 0; i < cantidad-1; i++) {\n var item = respuesta.ciudades[i];\n combo.append('<option value=\"'+item[\"muncodigo\"]+'\">'+item[\"munnombre\"]+'</option>');\n }\n }\n }\n });\n}", "function asociarVacunas (pais) {\n let paisResidencia = pais;\n const listaDeVacunasPosibles = [];\n \n const contenedor = document.getElementById(\"inputVacuna\");\n \n switch (paisResidencia) {\n case \"URUGUAY\":\n listaDeVacunasPosibles.push('SINOVAC');\n listaDeVacunasPosibles.push('ASTRAZENECA');\n listaDeVacunasPosibles.push('PFIZER');\n while (contenedor.firstChild) {\n contenedor.removeChild(contenedor.firstChild);\n }\n for (const vacuna of listaDeVacunasPosibles) {\n let option = document.createElement(\"option\");\n option.innerHTML = `${vacuna}`;\n contenedor.appendChild(option);\n }\n break;\n case \"ARGENTINA\":\n listaDeVacunasPosibles.push('SPUTNIKV');\n listaDeVacunasPosibles.push('ASTRAZENECA');\n listaDeVacunasPosibles.push('SINOPHARM');\n listaDeVacunasPosibles.push('PFIZER');\n while (contenedor.firstChild) {\n contenedor.removeChild(contenedor.firstChild);\n }\n for (const vacuna of listaDeVacunasPosibles) {\n let option = document.createElement(\"option\");\n option.innerHTML = `${vacuna}`;\n contenedor.appendChild(option);\n } \n break;\n case \"CHILE\":\n listaDeVacunasPosibles.push('ASTRAZENECA');\n listaDeVacunasPosibles.push('CANSINO');\n listaDeVacunasPosibles.push('SINOVAC');\n listaDeVacunasPosibles.push('PFIZER');\n while (contenedor.firstChild) {\n contenedor.removeChild(contenedor.firstChild);\n }\n for (const vacuna of listaDeVacunasPosibles) {\n let option = document.createElement(\"option\");\n option.innerHTML = `${vacuna}`;\n contenedor.appendChild(option);\n }\n break;\n default:\n break;\n }\n \n return listaDeVacunasPosibles;\n }", "function cmbdepartemenS(){\n deplist().done(function(res){\n var opt='';\n if(res.status!='sukses'){\n notif(res.status,'red');\n }else{\n $.each(res.departemen, function(id,item){\n opt+='<option value=\"'+item.replid+'\">'+item.nama+'</option>'\n });\n $('#departemenS').html(opt);\n cmbprosesS($('#departemenS').val());\n }\n });\n }", "function actualizarGetPuntosTipoSelecciondado(){\n // no se realizo la busqueda de tipo de puntos\n if(vm.nameTipoSeleccionado == null){\n return;\n }\n // volvemos a realizar la busqueda de puntos para mantener actualizada la lista de edicion\n if((vm.nameTipoSeleccionado.nombre == \"todos\")||(vm.nameTipoSeleccionado.nombre == vm.tipoSeleccionado.nombre)){\n console.log(\"[EDIT]: va a traer los ptoInteres\");\n getTipoPuntos();\n }\n else{\n console.log(\"[EDIT]: lo deja como esta, no busca puntos\");\n }\n \n }", "function obtenerArbolDepartamentos(s, d, e) {\n if(s) {\n $('form[name=frmGestionPerfil] .arbolDepartamento').append(procesarArbolDep(d));\n $('form[name=frmGestionPerfil] .arbolDepartamento').genTreed(); // Añade clases y imagenes a la lista html para hacerla interactiva\n\n $('form[name=frmGestionPerfil] .arbolDepartamento.tree li').dblclick(function (e) {\n let me = $(this);\n $('form[name=frmGestionPerfil] .tree li').each(function () {\n $(this).removeClass('filaSeleccionada');\n });\n me.addClass('filaSeleccionada');\n\n Moduls.app.child.templateParamas.template.Forms.frmGestionPerfil.set({\n p_objtiv: me.attr('id')\n });\n\n $('form[name=frmGestionPerfil] [name=nomdep]').val(me.attr('name'));\n $('form[name=frmGestionPerfil] [name=nomdep]').change();\n $('form[name=frmGestionPerfil] .arbolDepartamento').addClass('dn');\n return false;\n });\n } else {\n validaErroresCbk(d, true);\n }\n}", "function carregarListaUnidadesCadastradas(){\n\tDWRUtil.removeAllOptions(\"comboUnidade\");\n\tFacadeAjax.getListaUnidadesSuporte(function montaComboUnidadeCadastradas(listBeans){\n\t\tDWRUtil.removeAllOptions(\"comboUnidade\");\n\t\tDWRUtil.addOptions(\"comboUnidade\", listBeans, \"idUsuario\",\"nome\");\n\t});\n}", "function carregaOpcoesUnidadeSuporte(){\n\tcarregaTipoGerencia();\t\n\tcarregaTecnicos();\n\tcarregaUnidadesSolicitantes();\t\n\tcarregaEdicaoTipos();//no arquivo tipoSubtipo.js\n\tcarregaComboTipo();//no arquivo tipoSubtipo.js\n}", "function template_actualizar_ciudad(nomElemento, idCiudad, idColonia) {\n\tvar indexEstado = -1;\n\tvar arrayEstados = Array(\"template_venta_estado\", \"template_renta_estado\", \"template_rentaVac_estado\", \"template_busqueda_estado\");\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\", \"template_busqueda_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\", \"template_busqueda_colonia\");\n\t\n\tindexEstado = arrayEstados.indexOf(nomElemento);\n\t\n\tif (indexEstado > -1) {\n\t\tobjEstado = $(\"#\"+nomElemento);\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexEstado]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexEstado]);\n\t\t\n\t\t\n\t\tobjMunicipio.find(\"li.lista ul\").html(\"\");\n\t\tobjMunicipio.find(\"p\").attr(\"data-value\", -1);\n\t\tobjMunicipio.find(\"p\").text(\"\");\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: objEstado.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjMunicipio.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjMunicipio.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjMunicipio.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjMunicipio.find(\"p\").text($(this).text());\n\t\t\t\t\t\ttemplate_actualizar_colonia(objMunicipio.prop(\"id\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif ((idCiudad != null) && (idCiudad != -1)) {\n\t\t\t\t\tobjMunicipio.find(\"li.lista li[data-value='\"+idCiudad+\"']\").click();\n\t\t\t\t\tobjMunicipio.find(\"li.lista\").hide();\n\t\t\t\t\t\n\t\t\t\t\tif ((idColonia != null) && (idColonia != -1)) {\n\t\t\t\t\t\ttemplate_actualizar_colonia(objMunicipio.prop(\"id\"), idColonia);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function listarMaterialesCaja(id_tipo_caja) {\n var cantidad = $(\"#cantidad\").val();\n cantidad = (cantidad=='')? 0: cantidad;\n $.ajax({\n url: $.PATH + \"almacen?function=listMaterialesCaja\",\n data: {id_tipo_caja: id_tipo_caja},\n dataType: \"json\",\n cache: false,\n type: \"get\",\n success: function(response) {\n var html = \"\";\n if (response.data != null) {\n $.flgMateriales = true; // para validar envío\n var response = response.data;\n for (var i = 0; i < response.length; i++) {\n var color = '';\n if (response[i].stock_requerido == '1') {\n if (response[i].stock <= response[i].stock_minimo) {\n color = '#FAAC58';\n }\n }\n html += \"<tr style='background-color: \"+color+\"'>\";\n html += \"<td>\"+response[i].codigo+\"</td>\";\n html += \"<td>\"+response[i].nombre+\"</td>\";\n html += \"<td>\"+response[i].stock+\"</td>\";\n html += \"<td>\"+response[i].unidad_medida+\"</td>\"; \n var valor = 0;\n if (response[i].calcular == '1') {\n valor = parseFloat(cantidad)*parseFloat(response[i].multiplo);\n } else {\n valor = response[i].multiplo;\n }\n html += \"<td><input name='id_materiales[]' type='hidden' value='\"+response[i].id+\"'>\";\n html += \"<input name='materiales[]' type='text' class='decimal' style='width: 50px;' value='\"+valor+\"'></td>\";\n html += \"<td>\"+response[i].tipo+\"</td>\";\n html += \"</tr>\";\n }\n } else {\n $.flgMateriales = false; // para validar envío\n }\n $(\"#tbl-materiales tbody\").html(html);\n $(\"#tbl-materiales tbody\").css({\"color\":\"#000\"});\n $(\".decimal\").numeric(\".\");\n $(\".decimal\").blur(function (e) {\n var v = $(this).val().trim();\n v = (v == \"\")?0:parseFloat(v);\n var cantidad = $(\"#cantidad\").val().trim();\n cantidad = (cantidad == \"\")?0:parseFloat(cantidad);\n if (v == 0 && cantidad > 0) {\n //$(this).focus();\n $.flgEntrega = false;\n $(this).css({\"background-color\":\"#FF0000\"});\n } else {\n $.flgEntrega = true;\n $(this).css({\"background-color\":\"#FFFFFF\"});\n }\n });\n },\n error: function(response) {\n console.log(response);\n }\n });\n }", "function cadastrarUmaUnidade(){\n\tvar unidadeSelecionadaBDTRE = DWRUtil.getValue(\"comboUnidadeTRE\"); \n\tif(unidadeSelecionadaBDTRE==null || unidadeSelecionadaBDTRE==''){\n\t\talert(\"Selecione uma unidade a ser cadastrada.\");\n\t}else{\n\t\tvar loginGerente = DWRUtil.getValue(\"loginGerenteUnidade\");\n\t\tvar matriculaGerente = DWRUtil.getValue(\"matriculaGerente\"); \n\t\tFacadeAjax.cadastrarUnidadeSuporte(unidadeSelecionadaBDTRE,loginGerente,matriculaGerente);\n\t\tcarregarCamposUnidades();\n\t}\n}", "function somarInventarioDepartamento(departamento) {\n let somaInventario = 0;\n for (p in listaProdutos) {\n if (listaProdutos[p].departamento.nomeDepto == departamento) {\n somaInventario += listaProdutos[p].qtdEstoque * listaProdutos[p].preco\n }\n }\n somaInventario = somaInventario.toLocaleString('pt-BR', {style: 'currency', currency: 'BRL'});\n return {departamento, somaInventario};\n}", "function ResumenOrden()\r\n\t{\r\n\t var buffer = '';\r\n\t \r\n\t if (_orden.length == 0)\r\n\t {\r\n\t \t$(\"#search\").focus();\r\n\t }\r\n\t \r\n\t buffer += '<h1 class=\"titulo_resumen\">Resumen de la orden</h1>';\r\n\t \r\n\t \r\n\t buffer += '<table class=\"table\" id=\"seleccion_producto\">';\r\n\t var contadorMonto=0;\r\n\t var SimboloMoneda = $(\"#Moneda\").val();\r\n\t _total_adicionales=0;\r\n\t for (x in _orden)\r\n\t {\r\n\t \t\r\n\t var adicionales = '';\r\n\t if (_orden[x].adicionales.length > 0) {\r\n\t \t\r\n\t adicionales += '<b>Agregar:</b>';\r\n\t \r\n\t adicionales += '<ul>';\t \r\n\t for (y in _orden[x].adicionales) {\r\n\t \t\r\n\t \tadicionales += \"<li>\" + _orden[x].adicionales[y].item + \" \"+SimboloMoneda +\" \"+ _orden[x].adicionales[y].precio+\"</li>\";\r\n\t \t_total_adicionales += parseFloat(_orden[x].adicionales[y].precio);\r\n\t }\t \r\n\t adicionales += '</ul>';\r\n\r\n\t }\r\n\t \r\n\t var quitar = '';\t \r\n\t if (_orden[x].ingredientes.length > 0) {\r\n\t quitar += '<b>Quitar:</b>';\r\n\t quitar += '<ul>';\r\n\t \r\n\t for (y in _orden[x].ingredientes) {\r\n\t quitar += '<li>' + _orden[x].ingredientes[y].nombre_m + '</li>';\r\n\t }\t \r\n\t quitar += '</ul>';\t \r\n\t }\r\n\r\n\t var nota = '';\t \r\n\t if (_orden[x].llevar.abc==\"1\") {\t \t\r\n\t nota += '<b>Nota:</b>';\r\n\t nota += '<ul>';\r\n\t \r\n\t for (y in _orden[x].llevar) {\r\n\t nota += '<li>Para Llevar</li>';\r\n\t }\t \r\n\t nota += '</ul>';\t \r\n\t }\r\n\t \r\n\t contadorMonto += parseFloat(_orden[x].precio);\r\n\t buffer += '<tr ID_orden=\"' + x + '\">';\r\n\t buffer += '<td>' + (parseInt(x)+1) + '</td>';\r\n\t buffer += '<td><div style=\"color:blue;font-weight:bold;\">' + _orden[x].detalle + '</div><div>' + adicionales + '</div><div>' + quitar + nota+ '</div></td>';\r\n\t buffer += '<td>' +SimboloMoneda +' '+ _orden[x].precio + '</td>';\r\n\t buffer += '<td><button class=\"btn_eliminar_pedido\">Eliminar</button></td>';\r\n\t buffer += '</tr>';\r\n\t \r\n\t }\t \r\n\t buffer += '<tr><td>#</td><td></td><td>Total = '+ SimboloMoneda+' '+ (contadorMonto+_total_adicionales)+'</td><td></td></tr>';\r\n\t buffer += '</table>';\r\n\t \r\n\t \r\n\t //_orden[x].precio;\r\n\r\n\t if($(\"#resumen\").html() != \"\"){\r\n\t \t$(\"#scroller\").show();\r\n\t \t$(\"#resumen\").empty();\r\n\t }else{\r\n\t \t$(\"#resumen\").html(buffer);\r\n\t \t$(\"#scroller\").hide();\r\n\t }\t \r\n\t}", "function carregarCampos() {\n let qtd_locais_medidos = 0;\n let element = \"\";\n let array_taxas = [];\n\n array_taxas = montaSelectTaxaMetabolica();\n\n qtd_locais_medidos = buscaQtdeLocais();\n\n if (qtd_locais_medidos < 1 || qtd_locais_medidos > 5) {\n clearAll();\n mostraErro(\"O número de locais medidos deve estar entre 1 e 5\",\"\");\n\n return;\n }\n\n resetResultado();\n\n for (let i = 0; i < qtd_locais_medidos ; i++) {\n\n element += \"<div class='window_local'>\";\n element += \"<h3>Local \" + (i+1) + \"</h3>\";\n\n element += \"<label for='ibutg_local_\" + (i + 1) + \"'>Nome</label>\";\n \n element += \"<input type='text' \";\n element += \"name='nome_local_\" + (i + 1) + \"' \";\n element += \"id='nome_local_\" + (i + 1) + \"' \";\n element += \"maxlength='25'\";\n element += \"placeholder='Nome do local medido \" + (i + 1) + \"' \";\n element += \"/>\";\n\n element += \"<label for='ibutg_local_\" + (i + 1) + \"'>IBUTG</label>\";\n \n element += \"<input type='number' \";\n element += \"name='ibutg_local_\" + (i + 1) + \"' \";\n element += \"id='ibutg_local_\" + (i + 1) + \"' \";\n element += \"placeholder='IBUTG medido no local \" + (i + 1) + \"' \";\n element += \"/>\";\n\n element += \"<label for='tempo_local_\" + (i + 1) + \"'>Tempo</label>\";\n\n element += \"<input type='number' \";\n element += \"name='tempo_local_\" + (i + 1) + \"' \";\n element += \"id='tempo_local_\" + (i + 1) + \"' \";\n element += \"placeholder='Tempo no local \" + (i + 1) + \" (minutos)' \";\n element += \"/>\";\n\n element += \"<label for='select_metabolica_local_\" + (i + 1) + \"'>Atividade</label>\";\n\n element += \"<select name='select_metabolica_local_\" + (i + 1) + \"'\";\n element += \"id='select_metabolica_local_\" + (i + 1) + \"' onchange='selecionarTaxa(\" + (i + 1) + \")'>\";\n\n\n for (let x = 0; x < array_taxas.length ; x++) {\n element += \"<option value='\";\n element += array_taxas[x]['valor'];\n element += \"'>\";\n element += array_taxas[x]['descricao'];\n element += \"</option>\";\n }\n\n element += \"</select>\";\n\n element += \"<label for='metabolica_local_\" + (i + 1) + \"'>Taxa Metabólica</label>\";\n\n element += \"<input type='number' \";\n element += \"name='metabolica_local_\" + (i + 1) + \"' \";\n element += \"id='metabolica_local_\" + (i + 1) + \"' \";\n element += \"placeholder='Taxa metabólica no local \" + (i + 1) + \"' \";\n element += \"readonly/>\";\n\n element += \"</div>\";\n }\n\n $(\".window_campos\").html(element);\n $(\"#calcular\").show();\n\n return;\n}", "function getVuelos() {\n $.ajax({\n url: '/api/search/trip-options',\n dataType: 'json',\n data: {\n 'fromCity': currentTrip.fromCity.code,\n 'toCity': currentTrip.toCity.code,\n 'startDate': currentTrip.startDate,\n 'endDate': currentTrip.endDate,\n 'offset': 0, //TODO falta paginación!\n 'limit': 5\n },\n success: function (data) {\n $(\"#cargandoVuelos\").hide();\n airports = data.airports;\n airlines = data.airlines;\n var datalen = data.items.length;\n if (datalen > 0) {\n $(\"#sinVuelos\").hide();\n $(\"#lstVuelos\").show();\n $(\"#lstVuelos .list-group\").html('');\n opcionesViaje = data.items;\n var i = 0;\n var line;\n \n// \tEsto es par limpiar los marcadores que vengan en el mapa de un modal abierto anteriormennte\n if (markersVuelos.length > 0) {\n \tconsole.log(\"TIENE MARKERS, LIMPIO\");\n for (i in markersVuelos) {\n \tmarkersVuelos[i].setMap(null);\n }\n markersVuelos.length = 0;\n }\n if (lineasVuelos.length > 0) {\n \tconsole.log(\"TIENE Lineas, LIMPIO\");\n for (i in lineasVuelos) {\n \tlineasVuelos[i].setMap(null);\n }\n lineasVuelos.length = 0;\n }\n \n for (i = 0; i < datalen; i++) {\n $(\"#listaVuelos\").append(templateVuelo(i, data.items[i]));\n }\n $(\"div[role=opciones-vuelo]\").hide();\n $(\"a[role=ver-detalle-vuelo]\").click(function (event) {\n $(\"div[role=opciones-vuelo][vuelo!=\" + $(this).attr(\"vuelo\") + \"]\").hide();\n $(\"div[role=opciones-vuelo][vuelo!=\" + $(this).attr(\"vuelo\") + \"]\").children(\"input[type=radio]\").prop(\"disabled\", true);\n $(\"div[role=opciones-vuelo][vuelo=\" + $(this).attr(\"vuelo\") + \"]\").toggle();\n $(\"div[role=opciones-vuelo][vuelo=\" + $(this).attr(\"vuelo\") + \"]\").children(\"input[type=radio]\").prop(\"disabled\", false);\n });\n $(\"input[type=radio][alternativa]\").click(function (event) {\n var i_vuelo = $(this).parents(\"div[role=opciones-vuelo]\").attr(\"vuelo\");\n var i_alternativa = $(this).attr('alternativa');\n var i_type = $(this).parents(\"div[role=opciones-vuelo]\").attr(\"type\");\n var airportdata = new Array();\n\n if (i_type == \"ida\") {\n currentTrip.outbound = opcionesViaje[i_vuelo].outbound_choices[i_alternativa];\n var tam = currentTrip.outbound.segments.length - 1; //Maxima posicion de segmento\n\n for (var x in airports) {\n if (airports[x].code == currentTrip.outbound.segments[0].from) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n for (var x in airports) {\n if (airports[x].code == currentTrip.outbound.segments[tam].to) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n } else {\n currentTrip.inbound = opcionesViaje[i_vuelo].inbound_choices[i_alternativa];\n var tam = currentTrip.inbound.segments.length - 1;\n\n for (var x in airports) {\n if (airports[x].code == currentTrip.inbound.segments[0].from) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n for (var x in airports) {\n if (airports[x].code == currentTrip.inbound.segments[tam].to) {\n console.log('Encontre el aeropuerto: ' + airports[x].code + ' en L: ' + airports[x].latitude + ' Lon: ' + airports[x].longitude + ' - ' + airports[x].name);\n airportdata.push({\"latitude\": airports[x].latitude, \"longitude\": airports[x].longitude, \"descripcion\": airports[x].name});\n }\n }\n }\n drawFlightRoute(airportdata);\n currentTrip.price = opcionesViaje[i_vuelo].price_detail;\n if (currentTrip.isReady()) {\n $(\"#btnViajar\").show();\n }\n });\n }\n else {\n $(\"#cargandoVuelos\").hide();\n $(\"#lstVuelos\").show();\n $(\"#sinVuelos\").show();\n }\n\n },\n error: function () {\n $(\"#cargandoVuelos\").hide();\n $(\"#lstVuelos\").show();\n $(\"#sinVuelos\").show();\n \n }\n });\n}", "function cmbdepartemen(){\n $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen',\n dataType:'json',\n type:'post',\n success:function(dt){\n var out='';\n if(dt.status!='sukses'){\n out+='<option value=\"\">'+dt.status+'</option>';\n }else{\n $.each(dt.departemen, function(id,item){\n out+='<option value=\"'+item.replid+'\">'+item.nama+'</option>';\n });\n //panggil fungsi viewTB() ==> tampilkan tabel \n viewTB(dt.departemen[0].replid); \n }$('#departemenS').html(out);\n cmbtahunajaran(dt.departemen[0].replid);\n }\n });\n }", "function populateDepInfo() {\n const depCheck = document.querySelectorAll(\"#depTable tbody tr\"); //Get Department Table Rows\n let deps = getDeps();\n if (depCheck.length == 0) {\n for (let j = 0; j < deps.length; j++) {\n let depOb = new CRUD(\"depTable\", \"depSelect\", deps[j]); //Create Object for department\n depOb.addOption();\n depOb.addRow();\n }\n } else {\n removeExistingDep();\n populateDepInfo();\n }\n}", "function cargarenFormulario(id, descripcion, nombrecomercial, nit, telefono, direccion, departamento, municipio, actividad, tipoPago, numeroest, numeroreg, fechaRegistro, fechaConstitucion) {\n limpiar();\n\n\n\n $('#nit').val(nit);\n $('#nombre').val(descripcion);\n $('#razon').val(nombrecomercial);\n $('#telefono').val(telefono);\n $('#direccion').val(direccion);\n $('#id').val(id);\n $('#departamento').val(departamento);\n $('#municipio').html('<option value=\"0\">Seleccione Una Opción</option>');\n $('#actividad').val(actividad);\n $('#tipoPago').val(tipoPago);\n $('#numeroest').val(numeroest);\n $('#numeroreg').val(numeroreg);\n $('#fechaRegistro').val(fechaRegistro);\n $('#fechaConstitucion').val(fechaConstitucion);\n\n\n\n\n //consume el ws para obtener los datos\n $.ajax({\n url: 'wscargar_datos.asmx/cargarMunicipiosPorDep',\n data: '{dep: ' + departamento + '}',\n type: 'POST',\n contentType: 'application/json; charset=utf-8',\n success: function (msg) {\n $.each(msg.d, function () {\n $('#municipio').append('<option value=\"' + this.id + '\">' + this.descripcion + '</option>')\n });\n\n $('#municipio').val(municipio)\n }\n });\n\n\n\n\n $('#MdNuevo').modal('toggle')\n\n $('#bt-guardar').html('<i class=\"material-icons\">cached</i>Actualizar');\n $('#bt-guardar').removeClass('btn-success');\n $('#bt-guardar').removeClass('btn-warning');\n $('#bt-guardar').addClass('btn-info');\n}", "function populateMonths() {\n let template = $('#ddlViewBy').find('option:selected').val();\n\n // update dropdown\n $(\"#monthID\").empty();\n for (i in availableMonths[template]) {\n let month = availableMonths[template][i];\n if (months.indexOf(month) < 0) {\n $(\"#monthID\").append($('<option></option>').val(month).html(month));\n }\n }\n }", "function cargar_empleados() {\n $('#inventable>tbody>tr').find(\"#select_empleado\").each(function() {\n $(this).load('editar_factura.php?' + 'process=cargar_empleados');\n totales();\n });\n}", "function fn_calcular(fila) {\n\n\n var enfoque = $(\"#cbo-enfoque\").val();\n if (enfoque == 1) {\n if (validarCampoE(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n KRVB: $(\"#txt-det-1-\" + fila).val(),\n CANTIDADB: $(\"#txt-det-2-\" + fila).val(),\n FACTOR_RENDIMIENTO: $(\"#txt-det-3-\" + fila).val(),\n ID_TIPO_FUENTEI: 1,\n ID_ENFOQUE: enfoque\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n } else if (enfoque == 2) {\n if (validarCampoH(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n KRVB: $(\"#txt-det-1-\" + fila).val(),\n KRV_COMBUSTIBLE: $(\"#txt-det-2-\" + fila).val(),\n CANTIDADB: $(\"#txt-det-3-\" + fila).val(),\n FACTOR_RENDIMIENTO: $(\"#txt-det-4-\" + fila).val(),\n ID_TIPO_FUENTEI: 2,\n ID_ENFOQUE: enfoque\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n } else if (enfoque == 3) {\n if (validarCampoEC(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n CONSUMO_ELECTRICIDAD: $(\"#txt-det-1-\" + fila).val(),\n ID_ENFOQUE: enfoque\n //ID_TIPO_FUENTEI: $(\"#cbo-enfoque\").val(),\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n } else if (enfoque == 4) {\n if (validarCampoHC(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n CONSUMO_ELECTRICIDAD: $(\"#txt-det-1-\" + fila).val(),\n CONSUMO_COMBUSTIBLE: $(\"#txt-det-2-\" + fila).val(),\n ID_ENFOQUE: enfoque\n //ID_TIPO_FUENTEI: $(\"#cbo-enfoque\").val(),\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n }\n}", "function getLieuFromRegionFirst(region,edNumber) {\n $.ajax({ \n url: '../json/ED'+edNumber+'/PositionsPoints'+edNumber+'.json', \n data: \"\",\n dataType: 'json', \n success: function(data)\n {\n $output = \"<div class='form-group'><label>\"+lieuDefi+\" :</label><select name='lieu' class='form-control' required><option disabled selected value></option>\";\n\n $.each(data, function(i, item) {\n if (typeof(data[i].lieu) != \"undefined\" && data[i].region == region) {\n $output += \"<option value=\"+data[i].lieu+\">\"+data[i].lieu+\"</option>\";\n }\n });\n $output += \"</select></div>\";\n $('#LieuList').html($output);\n $('#LieuList > div > select').val(dataRes.lieu);\n } \n });\n }", "function getFOptions_PeriodoPreNomina(idSelectOrigen, idSelectDestino, idChkDestino, codorganismo) {\r\n\tvar selectOrigen=document.getElementById(idSelectOrigen);\r\n\tvar optSelectOrigen=selectOrigen.options[selectOrigen.selectedIndex].value;\r\n\tvar selectDestino=document.getElementById(idSelectDestino);\r\n\tvar chkDestino=document.getElementById(idChkDestino);\r\n\tif (optSelectOrigen==\"\") {\r\n\t\tselectDestino.length=0;\r\n\t\tnuevaOpcion=document.createElement(\"option\");\r\n\t\tnuevaOpcion.value=\"\";\r\n\t\tnuevaOpcion.innerHTML=\"\";\r\n\t\tselectDestino.appendChild(nuevaOpcion);\r\n\t} else {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_selects.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"accion=getOptions_2PreNomina&tabla=\"+idSelectDestino+\"&opcion=\"+optSelectOrigen+\"&codorganismo=\"+codorganismo+\"&ventana=PRENOMINA\");\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tselectDestino.parentNode.innerHTML=ajax.responseText;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function BuscarMuni(departamento){\n $.ajax({\n url:'/admins/municipios/',\n datatype: 'JSON',\n type: 'POST',\n data: {\n departamento: departamento,\n csrfmiddlewaretoken: $('input:hidden[name=csrfmiddlewaretoken]').val()\n },\n success: (data) => {\n data = data.toString();\n res = data.replace(/\\(\\'|\\'\\,\\)/g, \"/\");\n res = res.split(\"/\")\n res = res.filter(e => e !== '');\n opt = new String();\n $.each(res, (i,v) => {\n opt+=\"<option value = \"+(i+1)+\">\"+v+\"</option>\";\n });\n $(\"#sl_muni\").html(opt);\n },\n error: (error, e) => {\n console.log(error + \" \" + e);\n }\n })\n}", "function marcarBases (idRuta) {\n var listaPuntosRuta = document.getElementById(\"listaPuntosRuta\");\n var listaBasesBD = document.getElementById(\"listaBasesInit\");\n var n = 0;\n \n // Formato entrada: idRuta, tipo, idBase, nom, lat, lon\n for (var i = 0; i < listaBasesBD.options.length; i++) {\n if (n == 2) break; // Extrictamente dos bases\n var infoBase = listaBasesBD.options[i].value;\n var ruta = infoBase.split(\",\")[0];\n \n if (ruta == idRuta) {\n var tipo = infoBase.split(\",\")[1];\n var base = infoBase.split(\",\")[2];\n var nom = infoBase.split(\",\")[3];\n var lat = infoBase.split(\",\")[4];\n var lon = infoBase.split(\",\")[5];\n var value = base +\",\"+ nom +\",\"+ lat +\",\"+ lon;\n var text = null; \n \n var option = document.createElement(\"option\"); \n \n if (tipo == \"1\") { n += 1;\n value = \"BS,\" + value;\n text = document.createTextNode(\"[BS] \" + nom);\n option.appendChild(text);\n option.setAttribute(\"value\", value); \n listaPuntosRuta.add(option, listaPuntosRuta[0]);\n addNewMarkExternMult(nom, lat, lon);\n } else { n += 1;\n value = \"BL,\" + value;\n text = document.createTextNode(\"[BL] \" + nom);\n option.appendChild(text);\n option.setAttribute(\"value\", value); \n listaPuntosRuta.appendChild(option); \n addNewMarkExternMult(nom, lat, lon);\n }\n }\n }\n disableDrag();\n}", "function llenarOrganizaciones( organizaciones ){\n\n // Borro los marcadores del mapa\n $(\".leaflet-marker-icon\").remove(); $(\".leaflet-popup\").remove();\n $(\".leaflet-pane.leaflet-shadow-pane\").remove();\n\n let divOrganizaciones = $('.listaOrganizaciones');\n divOrganizaciones.html('');\n\n //SI NO HAY ORGANIZACIONES CON NO LAS CARGO\n if( organizaciones.length < 1){\n divOrganizaciones.html(\n `<div class=\"alert alert-danger\" role=\"alert\">\n No se encontraron resultados\n </div>`\n );\n }\n else{\n\n moment.locale('es');\n organizaciones.forEach(org => {\n\n if(org.necesidades.length>0){\n let cardOrganizacion = `\n <div class=\"card cardOrganizacion cardOrganizacion${org.idUsuario} shadow-sm my-2\" style=\"display: block; opacity: 1;\">\n <div class=\"card-header d-flex flex-row px-2 justify-content-star detalleOrganizacion align-items-center\">\n <img class=\"rounded-circle imgPerfilOrg\" src=\"${org.urlFotoPerfilUsuario || 'assets/img/imgUserProfile.png'}\" alt=\"Avatar de la org ${org.razonSocial}\">\n <div id=\"card-org-name\" class=\"ml-2\">\n <a href=\"organizacion/${org.idUsuario}\">${org.razonSocial}</a>\n <a href=\"#\">${org.nombreTipoOrganizacion}</a>\n </div>\n </div>\n <div class=\"card-body p-0 listaNecesidades${org.idUsuario}\">\n\n </div>\n <div class=\"card-footer py-0 bg-transparent\">\n <a href=\"/organizacion/${org.idUsuario}\" class=\"btn btn-sm w-100 btn-link ml-auto text-decoration-none text-muted\">Ver todas</a>\n </div>\n </div>`\n\n divOrganizaciones.append( cardOrganizacion );\n org.necesidades.forEach( need => {\n\n $category = need.nombreCategoria.split(' ')[0].toLowerCase();\n $diffDate = moment(need.fechaCreacionNecesidad, \"YYYY-MM-DD HH:mm:ss\").startOf('day').fromNow();\n\n $(`.listaNecesidades${org.idUsuario}`).append(`\n <div class=\"need ${$category}\">\n <div class=\"card-body py-2 px-3\">\n <div class=\"card-title\"><a title=\"${$category}\" href=\"#\" class=\"card-category\">${capitalize(need.nombreCategoria)}</a></div>\n <div class=\"card-subtitle text-muted\">${capitalize(need.descripcionNecesidad)}</div>\n </div>\n <div class=\"card-footer d-flex align-items-center p-0\">\n <small class=\"ml-3 mr-auto align-items-center\">${$diffDate}</small>\n <button class=\"btn btn-link btn-sm btnDetalleOrg btnDetalleOrg${need.idNecesidad} text-decoration-none pl-0\" data-toggle=\"modal\" data-target=\"#modalDetalleNecesidad\">Me interesa</button>\n </div>\n </div>\n `);\n\n $(`.btnDetalleOrg${need.idNecesidad}`).on('click', function(){\n cargarDatosModalDetalleNecesidad(need);\n })\n\n\n })\n\n cargarOrgEnMapa(org);\n }\n })\n }\n agregarPaginacionListaOrganizaciones();\n}", "function MUPM_FillSelectTableDepartment() {\n //console.log(\"===== MUPM_FillSelectTableDepartment ===== \");\n //console.log(\"department_map\", department_map);\n\n const data_map = department_map;\n const tblBody_select = document.getElementById(\"id_MUPM_tbody_select\");\n tblBody_select.innerText = null;\n\n// --- loop through data_map\n let row_count = 0\n if(data_map.size > 1) {\n MUPM_FillSelectRow(tblBody_select, {}, \"<\" + loc.All_departments + \">\");\n }\n for (const [map_id, dict] of data_map.entries()) {\n MUPM_FillSelectRow(tblBody_select, dict);\n }\n\n } // MUPM_FillSelectTableDepartment", "function loadMembersSetForDep() {\n\t\n $.ajax(\"res/raw/staff.xml\").done(function(data) {\n \t\n \tvar depInfo = $(data).find(\"department[name=\\\"\"+decodeURI(getUrlVars().dep)+\"\\\"]\");\t//info del departamento seleccionado\n \t\n \t//generamos un acordeon con cada uno de los cargos del departamento\n \t$(depInfo).find(\"charge\").each(function(){\n \t\t\n \t\t$(\"#membersSet\").append(\"<div data-role=\\\"collapsible\\\">\"\n \t\t\t\t\t\t\t\t\t+ \"<h2>\" + $(this).attr(\"name\") + \"<span class=\\\"ui-li-count\\\">\" + $(this).find(\"member\").length + \"</span></h2>\"\n \t\t\t\t\t\t\t\t\t+ \"<ul class=\\\"membersList\\\" data-role=\\\"listview\\\"></ul></div>\");\n \t});\n \t$(\"#membersSet\").collapsibleset(\"refresh\");\t\t\n });\n}", "function recargarCategoria(select, codigo, categoria_id) {\n // Busco todas las categorias con el codigo actual\n /*$('#nueva-mercaderia').find('tr td.fila-categoria').each(function() {\n // Encuentro codigos iguales => escribo la descripcion\n if ($(this).parent().find('td.fila-codigo input').val() == codigo ) {\n /*console.log($(this).find('select'));\n cargarTallesDeCategoria($(this).find('select'));*/\n // Actualizo\n /*$(this).find('select').selectpicker('val', categoria_id).selectpicker('refresh');\n }\n });*/\n\n\n // Si la descripcion esta vacia, busco el primer articulo de igual codigo con descripcion llena\n if (categoria_id == \"\") {\n $('#nueva-mercaderia').find('td.fila-codigo').each(function() {\n // Encuentro codigos iguales\n if ($(this).find('input').val() == codigo ){\n // Si la descripcion está llena, la guardo\n var valor = $(this).parent().find('td.fila-categoria select').val();\n\n if ( valor != \"\") {\n categoria_id = valor;\n return false;\n }\n }\n });\n }\n\n // Busco todas las descripciones con el codigo actual\n $('#nueva-mercaderia').find('td.fila-codigo').each(function() {\n // Encuentro codigos iguales => escribo la descripcion\n if ($(this).find('input').val() == codigo ){\n $(this).parent().find('select.categoria_id').selectpicker('val', categoria_id).selectpicker('refresh');\n\n // Si la categoria actual es distinta a la nueva que se quiere poner => recargo los talles\n //cargarTallesDeCategoria($(this).parent().find('select'));\n\n // Si el genero actual es distinto al nuevo que se quiere poner => recargo los talles\n //cargarTallesDeGenero($(this).parent().find('select'));\n }\n });\n }", "function camposEdicionHorarioDeGrupo(horarioId, horario) {\n var esMateria = true;\n if (horario['rol_id'] == 1) esMateria = false;\n\n // Vaciamos los elementos de la fila y añadimos las opciones\n $(\"#horario\" + horarioId + \", #dia\" + horarioId)\n .children(\"p\")\n .hide();\n\n if (esMateria) {\n $(\"#horario\" + horarioId).append(\n '<select id=\"dias' + horarioId + '\"></select>'\n );\n } else {\n $(\"#dia\" + horarioId).append(\n '<select id=\"dias' + horarioId + '\"></select>'\n );\n }\n var dias = [\"LUNES\", \"MARTES\", \"MIERCOLES\", \"JUEVES\", \"VIERNES\", \"SABADO\"];\n dias.forEach((dia) => {\n $(\"#dias\" + horarioId).append(\n '<option value=\"' + dia + '\">' + dia + \"</option>\"\n );\n if (dia == horario[\"dia\"]) {\n $(\"#dias\" + horarioId + \" :last-child\").prop(\n \"selected\",\n \"selected\"\n );\n }\n });\n\n $(\"#horario\" + horarioId).append(\n '<input class=\"ml-1\" type=\"time\" id=\"horaInicio' +\n horarioId +\n '\" value=\"' +\n horario[\"hora_inicio\"].substring(0, 5) +\n '\" onchange=\"setHoraFin(' +\n horarioId + ', ' + esMateria +\n ')\"></input>'\n );\n $(\"#horario\" + horarioId).append(\n '<input class=\"ml-1\" type=\"time\" id=\"horaFin' +\n horarioId +\n '\" value=\"' +\n horario[\"hora_fin\"].substring(0, 5) +\n '\" disabled></input>'\n );\n\n // Obtenemos la diferencia entre la hora de inicio y la hora fin\n // y asignamos esa diferencia a los periodos\n var splitTimeInicio = horario[\"hora_inicio\"].split(\":\");\n var horaInicio = parseInt(splitTimeInicio[0]);\n var minutosInicio = parseInt(splitTimeInicio[1]);\n\n var splitTimeFin = horario[\"hora_fin\"].split(\":\");\n var horaFin = parseInt(splitTimeFin[0]);\n var minutosFin = parseInt(splitTimeFin[1]);\n\n var periodos = horaFin * 60 + minutosFin - horaInicio * 60 - minutosInicio;\n if (esMateria) periodos /= 45;\n else periodos /= 60;\n\n $(\"#horario\" + horarioId).append(\n '<input class=\"ml-1\" type=\"number\" name=\"\" id=\"periodo' +\n horarioId +\n '\" min=\"1\" max=\"12\" value=\"' +\n periodos +\n '\" onchange=\"setHoraFin(' +\n horarioId + ', ' + esMateria +\n ')\">'\n );\n\n $(\"#cargo\" + horarioId)\n .children(\"p\")\n .hide();\n $(\"#cargo\" + horarioId).append(\n '<select id=\"cargos' + horarioId + '\"></select>'\n );\n $(\"#cargos\" + horarioId).append(\n '<option value=\"DOCENCIA\">DOCENCIA</option>'\n );\n $(\"#cargos\" + horarioId).append(\n '<option value=\"AUXILIATURA\">AUXILIATURA</option>'\n );\n if (horario[\"rol_id\"] == 3)\n $(\"#cargos\" + horarioId + \" :first-child\").prop(\"selected\", \"selected\");\n else $(\"#cargos\" + horarioId + \" :last-child\").prop(\"selected\", \"selected\");\n\n $(\"#botonEditar\" + horarioId).hide();\n $(\"[id^=botonEditar]\").prop(\"disabled\", true);\n $(\"[id^=botonEliminar]\").prop(\"disabled\", true);\n $(\"#botonEliminar\" + horarioId).prop(\"disabled\", false);\n\n $(\n \"<input id = botonAceptar\" +\n horarioId +\n ' width=\"30rem\" height=\"30rem\" type=\"image\" name=\"botonAceptar\"' +\n ' src=\"/icons/aceptar.png\" alt=\"Aceptar\"onclick=\"aceptarEdicionHorarioDeGrupo(' +\n horarioId +\n ')\">'\n ).insertBefore(\"#botonEliminar\" + horarioId);\n\n $(\n \"<input id = botonCancelar\" +\n horarioId +\n ' width=\"30rem\" height=\"30rem\" type=\"image\" name=\"botonCancelar\"' + \n ' src=\"/icons/cancelar.png\" alt=\"Cancelar\"onclick=\"cancelarEdicionHorarioDeGrupo(' +\n horarioId +\n '); activar()\">'\n ).insertBefore(\"#botonEliminar\" + horarioId);\n}", "function iniciar(){\n for(var i = 1; i <= 31; i ++){\n var dezena = diaSorteService.montaDezena(i);\n vm.dezenas.push(dezena);\n }\n }", "function cambiarCiudadEditar(id_p, seleccionado){\n\t$.post(\"/contacts/get_city\",{id_pais:id_p},function(data){\n\t\tvar obj_int = jQuery.parseJSON(data);\n\t\tvar opciones = \"\";\n\t\tif(obj_int){\n\t\t\t$.each(obj_int, function(i, item) {\n\t\t\t\tvar sel = \"\";\n\t\t\t\tif(item.id == seleccionado){\n\t\t\t\t\tsel = \"selected\";\n\t\t\t\t}\n\t\t\t\topciones += '<option value=\"'+item.id+'\" '+sel+'>'+item.name+'</option>';\n\t\t\t});\n\n\t\t}\t\n\t\t$(\".cbo-city\").html(opciones);\n\t\t\n\t\t\n\t});\n}", "function devolver_campos_de_lista(map,id_male,id_female){\n\tconsole.log('ejecutando: devolver campos de lista');\n\tconsole.log(map);\n\t$('tbody td a.id_click').on('click',function(e){\n\t\tconsole.log('estoy aqui');\n\t\te.preventDefault();\n\t\t$(\"#id_buscar_mujeres\").modal('hide'); \n\t\t$(\"#id_buscar_hombres\").modal('hide');\n\t\tvar id = $(this).parents('tr').attr('id');\n\t\tconsole.log('id: ' + id);\n\t\tvar objeto = map[id];\n\t\tconsole.log('objeto: ' + objeto);\n\t\tif(objeto.sexo =='m'){\n\t\t\t$(id_male+' option').remove();\n\t\t\t$(id_male).append('<option value=\"\"> -- Seleccione --</option><option value='+objeto.id+' selected>'+ objeto.full_name+'</option>');\n\t\t\tlimpiar_campos('#id_query_nombres, #id_query_apellidos','#id_query_cedula');\n\t\t\tlimpiar_campos('#id_query_nombres_h, #id_query_apellidos_h','#id_query_cedula_h');\n\t\t\tlimpiar_campos('#id_query_nombres_m, #id_query_apellidos_m','#id_query_cedula_m');\n\t\t\tocultar_tablas('#id_table_busqueda_usuarios','#id_button_cedula','#id_button_nombres','#id_div_form_buscar');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_hombres','#id_button_cedula_h','#id_button_nombres_h','#id_div_form_buscar_h');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_mujeres','#id_button_cedula_m','#id_button_nombres_m','#id_div_form_buscar_m');\n\t\t\tocultar_bottom('.bottom');\n\n\t\t} \n\t\tif (objeto.sexo =='f') {\n\t\t\t$(id_female+' option').remove();\n\t\t\t$(id_female).append('<option value=\"\"> -- Seleccione --</option><option value='+objeto.id+' selected>'+ objeto.full_name+'</option>');\n\t\t\tlimpiar_campos('#id_query_nombres, #id_query_apellidos','#id_query_cedula');\n\t\t\tlimpiar_campos('#id_query_nombres_h, #id_query_apellidos_h','#id_query_cedula_h');\n\t\t\tlimpiar_campos('#id_query_nombres_m, #id_query_apellidos_m','#id_query_cedula_m');\n\t\t\tocultar_tablas('#id_table_busqueda_usuarios','#id_button_cedula','#id_button_nombres','#id_div_form_buscar');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_hombres','#id_button_cedula_h','#id_button_nombres_h','#id_div_form_buscar_h');\n\t\t\tocultar_bottom('.bottom');\n\t\t\tocultar_tablas('#id_table_busqueda_mujeres','#id_button_cedula_m','#id_button_nombres_m','#id_div_form_buscar_m');\n\t\t\tocultar_bottom('.bottom');\n\n\t\t}\n\t});\n}", "function chargerDomaines() {\n return $.ajax({\n url: urlServiceWeb +'domainesEmploi/' + langue,\n dataType: 'JSON',\n success: function(retour) {\n for(var i = 0; i < retour.items.length; i++) {\n listeDomaines = listeDomaines + '<option value=\"' + retour.items[i].valeur + '\">' + retour.items[i].nom + '</option>';\n }\n },\n error: function() {\n $('#manitouSimplicite').html(messages.erreurs.chargementDomainesEmploi);\n }\n });\n }", "function paz(){\n\tDepartamento = new Array('<p>La Paz</p>');\n\tHistoria = new Array('<p class=\"text-justify\">La Paz es un departamento de El Salvador ubicado en la zona oriental del país. Limita al Norte con la república de Honduras; al Sur y al Oeste con el departamento de San Miguel, y al Sur y al Este con el departamento de La Unión. Su cabecera departamental es San Francisco. Morazán comprende un territorio de 1 447 km² y cuenta con una población de 181 285 habitantes.</p>');\n\t/*Declaracion de Variable Interna para recorrer el arreglo de Municipios,\n\tde la Misma manera para recorrer los elementos de otros arreglos*/\n\tvar Municipioss, Municipioss2, rios, lagos, volcanes, centertour, personaje;\n\tMunicipioss = \"\";\n\tMunicipios = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> La Union</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yucuaiquin</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Intipuca</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> El Carmen</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Bolivar</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Santa Rosa de Lima</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Anamoros</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Concepcion de Oriente</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Lislique </ol>');\n\tfor(i = 0; i < Municipios.length; i++){\n\t\tMunicipioss += Municipios[i];\n\t}\n\tMuniciipios2 = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> San Alejo</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Conchagua</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> San Jose</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yayantique</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Meanguera del Golfo</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Pasaquina</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Nueva Esparta</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Poloros</ol>');\n\tfor(m = 0; m< Municiipios2.length; m++){\n\t\tMunicipioss2 += Municiipios2[m];\n\t}\n\tRios = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> PLaya El Jaguey</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Playa Blanca</ol>');\n\trios = \"\";\n\tfor(j = 0; j < Rios.length; j++){\n\t\trios += Rios[j];\n\t}\n\tVolcanes = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Volcan Conchagua</ol>');\n\tPersonajes = new Array('<ol><span class=\"glyphicon glyphicon-ok\"></span> Antonio Grau Mora</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Maria Cegarra Salcedo</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Asensio Saez</ol>');\n\tpersonaje = \"\";\n\tfor(k = 0; k < Personajes.length; k++){\n\t\tpersonaje += Personajes[k];\n\t}\n\tCentroTour = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Parque de la Familia</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Bosque Conchagua</ol>');\n\tcentertour = \"\";\n\tfor(c = 0; c < CentroTour.length; c++){\n\t\tcentertour += CentroTour[c];\n\t}\n\n\tdocument.getElementById(\"Departament\").innerHTML = Departamento[0];\n\tdocument.getElementById(\"History\").innerHTML = Historia[0];\n\tdocument.getElementById(\"Municipio\").innerHTML = Municipioss;\n\tdocument.getElementById(\"Municipio2\").innerHTML = Municipioss2;\n\tdocument.getElementById(\"centro\").innerHTML = centertour;\n\tdocument.getElementById(\"Persons\").innerHTML = personaje;\n\tdocument.getElementById(\"river\").innerHTML = rios;\n\tdocument.getElementById(\"volca\").innerHTML = Volcanes[0];\n}", "function 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 consultarDatosPuntos() {\n $.ajax({\n type: 'POST',\n dataType: 'json',\n url: url + \"ReporteAPH/ctrlLocalizacionLesiones/ListarDatosPuntos\",\n data: {\"idReporteAPH\": idReporteAPH}\n }).done(function (res) {\n\n var puntoTemp = [];\n\n // Recorro el json res por cada iteración creo un objeto temporal\n // y lo agrego al arreglo de lesiones\n $.each(res , function (indexPunto , valorPunto) {\n\n var lesionesTemp = [];\n var datosLesiones = valorPunto.datosLesiones;\n\n // Se encarga de recorrer las lesiones y agregarlos a lesionesTemp\n $.each(datosLesiones , function (indexLesiones , valorLesiones) {\n\n var objLesiones = {\n 'nombre': valorLesiones.descripcionCIE10,\n 'cie10' : valorLesiones.codigoCIE10,\n 'id' : valorLesiones.idLesion,\n 'especificacion' : (valorLesiones.especificacionLesion != null) ? valorLesiones.especificacionLesion : ''\n };\n\n lesionesTemp.push(objLesiones);\n\n });\n\n // Construye objeto con las lesiones y las cordenadas x - y del punto\n var objPunto = {\n\n \"infoLesion\" : lesionesTemp,\n\n \"infoPunto\" : {\n 'posX' : valorPunto.datosPunto.posX,\n 'posY' : valorPunto.datosPunto.posY\n }\n\n };\n\n\n // Agrego al arreglo puntoTemp el objeto temporal objPunto\n puntoTemp.push(objPunto);\n\n // Almacena la cantidad de puntos que hay en el cuerpo\n canLesiones++;\n\n // Arma la estructura del #id\n var idLesion = 'Puntolesion_' + canLesiones;\n // i apunta al indice de la lesion ==> lesion[i]\n var i = puntoTemp.length - 1;\n\n // Creación de un punto en el DOM\n $(\"#cont_cuerpo\").append(\"<div class='lesion' id='\"+ idLesion +\"' onclick='consultarLesion(\"+ i +\" , this.id, event)'></div>\");\n\n\n // Ubicar el punto en las cordenadas correspondientes\n $(\"#\" + idLesion).css({\n top : objPunto.infoPunto.posY + '%',\n left : objPunto.infoPunto.posX + '%'\n });\n\n });\n\n // Setear arreglo lesiones con puntoTemp\n lesiones = puntoTemp;\n\n }).fail(function () {\n\n // alerta de error\n Notificate({\n tipo: 'error',\n titulo: 'Error $Ajax',\n descripcion: 'ReporteAPH/ctrlLocalizacionLesiones/ListarDatosPuntos',\n duracion: 4\n });\n\n });\n }", "function getFOptions_Periodo(idSelectOrigen, idSelectDestino, idChkDestino, codorganismo, opt) {\r\n\tvar selectOrigen=document.getElementById(idSelectOrigen);\r\n\tvar optSelectOrigen=selectOrigen.options[selectOrigen.selectedIndex].value;\r\n\tvar selectDestino=document.getElementById(idSelectDestino);\r\n\tvar chkDestino=document.getElementById(idChkDestino);\r\n\tif (optSelectOrigen==\"\") {\r\n\t\tselectDestino.length=0;\r\n\t\tnuevaOpcion=document.createElement(\"option\");\r\n\t\tnuevaOpcion.value=\"\";\r\n\t\tnuevaOpcion.innerHTML=\"\";\r\n\t\tselectDestino.appendChild(nuevaOpcion);\r\n\t} else {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_selects.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"accion=getOptions_2&tabla=\"+idSelectDestino+\"&opcion=\"+optSelectOrigen+\"&codorganismo=\"+codorganismo+\"&opt=\"+opt);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tselectDestino.parentNode.innerHTML=ajax.responseText;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function llenarComboDias(nombreCombo) {\r\n\tFECHA_INICIO = new String(document.formularioFiltro.fechaInicio.value);\r\n\tFECHA_FIN = new String(document.formularioFiltro.fechaFinRegistro.value);\r\n\tvar arregloInicio = FECHA_INICIO.split(\"/\");\r\n\tvar diaInicio = arregloInicio[0];\r\n\tvar mesInicio = arregloInicio[1];\r\n\tvar annoInicio = arregloInicio[2];\r\n\tmesInicio = mesInicio - 1;\r\n\tvar fechaInicio = new Date(annoInicio, mesInicio, diaInicio);\r\n\tvar diasSiguiente = 0;\r\n\tvar stringDia = \"\";\t//Este string es una variabla auxiliar para guardar el dia y agregarlo al combo\r\n\tlimpiarCombo(document.formularioFiltro.valorDia);\t\r\n\t\r\n\t//Agregamos la primera opcion del combo vacia \r\n\tstringDia = \"\";\r\n\taddOption(document.formularioFiltro.valorDia, stringDia, 0);\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tdiasSiguiente = fechaInicio.getTime() + ((24 * 60 * 60 * 1000) * i);\r\n\t\r\n\t\t// Cosntruimos el objeto Date con la cantidad de\r\n\t\t// miliseg que representan cada dia de la semana\r\n\t\tvar fecha = new Date(diasSiguiente);\r\n\t\tvar dia = fecha.getDate();\r\n\t\tvar mes = fecha.getMonth() + 1;\r\n\t\tvar anno = fecha.getFullYear();\r\n\t\tstringDia = dia + \"/\" + mes + \"/\" + anno;\t\t\r\n\t\t\r\n\t\t// agregamos la opcion\r\n\t\taddOption(document.formularioFiltro.valorDia, stringDia, i);\r\n\t}\r\n}", "function Consultar_sector(){\n\n\t$.ajax({\n\t\t\ttype:\"POST\",\n\t\t\turl:\"../../backend/ajax/query_select_direccion/sector.php\",\n\t\t\tdata:\"cod_mun=\" + $('#municipio').val(),\n\t\t\tsuccess:function(r){\n\t\t\t\t$('#sector').html(r);\n\n\t\t\t\t\t}\n\t\t\t\t});\n}", "function inmueble_onChange_estado_ciudad_colonia(estado, ciudad, colonia, _nombreCampoEstado, _nombreCampoCiudad, _nombreCamposColonia) {\n\tnombreCampoEstado = _nombreCampoEstado == null ? \"estado\" : _nombreCampoEstado;\n\tnombreCampoCiudad = _nombreCampoCiudad == null ? \"ciudad\" : _nombreCampoCiudad;\n\tnombreCamposColonia = _nombreCamposColonia == null ? \"colonia\" : _nombreCamposColonia;\n\t$(\"#\"+nombreCampoEstado).val(estado);\n\t\n\tif (estado != \"\") {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: estado\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t$(\"#\"+nombreCampoCiudad).prop(\"disabled\", false);\n\t\t\t\t$(\"#\"+nombreCampoCiudad+\" option[value!='-1']\").remove();\n\t\t\t\t\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\t$(\"#\"+nombreCampoCiudad).append(\"<option value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</option>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$(\"#\"+nombreCampoCiudad).val(ciudad);\n\t\t\t\t\n\t\t\t\tif (ciudad != \"\") {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"lib_php/consDireccion.php\",\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tconsColonia: 1,\n\t\t\t\t\t\t\tciudad: ciudad\n\t\t\t\t\t\t}\n\t\t\t\t\t}).always(function(respuesta_json2){\n\t\t\t\t\t\tif (respuesta_json2.isExito == 1) {\n\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia).prop(\"disabled\", false);\n\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia+\" option[value!='-1']\").remove();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (var x = 0; x < respuesta_json2.datos.length; x++) {\n\t\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia).append(\"<option value='\"+respuesta_json2.datos[x].id+\"' data-cp='\"+respuesta_json2.datos[x].cp+\"'>\"+respuesta_json2.datos[x].nombre+\"</option>\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(\"#\"+nombreCamposColonia).val(colonia);\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\t$(\"#\"+nombreCamposColonia).val(\"-1\");\n\t\t\t\t\t$(\"#\"+nombreCamposColonia).prop(\"disabled\", true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\telse {\n\t\t$(\"#\"+nombreCampoCiudad).val(\"-1\");\n\t\t$(\"#\"+nombreCamposColonia).val(\"-1\");\n\t\t\n\t\t$(\"#\"+nombreCampoCiudad).prop(\"disabled\", true);\n\t\t$(\"#\"+nombreCamposColonia).prop(\"disabled\", true);\n\t}\n}", "function calcular_puntos(json, grupo, fechas, nro_partidos, dict_puntajes_grupo){\n\n // 3 fechas por grupo.\n for (k = 0 ; k < 3 ; k++) {\n\n $.each(json[grupo][fechas[k]][\"partidos\"], function(i, f) {\n\n goles_eq_1 = document.getElementById(f.equipo_1+nro_partidos[k]).value;\n goles_eq_2 = document.getElementById(f.equipo_2+nro_partidos[k]).value;\n\n actualizar_tabla(goles_eq_1, goles_eq_2, f.equipo_1, dict_puntajes_grupo);\n actualizar_tabla(goles_eq_2, goles_eq_1, f.equipo_2, dict_puntajes_grupo);\n\n });\n }\n}", "function CargarDetalleDatos() {\n $(\"#cuerpoTablaIndicador\").html(\"\");\n var item = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ID_ENFOQUE: $(\"#cbo-enfoque\").val()\n }\n $.ajax({\n url: baseUrl + 'Gestion/ListarDetalleIndicador',\n type: 'POST',\n datatype: 'json',\n data: item,\n success: function (data) {\n if (data != null && data != \"\") {\n if (data.length > 0) {\n var total = 0.0;\n for (var i = 0; i < data.length; i++) {\n\n var enfoque = $(\"#cbo-enfoque\").val();\n if (enfoque == 1) {\n cargarCuerpoElectrico(data, (i + 1), enfoque, 1);\n } else if (enfoque == 2) {\n cargarCuerpoHibrido(data, (i + 1), enfoque, 1)\n } else if (enfoque == 3) {\n cargarCuerpoElectricoConsumo(data, (i + 1), enfoque, 1);\n } else if (enfoque == 4) {\n cargarCuerpoHibridoConsumo(data, (i + 1), enfoque, 1);\n }\n total += data[i][\"TOTAL_GEI_REDUCIDO\"]\n }\n $(\"#total-detalle\").html(\"\");\n $(\"#total-detalle\").append((Math.round(total * 100) / 100));\n $(\"#cuerpoTablaIndicador\").data(\"total\", total);\n $(\"#cuerpoTablaIndicador\").data(\"row\", data.length);\n }\n } else {\n cargarCuerpoTabla($(\"#cbo-enfoque\").val());\n //$(\"#total-detalle\").append('<strong id=\"total\">0.00 tCO<sub>2</sub>eq</strong>');\n //$(\"#total-detalle2\").append('<strong id=\"total2\">0.00 tCO<sub>2</sub>eq</strong>');\n }\n }\n });\n}", "function Ajax_Municipio_Departamento(departamento,multi) {\n\n $.ajax({\n type: 'post',\n url: '/Incorporaciones/Reportes/Mostrar_Municipios/',\n data: { 'departamento': departamento },\n success: function (response) {\n\n AldeasCb.ClearItems()\n CaserioCb.ClearItems()\n MuniCb.ClearItems()\n var ResponseParse = JSON.parse(response)\n if (JSON.parse(response).length != 0 && multi ==1)\n {\n MuniCb.AddItem(\"TODOS\", \"00\")\n }\n \n for (i = 0; i < ResponseParse.length ; i++) {\n MuniCb.AddItem(ResponseParse[i][\"desc_municipio\"], ResponseParse[i][\"cod_municipio\"])\n }\n }\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 buscarEntradasDeODC(tipoBusqueda){\n\tswitch (tipoBusqueda){\n\t\tcase 1: //Cuando el criterio de buesqueda es por Almacen, Proveedor, Fecha de ODC, Fecha de Entrada de Almacen\n\t\t\tvar almacenes = []; \n\t\t\t$('#ListaAlmacenes :selected').each(function(i, selected){ \n\t\t\t almacenes[i] = $(selected).val(); \n\t\t\t});\n\n\t\t\tvar proveedores = $(\"#select-proveedor\").find(\"option:selected\").val();\n\t\t\tvar fecha_inicio_odc = $(\"#fechadel1\").val();\n\t\t\tvar fecha_fin_odc = $(\"#fechaal1\").val();\n\t\t\tvar fecha_inicio_entrada_almacen = $(\"#fechadel2\").val();\n\t\t\tvar fecha_fin_entrada_almacen = $(\"#fechaal2\").val();\n\t\t\tvar FechaInicioODC = convierteFechaJava(fecha_inicio_odc);\n\t\t\tvar FechaFinODC = convierteFechaJava(fecha_fin_odc);\n\t\t\tvar FechaInicioEntradaAlmacen = convierteFechaJava(fecha_inicio_entrada_almacen);\n\t\t\tvar FechaFinEntradaAlmacen = convierteFechaJava(fecha_fin_entrada_almacen);\n\n\t\t\tif ( (proveedores==0) && (fecha_inicio_odc==\"\") && (fecha_inicio_entrada_almacen==\"\") && (fecha_inicio_entrada_almacen==\"\") && (fecha_fin_entrada_almacen==\"\") && (almacenes.length==0) ){\n\t\t\t\talert(\"Debe elegir al menos alg\\u00fan criterio de b\\u00fasqueda\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(FechaInicioODC > FechaFinODC){\n\t\t\t\talert(\"La fecha inicial no puede ser mayor a la fecha final en la fecha de orden de compra\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(FechaInicioEntradaAlmacen > FechaFinEntradaAlmacen){\n\t\t\t\t\talert(\"La fecha inicial no puede ser mayor a la fecha final en la fecha de entrada a almacen\");\n\t\t\t\t}else{\n\t\t\t\t\t$(\".detalle tbody tr\").remove();\n\t\t\t\t\tvar ruta = \"llenaTablaDetalle.php\";\n\t\t\t\t\tvar envio = \"almacenes=\" + almacenes + \"&proveedores=\" + proveedores + \"&fecha_inicio_odc=\" + fecha_inicio_odc + \"&fecha_fin_odc=\" + fecha_fin_odc + \"&fecha_inicio_entrada_almacen=\" + fecha_inicio_entrada_almacen + \"&fecha_fin_entrada_almacen=\" + fecha_fin_entrada_almacen + \"&proceso=ad_movimientos_almacen\";\n\t\t\t\t\tvar respuesta = ajaxN(ruta, envio);\n\t\t\t\t\t$(\".detalle tbody\").append(respuesta);\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 2: //Cuando el criterio de buesqueda es por Orden de Compra o Documento de Cliente\n\t\t\tvar idOrdenCompra = $(\"#TxtOrdenCompra\").val();\n\t\t\tvar documentoCliente = $(\"#TxtDocumentoCliente\").val();\n\n\t\t\tif ((idOrdenCompra==\"\") && (documentoCliente==\"\")){\n\t\t\t\talert('Debe introducir la orden de compra o el documento del cliente');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$(\".detalle tbody tr\").remove();\n\t\t\tvar ruta = \"llenaTablaDetalle.php\";\n\t\t\tvar envio = \"idOrdenCompra=\" + idOrdenCompra + \"&documentoCliente=\" + documentoCliente+\"&proceso=ad_movimientos_almacen\";\n\t\t\tvar respuesta = ajaxN(ruta, envio);\n\t\t\t$(\".detalle tbody\").append(respuesta);\n\t\tbreak;\n\t}\n}", "function cambiarCiudad(id_p){\n\t$.post(\"/contacts/get_city\",{id_pais:id_p},function(data){\n\t\tvar obj_int = jQuery.parseJSON(data);\n\t\tvar opciones = \"\";\n\t\tif(obj_int){\n\t\t\t$.each(obj_int, function(i, item) {\t\n\t\t\t\t//console.log(item);\n\t\t\t\topciones += '<option value=\"'+item.id+'\">'+item.name+'</option>';\n\t\t\t});\n\n\t\t}\t\n\t\t$(\".cbo-city\").html(opciones);\n\t\t\n\t\t\n\t});\n}", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "function mostrarCarritoRecuperado()\n{\n for (const precio of carritoRecuperado)\n {\n precioRecuperado = precio.precio + precioRecuperado;\n }\n $(\"#precioDelCarrito\").text(`Total: $${precioRecuperado}`);\n\n// SI HAY ITEMS EN EL CARRITO, MUESTRA PRODUCTOS\n for (const nombre of carritoRecuperado)\n {\n listaRecuperada.push(nombre.nombre+\"<br>\");\n }\n $(\"#productosEnCarrito\").append(listaRecuperada);\n\n// VUELVO A PUSHEAR LOS ITEMS EN EL CARRITO\n for (const item of carritoRecuperado)\n {\n carrito.push(item);\n }\n\n// ACTUALIZO EL CONTADOR DEL CARRITO\n contadorCarrito();\n\n}", "function inmueble_onChange_estado_ciudad_colonia(estado, ciudad, colonia) {\n\t$(\"#estado\").val(estado);\n\t\n\tif (estado != \"\") {\n\t\t$.ajax({\n\t\t\turl: \"lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsCiudad: 1,\n\t\t\t\testado: estado\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t$(\"#ciudad\").prop(\"disabled\", false);\n\t\t\t\t$(\"#ciudad option[value!='-1']\").remove();\n\t\t\t\t\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\t$(\"#ciudad\").append(\"<option value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</option>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$(\"#ciudad\").val(ciudad);\n\t\t\t\t\n\t\t\t\tif (ciudad != \"\") {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"lib_php/consDireccion.php\",\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tconsColonia: 1,\n\t\t\t\t\t\t\tciudad: ciudad\n\t\t\t\t\t\t}\n\t\t\t\t\t}).always(function(respuesta_json2){\n\t\t\t\t\t\tif (respuesta_json2.isExito == 1) {\n\t\t\t\t\t\t\t$(\"#colonia\").prop(\"disabled\", false);\n\t\t\t\t\t\t\t$(\"#colonia option[value!='-1']\").remove();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (var x = 0; x < respuesta_json2.datos.length; x++) {\n\t\t\t\t\t\t\t\t$(\"#colonia\").append(\"<option value='\"+respuesta_json2.datos[x].id+\"' data-cp='\"+respuesta_json2.datos[x].cp+\"'>\"+respuesta_json2.datos[x].nombre+\"</option>\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(\"#colonia\").val(colonia);\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\t$(\"#colonia\").val(\"-1\");\n\t\t\t\t\t$(\"#colonia\").prop(\"disabled\", true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\telse {\n\t\t$(\"#ciudad\").val(\"-1\");\n\t\t$(\"#colonia\").val(\"-1\");\n\t\t\n\t\t$(\"#ciudad\").prop(\"disabled\", true);\n\t\t$(\"#colonia\").prop(\"disabled\", true);\n\t}\n}", "function perdidasorporte() {\n var perdidasoportel = $(\"#materialsubbase1 option:selected\").text();\n if (perdidasoportel == \"\") {\n $(\"#tiposbrango\").val(\"\");\n $(\"#valorLsoporte\").val(\"\");\n $(\"#Kcorr\").val(\"\");\n } else if (perdidasoportel == \"Bases granulares tratadas con cemento\") {\n var rangol = \"0.0 - 1.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"1.0\");\n } else if (perdidasoportel == \"Sub-bases tratadas con cemento\") {\n var rangol = \"0.0 - 1.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"1.0\");\n } else if (perdidasoportel == \"Bases asfálticas\") {\n var rangol = \"0.0 - 1.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"1.0\");\n } else if (perdidasoportel == \"Sub-bases estabiliadas con asfalto\") {\n var rangol = \"0.0 - 1.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"1.0\");\n } else if (perdidasoportel == \"Estabilización con cal\") {\n var rangol = \"1.0 - 3.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"3.0\");\n } else if (perdidasoportel == \"Materiales granulares sin tratar\") {\n var rangol = \"1.0 - 3.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"3.0\");\n } else if (perdidasoportel == \"Suelos finos y sub-rasantes naturales\") {\n var rangol = \"2.0 - 3.0\"\n $(\"#tiposbrango\").val(rangol);\n $(\"#valorLsoporte\").val(\"3.0\");\n }\n}", "formata_dados_v2( resposta_HANA ){\n const reducer = (r, row) => {\n \n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia} - ${row.Transportadora} - ${row.Modal} -${row.Nome}`;\n const key_entrega = `${row.Item_pedido} - ${row.Cod_Material} - ${row.Material} - ${row.Remessa} - ${row.Dia} - ${row.N_nota_fiscal} - ${row.Peso}`;\n\n const caminhoes = {\n ID: parseInt(row.ID),\n Unidade: row.Unidade,\n Status: row.Status || 'Aguardando chegada do veículo',\n Nome: row.Nome,\n Placa: row.Placa,\n Transportadora: row.Transportadora,\n Modal: row.Modal,\n Dia: row.Dia,\n Material: row.Material,\n Materiais: {},\n Assinaturas: []\n };\n\n r[key_caminhao] = r[key_caminhao] || caminhoes;\n\n const entregas = {\n Item_pedido: row.Item_pedido,\n Cod_Material: row.Cod_Material,\n Material: row.Material,\n Remessa: row.Remessa,\n Dia: row.Dia,\n N_nota_fiscal: row.N_nota_fiscal,\n Peso: parseInt(row.Peso.replace('.', ''))\n };\n\n r[key_caminhao]['Materiais'][key_entrega] = r[key_caminhao]['Materiais'][key_entrega] || entregas;\n\n return r;\n };\n\n const organizado = resposta_HANA.reduce( (r, row) => reducer(r, row), {});\n\n const obj_organizado = Object.values(organizado);\n\n const obj_organizado_2 = obj_organizado.map( item => {\n item['Materiais'] = Object.values(item['Materiais']);\n\n return item\n });\n\n return obj_organizado_2;\n }", "function carregaNacionalidades() {\n\n\t\tnacionalidadeService.findAll().then(function(retorno) {\n\n\t\t\tcontroller.nacionalidades = angular.copy(retorno.data);\n\n\t\t\tnewOption = {\n\t\t\t\tid : \"\",\n\t\t\t\tdescricao : \"Todas\"\n\t\t\t};\n\t\t\tcontroller.nacionalidades.unshift(newOption);\n\n\t\t});\n\n\t}", "function mostraUnidade(IDitemSelecionado) {\n var $labelUnidade = $('#labelUnidade');\n\n for (var i in itens) {\n if (itens.hasOwnProperty(i) && itens[i]['id_item'] == IDitemSelecionado) {\n for (var j in unidades) {\n if (unidades.hasOwnProperty(j) && unidades[j]['unidade_id'] == itens[i]['unidade_padrao_id']) {\n $labelUnidade.text(unidades[j]['nome']);\n return;\n }\n }\n }\n }\n }", "function fnCargaPartidaCvePptoServicios(orden, tagref, cpeprod) {\n var regresadatos= false;\n\n dataObj = { \n option: 'mostrarPartidaCvePpto',\n dato: cpeprod,\n datotagref: tagref\n };\n\n $.ajax({\n async:false,\n cache:false,\n method: \"POST\",\n dataType: \"json\",\n url: url,\n data: dataObj\n\n }).done(function(data) {\n \n if (data.result) {\n dataJson = data.contenido.datos;\n //console.log( \"dataJson: \" + JSON.stringify(dataJson) );\n var contenidoCvePresupuestal = \"\";\n\n for (var info in dataJson) {\n contenidoCvePresupuestal += \"<option value='\" + dataJson[info].cvePresupuestal + \"'>\" + dataJson[info].cvePresupuestal + \"</option>\";\n regresadatos= true;\n }\n\n /*$(\"#selectCveArticulo\" + orden).empty();\n $(\"#selectCveArticulo\" + orden).append('<option value=\"0\">Cve ...</option>');\n fnFormatoSelectGeneral(\"#selectCveArticulo\" + orden);\n $(\"#selectCveArticulo\" + orden).multiselect('rebuild');\n\n $(\"#selectArticulo\" + orden).empty();\n $(\"#selectArticulo\" + orden).append('<option value=\"0\">Articulo ...</option>');\n fnFormatoSelectGeneral(\"#selectArticulo\" + orden);\n $(\"#selectArticulo\" + orden).multiselect('rebuild');*/\n\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).empty();\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).append(contenidoCvePresupuestal);\n fnFormatoSelectGeneral(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden);\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).multiselect('rebuild');\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).prop(\"readonly\", true);\n $(\"#selectPartidaEspecificaCvePresupuestalServ\" + orden).attr('disabled', 'disabled');\n\n //$(\"#selectCveArticulo\" + orden).html('<option value=\"0\">Cve ...</option>');\n //$(\"#selectArticulo\" + orden).html('<option value=\"0\">Articulo ...</option>');\n //$(\"#addedUMArticulo\" + orden).html(\"\");\n //$(\"#addedCantidadArticulo\" + orden).val(0);\n //$(\"#addedPEArticulo\" + orden).val(0);\n\n $(\"#idCvePresupuestal\" + orden).removeClass(\"hide\");\n \n ocultaCargandoGeneral();\n\n if (!regresadatos) {\n muestraMensaje(\"No existen clave presupuestal registrada para la partida \"+cpeprod);\n }\n }\n }).fail(function(result) {\n ocultaCargandoGeneral();\n console.log(\"ERROR\");\n console.log(result);\n //alert(result);\n });\n\n return regresadatos;\n}", "function initProvinces() {\n\t\t// Marcar/desmarcar todas\n\t\tdocument.getElementById(\"checkall\").onclick = function(e) {\n\t\t\tvar cname = this.className;\n\t\t\tvar check = (cname!=\"on\");\n\t\t\tthis.textContent = (check ? \"Desmarcar\" : \"Marcar\") + \" Todas\";\n\t\t\tthis.className = check ? \"on\" : \"\";\n\t\t\tprovs = document.getElementById(\"province\").getElementsByTagName(\"li\");\n\t\t\tfor (var i=2,il=provs.length; i<il; i++) {\n\t\t\t\tcheckProvince(provs[i], check);\t// Marca/desmarca todas las provincias\n\t\t\t}\n\t\t\tupdateAll();\n\t\t\treturn stopEvent(e);\n\t\t};\n\t\t// Excluir Ceuta, Melilla, Canarias\n\t\tdocument.getElementById(\"hide\").onclick = function(e) {\n\t\t\tvar cname = this.className;\n\t\t\tvar check = (cname!=\"on\"); \n\t\t\tthis.className = check ? \"on\" : \"\";\n\t\t\tskip = check;\n\t\t\tvar lis = document.getElementById(\"province\").getElementsByTagName(\"li\");\n\t\t\tfor (var l=0, ll=lis.length; l<ll; l++) {\n\t\t\t\tvar li = lis[l];\n\t\t\t\tli.style.display = skipProv(li.textContent) ? \"none\" : \"block\";\n\t\t\t}\n\t\t\tupdateAll();\n\t\t\treturn stopEvent(e);\n\t\t}\n\t\t// Explicación \n\t\tvar why = document.getElementById(\"whyhide\");\n\t\twhy.onmouseover = function(e) {\n\t\t\tdocument.getElementById(\"hide\").style.height = \"250px\";\n\t\t}\n\t\twhy.onmouseout = function() {\n\t\t\tdocument.getElementById(\"hide\").style.height = \"\";\n\t\t}\n\t\t// Selector de provincias en TOOL\n\t\tinitProvLinks(\"province\", function(e) {\n\t\t\tcheckProvince(this);\n\t\t\tupdateAll();\n\t\t\treturn stopEvent(e);\n\t\t});\n\t\t// desplegar la lista de provincias\n\t\tdocument.getElementById(\"prov-list\").onclick = dropList;\n\t}", "function resultado_detalle(id_asoc, operacion)\r\n{\r\n var base_url = document.getElementById('base_url').value;\r\n var consumo_lec = operacion;\r\n var controlador = base_url+'lectura/obtenertarifa/';\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{id_asoc:id_asoc, consumo_lec:consumo_lec},\r\n success:function(respuesta){\r\n \r\n //$(\"#encontrados\").val(\"- 0 -\");\r\n var registros = JSON.parse(respuesta);\r\n \r\n \r\n html = \"\";\r\n html += \"<div class='col-md-12'>\";\r\n html += \"<div class='box'>\";\r\n html += \"<div class='box-body table-responsive'>\";\r\n html += \"<table class='table table-striped'>\";\r\n html += \"<tr>\";\r\n html += \"<th class='text-center'>#</th>\";\r\n html += \"<th class='text-center'>DETALLE</th>\";\r\n html += \"<th class='text-center'>MONTO</th>\";\r\n html += \"</tr>\";\r\n \r\n html += \"<tr>\";\r\n html += \"<td>\"+1+\"</td>\";\r\n html += \"<td class='text-right' style='align-items: center'>Consumo Agua</td>\";\r\n html += \"<td>\";\r\n html += \"<input id='consumo_agua\"+id_asoc+\"' type='text' value='\"+registros[1]+\"' class='form-control' autocomplete='off' >\";\r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n html += \"<tr>\";\r\n html += \"<td>\"+2+\"</td>\";\r\n html += \"<td class='text-right' style='align-items: center'>Aportes</td>\";\r\n html += \"<td>\";\r\n html += \"<input id='aportes\"+id_asoc+\"' type='text' value='\"+registros[2]+\"' class='form-control' autocomplete='off' >\";\r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n html += \"<tr>\";\r\n html += \"<td>\"+3+\"</td>\";\r\n html += \"<td class='text-right' style='vertical-align: central'>Multas</td>\";\r\n html += \"<td>\";\r\n html += \"<input id='multas\"+id_asoc+\"' type='text' value='\"+registros[3]+\"' class='form-control' autocomplete='off' >\";\r\n html += \"<input id='tipo_asoc\"+id_asoc+\"' type='hidden' value='\"+registros[4]+\"'>\";\r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n \r\n \r\n html += \"</table>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n html += \"</div>\";\r\n \r\n $(\"#eldetalle\"+id_asoc).html(html);\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n //$(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n //document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n \r\n }); \r\n}", "_getDataByTipoPersona() {\n let id = this.config.layer_id_dc\n // let feature_dc = this.layersMap.getLayerInfoById(id);\n let query = new Query();\n query.where = `${this.field_tipo_persona} IS NOT NULL`;\n query.returnGeometry = false;\n query.returnDistinctValues = true;\n query.outFields = [this.field_tipo_persona];\n\n self_cw.feature_dc.layerObject.queryFeatures(query, function(results) {\n let features = results.features;\n if (features.length) {\n features.forEach(i => {\n let opt = document.createElement(\"option\");\n opt.value = i.attributes[self_cw.field_tipo_persona];\n opt.text = i.attributes[self_cw.field_tipo_persona];\n self_cw.select_tipo_persona_cw.add(opt);\n });\n let opt = document.createElement(\"option\");\n opt.value = '';\n opt.text = 'Todos';\n opt.selected = true;\n self_cw.select_tipo_persona_cw.add(opt);\n } else {\n self_cw._showMessage(self_cw.nls.error_tipo_persona_count)\n }\n }, function(error) {\n self_cw._showMessage(`${self_cw.nls.error_tipo_persona}\\n${error.message}`, type = 'error')\n })\n }", "function cnsFornec_montaQuery(){\n\n LimpaTabela(CNSFORNEC_DIV_TABELA);\n $(CNSFORNEC_DIV_TABELA).html(\"<img src='../component/loading.gif' />\");\n\n var funcao = \"funcao=monta&texto=\"+ encode_uri($(\"#cnsFornec_pesquisa\").val());\n\n funcao += \"&order=\" + $('#cnsFornec_ordem').val();\n\n funcao += \"&status=\"+$(\"#cnsFornec_cbStatus\").val()+\"&grupo=\"+$('#cnsFornec_cbGrupo').val()+\"&uf=\"+$('#cnsFornec_cbUF').val();\n\n ajax(funcao,CNSFORNEC_EXEC,function(retorno){\n \n\t\tif(!empty(retorno.error)){\n loading.close();\n\t\t\tswal('Erro ao buscar tabela de FORNECEDOR',retorno.mensagem,'error');\n\t\t\treturn;\n\t\t}\n\n\t\t$('#cnsFornec_record').val(retorno.total);\n\t\tobjTabelaFornec = retorno;\n\n if(empty(objFornecedor.divDaConsulta)){\n //FUNCAO QUE MONTA A PAGINACAO / E TRAZ OS REGISTROS DA PAGINA ATUAL\n LimpaTabela(CNSFORNEC_DIV_TABELA);\n cnsFornec_pagination(1);\n return;\n\t\t}\n\n //ainda não abriu a consulta\n\t\tif(!$('#'+objFornecedor.divDaConsulta).hasClass('active')){\n\t\t\t//retornou so um registro\n\t\t\tif(objTabelaFornec.total == 1) {\n\t\t\t\t$('#cnsFornec_position').val('0');\n\t\t\t\tcnsFrn_fecha(true);\n loading.close();\n\t\t\t\tswal.close();\n\t\t\t\treturn;\n\t\t\t}\n\n $CNSFORNECdimmer.dimmer(\"consulta show\");\n\t\t}\n\n\t\t//FUNCAO QUE MONTA A PAGINACAO / E TRAZ OS REGISTROS DA PAGINA ATUAL\n\t\tcnsFornec_pagination(1);\n loading.close();\n swal.close();\n });\n}", "function cargarProvincias() {\n $.ajax({\n dataType: 'json', //recibe un objeto tipo json\n url: URLWS + \"/consultar/provincias/lista\", //Direccion del webservice + la accion que se desea realizar (consultar(listar) datos del cliente)\n type: \"POST\", //Por medio de POST se cargan los datos\n success: function (data) {\n for (i = 0; i < data.length; i++) {\n //Cargar las provincias en el combo respectivo\n $(\"select[id=provincia]\").append(new Option(data[i][\"DSC_PROVINCIA\"], data[i][\"COD_PROVINCIA\"]));\n }\n }\n });\n}", "function consultar_sector(){\n$.ajax({\n\t\t\ttype:\"POST\",\n\t\t\turl:\"../../backend/ajax/query_direccion/sector.php\",\n\t\t\tdata:\"cod_mun=\" + $('#municipio').val(),\n\t\t\tsuccess:function(r){\n\t\t\t\t$('#sector').html(r);\n\n\t\t\t\t\t}\n\t\t\t\t});\n}", "function getEmpleadosDropdown() {\n $http.post(\"lateral/getNombresDropdown\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.listaEmpleados.data = r.data.d.data;\n \n }\n })\n }", "function template_actualizar_colonia(nomElemento) {\n\tvar indexMunicipio = -1;\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\");\n\t\n\tindexMunicipio = arrayCiudades.indexOf(nomElemento);\n\t\n\tif (indexMunicipio > -1) {\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexMunicipio]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexMunicipio]);\n\t\t\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsColonia: 1,\n\t\t\t\tciudad: objMunicipio.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjColonia.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjColonia.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjColonia.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjColonia.find(\"p\").text($(this).text());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}", "function Ajax_Aldeas_Municipios(Municipio, multi) {\n $.ajax({\n type: \"post\",\n url: \"/Incorporaciones/Reportes/Mostrar_Aldeas/\",\n data: { 'municipio': Municipio },\n success: function (response) {\n AldeasCb.ClearItems()\n CaserioCb.ClearItems()\n var ResponseParser = JSON.parse(response)\n if (JSON.parse(response).length != 0 && multi ==1)\n {\n AldeasCb.AddItem(\"TODOS\", \"00\")\n } \n for (i = 0 ; i < ResponseParser.length; i++) {\n AldeasCb.AddItem(ResponseParser[i][\"desc_aldea\"], ResponseParser[i][\"cod_aldea\"])\n }\n }\n })\n}", "function cargarDepartamentos() {\n\n //consume el ws para obtener los datos\n $.ajax({\n url: 'wscargar_datos.asmx/cargarDepartamentos',\n data: '',\n type: 'POST',\n contentType: 'application/json; charset=utf-8',\n beforeSend: function () {\n },\n success: function (msg) {\n $.each(msg.d, function () {\n $('#departamento').append('<option value=\"' + this.id + '\">' + this.descripcion + '</option>')\n });\n }\n });\n\n}", "function filtrar(){\n dados_periodos_filtrados = [];\n dados_departamentos_filtrados = [];\n dados_grupos_filtrados = [];\n\n for (var i = box_periodo.length - 1; i >= 0; i--) {\n dados_periodos_filtrados = dados_periodos_filtrados.concat(dados_atuais.filter(function(d){return d.periodo == box_periodo[i];}));\n }\n\n if (show_disciplina) {\n dados_processados = dados_periodos_filtrados;\n if (show_agrupamento==true){\n for (var i = box_grupo.length - 1; i >= 0; i--) {\n dados_grupos_filtrados = dados_grupos_filtrados.concat(dados_processados.filter(function(d){return d.grupo == box_grupo[i];}));\n }\n dados_processados = dados_grupos_filtrados;\n }\n } else{\n for (var i = box_departamento.length - 1; i >= 0; i--) {\n dados_departamentos_filtrados = dados_departamentos_filtrados.concat(dados_periodos_filtrados.filter(function(d){return d.departamento == box_departamento[i];}));\n }\n dados_processados = dados_departamentos_filtrados;\n }\n \n init(1200, 500,\"#infos2\");\n executa(dados_processados, 0,10,4);\n}", "function EligedropOrigen(ind, pantalla)\n {\n console.log(\"EligeDropOrigen: \" + ind + ' ' + pantalla);\n var ZonaElegida=DatosTarifarios.Zonas[ind];\n if (pantalla==1) {\n $('#lblOrigen').text(ZonaElegida);\n $('#ulDestino').empty();\n $('#lblDestino').text(\"Elegir zona destino\");\n $('#lblMonto').text('$$$');\n }else{\n $('#lblOrigen2').text(ZonaElegida);\n $('#ulDestino2').empty();\n $('#lblDestino2').text(\"Elegir zona destino\");\n $('#lblMonto2').text('$$$');\n }\n\n \n for (indice in DatosTarifarios.Tarifas)\n { \n var txt=DatosTarifarios.Tarifas[indice]['zona'];\n //console.log(txt);\n if (ZonaElegida==DatosTarifarios.Tarifas[indice]['zona_ref']) {\n var option='<li><a style=' + String.fromCharCode(34) + 'font-size:2em;' + String.fromCharCode(34) + ' href=\"javascript: EligedropDestino(' + indice + ', ' + pantalla + ')\">' + txt + '</a></li>';\n if (pantalla==1) {\n $('#ulDestino').append(option);\n }else{\n $('#ulDestino2').append(option);\n }\n };\n }\n }", "function generarProvincias() {\r\n\tprovinciaInput.querySelectorAll('*').forEach(n => n.remove());\r\nfor (var i = 0; i < regionesMejorado.length; i++) {\r\n\tfor (var f = 0; f < regionesMejorado[i].provincias.length; f++) {\r\n\tif (regionInput.value === regionesMejorado[i].region) {\r\n\t\tprovinciaInput.innerHTML = provinciaInput.innerHTML +\r\n '<option value=\"' + regionesMejorado[i].provincias[f].name + '\">' + regionesMejorado[i].provincias[f].name + '</option>';\r\n\t}\t\r\n\t}\r\n}\r\n}", "function fillCustomLists()\n{\n var i = 0;\n\n var veto_br = CalcMenu.returnVetoBreakfast();\n var veto_pr = CalcMenu.returnVetoPrimo();\n var veto_se = CalcMenu.returnVetoSecondo();\n var veto_cont = CalcMenu.returnVetoContorno();\n var veto_comp = CalcMenu.returnVetoCompleto();\n var veto_fr1 = CalcMenu.returnVetoFrutta();\n var veto_pn1 = CalcMenu.returnVetoPane();\n var veto_mer = CalcMenu.returnVetoMerenda();\n\n\n for (i = 0; i < breakfastModel.count; i++)if (!checkArray(veto_br,i)) listaColazioni.append({\"text\": breakfastModel.get(i).name, \"id\": i});\n for (i = 0; i < primiModel.count; i++) if (!checkArray(veto_pr,i)) listaPrimi.append({\"text\": primiModel.get(i).name, \"id\": i});\n for (i = 0; i < secondiModel.count; i++) if (!checkArray(veto_se,i)) listaSecondi.append({\"text\": secondiModel.get(i).name, \"id\": i});\n for (i = 0; i < contorniModel.count; i++) if (!checkArray(veto_cont,i)) listaContorni.append({\"text\": contorniModel.get(i).name, \"id\": i});\n for (i = 0; i < fullMealModel.count; i++) if (!checkArray(veto_comp,i)) listaFullMeal.append({\"text\": fullMealModel.get(i).name, \"id\": i});\n for (i = 0; i < fruttaModel.count; i++) if (!checkArray(veto_fr1,i)) listaFrutta.append({\"text\": fruttaModel.get(i).name, \"id\": i});\n for (i = 0; i < paneModel.count; i++) if (!checkArray(veto_pn1,i)) listaPane.append({\"text\": paneModel.get(i).name, \"id\": i});\n for (i = 0; i < snacksModel.count; i++) if (!checkArray(veto_mer,i)) listaSnacks.append({\"text\": snacksModel.get(i).name, \"id\": i});\n\n}", "function agregarFilas(estados){\n $('#estado_data').DataTable().clear().draw();\n for(var i=0 ; estados[i] ; i++){\n var estado = estados[i],\n nombre = estado.nombre,\n codigo = estado.codestado,\n estatus = estado.estatus,\n nombre_pais = estado.nombre_pais;\n getFilas(nombre, codigo, estatus,nombre_pais)\n }\n $('#estado_data').DataTable().draw();\n}", "function MostrarCanastaIndividual( nombre ) \n {\n document.getElementById('OcltarBotonSubmit').style.display = 'block';\n document.getElementById('OcultarBotonModal').style.display = 'none';\n \n $('#fk_precio').prop('disabled', false);\n \n // creamos un variable que hace referencia al select\n var select=document.getElementById(\"combobox\").value;\n var separar=select.split(',');\n // for(var i=0;i<separar.length;i++){\n\n\n // alert(separar[i]);\n // }\n var ruta='http://'+window.location.host;\n \n var IdProducto=separar[0];\n // $('#precio_compra2').val(precioCompra);\n $.ajax({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n type: \"POST\",\n url: ruta+\"/compra/MostrarCanastaIndividualEditar/\"+IdProducto,\n \n dataType: \"json\",\n success: function (items,responseTexr) {\n \n \n if(items.paca==1)\n {\n document.getElementById('cantidaenvaseOcultar').style.display = 'block';\n document.getElementById('cantidadPlasticoOcultar').style.display ='block';\n }\n else\n {\n document.getElementById('cantidaenvaseOcultar').style.display = 'none';\n document.getElementById('cantidadPlasticoOcultar').style.display ='none';\n }\n // $(\"#fk_precio\").empty(); $(\"#fk_precio\").append($(\"<option />\").val(\"0\").text(\"SELECCIONE El PRECIO DE VENTA\"));\n // $.each( items, function( key, value ) {\n // $.each( value , function(index,precio){\n // $(\"#fk_precio\").append($(\"<option />\").val(precio.id).text(precio.valor));\n // }); \n // });\n \n }\n });\n }", "function fillOrganizationList() {\n $(\"select\").each(function () {\n var isOrgList = $(this).data(\"organization\");\n if (isOrgList == null || isOrgList == undefined || isOrgList == false) {\n return;\n }\n var select = $(this);\n ajaxGetAllOrganizations(select)\n });\n}", "function cargar_Provincias(datos_provincias) {\r\n\tvar texto_aconvertir = \"{'provincias':\" + datos_provincias + \"}\";\r\n\tvar objeto_provincias = eval('(' + texto_aconvertir + ')');\r\n\tvar lista_provincias = document.getElementById(\"provincias\");\r\n\tlista_provincias.options.length = 0;\r\n\tvar posiciones = objeto_provincias.provincias.length;\r\n\tfor (var i = 0; i < posiciones; i++) {\r\n\t\topcion = document.createElement('option');\r\n\t\ttexto_opcion = document\r\n\t\t\t\t.createTextNode(objeto_provincias.provincias[i].provincia);\r\n\t\topcion.appendChild(texto_opcion);\r\n\t\topcion.value = objeto_provincias.provincias[i].codigoProvincia;\r\n\t\tlista_provincias.appendChild(opcion);\r\n\t}\r\n\t// REINICIO DE LOS MUNICIPIOS SI SE CAMBIA DE PAIS\r\n\tif (objeto_provincias.provincias[0].codigoProvincia = -1) {\r\n\t\tvar lista_municipios = document.getElementById(\"municipios\");\r\n\t\tlista_municipios.options.length = 0;\r\n\t\topcion = document.createElement('option');\r\n\t\ttexto_opcion = document.createTextNode(\"Seleccione una provincia\");\r\n\t\topcion.appendChild(texto_opcion);\r\n\t\topcion.value = -1;\r\n\t\tlista_municipios.appendChild(opcion);\r\n\t}\r\n}", "formata_dados( resposta_HANA ){\n const reducer = (r, row) => {\n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia}`;\n const key_entrega = `${row.Item_pedido} - ${row.Cod_Material} - ${row.Material} - ${row.Remessa} - ${row.Dia} - ${row.N_nota_fiscal} - ${row.Peso}`;\n\n const caminhoes = {\n ID: parseInt(row.ID),\n Unidade: row.Unidade,\n Nome: row.Nome,\n Placa: row.Placa,\n Transportadora: row.Transportadora,\n Modal: row.Modal,\n Dia: row.Dia,\n Material: row.Material,\n Materiais: {}\n };\n\n r[key_caminhao] = r[key_caminhao] || caminhoes;\n\n const entregas = {\n Item_pedido: row.Item_pedido,\n Cod_Material: row.Cod_Material,\n Material: row.Material,\n Remessa: row.Remessa,\n Dia: row.Dia,\n N_nota_fiscal: row.N_nota_fiscal,\n Peso: parseInt(row.Peso.replace('.', ''))\n };\n\n r[key_caminhao]['Materiais'][key_entrega] = r[key_caminhao]['Materiais'][key_entrega] || entregas;\n\n return r;\n };\n\n const organizado = resposta_HANA.reduce( (r, row) => reducer(r, row), {});\n\n const obj_organizado = Object.values(organizado);\n\n const obj_organizado_2 = obj_organizado.map( item => {\n item['Materiais'] = Object.values(item['Materiais']);\n\n return item\n });\n\n return obj_organizado_2;\n }", "function get_select_departments_countrys($selected) {\n\n $.ajax({\n url: './fullSelectCountry',\n type: 'GET',\n data: {},\n dataType: 'json',\n success: function(result) {\n\n\n $('#selectPais').find('option').remove().end();\n\n $('#selectPais').append($('<option>', { value: 'disabled', text: 'Seleccione un país' }));\n\n if ($selected === undefined) {\n\n $.each(result, function(k, v) {\n $('#selectPais').append($('<option>', { value: v.CODIGO_PAIS, text: v.NOMBRE }));\n });\n\n } else {\n\n $.each(result, function(k, v) {\n\n var id = v.CODIGO_PAIS;\n var name = v.NOMBRE;\n\n $(\"#selectPais\").append(\"<option value='\" + id + \"'>\" + name + \"</option>\");\n\n if (id === $selected) {\n\n $(\"#selectPais\").attr('selected', 'selected').val(id);\n }\n\n });\n\n }\n },\n error: function(result) {\n //handle errors\n alert('error...' + result);\n }\n });\n}", "function refreshPaisZona(source,target){\r\n\t$j(source).change(function(){\t\t\r\n\t\t$j(target).empty();\r\n\t\t$j(target).append('<option value=\"\">--Seleccionar--</option>');\r\n\t\t$j(listaProvincias).each(function(i,item){\r\n\t\t\tif ( item.id_pais==$j(source).val() )\r\n\t\t\t\t$j(target).append( $j('<option value='+item.id+'>'+item.provincia+'</option>') );\r\n\t\t});\r\n\t});\r\n}", "function loadDeparturesData() {\n\n //add a empty option\n // let departureOption = document.createElement('option');\n // departureOption.text = '';\n // document.querySelector('#slcDepartures').add(departureOption);\n\n for (let i = 0; i < airports.length; i++) {\n let departureOption = document.createElement('option');\n departureOption.text = airports[i].departure;\n document.querySelector('#slcDepartures').add(departureOption);\n }\n\n loadDestinationsData();\n}", "function carregarListaSolicitantes(){\n\tdwr.util.useLoadingMessage();\n\tvar unidade = DWRUtil.getValue(\"comboUnidade\"); \n\tFacadeAjax.getListaSolicitantes(unidade, function montaComboUnidadeTRE(listBeans){\n\t\tDWRUtil.removeAllOptions(\"comboUnidadesSolicitantes\");\n\t\tDWRUtil.addOptions(\"comboUnidadesSolicitantes\", listBeans, \"idUnidade\",\"nome\");\n\t});\n}", "function onObligatorioMonto() {\n\t// Si obligatorio activar la obligatoriedad de los relacionados.\n\tif (get(FORMULARIO + '.ObligatorioMonto') == 'S') {\n\t\tset(FORMULARIO + '.ObligatorioPeriodoInicioV', 'S');\t\t\n\t\tset(FORMULARIO + '.ObligatorioPeriodoFinV', 'S');\n\t}\t\t\n}", "function obterLista(elemento) {\n switch (elemento) {\n case 'insetos':\n crudService.listarRegistros(rotaInseto, sucessoInseto)\n\n function sucessoInseto(res) {\n $scope.listInsetos = res.data;\n }\n break;\n case 'ordem':\n crudService.listarRegistros(rotaOrdem, sucessoOrdem)\n\n function sucessoOrdem(res) {\n $scope.listOrdem = res.data;\n }\n break;\n }\n }", "function handlerFiltro(data) {\n let $selectFiltro = document.getElementById(\"filtro-animal\");\n let $promedioLabel = document.getElementById(\"promedio\");\n let $maximo = document.getElementById(\"maximo\");\n let $minimo = document.getElementById(\"minimo\");\n let $vacunados = document.getElementById(\"vacunados\");\n let aux = [];\n if ($selectFiltro.value == \"todos\") aux = data.articulos;\n else\n aux = data.articulos.filter(\n (articulo) => articulo.animal == $selectFiltro.value\n );\n $promedioLabel.innerText =\n aux.reduce(\n (promedio, articulo) => promedio + parseFloat(articulo.precio),\n 0\n ) / aux.length;\n $maximo.innerText = aux.reduce(\n (acc, value) => Math.max(acc, value.precio),\n aux[0].precio\n );\n $minimo.innerText = aux.reduce(\n (acc, value) => Math.min(acc, value.precio),\n aux[0].precio\n );\n $vacunados.innerText =\n (100 * aux.filter((articulo) => articulo.vacuna == \"si\").length) /\n aux.length;\n $vacunados.innerText += \"%\";\n}", "function cargarListas(objeto,procedimiento) {\n\t $.post(\"../../controlador/fachada.php\", {\n\t clase: 'clsUtilidades',\n\t oper: 'cargarListas',\n\t objeto: objeto,\n\t procedimiento: procedimiento\n\t }, function(data) {\n\t if (data !== 0) {\n\t formarOptionValueLista(data,objeto);\n\t }\n\t else {\n\t alert('error');\n\t }\n\t }, \"json\");\n\t}", "function selectConsultarUnidades()\n{\n var mi_obj = {\n campos : \"idUnidad, unidad\",\n order : \"unidad\",\n table : \"unidad\",\n operacion : \"consultar-n-campos\"\n };\n\n var mi_url = jQuery.param( mi_obj );\n\n peticionConsultarOpcionesParaSelect( mi_url, \"select[name='unidad']\" );\n}" ]
[ "0.6432732", "0.6351011", "0.6192081", "0.61283785", "0.6064947", "0.59984577", "0.5974175", "0.59726495", "0.59365463", "0.5886678", "0.5739219", "0.5719336", "0.5697672", "0.56490976", "0.5633712", "0.56298995", "0.56070954", "0.55704844", "0.55566484", "0.5547164", "0.554369", "0.55376583", "0.55220836", "0.55049586", "0.55039406", "0.550228", "0.54737324", "0.54733133", "0.54732215", "0.54592067", "0.5450387", "0.5441043", "0.5429541", "0.54251945", "0.54125905", "0.5411092", "0.5398916", "0.5398635", "0.5397444", "0.53892213", "0.5384708", "0.5375932", "0.5372781", "0.5369145", "0.5365915", "0.5364629", "0.53567904", "0.53507817", "0.53247464", "0.5308022", "0.530159", "0.53012043", "0.52930385", "0.52920264", "0.52879256", "0.52842325", "0.5281114", "0.5277747", "0.5263058", "0.5259291", "0.525807", "0.52572286", "0.5253395", "0.5250045", "0.5247602", "0.52422655", "0.5231792", "0.52283937", "0.5225803", "0.5221049", "0.521508", "0.5211953", "0.5202395", "0.51997834", "0.5199724", "0.5197102", "0.5195126", "0.51933306", "0.5192571", "0.51878375", "0.5180761", "0.5177521", "0.5174491", "0.51712894", "0.51562935", "0.51557535", "0.5155273", "0.51534593", "0.5152313", "0.51415694", "0.5140805", "0.5139996", "0.5139554", "0.5137919", "0.51377547", "0.5136618", "0.5130024", "0.5129431", "0.5126991", "0.5121229" ]
0.6978294
0
Agregar una persona a cargo en el datagrid de personas a cargo
function agregar() { // Máximo pueden haber 4 personas a cargo if (props.personasaCargo.length < 4){ let result = [...props.personasaCargo]; result.push([,"", "",]) cambiarPersonasaCargo(result); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "agregarPersonajes(personaje) {\n this.personajes.push(personaje);\n }", "addPerson() {\n this.people.pushObject(this.personName);\n }", "agregarPersona(id, nombre, sala) {\n\n let persona = { id, nombre, sala }\n\n //agregar la \"persona\" recibida al arreglo de personas\n this.personas.push(persona);\n\n return this.personas;\n }", "function AddPerson(data) {\n var mapped = ko.utils.arrayMap(data, function (item) {\n return new person(item);\n });\n self.people(mapped);\n }", "function IniciaPersonagem() {\n // entradas padroes para armas, armaduras e escudos.\n gPersonagem.armas.push(ConverteArma({\n chave: 'desarmado',\n nome_gerado: 'desarmado',\n texto_nome: Traduz('desarmado'),\n obra_prima: false,\n bonus: 0\n }));\n}", "function addNewCities(){\n\t$.aceOverWatch.field.grid.addNewRecord(objCities.grid);\n}", "addPerson(world, name, extra) {\n if (!name) {\n console.warn(\"Attempted to add person without a name\");\n return;\n }\n world.performAction({\n name: `AddPerson[${name}]`,\n transaction: ws => People._addPerson(ws, name, extra)\n });\n }", "function addPerson() {\n var person = {};\n person.firstName = document.getElementById('firstName').value;\n person.lastName = document.getElementById('lastName').value;\n person.email = document.getElementById('email').value;\n var data = JSON.stringify(person);\n setData(data, \"person\");\n}", "function aDashboardActionCreatePerson( p, el ) {\n\tlet windowTitle = `New Person...`;\n\n\tlet values = { name: 'Please, provide a name', descr: 'Please, provide a description...', position: 'Please, provide a position', icon:null };\n\t\n\tlet keyProperties = { descr: { height:'200px' } };\n\tlet rightPaneHTML = `<h1 align=center>Creating a New Person</h1>`;\n\n\tlet keys = [ 'name', 'position', 'descr', 'icon' ];\n\n\taDisplayDashboardDataArrayEditWindow( windowTitle, keys, values, \n\t\t{ rightPaneHTML:rightPaneHTML, keyProperties:keyProperties, saveURL:'/a_persons_new' } );\n}", "function addCompanies(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Companies.collection.insert(data);\n}", "function addData(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Patients.insert(data);\n}", "insertarPersona (persona) {\n let valores = `${ persona.getNombre() }, ${ persona.getApellido() }, ${ persona.getDireccion() }, ${ persona.getEdad() }, ${ persona.getTelefono() }, ${ persona.getCorreo() }`;\n let r = this.db.push(valores);\n if (r) {\n console.log( \"PERSONA_INSERTADA\" );\n } else {\n console.log( \"ERROR_PERSONA_INSERTADA\" );\n }\n }", "function ajouterNouveau(nom, prenom) {\n nouveauContact.init(nom, prenom);\n contactLists.push(nouveauContact);\n console.log(\"Un nouveau contact a été ajouté!\");\n}", "function addCamisetaCarrito() {\n\t\t\tvar id = usuarioService.getCarrito();\n\t\t\tvar clone = setupClone();\n\t\t\tif (clone.id) {\n\t\t\t\tcarritoService.putCustom(clone, id).then(camisetaService.setTshirtDefaults);\n\t\t\t} else {\n\t\t\t\tcarritoService.postCustom(clone, id).then(camisetaService.setTshirtDefaults);\n\t\t\t}\n\t\t}", "addPersonAsRelationship(world, type, personId, name, id) {\n if (!(type && personId && name)) {\n console.warn(`addPersonAsRelationship: missing type (${type}), personId (${personId}), and/or name (${name}).`);\n return;\n }\n // ick?\n People[`add${type}`](world, personId, {name, id});\n }", "add(info) {\n this.contacts.push(new Contact(...info));\n }", "function addPerson() {\n if (!haveNewValue) {\n return;\n }\n\n var name = $newName.val();\n var location = $newFrom.val();\n var mode = $(\"input[name='newMode']:checked\", $newPersonForm).val();\n\n geocoder.geocode({\n \"address\": location, \"region\": \"GB\", componentRestrictions: {country: 'UK'}\n }, function (results, status) {\n if (status === google.maps.GeocoderStatus.OK && results[0].address_components.length > 1) { //Length of one is address of \"UK\" means it wasn't found.\n var latLng = results[0].geometry.location;\n if (editingPerson === undefined || editingPerson === null) { //Don't rely on falsy since person ids start from 0\n new Person(name, location, latLng, mode);\n } else {\n people[editingPerson].person.update(name, location, latLng, mode);\n editingPerson = null;\n }\n\n $newPersonForm[0].reset();\n haveNewValue = false;\n $addPersonBtn.addClass(\"disabled\");\n\n if (personId >= 2) {\n $submitButton.prop(\"disabled\", false);\n }\n\n $newName.focus()\n } else {\n addError(\"UNKNOWN_LOCATION\");\n }\n });\n }", "function agregarCita(e) {\n\n e.preventDefault();\n // extraer la información del objeto de citas\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n // validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === '') {\n ui.imprimirAlerta('Todos los campos son obligatorios','error');\n return;\n }\n\n if(editando) {\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se editó correctamente');\n \n // pasar el objeto de la cita a ediccion\n administrarCitas.editarCita({...citaObj});\n\n // regresar el botón a su estado original\n form.querySelector('button[type=\"submit\"]').textContent = 'Crear cita';\n\n // quitar modo edición\n editando = false;\n } else {\n // crear id único\n citaObj.id = Date.now();\n\n // agregando una nueva cita\n administrarCitas.crearCita({...citaObj});\n\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se agregó correctamente');\n }\n\n \n \n // reiniciar objeto de validación\n reiniciarObjeto();\n\n // reiniciar formulario\n form.reset();\n\n // mostrar html de las citas\n ui.imprimirCitas(administrarCitas);\n}", "function addContact() {\n tabPrenom.push(prompt(\"Ecrivez le prénom :\"));\n tabNom.push(prompt(\"Ecrivez le nom : \"));\n list();\n}", "function Persona(nombre, redes_sociales){\n this.nombre = nombre\n this.redes_sociales = redes_sociales || []\n}", "function addContact(){\n let lastName = prompt('Ajouter un nom');\n let firstName = prompt('Ajouter un prénom');\n let newContact = new Contact(lastName, firstName);\n allContacts.push(newContact);\n}", "addNewMentor(newMentor) {\n this.mentors.push(newMentor);\n }", "function adicionarReservaPrato() {\n let idPrato = $(\"#reservaIdPrato\").val();\n\n let refeicaoTable = $(\"#divRefeicaoReserva table\");\n\n $(\"#reservaIdPrato\").val(null);\n\n let prato = $.map(pratos, function (n) {\n if (n.id_prato == idPrato) {\n return n;\n }\n });\n\n refeicao.adicionarPrato(prato);\n // pratosRefeicao.push(prato);\n\n prato.forEach(element => {\n\n let tr = document.createElement(\"tr\");\n\n let tdId = document.createElement(\"td\");\n let tdNm = document.createElement(\"td\");\n let tdVl = document.createElement(\"td\");\n let tdDs = document.createElement(\"td\");\n\n let textId = document.createTextNode(element.id_prato);\n let textNm = document.createTextNode(element.nm_prato);\n let textVl = document.createTextNode(element.vl_prato);\n let textDs = document.createTextNode(element.ds_prato);\n\n tdId.append(textId);\n tdNm.append(textNm);\n tdVl.append(textVl);\n tdDs.append(textDs);\n\n tr.append(tdId);\n tr.append(tdNm);\n tr.append(tdVl);\n tr.append(tdDs);\n\n refeicaoTable.append(tr);\n });\n }", "agregar(usuario) {\n this.lista.push(usuario);\n }", "function addPerson(name, surname, age) {\n var personId = firebase\n .database()\n .ref(\"people\")\n .push().key;\n console.log(\"personID\", personId);\n\n firebase\n .database()\n .ref(\"people/\" + personId)\n .set({\n name: name,\n surname: surname,\n age: age\n })\n .then(function() {\n alert(\"Dodano pomyślnie\");\n getPeople();\n })\n .catch(function(error) {\n alert(\"Error \" + error.message);\n });\n}", "function addContact(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Contacts.collection.insert(data);\n}", "function agregarPersona(uniquePerson){\n return `\n <li data-id=\"${uniquePerson.id}\">\n <h3 role=\"button\">${uniquePerson.fullName}</h3>\n <button>X</button>\n </li>\n `;\n}", "AddPerson(e){\n\t\tconst person = { \n\t\t\tuser_id: this.state.user.id,\n\t\t};\n\n\t\taxios.post(url +'api/AddPerson', person).then(response=> {\n\t\t\tthis.getNewData();\n\t\t})\n\t\t.catch(error=> {\n\t\t\tthis.setState({err:true});\n\t\t})\n\t}", "function mostrarDatos(Persona) {\n //debugger;\n let div = document.createElement(\"div\");\n let parr = document.createElement(\"p\");\n let nombres = document.createTextNode(Persona.nombres+\" \");\n let apellidos = document.createTextNode(Persona.apellidos+\" \");\n let edad = document.createTextNode(Persona.edad+\" \");\n\n console.log(apellidos);\n parr.append(nombres);\n parr.append(apellidos);\n parr.append(edad);\n div.appendChild(parr);\n document.body.appendChild(div);\n}", "function add_user_ui(u) {\n //a = `<div id=\"${name_to_id(u.first_name)}\" onClick=\"update_person(this)\" class=\"person\"><div class=\"person-name\">${u.first_name}</div><div class=\"person-date\">${u.last}</div></div>`\n a = `<div id=\"${name_to_id(u.first_name + u.last_name)}\" onClick=\"update_person(this)\" class=\"person\"><div class=\"person-name\">${u.first_name}</div><div class=person-lastname>${u.last_name}</div></div>`\n $(\"#contact_list\").append(a);\n}", "function addAgenmento() {\n var pop = $('#md-editar-agendamento');\n\n if (pop) {\n loadClientes().then(() => {\n onNovoAgendamento();\n setPopAgendamentoTitle(\"Criar Agendamento\");\n pop.draggable();\n pop.modal();\n });\n }\n }", "function agregar(){\n $('#MyP').append('<div></div>');\n $('#MyP').append('<span>'+$('#nombre').val()+' </span>');\n $('#MyP').append('<span>'+$('#apellido').val()+' </span>');\n $('#MyP').append('<span>'+$('#direccion').val()+' </span>');\n\n $('#nombre').val(\"\");\n $('#apellido').val(\"\");\n $('#direccion').val(\"\");\n }", "function addNewPatron(e) {\n\te.preventDefault();\n\n\t// Add a new patron to global array\n // Can either use querySelector OR ...\n let name = e.target.children[0].value;\n // const name = document.querySelector('#newPatronName').value\n const patron = new Patron(name);\n patrons.push(patron);\n\n\t// Call addNewPatronEntry() to add patron to the DOM\n addNewPatronEntry(patron);\n}", "constructor(nombre, apellido,edad){\n this._nombre = nombre; \n this._apellido = apellido;\n this._edad = edad;\n this.idPersona = ++Persona.contadorPersonas;\n \n }", "function addContact() {\n var newContact = {};\n\n // Set a default contact type\n newContact.typeId = 1;\n vm.contacts.push(newContact);\n }", "function addData(data) {\n console.log(` Adding: ${data.firstName} (${data.owner})`);\n Vaccine.collection.insert(data);\n}", "function agregarOrden(){\r\n let compra = document.getElementById('tit1')\r\n let precio = document.getElementById('pre1')\r\n pedido.push(new vehiculo(compra.textContent, precio.textContent));\r\n crearPedido(); \r\n}", "function addNew(name){\r\n\troster.push(name)\r\n}", "function add(info) {\n for (let i of info) {\n let p = makePerson(i[0], i[1], i[2], i[3]);\n people.push(p);\n }\n }", "function create_person(data) {\n\t\t$('#submissions').loadTemplate($('#submission-template'), data, {append: true});\n\t}", "constructor(nombre,apellido){\n this._nombre=nombre;\n this._apellido=apellido;\n Persona.contadorObjetosPersona++;\n }", "function add_person() {\n var person_name = document.getElementById('name').value,\n genderDdl = document.getElementById('gender'),\n person_gender = genderDdl.options[genderDdl.selectedIndex].value,\n person_age = document.getElementById('age').value;\n\n person_id = counter; // This counter creates person IDs.\n counter++;\n\n persons.push({\n 'id': person_id,\n 'name': person_name,\n 'gender': person_gender,\n 'age': person_age\n });\n localStorage.setItem('person', JSON.stringify(persons));\n\n if (document.forms['add-persons'].name.value !== \"test_me\") { // If Test Mode is on, don't reset form.\n document.getElementById(\"add-persons\").reset();\n }\n\n render_entries(pagenumber);\n\n return false;\n}", "function addPrefect(student, currentHouse) {\n student.isPrefect = true;\n prefects[currentHouse].push(student);\n console.log(prefects);\n displayStudentModal(student);\n}", "function agregarConceptoRelacion(codigo){\n\t\tcnTaxonomia.varAgregar = codigo;\n\t\tcnTaxonomia.seleccionadoAgregar = 0;\n\t\tcnTaxonomia.filtroTaxonomiaAgregar.buscarPor='seleccione';\n\t\t$('#agregarConceptoTaxonomiaModal').modal('show');\n\t}", "function addPlanilha(pessoa){\n var ss = openSheetById();\n var sheet = ss.getActiveSheet();\n var pessoas = [];\n \n sheet.appendRow([pessoa.nome, pessoa.peso, pessoa.altura, pessoa.gordura, pessoa.imc]);\n \n return pessoa;\n }", "function ClickGerarPersonagem(modo) {\n GeraPersonagem(modo);\n}", "function addPerson () {\n new Person(inputFirst, inputLast, inputPhone, inputEmail);\n\n}", "addPerson(person) {\n return new Item({\n name: this.name,\n date: this.date,\n dueDate: this.dueDate,\n person\n })\n }", "addPersonalRow(state) {\n state.personalinfo.push({\n email: '',\n zip: '',\n street: '',\n });\n }", "function addPeople(name, age, gender, natinalty) {\n return {\n name: name,\n age: age,\n gender: gender,\n natinalty: natinalty\n }\n}", "add(clave, valor) {\n if (typeof clave == \"string\") {\n var indx = this.findIndex(this.#elementos, clave);\n if (indx != -1)\n this.#elementos[indx].valor = valor;\n else\n this.#elementos.push({ clave, valor });\n }\n }", "function addRelation()\n{\n var\ttable\t\t= document.getElementById('formTable');\n var tbody\t\t= table.tBodies[0];\n var newrownum\t= tbody.rows.length;\n var\tform\t\t= this.form;\n var formElts\t= form.elements;\n \n var\ttemplate\t= document.getElementById('newRowTemplate');\n var\tparms\t\t= {\"rownum\"\t: newrownum,\n\t\t\t\t\t \"idcp\"\t: newrownum + 1,\n\t\t\t\t\t \"relation\"\t: \"\"};\t\n var newrow\t\t= createFromTemplate(template,\n\t\t\t\t\t\t\t parms,\n\t\t\t\t\t\t\t null);\n tbody.appendChild(newrow);\n}", "function agregar(usuario) {\n let data = {\n 'thing': usuario\n };\n\n fetch(`${baseUrl}/${groupID}/${collectionID}`, {\n 'method': 'POST',\n 'headers': {\n 'content-type': 'application/json'\n },\n 'body': JSON.stringify(data)\n }).then(res => {\n return res.json();\n }).then(dato => {\n precargarUsers();\n }).catch((error) => {\n console.log(error);\n })\n\n document.querySelector(\"#userName\").value = \"\";\n document.querySelector(\"#resetsUser\").value = \"\";\n document.querySelector(\"#viplevelUser\").value = \"\";\n document.querySelector(\"#levelUser\").value = \"\";\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}", "function Persona(nombre,apellido) {\r\n this.nombre = nombre\r\n this.apellido = apellido\r\n}", "function addAddress(name, address) {\n \tvar row = buildAddressRow(name, address);\n \tdocument.getElementById('address-table').appendChild(row);\n }", "function insertData(user,giorno,pasto,menu_giorno,pasto_scelto) {\n //crea un user\n user.create({\n first_name: 'Rossi',\n last_name: 'Mario'\n });\n //crea giorni\n giorno.create({\n nome_giorno: 'lun'\n });\n giorno.create({\n nome_giorno: 'mar'\n });\n giorno.create({\n nome_giorno: 'mer'\n });\n giorno.create({\n nome_giorno: 'gio'\n });\n giorno.create({\n nome_giorno: 'ven'\n });\n giorno.create({\n nome_giorno: 'sab'\n });\n giorno.create({\n nome_giorno: 'dom'\n });\n\n //crea pasti\n //crea parimi\n pasto.create({\n nome_pasto: 'Pasta al pomodoro',\n tipo: 'primo',\n dettagli: 'Scaldate in una casseruola un velo di olio con uno spicchio di aglio sbucciato. Unite i pomodori non appena l\\'aglio comincia a sfrigolare. Aggiungete quindi una generosa presa di sale. Completate con un ciuffetto di basilico e mescolate; cuocete senza coperchio per 10 circa.'\n });\n pasto.create({\n nome_pasto: 'Pasta con la ricotta in bianco',\n tipo: 'primo',\n dettagli: 'La pasta con la ricotta in bianco è un esempio di come possa essere facile e veloce preparare un piatto di pasta veramente buono.'\n });\n pasto.create({\n nome_pasto: 'Minestrone',\n tipo: 'primo',\n dettagli: 'Il minestrone di verdure è un primo piatto salutare, di semplice ma lunga realizzazione, per via della pulizia e del taglio delle molte verdure!'\n });\n pasto.create({\n nome_pasto: 'Risotto',\n tipo: 'primo',\n dettagli: 'Il risotto è un primo piatto tipico della cucina italiana, diffuso in numerose versioni in tutto il paese anche se più consumato al nord.'\n });\n pasto.create({\n nome_pasto: 'Lasagna',\n tipo: 'primo',\n dettagli: 'Le lasagne al forno sono costituite da una sfoglia di pasta madre, oggi quasi sempre all\\'uovo, tagliata in fogli grossolanamente rettangolari (losanghe), dette lasagna le quali, una volta bollite e scolate, vengono disposte in una sequenza variabile di strati, ognuno dei quali separato da una farcitura che varia in relazione alle diverse tradizioni locali.'\n });\n //create secondo\n pasto.create({\n nome_pasto: 'Bistecca alla Fiorentina',\n tipo: 'secondo',\n dettagli: 'La bistecca alla fiorentina è un taglio di carne di vitellone o di scottona che, unito alla specifica preparazione, ne fa uno dei piatti più conosciuti della cucina toscana. Si tratta di un taglio alto comprensivo dell\\'osso, da cuocersi sulla brace o sulla griglia, con grado di cottura \"al sangue\".'\n });\n pasto.create({\n nome_pasto: 'Salmone in crosta',\n tipo: 'secondo',\n dettagli: 'Il salmone in crosta con spinaci è una delle ricette tipiche della vigilia e di Capodanno: durante queste occasioni non potrà di certo mancare il salmone! '\n });\n pasto.create({\n nome_pasto: 'Pollo al forno',\n tipo: 'secondo',\n dettagli: 'Le cosce di pollo al forno sono un tipico secondo piatto della cucina italiana, un classico per gustare il pollo con contorno di patate!'\n });\n pasto.create({\n nome_pasto: 'Arrosto di lonza',\n tipo: 'secondo',\n dettagli: 'Tradizionale, genuino e ricco di gusto. La lonza arrosto al vino bianco è davvero un piatto che non può mancare nella vostra lista dei manicaretti casalinghi. '\n });\n //create contorno\n pasto.create({\n nome_pasto: 'Patatine fritte',\n tipo: 'contorno',\n dettagli: 'Patatine fritte'\n });\n pasto.create({\n nome_pasto: 'Patate al forno',\n tipo: 'contorno',\n dettagli: 'patate al forno'\n });\n pasto.create({\n nome_pasto: 'Carote',\n tipo: 'contorno',\n dettagli: 'Carote'\n });\n pasto.create({\n nome_pasto: 'Fagiolini',\n tipo: 'contorno',\n dettagli: 'Fagiolini'\n });\n pasto.create({\n nome_pasto: 'Insalata',\n tipo: 'contorno',\n dettagli: 'Insalata verde fresca'\n });\n\n //create dolce\n pasto.create({\n nome_pasto: 'Budino',\n tipo: 'dolce',\n dettagli: 'Il budino è composto da una parte liquida, generalmente costituita da latte, da zucchero e da vari ingredienti o aromi che gli danno il gusto desiderato: frutta, cioccolato, nocciole, caramello, liquori, vaniglia ed altri ancora. A questi si uniscono spesso degli ingredienti che servono a legare il composto, cioè a renderlo più corposo e solido.'\n });\n pasto.create({\n nome_pasto: 'Yogurt',\n tipo: 'dolce',\n dettagli: 'Yogurt con tanti gusti'\n });\n pasto.create({\n nome_pasto: 'Frutta',\n tipo: 'dolce',\n dettagli: 'Frutta fresca'\n });\n pasto.create({\n nome_pasto: 'Crostata',\n tipo: 'dolce',\n dettagli: 'La crostata è un dolce tipico italiano basato su un impasto di pasta frolla coperto con confettura, crema o frutta fresca. Dolci simili sono diffusi in tutta Europa.'\n });\n\n //inserire menu_giorno in modo casuale\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 1\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 2\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 3\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 4\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 5\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 6\n });\n }\n }\n random.init(0,18);\n for(var i=0;i<10;i++){\n var num=random.getNum();\n if(num>0){\n menu_giorno.create({\n pasto_id: num,\n giorno_id: 7\n });\n }\n }\n}", "function addPersonToRoom (room_name, id, person_name) {\n \t// we store the person name in the socket session as people of the current room\n\t// e.g. { socket.id: nameOfThePerson }\n \tfor (var i=0; i<chatRooms.length; i++) {\n \t\tif (chatRooms[i]['roomname'] === room_name) {\n \t\t\tchatRooms[i].people[id] = person_name;\n \t\t}\n \t}\n }", "function agregarAlCarrito() {\n /* Función que agrega un producto al carrito. utiliza el atributo \"alt\" del botón clickeado para obtener el código del producto a agregar. Cada vez que se agrega un producto se vuelve a generar la tabla que se muestra en pantalla.*/\n var elCodigo = $(this).attr(\"alt\");\n var laPosicion = buscarCodigoProducto(elCodigo);\n var productoAgregar = listadoProductos[laPosicion];\n carrito[carrito.length] = productoAgregar;\n armarTablaCarrito();\n }", "function addProject() {\n const inputname = document.querySelector('.project_name_input').value; //get input data from dom\n if (inputname == '')\n return;\n data.projects.push(new project(inputname, data.projects.length)) //add new project with name and id to list\n\n }", "function addNewPatronEntry(patron) {\n\n // create a new div class=patron element\n const patronDiv = document.createElement('div');\n patronDiv.classList.add(\"patron\");\n\n // add the proper internal elements\n patronDiv.className = 'patron';\n patronDiv.innerHTML = \"<p>Name: <span>\"+\n patron.name+\"</span></p><p>Card Number: <span>\"+\n patron.cardNumber+\"</span></p><h4>Books on loan:</h4>\"+\n \"<table class='patronLoansTable'><tr><th>BookID</th><th>Title</th>\"+\n \"<th>Status</th>\t<th>Return</th></tr></table>\";\n\n // append this new patronDiv to all the patronEntries on the DOM\n patronEntries.appendChild(patronDiv);\n}", "addPerson(data) {\n var fname = read.question(\"Enter firstname of person :\")\n var lname = read.question(\"Enter lastname of person :\")\n var city1 = read.question(\"Enter city of person:\")\n var state1 = read.question(\"Enter state of person:\")\n var phonenum1 = read.question(\"Enter phonenumber:\")\n var zip = read.question(\"Enter zip code:\")\n // create object of Person class\n var o = new Person(fname, lname, city1, state1, phonenum1, zip)\n /**\n * push each value into json\n */\n data.Person.push(o);\n // write data into json file\n var d = file.writeFileSync('/home/admin1/Documents/javascript/OOPs_Programs/JSON_files/adressBook.json', JSON.stringify(data))\n }", "function addCollaboratorToCreateBoardModel(collInfo) {\n var parentUl = $('#panel-collaborators').children('ul');\n\n // Add to the collaborator list..\n var collUser = {\n username: collInfo.username,\n email: collInfo.email,\n right: \"MODIFY\"\n };\n collaboratorList.push(collUser);\n\n // Add to the board modal..\n var cloneLi = $(\"<li style='cursor: pointer;'>\" +\n \"<div class='user' onclick='javascript:selectUserFromCollaboratorList();'>\" +\n \"<img src='/images/man.png' class='avatar'>\" +\n \"<div class='name'>Name</div></div></li>\");\n\n cloneLi.attr('id', collUser.email);\n cloneLi.children('div').attr('onclick', \"javascript:selectUserFromCollaboratorList('\" + collUser.email + \"');\");\n cloneLi.children('div').children('img').attr('src', collInfo.img);\n cloneLi.children('div').children('div').text(collInfo.username + \"(\" + collInfo.email + \")\");\n parentUl.prepend(cloneLi);\n}", "function addData(fName, lName, email, phone) {\n let object = {\n firstName: fName,\n lastName: lName,\n email: email,\n phoneNumber: phone\n }\n fBase.add(object);\n}", "function add(firstName, lastName, phoneNumber, email) {\n contacts[contacts.length] = {\n firstName: firstName,\n lastName: lastName,\n phoneNumber: phoneNumber,\n email: email\n };\n}", "invitePerson (person) {\n if (this.inInvited(person)) return\n var p = new People()\n logger.debug('event.js', 'invitePerson', 'The id of the person being added ' + person.id)\n p.id = person.id\n p.firstName = person.firstName\n p.lastName = person.lastName\n p.nickName = person.nickName\n p.phone = person.phone\n p.address = person.address\n p.email = person.email\n this.invited.push(p)\n }", "function addTaxonData(taxonName, field, idx, tP) { //console.log(\"addTaxonData called. taxonName = \", taxonName);\n if (taxonName in tP.taxaObjs) { fillInAnyNewData(taxonName, field, idx, tP);\n } else { buildTaxonObj(taxonName, field, idx, tP); }\n }", "addContact(contact) {\n // Create a new array with the list of existing items and the new contact at the end\n this.data = [...this.data, contact];\n\n // Rerender the list\n this.render();\n }", "addResidents(arr) {\n arr.forEach(resident => {\n // this.appendChild(resident);\n this.innerHTML = resident;\n });\n }", "function addCompany() {\n var company = {};\n company.name = document.getElementById('c-name').value;\n company.email = document.getElementById('c-email').value;\n company.description = document.getElementById('c-desc').value;\n company.cvr = document.getElementById('c-cvr').value;\n company.numEmployees = document.getElementById('c-emps').value;\n company.marketValue = document.getElementById('c-value').value;\n var data = JSON.stringify(company);\n setData(data, \"company\");\n}", "function addFco(fco) {\n\n console.log('Creazione fco elements');\n UserService.createFcoSelected(fco)\n .then(\n function () {\n\n console.log('Aggiunto con successo ai preferiti');\n $window.alert('Elemento aggiunto con successo ai preferiti' );\n\n\n },\n function (errResponse) {\n\n console.error('Errore: elemento già ai preferiti');\n $window.alert('Elemento già presente nei preferiti');\n\n }\n );\n }", "function addItem (item) {\n if (listPeople.length == 0) getPeopleList()\n\n // busco si ya existe para no agregarlo nuevamente\n for (var i = 0; i < listPeople.length; i++) {\n if (item.name === listPeople[i].name) {\n return\n }\n }\n\n listPeople.push(item)\n\n setPeopleList()\n}", "function add_janelas(id, nome){\n \n /*cria uma variavel string com o HTML da jenela*/\n var html_add = \"<div class='janela' id='jan_\"+id+\"'>\"+\n \"<div class='topo' id='\"+id+\"'>\"+\n \"<span>'\"+nome+\"'</span>\"+\n \"<a href='javascript:void(0);' id='fechar'>x</a>\"+\n \"</div>\"+ \n \"<div id='corpo'>\"+\n \"<div class='mensagens'>\"+\n \"<ul class='listar'>\"+\n \"<li><span>Enyo Cavalcante:</span><p>Olá, tudo bem?</p></li>\"+\n \"<li><span>Jamile Solsa:</span><p>Olá, tudo bem?</p></li>\"+ \n \"</ul>\"+\n \"</div>\"+\n \"<input type='text' class='mensagem' id='\"+id+\"' maxlength='255' />\"+\n \"</div>\"+\n \"</div>\";\n $('#janelas').append(html_add);\n }", "function addCard() {\n let player = {};\n player.id = data.players.length + 1;\n player.name = document.getElementById(\"playername\").value;\n player.school = document.getElementById(\"playerschool\").value;\n player.points = document.getElementById(\"ppg\").value;\n player.assists = document.getElementById(\"apg\").value;\n player.rebounds = document.getElementById(\"rpg\").value;\n player.note = document.getElementById(\"playernote\").value;\n data.players.push(player);\n $('.gridView').append(createCard(player));\n }", "function add_room(creator, name){\n const room = {creator, name};\n // save room info to room list\n rooms.push(room);\n}", "function crearLista(){\n listaJugadores.push({nombre: nombreJugador, puntos: letrasAcertadas});\n }", "function addTramite(){\n var fullname = vm.name + \" \" + vm.surnames;\n var date = dateFormat(vm.date);\n firebase.database().ref('rh/tramitesProceso/').push({\n usuario: fullname,\n rfc: vm.rfc,\n tramite: vm.tramite.nombreTramite,\n fecha: date,\n estatus: vm.estatus,\n oficina: vm.usuarioOficina,\n usuarioOficina: vm.usuarioTramites \n }).then(function(){\n vm.modalAddTramite.dismiss();\n swal('Tramite agregado!','','success');\n vm.name = \"\";\n vm.surnames = \"\";\n vm.rfc = \"\";\n vm.tramite = \"\";\n });\n }", "function agregarMarcadorTabla(marcador, nombre){\n\t\tvar tbody = document.getElementById(\"puntosrec\").querySelectorAll(\"tbody\")[0];\n\t\tvar row = document.createElement(\"tr\");\n\n\t\tvar cell1 = document.createElement(\"td\");\n\t\tvar cell2 = document.createElement(\"td\");\n\t\tvar cell3 = document.createElement(\"td\");\n\t\tvar cell4 = document.createElement(\"td\");\n\t\tvar cell5 = document.createElement(\"td\");\n\t\tvar cell6 = document.createElement(\"td\");\n\n\t\tvar span = document.createElement(\"SPAN\");\n\t\tvar txt = document.createTextNode(\"\\u00D7\");\n\t\tspan.className = \"close\";\n\t\tspan.appendChild(txt);\n\n\t\tspan.onclick = function(){\n\t \t\tvar idDelTR = jQuery(this).closest(\"tr\").attr('id');\n \t\t\tvar partes = idDelTR.split(\"ID-\");\n \t\t\tvar nombreDeAhora = partes[1].replace(\"_\", \" \");\n\t \t\tvar element = document.getElementById(idDelTR);\n\t\t\telement.parentNode.removeChild(element);\n\t\t\tmap.removeLayer(markers[nombreDeAhora]);\n\t\t\tdelete markers[nombreDeAhora];\n\t \t}\n\n\t\tcell1.appendChild(span);\n\n\t\tvar alt = marcador.getLatLng().alt;\n\t\tif(alt == \"undefined\") alt = \"\";\n\t\tcell2.appendChild(document.createTextNode(nombre));\n\t\tcell3.appendChild(document.createTextNode(marcador.getLatLng().lat));\n\t\tcell4.appendChild(document.createTextNode(marcador.getLatLng().lng));\n\t\tcell5.appendChild(document.createTextNode(alt));\n\t\tcell6.appendChild(document.createTextNode('Estaca???'));\n\t\t\n\t\trow.appendChild(cell1);\n\t\trow.appendChild(cell2);\n\t\trow.appendChild(cell3);\n\t\trow.appendChild(cell4);\n\t\trow.appendChild(cell5);\n\t\trow.appendChild(cell6);\n\n\t\trow.id = \"ID-\"+nombre.replace(\" \", \"_\");\n\t\ttbody.appendChild(row);\n\t\n }", "function onAdd() {\n\n var tmp = $scope.section.rows[$scope.section.rows.length - 1];\n if (tmp.cols.length > 0) {\n if (tmp.cols[0].fields.length > 0) {\n $scope.section.rows.push(OdsFormService.newRowObject());\n }\n }\n }", "function addPersonToTable(someone) {\n 'use strict';\n// use var when you create tabularForm\n var tabularForm, tablerow, fname, lname, dob, myBirthDay;\n tabularForm = document.createDocumentFragment();\n tablerow = document.createElement('tr');\n // append to the dom the latest person (ie., myArray)\n fname = document.createElement('td');//Start of First Name\n fname.innerHTML = someone.firstname;\n tablerow.appendChild(fname);//End of First Name\n lname = document.createElement('td');//Start Lastname\n lname.innerHTML = someone.lastname;\n tablerow.appendChild(lname);//End Lastname\n dob = document.createElement('td');//Start DOB\n dob.innerHTML = someone.dateOfBirth;\n tablerow.appendChild(dob);//End DOB\n myBirthDay = document.createElement('td'); //Start of Birth Day\n myBirthDay.innerHTML = someone.age();\n tablerow.appendChild(myBirthDay);//End of Birth Date\n tabularForm.appendChild(tablerow);\n document.getElementById(\"details\").appendChild(tabularForm);\n}", "function add_comentarios(){ // funcion de agregar comentarios\n\n var nombre = document.getElementById('nombre').value; //tomo valores que ingresa el usuario en el form\n var coment = document.getElementById('texto_coment').value;\n var puntos = document.getElementById('puntos').value;\n\n comentario.push(nombre);\n comentario.push(coment);\n comentario.push(puntos);\n \n console.log(comentario);\n mostrar(comentario);\n\n}", "function registrar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_registrar\", 'EsquemaComision/registrar_esquema_comision', '#cuadro2');\n\t}", "function addMember(id, info) {\n\n let tableBody = document.querySelector(id+' tbody');\n let memberRow = document.createElement('tr');\n let memberData = [`<a href=\"${info.url}\">${info.first_name} ${info.middle_name || ''} ${info.last_name}</a>`, info.party, info.state, info.seniority + ' years', info.votes_with_party_pct + ' %'];\n\n memberData.forEach((cell) => {\n let td = document.createElement('td');\n td.innerHTML = cell;\n memberRow.appendChild(td);\n })\n\n tableBody.appendChild(memberRow);\n\n}", "function adicionar() {\r\n \t\t\t$scope.view.selectedItem.tituloC = $scope.titulo.id;\r\n \t\t\tif($scope.result != null)\r\n \t\t\t\t$scope.view.selectedItem.imagem = $scope.result.substr(22, $scope.result.length);\r\n \t\t\tCapituloCCreateFactory.create($scope.view.selectedItem).$promise.then(function(data) {\r\n \t \t\t$scope.view.dataTable.push(data);\r\n \t\t\t\t$mdDialog.hide('O capitulo adicionado com sucesso.');\r\n \t \t}, function() {\r\n \t \t\t$mdDialog.hide('O capitulo já foi gravado ou ocorreu algum erro.');\r\n \t \t});\t \t\r\n \t\t}", "function addRow() {\n\n $scope.section.rows.push(OdsFormService.newRowObject());\n }", "function adicionaPacientesNaTabela(paciente){\n\n\t// Cria uma linha da tabela com as colunas respectivamente do paciente\n\tvar tr = criaTabela(paciente);\n\n\t//Obtem a tabela do index.html\n\tvar tabela_paciente = document.querySelector(\"#tabela-pacientes\");\n\t\n\t//Adiciona a linha tr com as colunas td e adiciona como filha na tabela #tabela-pacientes\n\ttabela_paciente.appendChild(tr);\n}", "function mapEmployees(id,nome,cognome,livello,salario){\n var impiegato ={\n id : id,\n name : nome,\n surname : cognome,\n level : livello,\n salary: salario\n }\n employee.push(impiegato);\n}", "function CrearCuento(){\n SeleccionLibro();\n BorrarPaginasCuento();\n\n var Cuento = {Nombre:$('#InputNombre').val(),Coleccion:$('#SelectorColecciones').val()};\n InsertarCuentos(Cuento);\n GetIDCuento(Cuento);\n CargarCuentos();\n}", "addPatient(){\n \n var pname = readline.question('\\nEnter patient name : ');\n var pmobile = readline.questionInt('Enter Mobile number : ');\n var page = readline.questionInt('Enter patient age : ');\n \n var patient = {\n \"PName\" : pname,\n \"PMobile\" : pmobile,\n \"PID\" : this.pid,\n \"PAge\" : page\n }\n this.pfile.Patients.push(patient);\n this.savePatientData();\n }", "agregarOperarioPersona(formData) {\n return axios.post(`${API_URL}/v1/operario`, formData);\n }", "function addProduit (id, nom, prix) {\n\tlet detailProduit = [id, nom, prix];\n\tcontenuPanier.push(detailProduit);\n\tlocalStorage.panier = JSON.stringify(contenuPanier);\n\tcountProduits();\n}", "function addData(data) {\n console.log(` Adding: ${data.title} (${data.owner})`);\n Foods.insert(data);\n}", "function addData(data) {\n console.log(` Adding: ${data.name} (${data.icon})`);\n Reports.insert(data);\n}", "static renderPersonas(){\n for (let i = 0; i < personas.length; i++) {\n listadoPersonasSeleccion.innerHTML = listadoPersonasSeleccion.innerHTML + `<div class=\"persona\">${personas[i].numero}</div>`;\n }\n }", "function addContact(){\n var name = readLineSync.question('name: ');\n var phoneNum = readLineSync.question('phone: ');\n var contact = {\n Name: name,\n Phone: phoneNum\n };\n listContact.push(contact);\n save();\n console.log(\"\\nthem thanh cong nhe!\");\n}", "afficherNom() {\r\n\r\n let elmH4 = document.createElement('h4');\r\n let elmH3 = document.createElement('h3');\r\n\r\n let texteContenu = this.prenom + \" \" + this.nom;\r\n let titreTextContenu = \" Nom Complet : \" \r\n\r\n let texte = document.createTextNode(texteContenu);\r\n let titreTexte = document.createTextNode(titreTextContenu);\r\n\r\n elmH4.appendChild(texte);\r\n elmH3.appendChild(titreTexte);\r\n\r\n document.getElementById('iNomComplet').appendChild(elmH3);\r\n document.getElementById('iNomComplet').appendChild(elmH4);\r\n }", "function addPerson(person, map, userLat, userLng)\n{\n var loc = new google.maps.LatLng(person.lat, \n person.lng);\n\n var distance = Math.round(haversineDistance([userLng, userLat], \n [person.lng, person.lat], true)\n * 100) / 100;\n\n var text = person.login + \"<BR>Distance : \" + distance + \" miles\";\n\n var marker = new google.maps.Marker({\n position: loc,\n title: text,\n icon: new google.maps.MarkerImage(\n \"otherperson.png\",\n new google.maps.Size(40, 40),\n new google.maps.Point(0, 0),\n new google.maps.Point(20, 20))\n });\n marker.setMap(map);\n \n var infowindow = new google.maps.InfoWindow();\n \n google.maps.event.addListener(marker, 'click', function() {\n infowindow.setContent(marker.title);\n infowindow.open(map, marker);\n });\n}", "function aniadirEmpleadoTabla(empleado) {\n\tvar tablaEmpleados = document.getElementById(\"tablaEmpleados\");\t\n\tvar celda;\n\tvar contadorCeldas = 0;\n\tvar fila = tablaEmpleados.insertRow(-1);\n\n\t//Vamos creando las celdas con el contenido del objeto\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.nombre;\n\tcontadorCeldas++;\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.dni;\n\tcontadorCeldas++;\n\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.telefono;\n\tcontadorCeldas++;\n\n\tif (empleado instanceof Fisioterapeuta){\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasConsulta;\n\t\tcontadorCeldas++;\n\t\t\n\t\t//Respetamos los huecos vacios con atributos del monitor\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t}else{\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.actividades;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasClase;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasComun;\n\t\tcontadorCeldas++;\n\t}\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = \"<button onclick=\\\"mostrarDescripcion(this)\\\">DESCRIPCION</button>\";\t\t\n\n}", "function add ( name, text ) {\n data.push( { id: data.length, name: name, text: text } );\n}" ]
[ "0.64950323", "0.6444278", "0.6369781", "0.62349975", "0.6185863", "0.60871744", "0.6008432", "0.59491014", "0.5875018", "0.58600676", "0.58280057", "0.57749724", "0.5760148", "0.5731279", "0.5717448", "0.5698203", "0.5675311", "0.56695163", "0.5601724", "0.55939764", "0.5592333", "0.5585087", "0.5557746", "0.5539092", "0.55157083", "0.5504318", "0.55022275", "0.54962176", "0.5483122", "0.54739654", "0.54695404", "0.5451704", "0.54496145", "0.5436255", "0.5435705", "0.5421882", "0.5412513", "0.54091877", "0.53997594", "0.53952205", "0.5392914", "0.53868634", "0.53740424", "0.5373406", "0.53631616", "0.5361335", "0.53612727", "0.5360896", "0.5354655", "0.53452164", "0.5338845", "0.53239304", "0.531857", "0.53178024", "0.53178024", "0.5315479", "0.53054947", "0.53039306", "0.530306", "0.53013974", "0.52977526", "0.52976173", "0.5288256", "0.5284839", "0.52785146", "0.52756345", "0.5270047", "0.52653086", "0.52645934", "0.52555764", "0.52529985", "0.5246474", "0.52427304", "0.5239471", "0.52294034", "0.5224159", "0.52189684", "0.52188927", "0.52173823", "0.52082646", "0.5202172", "0.5199542", "0.51990545", "0.5197779", "0.51966655", "0.519642", "0.5196198", "0.518682", "0.5186116", "0.5182995", "0.51816887", "0.5173439", "0.51684105", "0.5163764", "0.5160974", "0.51607406", "0.51585615", "0.5156127", "0.51534164", "0.51506656" ]
0.6652078
0
Celda para ingresar datos
function renderEditable(cellInfo) { const aboutUserText = "<img onerror='alert(\"Hacked!\");' src='invalid-image' />"; return ( <div className = "cell" contentEditable // La variable de estado se actualiza cada vez que se suelta el foco de la celda actual onBlur = {e => { // Se valida si la edad es numerica o no if (cellInfo.column.id === 3){ if (!isNaN(e.target.innerHTML)){ const newData = [...props.personasaCargo]; newData[cellInfo.index][cellInfo.column.id] = e.target.innerHTML; cambiarPersonasaCargo(newData); } } else { const newData = [...props.personasaCargo]; newData[cellInfo.index][cellInfo.column.id] = e.target.innerHTML; cambiarPersonasaCargo(newData); } }} dangerouslySetInnerHTML = {{ __html: props.personasaCargo[cellInfo.index][cellInfo.column.id] /* __html: aboutUserText */ }} /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getData() {\n let cleanService = await CleanServiceModel.getCleanServiceById(id);\n setDitta(cleanService.ditta);\n setEmail(cleanService.email);\n setTelefono(cleanService.numeroTel);\n setDataAssunzione((new Date(cleanService.dataAssunzione.seconds * 1000)).toLocaleString(\"it-IT\").split(\",\")[0]);\n }", "function insertdata() {\n getData.getAllData().then(function() {});\n }", "function cargaDatos(){\n\tdb.transaction(cargaRegistros, errorDB);\n}", "function getData() {\n\n var sqlQuery = \"INSERT INTO job \\\n (`machine`,`tacho`,`site`,`description`,`order_number`,\\\n `id_number`,`mileage_e/w`,`customer_idcustomer`,`jlg_jobnumber`,`creation_date`,`job_status_idjob_status`) \\\n VALUES (?,?,?,?,?,?,?,?,?,?,?);\";\n\n var array = [req.body.machine,\n req.body.tacho,\n req.body.site,\n req.body.description,\n req.body.orderNumber,\n req.body.serial,\n req.body.mileage,\n req.body.customerDB,\n req.body.job_number,\n _formattedDate,\n req.body.statusDB\n\n ];\n mysql.query(sqlQuery, array, function(err2, rows) {\n if (!err2) {\n res.json(rows);\n } else {\n logger.debug('error:', err2);\n res.status(500).send(err);\n }\n })\n\n }", "async saveData(e){\n e.preventDefault()\n if (this.state.calle && this.state.numero && this.state.localidad){\n const instance = axios.create({\n withCredentials: true\n })\n let fullname = this.state.nombre + \" \" + this.state.apellido\n let data = this.state.calle+\" \"+this.state.numero+\" \"+this.state.departamento+\", \"+this.state.localidad+\", \"+this.state.provincia\n let motivo = \"\"\n \n await this.props.completeOrder(this.props.newOrderID,\"procesando\",data)\n await instance.get(\"http://localhost:3001/submit?email=\"+this.props.user.email+\"&direccion=\"\n +data+\"&nombre=\"+fullname+\"&orderID=\"+this.props.newOrderID+\"&status=confirmar\")\n .then(res=>{\n alert(\"La Orden esta siendo procesada, su compra sera despachada a la brevedad\")\n })\n .catch(err =>{\n alert(\"hubo un error\")\n })\n this.props.setRedirect(true)\n }else(alert(\"Complete la dirección de envio para completar la compra\"))\n}", "async function coletar() {\n try {\n console.log(\"Coletando dados do irrigador\");\n\n let res = await axios.get(URL_DISPOSITIVO);\n if (!res?.data?.status)\n throw new Error(\"Erro durante a coleta dos dados do dispositivo\");\n let status = res.data.status;\n\n // Converte a ultima irrigacao para o tempo atual\n if (!status.ultimaIrrigacao) {\n status.ultimaIrrigacao = await getUltimaIrrigacao();\n } else {\n let agora = Date.now();\n status.ultimaIrrigacao = new Date(agora - status.time + status.ultimaIrrigacao);\n }\n status.time = new Date();\n console.log(`Ultima irrigacao: ${status.ultimaIrrigacao}`);\n\n // Armazena e publica os dados\n console.log(`Armazenando Status: ${JSON.stringify(status)}`);\n udb.insert(res.data);\n if (URL_PLANILHA)\n postPlanilha({ timestamp: new Date(), ...status });\n\n } catch (ex) {\n console.error(err); F\n }\n}", "async function buscarUsuario(email){\n \n //insere os relatorios \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/cosnultaremail/\"+email); \n var usuario = JSON.parse(resposta);\n\n var idDestinatario = usuario.idUsuario;\n now = new Date();\n\n var relatorio = {\n titulo: $(\"#idTitulo\").val(),\n destinatario: idDestinatario,\n texto: $(\"#texto-area\").val(),\n dataRelatorio: now,\n fk_usuario: idUsuario\n }\n cadastrar(relatorio);\n}", "async function startETL() {\n await db.dropCustomersTable().then((res) => console.log(\"Drop customers table...\"));\n await db.createCustomersTable().then((res) => console.log(\"Customers table created...\"));\n\n /** Here is for map1.csv and data1.csv */\n let header = await getData(\"./etl/map1.csv\");\n let headerMap = await mapHeader(header[0]);\n // console.log(headerMap);\n\n let data = await getData(\"./etl/data1.csv\");\n data.map((record) => {\n // console.log(\"Inserting data\");\n let temp = {};\n Object.keys(record).forEach(key => {\n temp[headerMap[key]] = record[key];\n })\n // console.log(temp);\n loadDataToDB(temp);\n });\n\n /** Here is for map2.csv and data2.csv */\n let header2 = await getData(\"./etl/map2.csv\");\n let headerMap2 = await mapHeader(header2[0]);\n // console.log(headerMap);\n\n let data2 = await getData(\"./etl/data2.csv\");\n data2.map((record) => {\n // console.log(\"Inserting data\");\n let temp = {};\n Object.keys(record).forEach(key => {\n temp[headerMap2[key]] = record[key];\n })\n // console.log(temp);\n loadDataToDB(temp);\n });\n}", "data2db() {\n\t\tlet tables = ['modules', 'terms']\n\t\treturn this.db.transaction('rw', this.db.tables, () => {\n\t\t\treturn Promise.all(tables.map(t => \n\t\t\t\tthis.db.table(t).clear().then(()=>\n\t\t\t\t\tthis.db.table(t).bulkAdd(this.data[t]))))\n\t\t})\n\t}", "function entregado(idpedido) {\n $.post(\"controlador/pedido.php?op=entregado\",{idpedido : idpedido}, function(data, status)\n\t{\n\t\t\n $('#tbllistado').DataTable().ajax.reload();\n \t});\n }", "VerificarDatos(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n let list = req.files;\n let cadena = list.uploads[0].path;\n let filename = cadena.split(\"\\\\\")[1];\n var filePath = `./plantillas/${filename}`;\n const workbook = xlsx_1.default.readFile(filePath);\n const sheet_name_list = workbook.SheetNames; // Array de hojas de calculo\n const plantilla = xlsx_1.default.utils.sheet_to_json(workbook.Sheets[sheet_name_list[0]]);\n var contarDatos = 0;\n var contarCedula = 0;\n var contarContrato = 0;\n var contarPeriodos = 0;\n var contador = 1;\n /** Periodo de vacaciones */\n plantilla.forEach((data) => __awaiter(this, void 0, void 0, function* () {\n // Datos obtenidos de la plantilla\n const { nombre_empleado, apellido_empleado, cedula, descripcion, vacaciones_tomadas, fecha_inicia_periodo, fecha_fin_periodo, dias_vacacion, horas_vacacion, minutos_vacacion, dias_por_antiguedad, dias_perdidos } = data;\n // Verificar si los datos obligatorios existen\n if (cedula != undefined && descripcion != undefined && vacaciones_tomadas != undefined &&\n fecha_inicia_periodo != undefined && fecha_fin_periodo != undefined && dias_vacacion != undefined &&\n horas_vacacion != undefined && minutos_vacacion != undefined && dias_por_antiguedad != undefined &&\n dias_perdidos != undefined) {\n contarDatos = contarDatos + 1;\n }\n // Verificar si la cédula del empleado existen dentro del sistema\n if (cedula != undefined) {\n const CEDULA = yield database_1.default.query('SELECT id, codigo FROM empleados WHERE cedula = $1', [cedula]);\n if (CEDULA.rowCount != 0) {\n contarCedula = contarCedula + 1;\n // Verificar si el empleado tiene un contrato\n const CONTRATO = yield database_1.default.query('SELECT MAX(ec.id) FROM empl_contratos AS ec, empleados AS e WHERE ec.id_empleado = e.id AND e.id = $1', [CEDULA.rows[0]['id']]);\n if (CONTRATO.rowCount != 0) {\n contarContrato = contarContrato + 1;\n // Verificar si el empleado ya tiene registrado un periodo de vacaciones\n const PERIODO = yield database_1.default.query('SELECT * FROM peri_vacaciones WHERE codigo = $1', [parseInt(CEDULA.rows[0]['codigo'])]);\n if (PERIODO.rowCount === 0) {\n contarPeriodos = contarPeriodos + 1;\n }\n }\n }\n }\n // Verificar que todos los datos sean correctos\n console.log('datos', contarDatos, contarCedula, contarContrato);\n if (contador === plantilla.length) {\n if (contarDatos === plantilla.length && contarCedula === plantilla.length &&\n contarContrato === plantilla.length && contarPeriodos === plantilla.length) {\n return res.jsonp({ message: 'correcto' });\n }\n else {\n return res.jsonp({ message: 'error' });\n }\n }\n contador = contador + 1;\n }));\n fs_1.default.unlinkSync(filePath);\n });\n }", "async myTask(data, msg, conn, ch, db) {\n\n if (!data.app) {\n ch.ack(msg);\n throw Error(\"Must include an app label\");\n }\n\n if (this.isClientRequested(data)) {\n throw Error(\"Not authorized for client requests\");\n }\n\n try {\n\n let result = {\n app: ''\n };\n\n Object.assign(result, data);\n result.app = result.app.toUpperCase();\n\n // ***** ETL Logic ******\n\n result.processed_worker = moment().format();\n result.id_worker = this.consumer.uuidForCurrentExecution;\n\n let query = {id:result.id,app:result.app};\n let cookie = result['request_cookies'];\n delete result['request_cookies'];\n\n await db.collection(c).findOneAndUpdate(query, {$set: result}, {upsert:true});\n\n if (cookie && cookie != '') {\n Object.assign(result, {timestamp:moment().toDate()}, flatten(cookie, {delimiter: '__'}));\n await db.collection(c + '_registration').findOneAndUpdate(query, {$set: result}, {upsert: true});\n }\n\n console.log(` [x] Wrote ${JSON.stringify(result)} to ${this.DbName + '.' + c}`);\n\n ch.ack(msg);\n } catch (ex) {\n this.logError(data, msg, ex);\n // client.close();\n // conn.close();\n }\n }", "static async buscarNiveis(req, res) {\n try {\n const consultaNiveis = await //Enquanto executa\n niveisServices.buscarRegistros() /* Método Sequelize para busca de registros */\n\n /*Retorna a consulta do banco no formato JSON */\n return res.status(200).json(consultaNiveis)\n\n } catch (error) {\n\n /*Em caso de erro, retorna o cod. erro (500) e sua mensagem\n em formato JSON */\n return res.status(500).json(error.message)\n }\n }", "function dataSend() {\n let db;\n const request = indexedDB.open('my-db');\n request.onerror = (event) => {\n console.log('Error with IndexDB', event);\n };\n request.onsuccess = (event) => {\n db = event.target.result;\n getData(db);\n };\n }", "async function insertData(req, res) {\n var versionId = await pool.query(\"select id from version where number='\" + req.body.data.version + \"' and formularId='\" + req.body.data.formular + \"'\");\n\n // update data for existing version. First delete last data and then insert new data\n if (versionId.rows.length != 0) {\n await pool.query(\"delete from data where versionId='\" + versionId.rows[0].id + \"'\");\n await pool.query(\"delete from version where id='\" + versionId.rows[0].id + \"'\");\n }\n\n // insert into version and data tables for existing and non existing version\n await pool.query(\"INSERT INTO version(number, formularId) VALUES('\" + req.body.data.version + \"','\" + parseInt(req.body.data.formular) + \"')\")\n var version = await pool.query(\"select id from version where number='\" + req.body.data.version + \"' and formularId='\" + req.body.data.formular + \"'\")\n for (var i = 0; i < req.body.data.data.length; i++) {\n var data = req.body.data.data[i];\n await pool.query(\"INSERT INTO data(input, versionId, elementId) VALUES('\" + data.data + \"','\" + version.rows[0].id + \"', '\" + data.id + \"')\");\n }\n}", "async function populateThematique() {\n for (const [key, value] of Object.entries(ThematiquesDATA)) {\n let thematique = new Thematique({ name: value.name });\n thematique.save();\n }\n return \"populate Thematique Done\";\n}", "async function comprar(idUsuario,idPots) {\n try {\n let uuid_t = uuid();\n\n let queryInsert = \"insert into soluciones_compradas set ?\";\n let obj = {\n id_usuario: idUsuario,\n id_posts: idPots,\n token_compra: uuid_t\n } \n const rowsInsert = await pool.query(queryInsert,obj);\n\n let queryCorreo = \"select mail_usuario from usuarios where id_usuario = ? \";\n var correoDelUsuario = await pool.query(queryCorreo,idUsuario);\n // {mail_usuario : 'x'}\n correoDelUsuario = correoDelUsuario[0].mail_usuario;\n console.log(correoDelUsuario)\n\n //-- Actualizar la cant de salvavidas del usuario(escalable a una cantidad) -------------\n let queryUsuario = \"update usuarios set salvavidas = salvavidas - 1 where id_usuario = ? \";\n var userActualizado = await pool.query(queryUsuario,idUsuario);\n //---------------------------------------------------------------------------------\n\n let insertId = rowsInsert.insertId\n console.log(rowsInsert.insertId);//la pk de la fila insertada\n \n //mercado PAgo\n //[items] es un array de objetos que contienen todos los datos referidos a la compra\n let preference ={\n items : [\n {\n id : rowsInsert.insertId,\n title : 'Compra e-commerce',\n quantity : 1, //lo que elija el usuario req.body.cant\n currency_id : 'ARS',\n unit_price: 100 //lo que elija el usuario req.body.price\n }\n ],\n payer :{\n email : correoDelUsuario \n },\n notification_url : 'http://unaurldeverdad.com.ar:3000/' + \"compra/\"+ uuid_t\n }\n //notification_url es la url a la que mercado pago me redirige si la compra fue exitosa\n\n let obj_mercadopago = await mp.comprar(preference);\n // console.log(obj_mercadopago)\n // console.log(preference.notification_url);\n \n return obj_mercadopago.body.sandbo_init_point;\n } catch (error) {\n throw error;\n }\n \n \n}", "function asyncGetTempData(){\n //should I overwrite with the new(and old) data,(takes longer, simple)\n //check the database and only get then upload new data,(more complicated, no needless data retrieval)\n //or temp download all data and then check and upload new data?(might be easier to check database after getting the data)\n //There is also SQL online that will transfer directly from the FTP server to MySQL,\n //but it is beyond my level of knowledge and would have to just copy the code.\n}", "async saveData() {\n let data = this.state.rowData;\n let projectID = this.props.match.params.projectID;\n\n let updatedRows = this.updatedRows;\n\n // index is the index of a row that has been updated\n\n let processData = async function (pair) {\n let index = pair[\"rowIndex\"];\n let key = pair[\"colIndex\"];\n let netID = data[index][\"netid\"];\n let hours = data[index][key];\n let newData = {\n \"ProjectID\": projectID,\n \"NetID\": netID,\n \"Dates\": key,\n \"HoursPerWeek\": hours\n };\n let response = await fetch('../api/updateSchedule', {\n method: \"PUT\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(newData)\n });\n }\n updatedRows.forEach(processData);\n this.updatedRows.clear();\n }", "async SyncDB() { // Sincroniza com as tabelas, colunas e todos os elementos do Banco de Dados\n await mysql.sync();\n }", "async function cajas_hoy() {\n const datos = new FormData();\n datos.append(\"accion\", \"cajas_hoy\");\n\n try {\n const URL = \"../../../inc/peticiones/cajas/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n //console.log(db);\n let suma = 0;\n db.forEach((servicio) => {\n //console.log(servicio);\n const {id_caja,usuario,fecha_y_hora_abertura, fecha_y_hora_cierre, monto_inicial, monto_final , monto_final_ventas, corte } = servicio;\n \n const listado_pedidos = document.querySelector(\"#contenido_tabla\"); \n\n if(corte == 1){\n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-success text-wrap\">Caja cerrada</div></td>\n </tr>\n `\n }\n else if(corte == 0){ \n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-danger text-wrap\">Caja abierta</div></td>\n </tr>\n `\n }\n });\n\n //imprime el total\n //console.log(suma);\n\n } catch (error) {\n console.log(error);\n }\n}", "geraRelatorio(val, start, end, conn, tblRelations) {\n let global = this;\n let sql = this.makeSql(val, start, end, tblRelations);\n\n conn.query(sql, function (error, result, fields) {\n if (error) throw error;\n console.log(val.rs_id + \" :>>>>> \" + result.length);\n if (result.length > 0) {\n let data = [];\n mkdirp(`files/${val.rs_id}`, function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n\n \n });\n for (let i = 0; i <= result.length; i++) {\n data.push(result[i]);\n if (i > 0 && i % 200000 == 0) {\n\n let file = `files/${val.rs_id}/REL_${(global._contador + 1)}_${val.rs_id}.xlsx`;\n global._process[global._contador] = new Excel(data, global._param, file);\n global._process[global._contador].build();\n global._contador++;\n data = [];\n }\n }\n\n if (data.length > 0) {\n let file = `files/${val.rs_id}/REL_${(global._contador + 1)}_${val.rs_id}.xlsx`;\n global._process[global._contador] = new Excel(data, global._param, file);\n global._process[global._contador].setUser(val.rs_usuario);\n global._process[global._contador].build();\n global._contador++;\n data = [];\n }\n } else {\n\n /////////////////////////// Update na tabela não achou registro/////////////////////////\n // var sql = `update rel_solicita set rs_status = 'V', rs_arquivo= 'Sem Registro' where rs_id = ${val.rs_id}`;\n\n // this._connection.query(sql, function (error, result) {\n\n // if (error) throw error;\n // if (result.length > 0) {\n // result.forEach(function (val) {\n // rel.build(val);\n // });\n // } else {\n\n // console.log('Update com sucesso sem registro');\n\n // }\n // });\n\n console.log(\" nenhum averbação localizado\");\n }\n\n });\n\n \n // var global = this;\n // var arquivo = `${global._id}.zip`;\n \n // zipFolder(`files/${global._id}`, `files/${arquivo}`, function (err) {\n \n // if (err) {\n // console.log('oh no!', err);\n // } else {\n // console.log('deu certo');\n // }\n // });\n\n }", "function syncData() {}", "async importYleyServices() {\n\n this.log(\"Импортируем услуги Yley\", \"Info\");\n\n\n const {\n source,\n target,\n ctx,\n } = this;\n\n\n const knex = source.getKnex();\n\n\n const query = source.getQuery(\"yley_services\", \"source\")\n ;\n\n query\n .leftJoin(target.getTableName(\"Service\", \"target\"), {\n \"target.oldID\": \"source.id\",\n })\n .whereNull(\"target.id\")\n\n ;\n\n\n query.select([\n \"source.*\",\n \"source.id as oldID\",\n knex.raw(\"'YleyService' as type\"),\n ]);\n\n // query.limit(1);\n\n\n // console.log(chalk.green(\"query SQL\"), query.toString());\n\n // throw new Error (\"Topic error test\");\n\n const objects = await query.then();\n\n // console.log(\"objects\", objects);\n\n await this.log(`Было получено ${objects && objects.length} услуг Yley`, \"Info\");\n\n // return;\n\n const processor = this.getProcessor(objects, this.writeYleyService.bind(this));\n\n for await (const result of processor) {\n\n // console.log(\"writeUser result\", result);\n\n }\n\n }", "setUserClienteData(req, res) {\n // PASSWORD DATA\n let jsonData = req.body;\n // CONNECTING TO THE DATABASE\n pool.connect()\n // ON SUCCESS => CONNECTED\n .then(client => {\n // UPDATE QUERY\n client.query(\"UPDATE tbCliente SET nomeUser = $1, nomeCliente = $2, emailCliente = $3, dataNascimento = $4, enderecoDoCliente = $5, latCliente = $6, lngCliente = $7, telefoneCliente = $8 WHERE idCliente = $9\", [jsonData.user_name, jsonData.name, jsonData.email, jsonData.dataNascimento, jsonData.address, jsonData.lat, jsonData.lng, jsonData.telefone, jsonData.id])\n // ON SUCCESS\n .then(() => {\n // RESPONSE OK 200\n res.status(200).json({ title: 'Dados atualizados', message: 'Seus dados foram atualizados com sucesso.' })\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }))\n // DISCONNECTING TO THE DATABASE\n client.release();\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }));\n }", "function setData() {\r\n // Uzmemo trenutni grad iz niza\r\n const city = cityNames[currentCity];\r\n\r\n // Dohvatimo podatke za trenutni grad.\r\n getTemperatureDataForCity(city).then(({ temp, temp_max, temp_min }) => {\r\n // Upisemo podatke u html.\r\n document.getElementById('city').innerHTML = `${city}`;\r\n document.getElementById('currentTemp').innerHTML = `${temp} celzijusa`;\r\n document.getElementById('minTemp').innerHTML = `${temp_min} celzijusa`;\r\n document.getElementById('maxTemp').innerHTML = `${temp_max} celzijusa`;\r\n });\r\n\r\n // Uvecava indeks trenutnog grada. Vraca na 0 kada dodje do kraja.\r\n currentCity = (currentCity + 1) % cityNames.length;\r\n}", "async function registerDB(data, cep) {\n return new Promise((resolve, reject) => {\n try {\n for (const cepUni of data) {\n //console.log(cepUni.logradouroDNEC);\n //register at DB\n var endereco = cepUni.logradouroDNEC;\n var conplemento = '';\n // Get the index of the last - \n var lastIndex = endereco.lastIndexOf(' - ');\n // Add the string before the last .\n if (lastIndex > 3) {\n endereco = cepUni.logradouroDNEC.substring(0, cepUni.logradouroDNEC.lastIndexOf(' - '));\n conplemento = cepUni.logradouroDNEC.substr(lastIndex + 3);\n }\n\n var queryString = `INSERT INTO ceptable(\n cep,logradouro,complemento,bairro,cidade,estado,exist_no_ws,data_consulta,nome_unidade,tipo_cep\n ) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)`\n const values = [\n cepUni.cep,\n '',\n conplemento,\n cepUni.bairro,\n cepUni.localidade,\n cepUni.uf,\n 'SIM',\n new Date(),\n cepUni.nomeUnidade,\n cepUni.tipoCep\n ];\n\n pool.query(queryString,values, (err, res) => {\n if (err !== undefined) {\n // log the error to console\n //console.log(\"Postgres INSERT error:\", err);\n\n // get the keys for the error\n // var keys = Object.keys(err);\n //console.log(\"\\nkeys for Postgres error:\", keys);\n\n // get the error position of SQL string\n //console.log(\"Postgres error position:\", err.position);\n resolve(true); //já existe o cep\n }\n\n // check if the response is not 'undefined'\n if (res !== undefined) {\n // log the response to console\n //console.log(\"Postgres response:\", res);\n\n // get the keys for the response object\n // var keys = Object.keys(res);\n\n // log the response keys to console\n // console.log(\"\\nkeys type:\", typeof keys);\n // console.log(\"keys for Postgres response:\", keys);\n\n if (res.rowCount > 0) {\n console.log(\"# of records inserted:\", res.rowCount);\n } else {\n //console.log(\"No records were inserted.\");\n }\n resolve(true);\n }\n });\n\n }\n }\n catch {\n console.log(\"============================================erro salvar cep: \" + cep)\n resolve(false);\n }\n });\n}", "function insertMarker(){\n//peticion ajax al servidor\n $.ajax({\n async:true,\n url: \"/webservices/getMarkers_busqueda.php\",//devuelve un json con los marcadores que están en la base de datos.\n dataType: \"json\",\n success:pintar\n });\n}", "async function cajas_ayer() {\n const datos = new FormData();\n datos.append(\"accion\", \"cajas_ayer\");\n\n try {\n const URL = \"../../../inc/peticiones/cajas/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n //console.log(db);\n let suma = 0;\n db.forEach((servicio) => {\n //console.log(servicio);\n const {id_caja,usuario,fecha_y_hora_abertura, fecha_y_hora_cierre, monto_inicial, monto_final , monto_final_ventas, corte } = servicio;\n const listado_pedidos = document.querySelector(\"#contenido_ayer\"); \n\n if(corte == 1){\n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-success text-wrap\">Caja cerrada</div></td>\n </tr>\n `\n }\n else if(corte == 0){ \n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-danger text-wrap\">Caja abierta</div></td>\n </tr>\n `\n }\n });\n\n //imprime el total\n //console.log(suma);\n\n } catch (error) {\n console.log(error);\n }\n}", "async function insertInfluxDB(tableName, data) {\n await connI.write(tableName).field(data);\n}", "function converteEndereco(enderecos) {\n enderecos.forEach(function(endereco, index){\n geocoder.geocode( { 'address': endereco.endereco + ', ' + endereco.numero + ', ' + endereco.cidade + ', ' + endereco.uf}, function(resultado, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n endereco.lat = resultado[0].geometry.location.lat();\n endereco.lng = resultado[0].geometry.location.lng();\n \n $.ajax({\n type: \"POST\",\n url: \"/upload\",\n data: endereco,\n error: function(erro){\n console.log('erro na funcao salvaBanco' + erro);\n }\n });\n }\n else {\n console.log('Erro ao converter endereço: ' + status);\n }\n });\n });\n}", "inactivar(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n let transaction;\n try {\n const lRespuesta = yield VerificacionTokenController_1.VERIFICACIONTOKEN_CONTROLLER.VerificarToken(req, res);\n // if (!lRespuesta) {\n // res.sendStatus(403);\n // } else {\n transaction = yield database_1.sequelize.transaction();\n req.body.dtModificacion = Date.now();\n //*Validacion - itera el objeto y algun elemento esta inactivado, lo activa y viceversa.\n req.body = req.body.map((item) => { item.lActivo = !item.lActivo; return item; });\n yield tblClientes_1.default.bulkCreate(req.body, { updateOnDuplicate: ['iIdCliente', 'lActivo'] }, { transaction });\n //Obtener el o los Ids de los datos a inactivar para actualizar otras tablas\n let iIdPadron = req.body.map((x) => x.iIdPadron);\n //Actualiza las tablas realcionadas\n req.body.map((x) => {\n x.lActivo == true ? 1 : 0;\n //Actualiza la tabla de padron \n tblPadronPersonas_1.default.update({ lAsignado: x.lActivo }, { where: { iIdPadron: iIdPadron } });\n }, { transaction });\n yield transaction.commit();\n return res.json({\n message: \"Registro Eliminado con Exito\",\n data: req.body\n });\n // }\n }\n catch (error) {\n if (transaction)\n yield transaction.rollback();\n res.status(500).json({\n message: 'ocurrio un error'\n });\n }\n });\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}", "function storeEmailCSV(dataInfo) {\n return new Promise((resolve, reject) => {\n let success = true;\n let data = dataInfo.uploadedData;\n let user = dataInfo.user;\n let batchId = dataInfo.batchId;\n //Attempt to store email CSV\n data.forEach((contact) => {\n pool.connect(function (errorConnecting, db, done) {\n if (errorConnecting) {\n console.log('Error connecting', errorConnecting);\n reject(errorConnecting);\n } else {\n let queryText = 'INSERT INTO \"emails\" (\"first\",\"last\",\"title\",\"company\",\"domain\",\"building\",\"market\",\"email\",\"office_id\",\"batch_id\") VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10);';\n db.query(queryText, [\n contact.first,\n contact.last,\n contact.title,\n contact.company,\n contact.domain,\n contact.building,\n contact.market,\n contact.email,\n user.o_id,\n batchId\n ], function (errorMakingQuery, result) {\n done();\n if (errorMakingQuery) {\n console.log('error making email entry query', errorMakingQuery);\n reject(errorMakingQuery);\n } else {\n\n }\n });\n }\n }); //end of pool\n });\n resolve(batchId);\n });\n}", "updateDate(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // Leer listado de excel\n const workbook = xlsx_1.default.readFile('./src/public/Personas.xlsx', { cellDates: true });\n const workbookSheets = workbook.SheetNames;\n const sheet = workbookSheets[0];\n const dataExcel = xlsx_1.default.utils.sheet_to_json(workbook.Sheets[sheet]);\n const db = dataExcel;\n const conn = yield database_1.connect();\n const myQuery = \"UPDATE personas SET fecha_nacimiento=? WHERE identificacion=?\";\n // Actualizacion de fechas de nacimiento\n db.forEach((elemento) => __awaiter(this, void 0, void 0, function* () {\n if (elemento.FechaNacimiento != undefined) {\n let fecha = date_fns_1.format(new Date(elemento.FechaNacimiento), 'yyyy-MM-dd');\n yield conn.query(myQuery, [fecha, elemento.identificacion]);\n }\n }));\n response_1.respuesta.success(res, 'Fecha de nacimiento actualizada');\n }\n catch (error) {\n console.log(chalk_1.default.red(error));\n }\n });\n }", "async postParcelas(req,res){\n //recebe do form do fron-end via body//\n const{margem, orgao} = req.body;\n\n //pega o dia atual do servidor//\n const diaAtual = await format(new Date(), 'dd');\n \n // console.log(diaAtual);\n\n try{ //filtra pelo orgao e o dia atual//\n const ResultOrgao = await Simulador.find({'orgao':orgao, 'data':diaAtual});\n //mapeia o resultado e gera um novo array com a resposta//\n const resultadoFinal = await ResultOrgao.map(resultado =>(\n {\n id:resultado._id,\n banco:resultado.banco,\n parcelas:resultado.parcelas,\n valor:margem/resultado.fator\n\n }\n\n ))\n return res.json(resultadoFinal);\n\n }\n catch(e){\n return res.status(404).send(`${e} favor verifique os dados digitados`);\n }\n }", "async function bajar() {\n await importar();\n inicializar();\n obtener();\n}", "async function autorizarPrestamo(idPrestamo){\n\n event.preventDefault();\n\n data = await fetch(`http://localhost:41062/www/prestamos/autorizar/${idPrestamo}`)\n .then(res =>res.json())\n .then(json => json);\n // this.copydata = [...this.data];\n // console.table(data);\n renderPrestamo(data, idPrestamo);\n\n\n\n }", "function data_write(mydata) {\n\n const pool = mysql.createPool({\n host: process.env.RDS_HOSTNAME,\n user: process.env.RDS_USERNAME,\n password: process.env.RDS_PASSWORD,\n port: process.env.RDS_PORT,\n database: process.env.RDS_DATABASE\n });\n\n var id = convert_value(mydata.id,'qs');\n var siteid = convert_value(mydata.site_id,'s');\n var site = convert_value(mydata.site); \n var location = convert_value(mydata.address);\n var timestamp = Date.now();\n var latitude = mydata.latitude;\n var longitude = mydata.longitude;\n var temperature = mydata.temperature;\n var humidity = mydata.humidity;\n var pressure = mydata.pressure;\n var co2 = mydata.co2;\n var lpg = mydata.lpg;\n var registers = \"INSERT INTO SENSORS (id,\" +\n \"timestamp,\" +\n \"temperature,\" +\n \"humidity,\" +\n \"pressure,\" +\n \"lpg,\" +\n \"co2,\" +\n \"latitude,\" +\n \"longitude,\" +\n \"siteid,\" +\n \"site,\" +\n \"location)\" +\n \"VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n \n // Insert values in the database of MySQL \n context.callbackWaitsForEmptyEventLoop = false;\n pool.getConnection(function(error, connection) {\n connection.query(registers,\n [id,\n timestamp,\n temperature,\n humidity,\n pressure,\n lpg,\n co2,\n latitude,\n longitude,\n siteid,\n site,\n location],\n function(error, results, fields) {\n connection.release();\n if (error) {\n callback(error);\n } else {\n callback(null, results);\n console.log(null,results);\n }\n }); \n });\n }", "upsertBatch({\n commit\n }, list) {\n const url = `${endpointUrl}/batch-upsert`;\n return axios.post(url, list).then(result => {\n commit('CLEAR_LIST');\n\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 createdCell = result.data[i];\n\n if (createdCell) {\n //console.log('createdCell', createdCell); \n commit('ADD', createdCell);\n } else {//console.warn('createdCell is', createdCell);\n }\n }\n\n return result.data;\n });\n }", "function operadorAceptoSolicitud(req,res){\n let id_operador= req.params.id, id_solicitante = req.params.id_solicitante;\n let solicitud = buscarSolicitud(id_solicitante);\n let flag=buscarOperador(id_operador);\n\n\n solicitudes[solicitud].estatus='aceptada';\n solicitudes[solicitud].operador= id_operador;\n solicitudes[solicitud].latOperador = operadores[flag.i-1].lat;\n solicitudes[solicitud].lngOperador = operadores[flag.i-1].lng;\n\n console.log('SOLICITUD AGENDADA:',solicitudes[solicitud]);\n\n //AQUI VA LA FECHA POR EJEMPLO\n var date = new Date();\n var fechaActual = moment(date).format('YYYY-MM-DD');\n console.log(` fechas ${ fechaActual } == ${solicitudes[solicitud].fecha}`);\n if(fechaActual < solicitudes[solicitud].fecha ){\n //aqui se guardara\n console.log(`se guardardo en base de datos solicitud agendada`);\n let sql = `INSERT INTO solicitud \n (id_solicitud, id_solicitante, id_operador, id_servicio, fecha, hora, lat_inicio, lng_inicio, lat_fin, lng_fin, costo, estatus) \n VALUES \n ('NULL', \n '${solicitudes[solicitud].id_solicitante}',\n '${id_operador}',\n '${solicitudes[solicitud].id_servicio}', \n '${solicitudes[solicitud].fecha}', \n '${solicitudes[solicitud].hora}', \n '${operadores[flag.i-1].lat}', \n '${operadores[flag.i-1].lng}', \n '${solicitudes[solicitud].lat}', \n '${solicitudes[solicitud].lng}', \n '100', \n 'AGENDADA'\n )`;\n consultaBd.insertar(sql,(result)=>{\n if(result){\n console.log('se guardo en la base de datos solicitud agendada');\n res.status(200).send({message:[{'flag':'guardado','cuerpo':[]}]});\n solicitudes.splice(solicitud,1);\n }\n })\n }else{\n //buscamos al solicitante en la base de datos\n \n console.log(`solicitud de : ${ solicitudes[solicitud].id_solicitante } fue ${ solicitudes[solicitud].estatus }\n por el operador: ${ id_operador }`);\n //buscamos la lat y lng del operador para agregarlos al row de la solicitud en el arreglo\n let flag=buscarOperador(id_operador);\n solicitudes[solicitud].latOperador = operadores[flag.i-1].lat;\n solicitudes[solicitud].lngOperador = operadores[flag.i-1].lng;\n if(flag.flag){//verificamos que el operador este en el arreglo\n operadores.splice(flag.i-1,1);\n let rechazada = verificarRechazo(id_operador);\n if(rechazada.flag){//verificamos si alguien rechazo la solicitud\n arregloSolicitudRechazada.splice(rechazada.pos,1); //la eliminamos del arreglo de rechazadas\n }\n res.status(200).send({message:['Estado: Desconectado']})\n }else{\n res.status(404).send({message:['Error: No se encontro el operador']})\n }\n }\n}", "async function postG1() {\n var resultado;\n if ($(\"#dateRangePicker\").val() == \"\") {\n //Carga inicial grafica de Tramites por día\n try {\n resultado = await $.ajax({\n type: \"POST\",\n url: rootURL + TramitesDia,\n data: JSON.stringify({\n token: tokenSession\n }),\n contentType: \"application/json; charset=utf-8\"\n });\n } catch (error) {\n console.log(error);\n }\n $.when(resultado).then(function (data) {\n datos = JSON.parse(data.d);\n //Obtiene el total de registros retornados\n totRegTD = datos['iRegistros'];\n TotalRegistros = totRegTD;\n $(\".count\").html(totRegTD);\n for (var i = 0; i < totRegTD; i++) {\n var item = datos['aoData'][i];\n var FechaTramite = item['FechaTramite'];\n //console.log(item);\n slp = FechaTramite.split(\"-\");\n slp2 = slp[2].split(\"T\");\n var anio = slp[0];\n var mes = slp[1];\n var dia = slp2[0];\n var dateItem = new Date(anio, mes - 1, dia);\n var numDia = dateItem.getDay();\n switch (numDia) {\n case 1:\n l++;\n break;\n case 2:\n m++;\n break;\n case 3:\n x++;\n break;\n case 4:\n j++;\n break;\n case 5:\n v++;\n break;\n }\n }\n Highcharts.chart('tramitesDia', {\n chart: {\n type: 'column'\n },\n title: {\n text: 'Trámites por día'\n },\n xAxis: {\n categories: ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes']\n },\n yAxis: {\n title: {\n text: 'Número de trámites'\n },\n tickInterval: 2,\n gridLineWidth: 1\n },\n tooltip: {\n crosshairs: true\n },\n exporting: {\n enabled: false\n },\n plotOptions: {\n line: {\n dataLabels: {\n enabled: true\n }\n }\n },\n series: [{\n name: 'No. de trámites',\n data: [l, m, x, j, v]\n }]\n });\n l = 0;\n m = 0;\n x = 0;\n j = 0;\n v = 0;\n });\n } else {\n var dateRange = $(\"#dateRangePicker\").val().split(\" - \");\n var dateInicial = dateRange[0];\n var dateFinal = dateRange[1];\n var dataJson = JSON.stringify({\n token: tokenSession,\n fechaInit: dateInicial,\n fechaEnd: dateFinal\n });\n try {\n resultado = await $.ajax({\n type: \"POST\",\n url: rootURL + TramitesDia,\n data: dataJson,\n contentType: \"application/json; charset=utf-8\"\n });\n } catch (error) {\n console.log(error);\n }\n $.when(resultado).then(function (data) {\n datos = JSON.parse(data.d);\n //Obtiene el total de registros retornados\n totRegTD = datos['iRegistros'];\n $(\".count\").html(totRegTD);\n for (var i = 0; i < totRegTD; i++) {\n var item = datos['aoData'][i];\n var FechaTramite = item['FechaTramite'];\n //console.log(item);\n slp = FechaTramite.split(\"-\");\n slp2 = slp[2].split(\"T\");\n var anio = slp[0];\n var mes = slp[1];\n var dia = slp2[0];\n var dateItem = new Date(anio, mes - 1, dia);\n var numDia = dateItem.getDay();\n switch (numDia) {\n case 1:\n l++;\n break;\n case 2:\n m++;\n break;\n case 3:\n x++;\n break;\n case 4:\n j++;\n break;\n case 5:\n v++;\n break;\n }\n }\n Highcharts.chart('tramitesDia', {\n chart: {\n type: 'column'\n },\n title: {\n text: 'Trámites por día'\n },\n xAxis: {\n categories: ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes']\n },\n yAxis: {\n title: {\n text: 'Número de trámites'\n },\n tickInterval: 2,\n gridLineWidth: 1\n },\n tooltip: {\n crosshairs: true\n },\n exporting: {\n enabled: false\n },\n plotOptions: {\n line: {\n dataLabels: {\n enabled: true\n }\n }\n },\n series: [{\n name: 'No. de trámites',\n data: [l, m, x, j, v]\n }]\n });\n l = 0;\n m = 0;\n x = 0;\n j = 0;\n v = 0;\n });\n }\n}", "postCSV(req,res){\n\n //pega o csv do input file //\n const {path, filename} = req.file\n \n\n try{\n //le o input file //\n fs.createReadStream(path)\n .pipe(csv())\n .on('data', (row) => {\n //recebe as linhas da tabela como parametro e insere no banco //\n //CSV precisa ser separado por virgula, com o titulo da tabela na primeira linha //\n Simulador.create(row)\n \n })\n .on('end', () => {\n // console.log('CSV file successfully processed')\n \n //remove o csv da pasta temporaria //\n fs.unlinkSync(Dirpath.resolve(__dirname,'..','..','tmp','csv',filename))\n \n\n res.json({cadastrado:true});\n \n })\n \n\n \n }\n catch(e){\n return res.status(404).send(`${e} Verifique o arquivo csv`);\n }\n\n }", "function storeDonacio(dataDonacio) {\n\n dataDonacio.append('fecha', today());\n dataDonacio.append('id_usuario', idUsuario);\n dataDonacio.append('id_donante', donante.id);\n\n\n $.ajax({\n async: 'true',\n method: 'POST',\n data: dataDonacio,\n processData: false,\n contentType: false,\n enctype: 'multipart/form-data',\n url: '../api/donations',\n success: function (resp) {\n console.log(resp);\n donacionsRebudes++;\n reload()\n },\n error: function (jqXHR, exception) {\n console.log(jqXHR);\n console.log(exception);\n donacionsRebudes++;\n reload()\n }\n })\n}", "excelImport(data){\nreturn this.post(Config.API_URL + Constant.REFFERAL_EXCELIMPORT, data);\n}", "initDataFromCSV() {\n this.setState({\n data: dataTable.map((prop, key) => {\n return this.produceCustomer(prop[0], prop[1], prop[2], prop[3], 0);\n })\n });\n }", "async async_salva_hana_on_sqlite( data, unidade, callback ){\n \n console.log('Iniciou importacao do hana', data);\n \n const conn = hana.createConnection();\n \n const qry_mapa_descarregamento = `\n SELECT TOP 100\n B.\"TKNUM\" AS \"ID\",\n B.\"Plant\" AS \"Unidade\",\n B.\"PurchasingDocument\" AS \"Pedido\",\n D.\"ReferenceSDDocumentItem\" AS \"Item_pedido\",\n B.\"Material\" AS \"Cod_Material\",\n B.\"PurchasingDocumentItemText\" AS \"Material\",\n B.\"EKBE_BELNR\" as \"Remessa\",\n B.\"DOCDAT\" AS \"Dia\",\n B.\"NFENUM\" AS \"N_nota_fiscal\",\n B.\"CC_QtyBaseUnit\" AS \"Peso\",\n B.\"NAME1\" AS \"Transportadora\",\n B.\"Modal\",\n vk.\"SIGNI\" AS \"Placa\",\n vk.\"EXTI1\" AS \"Nome\"\n \n FROM \"_SYS_BIC\".\"LSA.ADM.O2C.Logistic/CV_BILLINGTRANSF\" AS B\n INNER JOIN \"_SYS_BIC\".\"BISelfService.F2P/CV_DELIVERYHISTORY\" AS D ON D.\"DeliveryDocument\" = B.EKBE_BELNR\n INNER JOIN \"RBT_ST4_GE4260\".\"VTTK\" AS vk ON vk.\"TKNUM\" = B.TKNUM\n \n WHERE\n B.\"Plant\" = '${unidade}' AND\n B.\"DOCDAT\" = ${data}\n `;\n \n conn.connect(HANA_conf, (err) => {\n if (err) return 404;\n \n conn.exec(qry_mapa_descarregamento, async (err, result) => {\n if (err) { conn.disconnect(); return 404; };\n \n conn.disconnect();\n\n // Organiza os dados\n const organizado = module.exports.formata_dados_v2( result );\n\n const dados_enviados = await Promise.all(\n organizado.map( item => {\n\n // Salva os dados do caminhão no sqlite\n module.exports.salva_descarregamento_sqlite_v2( item );\n return 200;\n })\n );\n\n return callback( dados_enviados[0], organizado );\n\n });\n \n });\n\n }", "async getCsvData() {\n await this.emptyIfFull();\n await this.runPython();\n await this.fetchScrapedData();\n await this.setPortData();\n await this.setAirfieldData();\n Meteor.call('setTimeofScrape');\n this.setState({ loading: false });\n }", "async store(req,res){\n let theLoai = new TheLoai();\n theLoai.columns.tenTheLoai = req.body['ten-the-loai'];\n theLoai.columns.moTa = req.body['mt-the-loai'];\n try {\n await theLoai.save(true);\n res.send({complete:true,newTheLoai:theLoai,mess:'Thêm thành công!'});\n } catch (error) {\n res.send({complete:false});\n }\n \n }", "async actualizaDatos (parametros, tabla, id) {\n try {\n tabla = tabla + ((id !== undefined) ? '/' + id : '') + '.json'\n const res = await fetch((API_URL + tabla), {\n method: 'PUT',\n headers: {\n 'content-Type': 'application/json'\n },\n body: JSON.stringify(parametros)\n })\n const datoDb = await res.json()\n return datoDb\n } catch (error) {\n console.log(error)\n }\n }", "async function cajas_dia_especifico() {\n const datos = new FormData();\n //Se obtiene el valor del dia\n const fecha = document.querySelector(\"#fecha_elegida\").value;\n console.log(\"fecha \"+fecha);\n if(fecha != 0){\n datos.append(\"fecha\", fecha);\n datos.append(\"accion\", \"buscar_fecha\");\n try {\n const URL = \"../../../inc/peticiones/cajas/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n let mensaje =db.length;\n console.log(mensaje);\n \n \n const listado_pedidos = document.querySelector(\"#contenido_fecha\"); \n listado_pedidos.innerHTML = \"\";\n if (mensaje >= 1){\n db.forEach((servicio) => {\n console.log(servicio);\n const {id_caja,usuario,fecha_y_hora_abertura, fecha_y_hora_cierre, monto_inicial, monto_final , monto_final_ventas, corte } = servicio;\n \n if(corte == 1){\n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-success text-wrap\">Caja cerrada</div></td>\n </tr>\n `\n }\n else if(corte == 0){ \n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-danger text-wrap\">Caja abierta</div></td>\n </tr>\n `\n }\n });\n }\n else{\n const mensajes = document.querySelector(\"#mensaje2\");\n mensajes.innerHTML += ` \n <div class=\"alert alert-danger alert-dismissible bg-warning text-white border-0 fade show\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong>¡ALERTA! </strong> No existen registros en la fecha seleccionada.\n </div>\n `;\n }\n \n //imprime el total\n //console.log(suma);\n } catch (error) {\n console.log(error);\n }\n }\n else{\n //Mensaje de alerta\n const mensajes = document.querySelector(\"#mensaje2\");\n mensajes.innerHTML += ` \n <div class=\"alert alert-danger alert-dismissible bg-danger text-white border-0 fade show\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong>¡ERROR! </strong> No ha seleccionado una fecha.\n </div>\n `;\n }\n \n}", "function Generatedata(){\n const zibvalue= zip.value\n const feelingsvalue=feelings.value\n\n gitWeatherApi(ApiUrl,zibvalue,ApiKey).then((res)=>{\n console.log(res);\n // make destructing object to filter data\n const{main:{temp},name:city,weather:[{description}]}=res\n const obsend={\n newdate,\n temp:Math.round(temp),\n city,\n description,\n feelingsvalue\n };\n postData(urlserver + '/add',obsend)\n fetchDataInUi()\n })\n}", "async upEmpresa(id, nova_senha, novo_email,novo_nome_empresa, nova_descricao, novo_telefone_um, novo_telefone_dois, novo_estado, nova_cidade, novo_endereco){\n const sql = 'SELECT updEmpresa ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)';\n const result = await pool.query(sql,[id, nova_senha, novo_email,novo_nome_empresa, nova_descricao, novo_telefone_um, novo_telefone_dois, novo_estado, nova_cidade, novo_endereco]);\n return result.rows;\n }", "async upCliente(id, nova_senha, novo_email, novo_nome, novo_telefone){\n const sql = 'SELECT updCliente ($1, $2, $3, $4, $5)';\n const result = await pool.query(sql,[id, nova_senha, novo_email, novo_nome, novo_telefone]);\n return result.rows;\n }", "async _transform (data,encoding,callback) {\n this.rowCount++;\n\tif (!Array.isArray(data)) {\n\t data = Object.values(data)\n\t}\n this.push({data:data.json})\n callback();\n }", "onTaskDataGenerated() {}", "function insertBd(idGateway,idLdevice,fechaLpro, mac, snr, rssi, voltaje, dhop, temperatura, longitud, latitud, altitud) {\n (async function() {\n try {\n let pool = await sql.connect(bdConfig)\n let result2 = await pool.request()\n .input('IDGATEWAY', sql.VarChar, idGateway)\n .input('LDEVICEID', sql.VarChar, idLdevice)\n .input('DPROTIMESTAMP', sql.DateTime2, fechaLpro)\n .input('MAC', sql.VarChar, mac)\n .input('SNR', sql.Float, snr)\n .input('RSSI', sql.Float, rssi)\n .input('VOLTAJE', sql.Int, voltaje)\n .input('DHOP', sql.Float, dhop)\n .input('TEMPERATURA', sql.Float, temperatura)\n .input('X', sql.Float, longitud)\n .input('Y', sql.Float, latitud)\n .input('Z', sql.Float, altitud)\n //.output('output_parameter', sql.VarChar(50))\n .execute('INSERT_LDPRODATA')\n //console.dir(result2)\n } catch (error) {\n console.log(`Error al insertar: ${error}`);\n sql.close();\n }\n sql.close();\n })()\n}", "async function saveData(data) {\n\tfor (let countryData of data) {\n\t\t// check that country is not yet exists\n\t\tlet sql = `SELECT id FROM country WHERE id = ?`;\n\t\tconst countries = await db.query(sql, [countryData.id]);\n\t\t// if there is no such country then save it to DB\n\t\tif (countries.length == 0) {\n\t\t\tsql = `INSERT INTO country SET ?`;\n\t\t\tconst data = {\n\t\t\t\tid: countryData.id,\n\t\t\t\tshort_name: countryData.extra ? countryData.extra.fifa : null,\n\t\t\t\tfull_name: countryData.name,\n\t\t\t\t// TODO: fix\n\t\t\t\t// flag_svg: countryData.extra.flag\n\t\t\t}\n\t\t\tawait (db.query(sql, data));\n\t\t}\n\t}\n}", "async function traeComboPpal(empresa){ \n const ruta = \"http://localhost:3000/api/usuarios?e=\"+empresa+\"&op=abono\";\n const res = await axios.get(ruta)\n .then(res=>{\n misDatos=res.data; \n setUsuarios(misDatos) \n setUsrs(misDatos.map(dat => {\n let properties = {\n \"id\": dat.id,\n \"us_nombre\": dat.us_nombre,\n \"us_codigo\":dat.us_codigo\n };\n return properties;\n })); \n })\n }", "function buscarFlete(){\n\n $('#fatalClose').unbind(\"click\").click(function(){\n $('#modalSolicitud').modal('hide'); \n socket.disconnect();\n });\n\n socket.socket.reconnect();\n start = 0;\n var datos={\"idUsuario\" : idU,\"origen\" : $('#start').val(), \"destino\" : $('#end').val(), \"cargar\" : $('#slider-flip-C').val(), \"descargar\" : $('#slider-flip-D').val(), \"comentario\" : $('#textarea').val()};\n\t\t$('#modalSolicitud').modal({\n\t\t show: true,\n\t\t backdrop: false,\n\t\t keyboard: false\n\t\t});\t\t\n \n //Chofer finaliza la transaccion\n socket.on('finalizaFlete', function(data){\n $('#modalFin').modal({\n backdrop: false,\n keyboard: false,\n show: true\n });\n $('#btnFin').css('display','none');\n finalizarFlete(data,\"Ha finalizado!\",false); \n });\n\n\t\tenviarSolicitud(datos);\n\n }", "async function upsert(data) { \n const authData = {\n // EL IDENTIFICADOR DE LOS DATOS AUTORIZACIÓN SON LOS MISMOS QUE EL DE USUARIO\n id: data.id,\n }\n // SE TRABAJA DE FORMA SEPARADA Y CREAR LOS CAMPOS QUE SE NECESITAN\n // PARA QUE SE ACTUALIZE LO QUE NECESITA\n if (data.username) {\n authData.username = data.username;\n }\n\n if (data.password) {\n // authData.password = data.password;\n // SE ENCRIPTA LA HASHEA CON 5 VECES QUE SE EJECUTE EL ALGORITMO(ENTRE 5 Y 10)\n authData.password = await bcrypt.hash(data.password, 5);\n }\n // isNew SE SETA PARA PODER GUARDAR EN MYSQL CUANDO NO CONTENGA data.id\n /* console.log(`authData`)\n console.log(authData) */\n return store.upsert(TABLA, authData);\n }", "async get_descarregamento_data_v2( request, response ){\n\n const { data: Dia, unidade: Unidade } = request.body;\n \n console.log('Iniciou descarregamento', Dia);\n\n const result = await connection('fDescarregamento')\n .select('*')\n .where({ Dia, Unidade });\n\n // Retorna um array dos caminhoes já com suas respectivas listas de status\n const adiciona_status = async ( caminhoes_s_status ) => {\n return await Promise.all(\n caminhoes_s_status.map( async item => {\n \n // Busca no sqlite os dados de status referente a esse caminhão\n const h_status = await status_func.busca_status( item.ID );\n\n // Buscano sqlite os dados de comentarios referente a esse caminhão\n const comentarios = await coments_func.buscaDados( item.ID );\n\n // Busca no sqlite o status atual desse caminhão\n const Status = await status_func.buscaStatusAtual( item.ID );\n \n const [ { Material } ] = item.Materiais;\n \n return { \n ...item,\n Material,\n Status,\n h_status,\n comentarios,\n };\n \n })\n );\n };\n\n // Adiciona os dados do sqlite referente aos caminhões retornados\n const descarregamento_final = await adiciona_status( result );\n\n // Tempo desde que os dados desse mapa de descarregamento foram atualizados\n const tempo_desde_ultima_atualizacao = ( descarregamento_final.length !== 0 )?( module.exports.agora() - descarregamento_final[0].Atualizado_sys ):0;\n\n // Se os dados do hana ainda não estiverem no sqlite, passe-os para lá\n if ( descarregamento_final.length === 0 || Math.abs( tempo_desde_ultima_atualizacao ) >= 10000 ) {\n\n const retorna = async ( fulfilled, caminhoes ) => {\n\n if ( fulfilled === 200 ) {\n\n // Busca no sqlite a lista de status referente a esse caminhão\n const caminhoes_c_status = await adiciona_status( caminhoes );\n\n const caminhoes_c_dados = await module.exports.busca_todos_os_dados( caminhoes_c_status );\n \n return response.status(200).json({ caminhoes: caminhoes_c_dados });\n \n } else {\n return response.status(400).json({ err: 'Ocorreu um erro.' });\n };\n };\n\n await module.exports.async_salva_hana_on_sqlite( Dia, Unidade, retorna );\n\n } else {\n\n const descarregamento_final_tratado = descarregamento_final.map( item => ({ ...item, Materiais: JSON.parse(item.Materiais), Assinaturas: JSON.parse(item.Assinaturas), }) );\n return response.status(200).json({ caminhoes: descarregamento_final_tratado });\n\n };\n\n }", "function changeSynchronized() {\n db.allDocs( { include_docs: true, descending: false } ).then( doc => {\n doc.rows.forEach( register => {\n register.doc.sincronizado = true;\n db.put( register.doc ).then( () => {\n console.log('Registro actualizado');\n }).catch( error => {\n console.log('Ha ocurrido un error al sincronizar: ', error);\n });\n });\n });\n}", "async function insertJogabilidade(dados){\n const conn = await connect();\n const sql = 'INSERT INTO Jogabilidade (idJog,rota,funcao) VALUES (?,?,?);';\n const values = [dados.idJog,dados.rota,dados.funcao]\n return await conn.query(sql,values);\n}", "async function busca() {\n try {\n const doc = await daoAlumno.doc(id).get();\n if (doc.exists) {\n const data = doc.data();\n forma.foto_file.src = await urlStorage(id);\n forma.matricula.value = data.matricula || \"\";\n forma.nombre.value = data.nombre || \"\";\n forma.correo.value = data.correo || \"\";\n forma.status.value = data.status || \"\";\n forma.telefono.value = data.telefono || \"\";\n forma.fecha.value = data.fecha || \"\";\n forma.addEventListener(\"submit\", guarda);\n forma.eliminar.addEventListener(\"click\", elimina(data.correo));\n } else {\n throw new Error(\"No se encontró.\");\n }\n } catch (e) {\n muestraError(e);\n muestraUsuarios();\n }\n}", "function updateRegistro(id, data, valor, obs, desc, callback) {\n db.pool.query(`UPDATE reg SET dtreg = '${data}', valorreg = ${valor}, obsreg = '${obs}', descreg = '${desc}' WHERE nreg = ${id} RETURNING *`, function (err, res) {\n console.log(err)\n if (err) {\n callback(err, null)\n } else {\n callback(null, res.rows[0])\n }\n })\n}", "async function mostrar_detalle(id_pedido) {\n const datos = new FormData();\n\n datos.append(\"id_pedido\", id_pedido);\n datos.append(\"accion\", \"buscar_pedido\");\n\n try {\n const URL = \"../../../inc/peticiones/compras/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n let suma = 0;\n db.forEach((servicio) => {\n //console.log(servicio);\n const {foto, id_producto,nombre_producto, stock, cantidad, precio_compra, importe, id_detalle_pedido,codigo} = servicio;\n suma += parseInt(importe);\n const listado_clientes = document.querySelector(\"#contenido_tabla\");\n \n listado_clientes.innerHTML += ` \n <tr>\n <td> <img src=\"../../imagenes/productos/${foto}\" alt=\"user\" class=\"rounded-circle\"\n width=\"40\"> </td>\n <td scope=\"row\">${codigo}</td>\n <td scope=\"row\">${nombre_producto}</td>\n <td scope=\"row\">${stock}</td>\n <td>${cantidad} </td> \n <td>${precio_compra} </td> \n <td>${importe} </td> \n </tr>\n `;\n });\n\n //imprime el total\n //console.log(suma);\n document.getElementById(\"por_pagar\").value=\"$\" + suma;\n document.getElementById(\"por_pagar2\").value= suma;\n\n } catch (error) {\n console.log(error);\n }\n}", "async function buscar(req, res) {\n const inscripcion = await Inscripcion.find({});\n res.status(200).json(inscripcion);\n}", "function updateMyData() {\n //Beenden des in \"loader\" definierten Intervalls\n try {\n console.log(\"update\")\n window.clearInterval(this.getData);\n }\n catch (err) {\n console.log(err)\n }\n /*'devices' bekommt JSON Objekt mit allen Geräten aus sessionStorage von \n 'getDevices' aus frontend.js*/\n let devices = datastore.getDevices()\n // Anlegen der Tabelle\n let table = document.getElementById(\"devices\");\n table.innerHTML = \"\"\n \n for (let i in devices) {\n let d = devices[i]\n // Anlegen einer Zeile pro Gerät\n let row = document.createElement(\"tr\");\n //Spalte 1: Zeilennummer\n let col1 = document.createElement(\"td\");\n col1.appendChild(document.createTextNode(i));\n //Spalte 2: hotname\n let col2 = document.createElement(\"td\");\n col2.appendChild(document.createTextNode(\n (d[\"hostname\"] === null) ? \"unbekannt\" : d[\"hostname\"]\n ));\n // Spalte 3: hersteller\n let col3 = document.createElement(\"td\");\n col3.appendChild(document.createTextNode(\n (d[\"vendor\"] === undefined) ? \"unbekannt\" : d[\"vendor\"]\n ));\n //Spalte 4: Betriebssystem\n let col4 = document.createElement(\"td\");\n col4.appendChild(document.createTextNode(d[\"os\"]));\n //Spalte 5: IP\n let col5 = document.createElement(\"td\");\n col5.appendChild(document.createTextNode(\n (d[\"ip\"] === undefined) ? \"unbekannt\" : d[\"ip\"]\n ));\n // Spalte 6: MAC\n let col6 = document.createElement(\"td\");\n col6.appendChild(document.createTextNode(\n (d[\"mac\"] === null) ? \"unbekannt\" : d[\"mac\"]\n ));\n // Spalte 7: Ports\n let col7 = document.createElement(\"td\");\n let ul = document.createElement(\"ul\")\n ul.classList.add(\"no-margin\")\n let ports = d[\"ports\"]\n\n if(typeof ports === \"object\"){\n ports.forEach((port)=>{\n let li = document.createElement(\"li\")\n li.innerText = port.port + \": \"+port.protocol+\" / \"+port.service\n ul.appendChild(li)\n })\n col7.appendChild(ul)\n }else{\n col7.appendChild(document.createTextNode(JSON.stringify(d[\"ports\"])));\n }\n // Die angelegten Felder werden der zu Beginn angelegten Zeile zugeordnet\n row.appendChild(col1);\n row.appendChild(col2);\n row.appendChild(col3);\n row.appendChild(col4);\n row.appendChild(col5);\n row.appendChild(col6);\n row.appendChild(col7);\n table.appendChild(row);\n }\n\n toggleLoad()\n\n}", "async importTeamContractServices() {\n\n this.log(\"Импортируем связки КонтрактКомпании-Услуга\", \"Info\");\n\n\n const {\n source,\n target,\n ctx,\n } = this;\n\n\n const knex = source.getKnex();\n\n\n const query = source.getQuery(\"yley_contract_services\", \"source\")\n ;\n\n query\n .innerJoin(target.getTableName(\"Service\"), {\n \"Service.oldID\": \"source.service_id\",\n })\n .innerJoin(target.getTableName(\"CompanyContract\"), {\n \"CompanyContract.oldID\": \"source.contract_id\",\n })\n // .whereNull(\"target.id\")\n\n ;\n\n\n query.select([\n \"Service.id as serviceId\",\n \"CompanyContract.id as contractId\",\n ]);\n\n // query.limit(3);\n\n\n // console.log(chalk.green(\"query SQL\"), query.toString());\n\n // throw new Error (\"Topic error test\");\n\n const objects = await query.then();\n\n // console.log(\"objects\", objects);\n\n await this.log(`Было получено ${objects && objects.length} связок КонтрактКомпании-Услуга`, \"Info\");\n\n // return;\n\n const processor = this.getProcessor(objects, this.writeTeamContractService.bind(this));\n\n for await (const result of processor) {\n\n // console.log(\"writeUser result\", result);\n\n }\n\n }", "async get_descarregamento_data(request, response){\n\n const { data, unidade } = request.body;\n \n console.log('Iniciou descarregamento', data);\n \n const conn = hana.createConnection();\n \n const qry_mapa_descarregamento = `\n SELECT TOP 100\n B.\"TKNUM\" AS \"ID\",\n B.\"Plant\" AS \"Unidade\",\n B.\"PurchasingDocument\" AS \"Pedido\",\n D.\"ReferenceSDDocumentItem\" AS \"Item_pedido\",\n B.\"Material\" AS \"Cod_Material\",\n B.\"PurchasingDocumentItemText\" AS \"Material\",\n B.\"EKBE_BELNR\" as \"Remessa\",\n B.\"DOCDAT\" AS \"Dia\",\n B.\"NFENUM\" AS \"N_nota_fiscal\",\n B.\"CC_QtyBaseUnit\" AS \"Peso\",\n B.\"NAME1\" AS \"Transportadora\",\n B.\"Modal\",\n vk.\"SIGNI\" AS \"Placa\",\n vk.\"EXTI1\" AS \"Nome\"\n \n FROM \"_SYS_BIC\".\"LSA.ADM.O2C.Logistic/CV_BILLINGTRANSF\" AS B\n INNER JOIN \"_SYS_BIC\".\"BISelfService.F2P/CV_DELIVERYHISTORY\" AS D ON D.\"DeliveryDocument\" = B.EKBE_BELNR\n INNER JOIN \"RBT_ST4_GE4260\".\"VTTK\" AS vk ON vk.\"TKNUM\" = B.TKNUM\n \n WHERE\n B.\"Plant\" = '${unidade}' AND\n B.\"DOCDAT\" = ${data}\n `;\n \n conn.connect(HANA_conf, function(err) {\n if (err) return response.status(400).json({error: err});\n \n conn.exec(qry_mapa_descarregamento, async function (err, result) {\n if (err) { conn.disconnect(); return response.status(400).json({error: err}); };\n \n conn.disconnect();\n\n // Organiza os dados\n const organizado = module.exports.formata_dados( result );\n\n for ( const item of organizado ) {\n\n // Salva os dados do caminhão no sqlite\n await module.exports.salva_descarregamento_sqlite( item );\n\n };\n\n // Adiciona os dados do sqlite referente aos caminhões retornados\n const descarregamento_final = await Promise.all(\n organizado.map( async item => {\n\n // Busca os dados referentes a esse caminhão no sqlite\n const dados_sqlite = await module.exports.buscar_dados_sqlite( item );\n\n // Busca os dados de status referente a esse caminhão no sqlite\n const status = await status_func.busca_status( item.ID );\n\n return { ...dados_sqlite, h_status: status, ...item };\n\n })\n );\n \n return response.status(200).json({ caminhoes: descarregamento_final });\n });\n \n });\n }", "function enviarSolicitud(datos){\n socket.emit(\"nuevaSolicitud\", datos, function(data){\n if(data['estado']){\n idSolicitud = data['idSolicitud'];\n buscarFleteros();//Buscamos choferes de la bd\n }else{\n alert(\"Lo sentimos, nuestro sistema no esta disponible.\")\n } \n });\n }", "async atualiza_status_descarregamento( request, response ){\n const { ID, Status, Peso, Comentario, Atualizado_por } = request.body;\n\n\n const [{ Unidade, Placa, Dia, Chegada }] = await connection('fDescarregamento')\n .select('*')\n .where('ID','=', ID)\n .catch( () => response.status(404).json({ err: 'Caminhão não encontrado na base de dados' }));\n\n // Reflete a mudança do status na tabela de status do sqlite\n module.exports.on_status_change({ ID, Status, Unidade, Placa, Dia });\n\n /* Se o status for do tipo 'Em carregamento',\n guardar a Hora e o peso da balança na entrada na unidade */\n if ( Status === evento_chegada ) {\n\n const agora = module.exports.agora();\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update({\n Status,\n Chegada: agora,\n Comentario,\n Atualizado: agora,\n Atualizado_por\n })\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else if ( Status === evento_pos_pesagem_1 ){\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Peso_chegada: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Peso_chegada: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else if ( Status === evento_pos_pesagem_2 ){\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Peso_saida: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Peso_saida: Peso,\n Comentario,\n Atualizado: agora,\n Atualizado_por\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else if ( Status === evento_saida ){\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Saida: agora,\n Comentario,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Saida: agora,\n Comentario,\n Atualizado: agora,\n Atualizado_por\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n } else {\n\n const agora = module.exports.agora();\n\n const dados_c_chegada = {\n Status,\n Atualizado: agora,\n Atualizado_por,\n Chegada: agora,\n };\n\n const dados_s_chegada = {\n Status,\n Atualizado: agora,\n Atualizado_por\n };\n\n // Atualiza no sqlite\n await connection('fDescarregamento')\n .update( ( [ null, undefined ].includes( Chegada ) )?dados_c_chegada:dados_s_chegada )\n .where( 'ID', '=', ID )\n .catch( (err) => {\n return response.status(404).json({ error: err });\n });\n\n return response.status(200).json({ message: 'Dados atualizados com sucesso!' });\n\n };\n\n }", "async somaDespesas(Request, Response){\n pool.connect(async function (err, client, done){\n\n const { mes } = Request.body\n const userId = Request.headers.authorization;\n \n const despesas = await client.query(\"select sum(valor) from despesas d inner join categoria c using (id_categoria) where Extract('Month' From _data) = $1 and id_usuario = $2\", [mes, userId]);\n \n done();\n\n return Response.json(despesas.rows);\n });\n }", "async guardaDatos (parametros, tabla) {\n try {\n tabla = tabla + '.json'\n const res = await fetch((API_URL + tabla), {\n method: 'POST',\n headers: {\n 'content-Type': 'application/json'\n },\n body: JSON.stringify(parametros)\n })\n const datoDb = await res.json()\n return datoDb\n } catch (error) {\n console.log(error)\n }\n }", "function agregarRecargar(){\n agregarProducto();\n setTimeout(() => imprimir(), 1000);\n}", "async save(objeto) {\n \n\n const contenido = await this.read();\n\n let id = contenido.length + 1;\n\n let item = {\n id: objeto.id,\n timestamp: objeto.timestamp,\n id_producto: objeto.producto.id,\n }; \n try {\n await knex(\"carrito\").insert(item);\n return item;\n } catch (error) {\n throw error;\n } \n \n }", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "async upObras(id, new_nome_obra, new_data_inicio, new_data_termino, new_orcamento, new_nome_cliente, new_telefone_cliente, new_estado_obra, new_cidade_obra, new_endereco_obra, new_status_obra){\n const sql = 'SELECT updObra ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)';\n const result = await pool.query(sql,[id, new_nome_obra, new_data_inicio, new_data_termino, new_orcamento, new_nome_cliente, new_telefone_cliente, new_estado_obra, new_cidade_obra, new_endereco_obra, new_status_obra]);\n return result.rows;\n }", "updateRow(row) {\n const id = notifyInfo(\"Update läuft\");\n axios.put(row._links.self.href, row ,{headers: {'Content-Type': 'application/json'}})\n .then(results => {\n console.log(results);\n notifyUpdateSuccess(id, \"Update erfolgreich\");\n this.getTableData(false)\n })\n .catch(error => {\n console.log(error);\n notifyUpdateError(id, \"Update fehlgeschlagen\");\n });\n }", "function Buscar() {\n //todos objBusqueda esta en los respectivos js\n var objConf = objConfiguracionGlobal;\n var objBus = objBusquedaGlobal;\n\n //recibe el valor id cama.js\n var valor = get(objBus.id);\n\n //url absoluta y agrega el contenido de la tabla a divContenedor\n fetchGet(`${objBus.url}/?${objBus.nombreParametro}=` + valor, function (res) {\n var respuesta = generarTabla(objConf, res);\n document.getElementById(\"divContenedor\").innerHTML = respuesta;\n\n })\n\n /* fetch(`${objBus.url}/?${objBus.nombreParametro}=` + valor)\n .then(res => res.json())\n .then(res => {\n var respuesta = generarTabla(objConf, res);\n document.getElementById(\"divContenedor\").innerHTML = respuesta;\n\n })\n */\n\n //pintar({\n // //ahora cambia esta linea\n // url: `${objBus.url}/?${objBus.nombreParametro}=` + valor,\n // id: objConf.id,\n // cabeceras: objConf.cabeceras,\n // propiedades: objConf.propiedades\n\n //}, objBus)\n\n}", "async function consultarHistorial(NumPart,horas){//Consulta si existe registros de NoPartes para determinar el tiempo de cada pieza\n cnSQL.cnn.query(\"SELECT Horas from historial WHERE EXISTS (SELECT NoParte FROM historial WHERE NoParte = '\"+ NumPart +\"' LIMIT 1) AND NoParte = '\"+ NumPart +\"'\", [], (err, consulta) => {//CONSULTA DE OT REFERENTE A LA ID [A]\n if(err){\n console.log(\"Consulta Error: \" + err);\n }\n /*==================================================== CALCULAR HORAS =======================================================================================*/\n else if(Object.keys(consulta).length > 0){//si la consulta obtiene horas de algun registro en el historial \n horas = Object.values(consulta[0]);\n console.log(\"Horas de consulta en if: \" + horas);\n\n }else if(Object.keys(consulta).length <= 0){//si no hay registro en el historial, crea registro nuevo en tabla historial\n var TablaCP = {\n NoParte : NumPart,\n Horas : horas\n }\n cnSQL.cnn.query('INSERT INTO historial set ? ',[TablaCP], (err, ot) =>{\n if(err){\n console.log(err);\n }\n });\n }\n });\n console.log(\"Return: \" + horas);\n return horas;\n}", "async init() {\n const { rows } = await this.client.db.query(`SELECT * FROM \"${this.table}\"`);\n for(const row of rows) this.cache.set(row.id, row);\n }", "function cargarDatos() {\n\n return new Promise(function (resolve, reject) {\n\n fs.readFile('./lib/anuncios.json', (err, data) => {\n\n if (err) reject(err);\n\n const anuncios = (JSON.parse(data)).anuncios;\n\n for (let i = 0; i < anuncios.length; i++) {\n let anuncio = new Anuncio(anuncios[i]);\n anuncio.save((err, anuncioCreado) => { \n if (err) {\n console.log('Error:', err);\n reject(err);\n }\n console.log('Anuncio ' + anuncioCreado.nombre + ' creado');\n });\n }\n\n resolve();\n });\n });\n}", "async somaReceitas(Request, Response){\n pool.connect(async function (err, client, done){\n\n const userId = Request.headers.authorization;\n const { mes } = Request.body;\n \n const receitas = await client.query(\"select sum(valor) from receitas where Extract('Month' From _data) = $1 and id_usuario = $2\", [mes, userId]);\n \n done();\n return Response.json(receitas.rows);\n });\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}", "exportDatasToCsv(){\n setTimeout(\n function() {\n window.location.reload();\n }\n .bind(this),\n 2000\n );\n }", "function saveData() {\n const transaction = db.transaction([\"transactions\"], \"readwrite\");\n const transactionStore = transaction.objectStore(\"transactions\");\n const allData = transactionStore.getAll();\n\n allData.onsuccess = () => {\n if (allData.result.length > 0) {\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: JSON.stringify(allData.result),\n headers: {\n Accept: \"application/json, text/plain, */*\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n return response.json();\n })\n .then(() => {\n const transaction = db.transaction(\n [\"transactions\"],\n \"readwrite\"\n );\n const transactionStore =\n transaction.objectStore(\"transactions\");\n transactionStore.clear();\n });\n }\n };\n}", "function loadDataDonViTinh() {\n $scope.donViTinh = [];\n if (!tempDataService.tempData('donViTinh')) {\n donViTinhService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('donViTinh', successRes.data.Data);\n $scope.donViTinh = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.donViTinh = tempDataService.tempData('donViTinh');\n }\n }", "function loadDataDonViTinh() {\n $scope.donViTinh = [];\n if (!tempDataService.tempData('donViTinh')) {\n donViTinhService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('donViTinh', successRes.data.Data);\n $scope.donViTinh = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.donViTinh = tempDataService.tempData('donViTinh');\n }\n }", "function loadDataDonViTinh() {\n $scope.donViTinh = [];\n if (!tempDataService.tempData('donViTinh')) {\n donViTinhService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('donViTinh', successRes.data.Data);\n $scope.donViTinh = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.donViTinh = tempDataService.tempData('donViTinh');\n }\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 }", "async obtenerPedidos(req,res){\n\n try{\n //Busco los ID de todos los pedidos.\n let listaIdsPedido = await querysAdmin.findIdsPedidos();\n\n let arrayIds = [];\n //Guardo en un array solo los numeros de los pedidos.\n for(let i = 0; i < listaIdsPedido.length; i++){\n \n arrayIds.push(listaIdsPedido[i].id_pedido);\n };\n \n\n let arrayPedidos = [];\n //Guardo en un nuevo array la informacion de cada uno de los pedidos\n for(let h = 0; h < arrayIds.length; h++){\n\n let pedido = await querysAdmin.infoPedidos(arrayIds[h]);\n\n arrayPedidos.push(pedido);\n }\n \n //Envio cada uno de los pedidos con toda su informacion\n let resp = new response(false,200,\"Lista de pedidos\", arrayPedidos);\n \n res.send(resp);\n \n }catch(error){\n\n let resp = new response(true,500,\"Error de servidor\");\n res.send(resp);\n }\n }", "function populateList() {\n axios\n .get(\"http://localhost:3000/api/employee/\")\n .then((res) => res.data.data)\n .catch((err) => console.log(err))\n .then((data) => {\n let tax;\n data.forEach(function (employee) {\n if (employee.paysTax === true) {\n tax = \"NU\";\n } else {\n tax = \"DA\";\n }\n rowData.push({\n nume: `${employee.name.firstName} ${employee.name.lastName}`,\n vechime: employee.jobYears,\n salariu: employee.salary,\n functie: `${employee.position}`,\n echipa: `${employee.team}`,\n telefon: `${employee.phone}`,\n email: `${employee.email}`,\n impozit: tax,\n });\n });\n gridOptions.api.setRowData(gridOptions.rowData);\n });\n}", "function busca(busca) {\n $.ajax({\n type: \"POST\",\n url: \"acoes/select.php\",\n dataType: \"json\",\n data: {//tipo de dado\n 'busca':\"busca\"//botão pra inicia a ação\n }\n\n }).done(function (resposta) { //receber a resposta do busca\n console.log('encontrei ' + resposta.quant + ' registros');\n console.log(resposta.busca[0,'0'].id, resposta.busca[0,'0'].descri);\n if(resposta.erros){\n\n //criação das variaves apos o receber a resposta da pagina select\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qntp = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var st = resposta.busca[i]['9']\n //criação da tabela para exebição do resultado\n $('.carro td.descri').append(\" <tr><td ><p class=' text-capitalize id='des' value='\"+desc+\"'>\"+desc +'</p></td></tr>')\n $('.carro td.marca').append(\" <tr><td ><p class=' text-capitalize id='mar' value='\"+mar+\"'>\"+mar +'</p></td></tr>')\n $('.carro td.modelo').append(\" <tr><td ><p class=' text-capitalize id='mod' value='\"+mod+\"'>\"+mod +'</p></td></tr>')\n $('.carro td.tipov').append(\" <tr><td ><p class=' text-capitalize id='tpv' value='\"+tpv+\"'>\"+tpv +'</p></td></tr>')\n $('.carro td.quantp').append(\" <tr><td ><p class=' text-capitalize id='qnt' value='\"+qntp+\"'>\"+qntp +'</p></td></tr>')\n $('.carro td.vlvenda').append(\" <tr><td ><p class=' text-capitalize id='vlv' value='\"+vlv+\"'>\"+vlv +'</p></td></tr>')\n $('.carro td.vlcompra').append(\" <tr><td ><p class=' text-capitalize id='vlc' value='\"+vlc+\"'>\"+vlc +'</p></td></tr>')\n $('.carro td.dtcompra').append(\" <tr><td ><p class=' text-capitalize id='dtc' value='\"+dtc+\"'>\"+dtc +'</p></td></tr>')\n $('.carro td.estato').append(\" <tr><td ><p class=' text-capitalize id='st' value='\"+st+\"'>\"+st +'</p></td></tr>')\n $('.carro td.id').append(\" <tr><td ><button class='r btn btn-sm btn-primary nav-link' id='idvalor' type='button' data-toggle='modal' data-target='#atualFormulario' value='\"+id+\"'>\"+\"Edit\"+'</button></td></tr>')\n $('.carro td.ider').append(\"<tr><td ><button class='del btn btn-sm btn-danger nav-link' type='button' name='idel' value='\"+id+\"'>\"+\"Del\"+'</button></td></tr>')\n\n\n }\n\n\n //função pra por valores da tabela no input do formulario de atualização\n //aqui insere os o ID no formulario de atualização\n $('.r').click('button',function() {\n var idvl = $(this).val();\n $('#i1'). val(idvl);\n for (let i = 0; i < resposta.quant; i++) {\n var id = resposta.busca[i]['0']\n var desc = resposta.busca[i]['1']\n var mar = resposta.busca[i]['2']\n var mod = resposta.busca[i]['3']\n var tpv = resposta.busca[i]['4']\n var qnt = resposta.busca[i]['5']\n var vlv = resposta.busca[i]['6']\n var vlc = resposta.busca[i]['7']\n var dtc = resposta.busca[i]['8']\n var sta = resposta.busca[i]['9']\n //aqui comparamos o valor que recuperamos o id da tabela e comparfamos com o id da função busca\n if (idvl==id) {\n $('#descri1'). val(desc);\n $('#marca1'). val(mar);\n $('#modelo1'). val(mod);\n $('#tipov1'). val(tpv);\n $('#quantp1'). val(qnt);\n $('#vlvenda1'). val(vlv);\n $('#vlcompra1'). val(vlc);\n $('#dtcompra1'). val(dtc);\n $('#estato1'). val(sta);\n console.log(idvl);\n\n }\n\n\n\n\n\n }\n })\n //aqui finda\n\n //deleta via ajax\n $('.del').click('button',function() {\n var idel = $(this).val();\n console.log(idel);\n $.ajax({\n url: \"acoes/del.php\",\n type: \"POST\",\n data : { 'idel': idel },\n success: function(data)\n {\n location.reload(\".carro\");//atualiza o contener apos a execução com sucesso\n }\n });\n }); // delete close\n\n\n }\n })\n }", "async function buscador(){\n // donde estaran los resultados de la busquedas\n var caja=document.getElementById(\"resultadoBusqueda\");\n // vaciamos dicho div para que no se acumulen los resultados\n //agregamos un color blanco de fondo \n caja.innerHTML=\"\";\n caja.style.background=\"#FFFFFF\";\n //variable del json, limite de productos que apareceran y datos recogidos en el input\n var urlProductos=\"https://my-json-server.typicode.com/ivanruiz25/ivanruiz25.github.io/productos?q=\";\n var nombreProducto=document.getElementById(\"buscar\").value;\n// si el campo de busqueda no esta vacio iniciaremos la busqueda\n if(nombreProducto !== \"\") {\n // creamos la url completa para buscar en el json\n //la creo en 2 variables porque sino me pone un espacion entre el producto y la paginacion \n var url=urlProductos.concat(nombreProducto);\n\n getJSON(url).then(function(data) { \n // recorremos el resultado \n for(let i in data) { \n // creamos una etiqueta parrafo \n var parrafo = document.createElement(\"p\");\n //introducimos los datos\n parrafo.innerHTML= data[i].nombre; \n // le agregamos una clase\n parrafo.setAttribute(\"class\",\"resultado__parrafo\");\n // introducimos el parrafo en el div que contendra los resultados\n caja.appendChild(parrafo); }\n\n}, function(status) {\n alert('Este compononte solo funciona en local');\n});\n// quitamos el color de fondo al div\n} else{\n caja.style.background=\"\";\n} }", "function senddata()\n{\n\tvar id_plan = $(\"#id_plan\").val();\n\tvar sesion = $(\"#sesion\").val();\n\tvar dosis = $(\"#dosis\").val();\n\tvar fecha_inicio = $(\"#fecha_inicio\").val();\n\tvar frecuencia = $(\"#frecuencia\").val();\n\t\n\tvar datos = \"\";\n\tvar cuantos = 0;\n\tvar fallos = 0;\n\t$(\"#table tr\").each(function()\n\t{\n\t\tvar fecha = $(this).find(\".fecha\").val();\n\t\tvar dosis = $(this).find(\".dosis\").val();\n\t\tif(isNaN(dosis)!=true && (dosis > 0) && fecha !=\"\")\n\t\t{\n\t\t\tdatos += fecha+\",\"+dosis+\"|\";\n\t\t\tcuantos = cuantos + 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfallos = fallos + 1;\n\t\t}\n\t});\n\tif(fallos>0)\n\t{\n\t\tdisplay_notify(\"Error\", \"Verifique que todos los campos esten completos antes de continuar\")\n\t}\n\telse\n\t{\n\t\tvar dataString = 'process=insert&sesion='+sesion+'&dosis='+dosis+'&fecha_inicio='+fecha_inicio+'&frecuencia='+frecuencia;\n\t\t\tdataString += '&cuantos='+cuantos+'&datos='+datos+'&id_plan='+id_plan;\n\t\t$.ajax({\n type: \"POST\",\n url: \"agregar_plan.php\",\n data: dataString,\n dataType : 'json',\n success: function(datax)\n {\t\n\t\t\t\tdisplay_notify(datax.typeinfo,datax.msg);\n\t\t\t\tif(datax.typeinfo==\"Success\")\n\t\t\t\t{\n\t\t\t\t\tsetInterval(\"reload1();\",1500);\n\t\t\t\t}\t\n\t\t\t}\n });\n\t}\t\t \n}", "function asyncGetDataFromTable(tableName, year, day){\n var data = {\n 'action': 'get_data_async',\n 'tableName': tableName,\n 'year': year,\n 'day': day\n };\n console.log(\"year \" + year + \" , day \" + day + \"============================================\");\n\n var ajaxCall = $.ajax({\n url: 'async-update.php',\n type: 'post',\n async:false,\n data: data,\n success: function(data){\n //console.log(\"AJAX success data: \" + data + \" :end success data\");\n localStorage.setItem(tableName, data);\n },\n error: function(xhr, desc, err){\n console.log(\"AJAX failure\");\n }\n });\n}", "async function rawDatabasePush(flagVar) {\n\n await asyncAppendCSV(flagVar);\n\n const fs = require(\"fs\");\n const mysql = require(\"mysql\");\n const fastcsv = require(\"fast-csv\");\n const json2csv = require(\"json2csv\");\n\n let stream = fs.createReadStream(\"mainData.csv\");\n let csvData = [];\n let csvStream = fastcsv\n .parse()\n .on(\"data\", function (data) {\n csvData.push(data);\n })\n .on(\"end\", function () {\n //strip headers\n csvData.shift();\n console.log(\"csvData from rawDataBasePush()\")\n console.log(csvData);\n \n //create conn\n const connection = mysql.createConnection({\n host: \"localhost\",\n user: \"root\",\n password: \"mysql\",\n database: \"db\"\n });\n \n //open conn\n connection.connect(error => {\n if (error) {\n console.error(error);\n } else {\n console.log(\"CONNECTED\")\n let query =\n \"INSERT INTO data(microvolts, trialstart, oddball, flag) VALUES ?\";\n connection.query(query, [csvData], (error, response) => {\n console.log(error || response);\n });\n }\n });\n });\n \n //writestream\n stream.pipe(csvStream);\n //delete file afted db send\n deleteCsv(\"mainData.csv\"); \n}", "async function getData() {\n //carrega a tabela do arquivo csv\n const response = await fetch('docs/data.csv');\n //nome,inicio,fim\n const data = await response.text();\n //debug\n //console.log(data);\n\n //pega cada linha da tabela até onde acaba (enter), pode ser\n //'\\n' ou '\\r', vai depender da tabela, checar antes\n //como tá gerando os csv\n //.slice \"corta\" o cabeçalho do array (row[0]), pq\n //coloquei pra começar no 1\n table = data.split('\\r').slice(1);\n\n //debug\n //console.log(table);\n console.log('csv carregado')\n dataCollection()\n \n}", "postIngestData() {}" ]
[ "0.60697067", "0.5780097", "0.5739184", "0.5654251", "0.5617345", "0.55710477", "0.554787", "0.55423343", "0.55383587", "0.5535877", "0.5522522", "0.5522182", "0.5518094", "0.5497508", "0.5480045", "0.54667646", "0.5454786", "0.5438436", "0.5430082", "0.54180545", "0.54135597", "0.54134476", "0.54015636", "0.53956985", "0.53717196", "0.5370187", "0.53613", "0.53596866", "0.53507984", "0.53471965", "0.53449965", "0.53396386", "0.53252846", "0.5320093", "0.53190273", "0.5315702", "0.5312222", "0.5303986", "0.53026444", "0.5295354", "0.52884734", "0.5287954", "0.5287634", "0.52812517", "0.5274826", "0.527423", "0.52713555", "0.5268901", "0.526492", "0.5256617", "0.5247061", "0.52356815", "0.52184874", "0.5211126", "0.5209826", "0.5202271", "0.5191077", "0.5188258", "0.51863986", "0.5184244", "0.5183065", "0.5176983", "0.51668453", "0.51657665", "0.51635927", "0.51593924", "0.5156518", "0.5155407", "0.5152597", "0.5152572", "0.5151722", "0.5149372", "0.51488537", "0.5147278", "0.51429534", "0.513984", "0.5133734", "0.5133369", "0.5132774", "0.51291347", "0.5122673", "0.51185673", "0.5115421", "0.5111084", "0.5109276", "0.51063794", "0.5105023", "0.5101506", "0.50972193", "0.50972193", "0.50972193", "0.5096922", "0.5094346", "0.5092609", "0.5088182", "0.50871575", "0.5086284", "0.5083814", "0.50833094", "0.5082329", "0.5079623" ]
0.0
-1
Celda para eliminar la fila
function renderDelete(cellInfo) { return ( <Button onClick = {e => { // Mínimo debe haber una persona a cargo if (props.personasaCargo.length > 1){ let result = [...props.personasaCargo]; result.splice(cellInfo.index , 1); cambiarPersonasaCargo(result); } }} size="sm" variant="danger" className="rellenar"> Eliminar </Button> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removerFila(cont_partida)\n{\n\tactualizarTotal(-1*regresarFloat($(\"#importe_\"+cont_partida).val()));\n\n\t$(\"#tr_\"+cont_partida).remove();\n}", "function eliminarFila(id_tabla, id_fila)\r\n{\r\n var TABLA = $(id_tabla);\r\n if(TABLA.rows.length > 1)\r\n {\r\n\t var FILAS = TABLA.rows;\r\n\t var eliminado = false;\r\n\t var fila = FILAS.length - 1;\r\n\t while ((eliminado == false) && (fila > 0))\r\n\t {\r\n\t if (FILAS[fila].id == id_fila)\r\n\t {\r\n\t \t TABLA.deleteRow(fila);\r\n\t\t eliminado = true;\r\n\t }\r\n\t else\r\n\t {fila--;}\r\n\t }\r\n }\r\n\tue_sumarTotal();\r\n}", "function eliminarPino() {\r\n\r\n document.getElementById(\"fila1\").remove();\r\n subT = 0;\r\n actualizarCostos();\r\n\r\n\r\n}", "function eliminarLinea(indice){\n $(\"#fila\" + indice).remove();\n calculaTotalAjusteInv();\n detalles=detalles-1;\n evaluarAjusteInv();\n}", "function EliminarFilaPrescripcion(fila){\n\n $('#fila'+fila).remove();\n $('.fila'+fila+\"Observacion\").remove();\n arrayPrescripcion.splice(fila,1);\n}", "function eliminarFila(oId){\n \n // RESTA DEL TOTAL EN LA TABLA\n cadenaDetalle.splice(cadenaDetalle.indexOf(\"-\"+oId+\"-\"),4);\n $(\"#Ttotal\").val(parseFloat($(\"#Ttotal\").val()) - parseFloat($(\"#hdnTotal_\"+oId).val())); // RESTA DEL TOTAL\n $(\"#unid\").val(parseFloat($(\"#unid\").val()) - parseFloat($(\"#hdnCant_\"+oId).val())); // RESTA DE LA CANTIDAD DE PRODUCTOS\n items = $(\"#cant_campos\").val()-1;\n $(\"#cant_campos\").val(items); \n $(\"#rowDetalle_\" + oId).remove();\n return false;\n }", "function eliminarAuto() {\r\n\r\n document.getElementById(\"fila2\").remove();\r\n subT2 = 0;\r\n actualizarCostos();\r\n\r\n}", "function EliminarFila(index) {\n $(\"#fila\" + index).remove();\n}", "function eliminarDetalle(indice, idproducto, idlote) {\n\n\tvar datadetalledelete = concatenate(idproducto, idlote, 10);\n\n\t$(\"#fila\" + indice).remove();\n\n\tArray.prototype.compacta = function(){\n\t\tfor(var i = 0; i < this.length; i++){\n\t\t\tif(this[i] === datadetalledelete){\n\t\t\t\t\tthis.splice(i , 1);\n\t\t\t}\n\t\t}\n\t}\n\tcontains.compacta();\n\n\tcalcularTotales();\n\tdetalles = detalles - 1;\n\tevaluar()\n}", "function removerAdicional() {\n\n abrirModalProgress()\n removerDadosFirebase();\n\n}", "function eliminaFilaDeTabla(miIdFila){\n\tvar mensaje = `Desea eliminar El elemento señalado?${miIdFila.id}`;\n\tif (confirm(mensaje)){\n\t\tmiIdFila.remove();\n\t\t//$('#'+miIdFila).remove();\n\t}\n}", "function eliminarFila(elem, save=true) {\n\twhile (elem.tagName.toLowerCase() != \"tr\") {\n\t\telem = elem.parentNode;\n\t}\n\tvar table = elem.parentNode;\n\tvar r = confirm(\"Estàs segur que vols eliminar la fila?\" + \"\\n\" + \"(aquesta acció no es pot desfer)\");\n\tif (r) {\n\t\ttable.removeChild(elem);\n\t\tif (save) {\n\t\t\tvar entity = capitalizeFirstLetter(elem.id.split(\"-\")[0]);\n\t\t\tvar id = elem.id.split(\"-\")[1];\n\t\t\tvar dataToSend = \"entity=\" + entity + \"&id=\" + id + \"&function=deleteEntity\";\n\t\t\tsend(dataToSend, AJAXCONTROLLER, sendValueReturn);\n\t\t}\n\t}\n}", "function eliminarfila() {\n var columna_btn_eliminar = this.parentNode;//En este caso guardo el elemento padre \n //del boton eliminar que dimos click o sea la columna\n var fila_btn_eliminar = columna_btn_eliminar.parentNode;//Guardo la fila de la columna\n var elt_fila = fila_btn_eliminar.childNodes;//Guardo los elementos hijo de mi fila\n var codigo = parseInt(elt_fila[0].childNodes[0].textContent);//Descubro cual es el codigo del elemento del \n //boton al que le di click de la tabla factura\n \n for (var f = 1; f < fila_inventario.length; f++) {//Recorro las filas de la tabla inventario\n var codigo_inventario = parseInt(fila_inventario[f].childNodes[1].childNodes[0].textContent);//Me\n //Recorre todos los codigos de mi tabla inventario \n if (codigo === codigo_inventario) {//y cuando verifique que uno de esos codigos sea igual\n //a uno de los codigos de mi tabla inventario va a realizar lo siguiente\n var cant_fac = parseInt(elt_fila[3].childNodes[1].textContent);//Guardo la cantidad que este\n //almacenada en la tabla factura\n //console.log(cant_fac);\n var cant_inve = parseInt(fila_inventario[f].childNodes[7].childNodes[0].textContent);//Ahora entro \n //a la cantidad que hay en mi tabla inventario\n //console.log(cant_inve);\n var resultado_cant = cant_fac + cant_inve;//Y como vamos a eliminar este articulo tenemos que saber \n //cual es la cantidad que hay en la tabla tanto la de inventario como factura y sumarla \n fila_inventario[f].childNodes[7].childNodes[0].textContent = resultado_cant;//Ese resultado de esa suma\n //La coloco en la tabla inventario ya que no vamos a ser la compra de ese artículo\n fila_btn_eliminar.remove();//Finalmente que tenemos que quitar la fila del boton que hemos dado click\n //ya que precisamente esto es lo que queremos conseguir con esta función\n fila_inventario[f].childNodes[9].childNodes[0].disabled = false;//Y como en la funcion agregar_factura \n //colocamos que ese boton que fue clickeado lo desabilite ahora lo que hacemos es habilitarlo ya que \n //ya no se encuentra en la tabla factura\n }\n\n }\n}", "function EliminarPartitura(idFila){\n $.ajax({\n type: \"POST\",\n url:\"../funciones/funciones.php\",\n data: \"funcion=borrarRegistroTablaPartituras&id=\"+idFila,\n cache: false,\n success: function(html)\n {\n var d = document.getElementById(\"tablaAdministracionPartituras\");\n while (d.hasChildNodes()){\n d.removeChild(d.firstChild);\n }\n var tabla = $('<tbody>'\n +'<tr class=\"head\">'\n +'<th>Genero</th>'\n +'<th>Titulo</th>'\n +'<th>Autor</th>'\n +'<th>Link Descarga</th>'\n +'<th>Eliminar</th>'\n +'</tr>'\n +'</tbody> ');\n $('.innerTablaAdministracion').append(tabla);\n cargarTablaPartituras();\n Alerta('Partitura Eliminada Correctamente');\n }\n }); \n }", "function eliminarproducto(e){\n for (let i = 0; i < carrito.length; i++) {\n \n if(e.target.id == carrito[i].nombre){\n carrito.splice(i,1);\n localStorage.setItem('datos',JSON.stringify(carrito))\n escribirDatosCarrito(carrito)\n iconcarrito.textContent=carrito.length;\n\n }\n } \n \n escribirCarroVacio()\n}", "function Excluir() {\n var par = $(this).parent().parent(); //tr\n\n par.remove();\n\n $(\"#total\").text(CalcularTotal());\n\n // produtos.splice(i,1);\n }", "function deleted(numero){\n \n //console.log(numero);\n Eliminarcore(numero);\n cargarTablaRecibidos();\n cargarTablaPrincipal();\n \n}", "function eliminarInfo() {\n let eliminar = document.getElementById(\"table\");\n eliminar.parentNode.removeChild(eliminar);\n let botonEliminar = document.getElementById(\"solicitarPrestamo\");\n botonEliminar.parentNode.removeChild(botonEliminar);\n}", "function eliminarCarrito() {\r\n const seleccionado = productos.find(producto => producto.id == this.id);\r\n let posicion = carrito.findIndex(producto => producto.id == this.id);\r\n carrito.splice(posicion, 1);\r\n seleccionado.cantidad=0;\r\n interfazCarrito(carrito);\r\n\r\n localStorage.setItem(\"carrito\", JSON.stringify(carrito));\r\n}", "function removerFiho(idpai, idfilho) {\n removerPessoasLista('paiId' + idpai + 'filhoId' + idfilho);\n listaPessoas.pessoas[idpai].filhos.splice(idfilho, 1);\n atualizarLista();\n} //Metodo de excluir filho", "function eliminarCarrito(e){\n console.log(\"target\" +e.target.id);\n let posicion= carrito.findIndex(c => c.id == e.target.id);\n carrito.splice(posicion, 1);\n console.log(carrito);\n\n carritoUI(carrito);\n\n localStorage.setItem(\"carrito\", JSON.stringify(carrito));\n\n}", "function eliminaFilas(){\n //$(\"#tbodyid\").empty(); \n $('#dataTables-example').DataTable().clear().draw();\n}", "function removerDetalhesExcluidosTable() {\n $scope.detalhesExcluir.forEach(detalhe => {\n $scope.gestaoVendaResultados = $scope.gestaoVendaResultados.filter((element) => element.idDetalhe != detalhe.idDetalhe);\n });\n\n $scope.detalhesExcluir = [];\n }", "function borrar(e){\n //buscamos el array de columnas del listado del carrito \n var cells = Array.prototype.slice.call(document.getElementById(\"tablaCarro\").getElementsByTagName(\"td\"));\n //guardamos el valor de cantidad y producto encontrado en a fila antes de eliminar\n var cantidad = cells[1].innerHTML;\n var prod = cells[0].innerHTML;\n var pu = cells[2].innerHTML;\n\n //llama a la funcion mensaje para mostrar que se eliminara el producto \n var texto = \"Sacando el producto del carrito ->\"+cantidad+\" unidades de\"+ prod ; \n //muestro mensaje\n mensaje(texto);\n //descontado del total\n total = total - cantidad * pu; \n //Elimina la fila\n event.preventDefault();\n this.closest('tr').remove(); \n //actualiza el total mostrado\n calcular();\n }", "function eliminarTodo() {\n ZCABD.transaction(function(tx) {\n tx.executeSql('DROP TABLE IF EXISTS FAVORITOS');\n oktx('TODO eliminado');\n }, errorBD);\n}", "deleteFantasmas(){\n this.fantasmas.forEach((fantasma) => {\n this.remove(fantasma);\n });\n }", "function exclui(){\n\tvar actipos = $('#position').val();//POSICAO DO REGISTRO NO JSON\n\tif(actipos === 'null'){\n\t\tswal('Erro de exclusão','É necessário selecionar uma linha','error');\n\t\treturn;\n\t}\n\n\tvar fa_number = $(DIV_TABELA + \" tr[posicao=\"+actipos+\"] td:eq(1) input\").val();\n\n\tswal({\n\t\t\ttitle: \"Deseja excluir a família selecionada?\",\n\t\t\ttype: \"warning\",\n\t\t\tshowCancelButton: true,\n\t\t\tconfirmButtonText: \"Sim\",\n\t\t\tcancelButtonText: \"Não\",\n\t\t\tcloseOnConfirm: false,\n\t\t\tcloseOnCancel: true,\n\t\t\tshowLoaderOnConfirm: true,\n\t\t\tconfirmButtonColor: \"#DD6B55\"\n\t\t},\n\t\tfunction(confirmouExclusao) {\n\t\t\tif(!confirmouExclusao){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar funcao = \"funcao=deleta&number=\" + fa_number;\n\n\t\t\tajax(funcao,EXEC,function(retorno){\n\t\t\t\tretorno = json(retorno);\n\t\t\t\tif(!retorno){\n\t\t\t\t\tvar erro = \"Houve um erro interno de servidor.\\nEntre em contato com o suporte da pennacorp!\";\n\t\t\t\t\tswal('Erro de exclusão',erro,'error');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(!empty(retorno.error)){\n\t\t\t\t\t//ERRO\n\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttitle:'Erro ao excluir famiia',\n\t\t\t\t\t\t\ttext: retorno.mensagem,\n\t\t\t\t\t\t\ttype: 'error'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tselecionaLinha(DIV_TABELA,actipos,2);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tobjTabela.registros.splice(actipos,1);\n\t\t\t\tobjTabela.total -= 1;\n\t\t\t\tswal.close();\n\n\t\t\t\tvar paginaAtual = getPagina('#records',\"#pagination\", LIMITE_REGISTROS);\n\n\t\t\t\tpagination(paginaAtual,function(){\n\t\t\t\t\t$('#records').val(objTabela.total);\n\t\t\t\t\tif(objTabela.total > 0){\n\t\t\t\t\t\tif(actipos > 0){\n\t\t\t\t\t\t\t--actipos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselecionaLinha(DIV_TABELA,actipos,2);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t);\n}", "function removeTask(event) {\n\n let id = event.target.dataset.id;\n let tareaEliminar = event.target.parentNode;\n console.log(tareaEliminar);\n\n tareaEliminar.parentNode.removeChild(tareaEliminar)\n\n //buscar en el array la posicion\n let posicionBorrar = tasks.findIndex(task => {\n return task.titulo == id\n })\n\n console.log(posicionBorrar);\n tasks.splice(posicionBorrar, 1)\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 DeleteAsistencia(idAsistencia) {\n let i = 0;\n asistieron.forEach(element => {\n if (element == idAsistencia) asistieron.splice(i, 1);\n i++;\n pintarFalta(idAsistencia);\n })\n console.log(\"ELEMENTO ELIMINADO\" + idAsistencia);\n console.log(asistieron);\n \n}", "deleteRow() {\n for (let i = 0; i <= this.Filtime.length; i++) {\n this.Filtime.splice(0);\n }\n }", "function Eliminarcore(e){\n var est=confirm(\"Desea eliminar el correo?\");\n if(est){\n carRec.splice(e,1); \n localStorage.setItem(\"correosRecibidos\", JSON.stringify(carRec));\n }\n }", "removerPosicao(posicao){}", "function borrar() {\r\n tab = document.getElementById('tabla');\r\n\r\n for (i = tab.getElementsByTagName('input').length - 1; i >= 0; i--) { //este for lo uqe hace es recorrer todas las filas \r\n chk = tab.getElementsByTagName('input')[i];\r\n if (chk.checked) { /*si el chek esta chekeado elimina esa fila*/\r\n tab.removeChild(chk.parentNode.parentNode);\r\n restar();/*llamamos a restar para que tambien se reste el valor de esa fila*/\r\n }\r\n\r\n }\r\n\r\n}", "function eliminarTablero(){\n for(let i = 0; i < tamano*tamano; i++) {\n var ultimo = document.getElementById(i);\n tablero.removeChild(ultimo)\n }\n // resetea numero de banderas la variable juego acabado, los cuadrados y el resultado.\n banderas = 0\n juegoAcabado = false\n cuadrados = []\n resultado.innerHTML = \"\"\n }", "function removerBalasForaDaTela(){\n\tbalas.forEach(removeBalaForaDaTela);\n}", "function eliminar(i, e) {\n personas.splice(i, 1);\n guardar();\n mostrarEmpleados();\n}", "function removerTodasBalas(){\n\tbalas.forEach(removeBala);\n}", "function eliminar(num){\r\n\tvar confirmar=confirm(\"Realmente desea eliminar este proveedor para este producto???\");\r\n\tif(confirmar==false){\r\n\t\treturn false;\r\n\t}\r\n//quitamos fila de la tabla\r\n\t$(\"#fila_\"+num).remove();\r\n\treturn true;\r\n}", "function eliminarActividad(e) {\n\n var actividadBorrar = e.target.dataset.id; //hay que utilizar la propiedad del dataset porque si solo pidieramos el valor del target donde está el boton (pues estamos enlazando la funcion de eliminar con un boton concreto), solo recibiriamos el <i> del icono (mal), no el id de todo el articulo, por lo que es necesario imprimirle al icono el id del articulo entero para que se relacione cada boton con el id de su articulo. El otro metodo sería remontarnos 5 generaciones con parentNode hasta llegar el article y pedir el id.\n \n for (let i = 0; i< agendaActividades.length; i++){ //recorremos el array para encontrar la actividad que tiene un id coincidente\n\n if(agendaActividades[i].id == actividadBorrar) //el [i] funciona como contador\n {\n agendaActividades.splice(i, 1); //recorremos el array original y se aplica a partir del articulo coincidente y en la cantidad que elijamos. 1 en este caso.\n pintarActividades(agendaActividades); //pintamos de nuevo los restantes\n }\n }\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}", "eliminarFertilizante(id) {\n return axios.delete(`${API_URL}/v1/fertilizacion/${id}`);\n }", "function borrarProductoCesta(){\n //recuperar id del producto que queremos eliminar\n let idproductocesta=this.getAttribute('item');\n //borrar todos los productos\n arrayCesta=arrayCesta.filter(function(idcesta){\n return idcesta !== idproductocesta;\n });\n //volver a renderizar\n renderCesta();\n //calcular el total\n calcularTotal();\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 eliminacionremota(){\n $.ajax({\n url:URL+ID,\n type:'GET',\n dataType:\"json\",\n\n success: function (data){\n if(data.respuesta)\n {\n\n \n $(fila_info+ID).remove();\n if (actualizar_total) {\n actualizar_total();\n };\n \n\n\n\n }\n else{\n alert(\"No se pudo eliminar.\");\n }\n\n }\n ,\n error: function(j,t,e){\n alert(\"\");\n }\n});\n \n $(\"#eliminar-confirmar\").modal('hide'); \n}", "function eliminar(key_empleado){\n const dbRef_empleados = firebase.database().ref('empleados/' + key_empleado);//.child('empleados');\n dbRef_empleados.remove();\n}", "eliminarUsuario({ item }) {\n let posicion = this.lista_usuario.findIndex(\n usuario => usuario.id == item.id\n );\n this.lista_usuario.splice(posicion, 1);\n this.saveLocalStorage();\n }", "function borrarFila(elemento){\n $(\"tr[name=\" + elemento + \"]\").fadeOut(600, function(){\n var x = $(this).attr(\"name\");\n $.ajax({\n url: \"../Controller/administracion.php\",\n method: \"GET\",\n data: \"borradoEvento=\" + x,\n success: function(){\n $(\".dialog\").dialog( \"close\" );\n //llama a la función de paginacion\n eventosPaginados();\n }\n });\n }); \n }", "function removerProduto() {\n\n abrirModalProgress()\n removerImagemFirebase();\n\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 deleteEl(e) {\n let grndParent = document.querySelector('tbody');\n grndParent.removeChild(e.target.parentElement.parentElement);\n //Esto se le agrega para que cuando borre el elemento tambien actualice el total\n calcAll();\n}", "function item_borrar_carrito(e){\r\n const boton_borrar = e.target;\r\n const tr = boton_borrar.closest(\".item_carrito\");\r\n const titulo = tr.querySelector('.tabla_titulo').textContent;\r\n for(let i=0; i<carrito.length ; i++){\r\n if(carrito[i].nombre.trim() === titulo.trim()){\r\n carrito.splice(i, 1);\r\n };\r\n };\r\n tr.remove();\r\n total_carrito();\r\n}", "function eliminarEstudiante() {\n //funcion al botton \n\n $(\".eliminar\").click(function() {\n\n var cedula_estudiante = $(this).attr(\"id\");\n\n var estudiantes = JSON.parse(localStorage.getItem('estudiantes'));\n\n for (var i = 0; i < estudiantes.length; i++) {\n\n if (estudiantes[i] != undefined) {\n\n if (estudiantes[i].cedula == cedula_estudiante) {\n\n delete estudiantes[i];\n\n }\n }\n\n };\n\n localStorage.setItem('estudiantes', JSON.stringify(estudiantes));\n // alert\n alert('Estudiante eliminada');\n // refrescar\n location.reload(true);\n\n\n });\n}", "function removerItensTabela(dados) {\n\n const index = keyLista.indexOf(dados.id)\n\n tabela.rows[index].remove()\n keyLista.splice(index,1)\n}", "function removerItensTabela(dados) {\n\n const index = keyLista.indexOf(dados.id)\n\n tabela.rows[index].remove()\n keyLista.splice(index,1)\n}", "function eliminarRegistro(id){\n\tlocalStorage.removeItem(id);\n\t//Mostrar Tabla\n\tlistarEstudiantes();\n}", "eliminarAsignacion(id, datos_fila){\n let config_request = {\n method: 'DELETE',\n url: '/asignaciones/'+datos_fila.id.toString()+'/'+datos_fila.punto_satelite+'/'+datos_fila.secuencia+'/'+datos_fila.dia\n } \n global_axios(config_request)\n .then((response)=>{\n alert(response.data.msg);\n //FUNC RECARGAR GRID\n this.cargarGridAsignacion(); \n })\n .catch(err => {\n console.log(err);\n });\n }", "function remover() {\n $(\"#datos\").fadeOut();\n}", "function borrarUltimo() { //borra el ultimo elemento del arreglo y de la tabla de html\n if (pedidos.length > 0) {\n pedidos.pop();\n tbody.lastChild.remove();\n console.table(pedidos);\n }\n}", "function eliminarContacto() {\n\n var id_ver = document.getElementById(\"ver\").value;\n\n for (let i = 0; i < agenda.length; i++) {\n\n let persona = agenda[i];\n\n if ((persona.id) == id_ver) {\n\n agenda.splice(persona.id, 1);\n cargarResumen();\n }\n }\n}", "function removeEspaco(id) {\n $(id).closest('tr').remove();\n espacoCount--;\n\n var elementos = document.getElementsByName(\"area\");\n //Calcula total da area\n var total = totalArea(elementos);\n $(\"#total-area\").html(total + \" m2\");\n}", "function eliminar_todo(){\n\tdocument.fo.valores.value=\"\";\n}", "eliminarAuto({ item }) {\n let posicion = this.informacion_vehiculos.findIndex(\n automovil => automovil == item\n );\n this.informacion_vehiculos.splice(posicion, 1);\n localStorage.setItem('automoviles', JSON.stringify(this.informacion_vehiculos));\n }", "function borrarDelCarrito (e){\n let producto = arrayProductos.find(elemento => elemento.nombre==$(e.target).parent().attr(\"id\").split(\"Eli\")[0]);\n let cantidad = arrayCarrito.filter(el => el === producto.nombre).length;\n \n producto.stock= producto.stock + cantidad;\n if (producto.stock>0){\n $(`#${producto.nombre}CardproductosDestacados`).css(\"opacity\", 1);\n $(`#${producto.nombre}CardgrillaProductos`).css(\"opacity\", 1);\n }\n\n total = total - producto.precio*cantidad;\n arrayCarrito = arrayCarrito.filter(el => el != producto.nombre);\n $(\"#numBadge\").html(`${arrayCarrito.length}`);\n mostrarTotal();\n \n $(`#${producto.nombre}EnCarrito`).css({\"background-color\": \"#E8F5E9\", \"border-color\": \" #007E33\"})\n .animate(({width: '110%', margin: '-1.25rem'}));\n $(`#${producto.nombre}EnCarrito`).slideUp(\"slow\", function () {\n $(`#${producto.nombre}EnCarrito`).remove();\n siCarritoVacio();\n })\n}", "function eliminar(tbody, table){\n\t\t$(tbody).on(\"click\", \"span.eliminar\", function(){\n var data=table.row($(this).parents(\"tr\")).data();\n eliminarConfirmacion('EsquemaComision/eliminar_esquema_comision', data.id_esquema_comision, \"¿Esta seguro de eliminar el registro?\");\n });\n\t}", "function eliminarTarea() {\n let padre = this.parentNode.parentNode;\n let listaPadre = this.parentNode.parentNode.parentNode;\n return listaPadre.removeChild(padre);\n}", "function removerMunicoesForaDaTela(){\n\tmunicoes.forEach(removeMunicaoForaDaTela);\n}", "function removerPagto() {\n\t\tvar indice = 0;\n\t\t$.get(\n\t\t\tAPP+'/'+$('#role').val()+'/pagamentos_pedidos/del',\n\t\t\t{\n\t\t\t\tindice: indice\n\t\t\t},\n\t\t\tfunction(data){ \n\t\t\t\t$('.pagamentos tbody').find('.'+indice).remove();\n\t\t\t},\n\t\t\t'html'\n\t\t\t);\n\t}", "delete(clave) {\n // Buscar la clave en el array y borrar.\n var indx = this.findIndex(this.#elementos, clave);\n if (indx != -1)\n this.#elementos.splice(indx, 1);\n else\n return NaN;\n }", "function del(no) {\n\t\t \tvar totalharga = $('#total_harganya').val();\n\t\t \tvar harga = $('#total'+no).val();\n\t\t \tvar totalharganya = parseInt(totalharga) - parseInt(harga);\n\t\t \t$('#total_harganya').val(totalharganya);\n\t\t\trealnomor = realnomor - 1;\n\t\t\tnomornya = jQuery.grep(nomornya,function(value){\n\t\t \treturn value != no;\n\t\t });\n\n\t\t \tdocument.getElementById('input'+no).remove();\n\t\t \thitungtotalharga();\n\t\t\t\thitungbayar();\n\t\t}", "function removerLinha( id ){\n\n // instancia a linha da tabela\n var linha = tabela.find( '[data-object-id=\"'+id+'\"]' );\n\n // insere um efeito na linha\n linha.addClass(\"danger\");\n\n // apaga a linha lentamente\n linha.fadeOut(\"slow\", function(){\n\n // remove a linha da tabela\n linha.remove();\n\n // atualiza a classe de orednação\n self.atualizaOrdenacao();\n\n });\n\n }", "function eliminarFactura(cnumero) {\n let resultado = baseFactura.filter(fila => fila.numero != cnumero);\n document.getElementById(\"tablaFactura\").innerHTML = \"<tr><th>Fecha</th><th>Serie</th><th>Numero</th><th>Cliente</th><th>Vehiculo</th><th>Importe</th><th>Acción</th></tr> \";\n\n baseFactura = [];\n for (const factura of resultado) {\n mostrarFacturaRegistrado(factura);\n baseVehiculo.push(factura);\n }\n\n registrarBaseFactura;\n}", "function removerColumnaSumaTotales(){\n $(\"#thColumnaTotales\").remove();\n $(\"#tdSumaSemana1\").remove();\n $(\"#tdSumaSemana2\").remove();\n $(\"#tdSumaSemana3\").remove();\n $(\"#tdSumaSemana4\").remove();\n $(\"#tdSumaSemana5\").remove();\n $(\"#tdSumaSemana6\").remove();\n $(\"#trSumaPromedioTresSemanas\").remove();\n}", "function eliminarBarraLateral(){\n\tvar barra = document.getElementById(\"barraLateral\");\n\tbarra.parentNode.removeChild(barra);\n}", "function eliminar(elemento){\n elemento.parentNode.remove();\n}", "function eliminarProductosCarrito(evento3) {\n console.log(evento3.target.parentNode.parentNode.parentNode.removeChild('id'));\n let idProduct = evento3.target.parentNode.parentNode.parentNode.removeChild('id');\n productosDeMiCarrito.forEach((productoE) =>{\n if(productoE.id == idProduct) {\n productosCarrito.splice(productosCarrito);\n console.log(productosCarrito);\n };\n localStorage.setItem('productosCarrito', JSON.stringify(productosCarrito));\n actualizarElCarrito()\n});\n}", "function deletarTarefa(tarefa) {\n // REMOVER ITEM\n tarefas.splice(tarefas.indexOf(tarefa.textContent), 1)\n\n // RENDERIZAR TELA NOVAMENTE\n renderizarTarefas()\n\n // SALVAR DADOS\n saveStorage() \n}", "function fEliminar(){\n if (cPermisoPag != 1){\n fAlert(\"No tiene Permiso de ejecutar esta acción\");\n return;\n }\n\n if(lBandera == true){\n fAlert(\"No puede efectuar esta operación mientras se encuentre realizando otra transacción\");\n return;\n }\n\n frm.hdCveOpinionEntidad.value = \"\";\n frm.iCveSistema.value = \"\";\n frm.hdCveModulo.value = \"\";\n frm.iNumReporte.value = \"\";\n\n aDoc = FRMListado.fGetObjs(0);\n\n for(cont=0;cont < aDoc.length;cont++){\n if(aDoc[cont]){\n if (frm.hdCveOpinionEntidad.value==\"\") frm.hdCveOpinionEntidad.value=aResLis[cont][0]; else frm.hdCveOpinionEntidad.value+=\",\"+aResLis[cont][0];\n if (frm.iCveSistema.value==\"\") frm.iCveSistema.value=aResLis[cont][1]; else frm.iCveSistema.value+=\",\"+aResLis[cont][1];\n if (frm.hdCveModulo.value==\"\") frm.hdCveModulo.value=aResLis[cont][2]; else frm.hdCveModulo.value += \",\" + aResLis[cont][2];\n if (frm.iNumReporte.value==\"\" ) frm.iNumReporte.value=aResLis[cont][3]; else frm.iNumReporte.value+=\",\"+aResLis[cont][3];\n }\n }\n\n if (frm.iCveSistema.value == \"\"){\n fAlert ('\\nSeleccione al menos un registro para realizar esta operación.');\n return;\n }\n\n frm.hdBoton.value = \"Borrar\";\n frm.hdFiltro.value = \"\";\n if(fEngSubmite(\"pgGRLReporteXOpinion.jsp\",\"idElimina\")){\n FRMPanel.fSetTraStatus(\"UpdateComplete\");\n fDisabled(true);\n FRMListado.fSetDisabled(false);\n }\n\n fCargaListadoA();\n }", "function eliminarEntrada() {\n\tli.remove(); //remueve la entrada con el click del botoncito\n\t}", "function ClickRemoverFilho(id_filho, id_pai) {\n RemoveFilho(id_filho, Dom(id_pai));\n AtualizaGeral();\n}", "function deleteChamp(l){\n\tvar supprimer = document.getElementById('line'+l);\n\tsupprimer.remove();\n}", "function removerItensTabela(dados) {\n const index = keyLista.indexOf(dados.id);\n\n tabela.rows[index].remove();\n keyLista.splice(index, 1);\n}", "function eliminar(nombre) {\n console.log(nombre)\n let datos = JSON.parse(localStorage.getItem('datos'));\n for(let i = 0; i < datos.length; i++) {\n if(datos[i].nombre == nombre) {\n datos.splice(i, 1);\n }\n }\n \n localStorage.setItem('datos', JSON.stringify(datos));\n IngresarDatos();\n}", "function taskDeletor(idel) {\n\t\tconst currentTask = tasks.find( el => el.id == idel);\n\t\tlet taskIndex = tasks.indexOf(currentTask);\n\t\ttasks.splice(taskIndex, 1);;\n\t}", "function limpiaTabla() {\n $('#tablaEstaciones tbody tr').remove();\n}", "function eliminar(){\n\tvar anterior=document.fo.valores.value;\n\n\tvar nuevovalor=anterior.substring(0,anterior.length-1);\n\n\tdocumnet.getElementById(\"valores\").value=nuevovalor;\n}", "function eliminarAlumno(legajoActual){\n for (let i = 0; i < listadoAlumnos.length; i++){\n if(listadoAlumnos[i][\"legajo\"] == legajoActual){\n //elimino del Array\n listadoAlumnos.splice(i, 1);\n //Elimino del local storage, no estaria eliminando lo que se carga con la pagina\n localStorage.removeItem(legajoActual);\n }\n }\n}", "function Eliminar(btn){\n\tvar route = \"/genero/\"+btn.value+\"\";\n\tvar token = $(\"#token\").val();\n\t\n\t//se envia la peticion mediante el metodo DELETE con el id del genero\n\t$.ajax({\n\t\turl: route,\n\t\theaders: {'X-CSRF-TOKEN': token},\n\t\ttype: 'DELETE',\n\t\tdataType: 'json',\n\t\tsuccess: function(){\n\t\t\tCarga();\n\t\t\t$(\"#msj-success\").fadeIn();\n\t\t}\n\t});\n}", "function borrarMarca(evento) {\n if (document.getElementById('prueba')) {\n document.getElementById('prueba').parentNode.removeChild(document.getElementById('prueba'));\n }\n}", "function excluir(aux) {\n aux.remove();\n}", "function eliminarDetalle(index){\r\n if(detallesOrden.length == 1){\r\n sessionStorage.removeItem(\"DetallesOrden\");\r\n document.getElementById(\"tablaDetalles\").innerHTML = \"\";\r\n return;\r\n }\r\n detallesOrden.splice(index,1);\r\n guardarDetalles();\r\n poblarDetalle();\r\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}", "async remove(id) {\n const tarea = await this.obtenerTareaporId(id);\n\n if (!tarea) {\n throw new Error(`No existe una tarea con id \"${id}`);\n }\n\n const fecha = obtenerFecha();\n await connection.execute(\n \"UPDATE tareas SET estado = 'eliminada', eliminated = ? WHERE id = ?\",\n [fecha, id]\n );\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 deleteResource(){\n\t//Recoge el value del boton pulsado\n\tvar recurso = this.value;\n\t/* LINEAS AÑADIDAS EN LA PRACTICA 9 */\n\t//Abre la conexion con la base de datos \n\tvar resourcesDB = indexedDB.open(nombreDB);\n\t//Si ha salido bien\n\tresourcesDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar deleteObjectStore = db.transaction([\"recursos\"],\"readwrite\").objectStore(\"recursos\");\n\t\t\tvar objeto = deleteObjectStore.get(recurso);\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\t//Se elimina por el key path\n\t\t\t\tdeleteObjectStore.delete(objeto.result.link);\n\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\texito();\n\t\t\t};//FIn de objeto.onsuccess\n\t};//Fin de resourcesDB.onsuccess\n}//Fin de deleteResource", "static deleteItem(description){//description iz faila index\n fs.readFile(pathToRegularTaskFile, (error, fileContent)=>{\n let tasks=[];\n if(!error){\n tasks=JSON.parse(fileContent);\n }\n for(let i=0; i<tasks.length; i++){\n if(tasks[i].description===description){\n console.log(tasks[i].description, \"deleted\");\n tasks.splice(i,1);//udalaet na kakom ind, skolko elementov\n break;\n }\n }\n fs.writeFile(pathToRegularTaskFile, JSON.stringify(tasks),(error)=>{\n console.log(\"Error while trying to delete\", error);\n })\n });\n\n }", "function borrarTodo() {\n let img = document.querySelectorAll('.adorno');\n for (let i = 0; i < img.length; i++) {\n img.item(i).remove()\n }\n bolas = 0\n eliminadas = 0;\n txtBolasCreadas.text(`Bolas Creadas : ${bolas}`);\n txtBolasEliminadas.text(`Bolas Eliminadas : ${eliminadas}`);\n\n }", "function removerTodasMunicoes(){\n\tmunicoes.forEach(removeMunicao);\n}", "DELETE_fotografias(event, id) {\n\n event.preventDefault()\n\n // Se de la formato a el parametro id\n var params = { \"id\": id };\n\n // Se crea la URL para mandar a la API\n const url = \"http://127.0.0.1:8081/fotografias/?\" + new URLSearchParams(params);\n var status_response;\n var elemento_eliminar = this.state.table_data.findIndex(element => element['idFotografias'] === id)\n\n // Se esconde el mensaje de confirmacion para eliminar\n this.setState({ delete_modal: false })\n\n //Se hace la llamada a la API\n fetch(url, {\n method: 'DELETE',\n headers: {\n 'Authorization': 'Token ' + this.props.user_data.token,\n },\n })\n .then(response => {\n status_response = response.status;\n return response.json()\n })\n .then(respuesta_delete => {\n\n if (status_response === 200) {\n // Para evitar recargar la pagina se toma la respuesta de la API y \n // se agrega directamente al estado.\n // Si la peticion a la API fue un exito\n console.log(\"status: \" + status_response)\n console.log(respuesta_delete)\n\n // Creamos una copia del estado\n var updated_table_data = this.state.table_data;\n\n // Modificamos la copia\n updated_table_data.splice(elemento_eliminar, 1)\n\n // Sobre escribimos el estado con la copia actualizada\n this.setState({ table_data: updated_table_data })\n }\n else {\n // De lo contrario se imprime el error en la consola\n console.log(\"status: \" + status_response)\n console.log(respuesta_delete)\n }\n })\n }", "function Eliminar(btn) {\n\tvar route = \"/genero/\"+btn.value+\"\"; //DAMOS L A RUTA que nos importa y concatenamos el valor que toma el boton eliminar\n\tvar token = $(\"#token\").val(); //despues traemos el valor del token, para que la peticion no sea malintencionada\n\n//hacemos la peticion\n\t$.ajax({\n\t\turl: route, //pasamos la URL que sera la ruta\n\t\theaders: {'X-CSRF-TOKEN': token}, //pasamos el encabezado donde viene el token\n\t\ttype: 'DELETE', //sera del tipo PUT COMO ES ACTUALIZAR\n\t\tdataType: 'json', //especificamos el tipo de dato\n\n\t\tsuccess: function(){ //cuando se lleva acabo la funcion correctamente, cada ves que se hague una actualizacion\n\t\t\tCarga(); //mandara a traer al metodo carga, que basiacamente va a eliminar, volvera hacer la peticion ajax\n\t\t\t$(\"#msj-errors\").fadeIn(); //Y QUIERO QUE APAREZCA UN MENSAJE QUE SE ELIMINO CORRECTAEMENTE, LLAMAMOS AL MENSAJE SUCESS Y LE DECIMOS QUE SE MUESTRE\n\t\t}\n\t\t//despues PASAMOS AL metodo DESTROY del GeneroController\n\t});\n}", "function EliminarChambaIndicada(){\n\t//debugger;\n\t// este obtiene el nombre donde guardo las chambas en el localstorage ('Noeliachambas')\n\tvar acumulador = localStorage.getItem(\"Usuario_Actual\") + \"chambas\";\n\t// este obtiene ese nombre ('Noeliachambas')y lo parsea para poder obtener el arreglo de arreglos \n\tvar chambas=JSON.parse(localStorage.getItem(acumulador));\n\t// este for recorre todo el arreglo de arreglos\n\tfor (i=0; i< chambas.length; i++){\n\t\t// este for recorre cada uno de esos arreglos\n\t\tfor (j=0; j< chambas[i].length; j++){\n\t\t\t// esta variable es para obtener el id del elemento en el que estoy actualmente\n\t\t\teliminar = JSON.parse(localStorage.getItem(\"id\"));\n\t\t\t// pregunto que si ese id es igual al id de la chamba\n\t\t\tif(eliminar == chambas[i][j]){\n\t\t\t\t// si es igual, intonces le digo que me elimine el que esta actualmente o sea i\n\t\t\t\tchambas.splice(i, 1);\n\t\t\t\t// luego vuelvo a guardarlo en localstorage todos loa arreglos menos el que eliminó obviamente\n\t\t\t\tlocalStorage[acumulador] = JSON.stringify(chambas);\n\t\t\t\t// muestro el mensaje para saber que se eliminó\n\t\t\t\talert(\"Se Eliminó correctamente\");\n\t\t\t}\n\t\t}\n\t}\n}" ]
[ "0.7876932", "0.74942636", "0.7486997", "0.7413939", "0.73556995", "0.7302456", "0.7237705", "0.72330207", "0.7174539", "0.70933974", "0.701447", "0.70037854", "0.6915748", "0.6897243", "0.6888558", "0.686472", "0.68101996", "0.6803581", "0.6784887", "0.6774764", "0.6774179", "0.6766216", "0.6737728", "0.67235655", "0.67111003", "0.6704271", "0.6701576", "0.668082", "0.66792", "0.6676861", "0.66524816", "0.66508555", "0.66113174", "0.65972173", "0.6592186", "0.6580333", "0.6577309", "0.6568533", "0.6563948", "0.6554552", "0.65402323", "0.65393203", "0.6527908", "0.65257853", "0.6521937", "0.65002525", "0.6498015", "0.6490435", "0.648439", "0.6483898", "0.6478673", "0.6477301", "0.6468738", "0.64644957", "0.64644957", "0.64551526", "0.6453374", "0.6430065", "0.64245963", "0.6423536", "0.64159626", "0.64155114", "0.6409302", "0.6385381", "0.6361153", "0.635018", "0.6349474", "0.6347802", "0.6345542", "0.6342533", "0.6333081", "0.63324666", "0.6328961", "0.6327606", "0.6325698", "0.63190824", "0.6314779", "0.6314736", "0.63077086", "0.63075465", "0.63041204", "0.63009834", "0.63007915", "0.6291127", "0.62875634", "0.6287413", "0.6273871", "0.6269841", "0.6260592", "0.62602156", "0.6259465", "0.6256259", "0.62515754", "0.6243757", "0.6234975", "0.6229577", "0.6228544", "0.62274665", "0.622282", "0.6221823", "0.6219321" ]
0.0
-1
Special case '(abc)', '((a)b)', 'abc(())' would be valid and ')a(' '((b())' would be invalid. '()()' is not valid
function isValid2(s){ if(!s || !s.trim()) return false; let openCount = 0; s=s.trim(); for(let i=0; i<s.length; i++){ if(s[i] == "(") openCount++; if (s[i] == ")"){ if (openCount === 0 || (openCount == 1 && i < s.length - 1)) return false; else openCount--; } } return openCount == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parensValid(string) {\r\n}", "function validParenthesis(str){\n var hasParenthesis = /[()]/;\n var validParenthesis = /\\([0-9]{3}\\)/;\n if(hasParenthesis.test(str)){\n if(validParenthesis.test(str)){\n return true;\n }\n return false;\n }\n return true;\n}", "function checkParens(str) {\n\n}", "function validParentheses(parens){\n \n var length = parens.length / 2;\n \n for (var i = 0; i <= length; ++i) {\n parens = parens.replace('()', '');\n }\n \n return parens == '';\n \n }", "function valid_paranthesis(str) {\n\tconst stack = [];\n\tconst valid = {\n\t\t')': '(',\n\t\t']': '[',\n\t\t'}': '{',\n\t};\n\tfor (let i = 1; i < str.length; i++) {\n\t\tif ('({['.includes(str[i])) {\n\t\t\tstack.push(str[i]);\n\t\t} else if (valid[str[i]] == stack[stack.length - 1]) {\n\t\t\tstack.pop();\n\t\t}\n\t}\n\treturn stack.length == 0 ? true : false;\n}", "function validParenthesis(str) {\r\n var hasParenthesis = /[()]/;\r\n var validParenthesis = /\\([0-9]{3}\\)/;\r\n if (hasParenthesis.test(str)) {\r\n if (validParenthesis.test(str)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n return true;\r\n}", "function validParentheses(parens){\n let str = parens.split('()').join('')\n while(str.includes('()')){\n str = str.split('()').join('')\n }\n return str.length === 0\n}", "function paren_valid(str){\n var count=0;\n for(var i=0;i<str.length;i++){\n if(str.charAt(i)==\"(\") // add 1 for left (\n count+=1;\n else if (str.charAt(i)==\")\") // minus 1 for right )\n count-=1;\n if (count<0) // if the count isn't 0 then they are not even\n return false;\n }\n return count === 0\n }", "function validParentheses(parens) {\n\n let length = parens.length;\n let position = 0;\n\n //grab the first and last element of the string \n //if they are a pair \"()\" or \")(\", then get the next elements from the beginning and end by incrementing the position counter\n while (parens[position] + parens[length - 1 - position] === '()' || parens[position] + parens[length - 1 - position] === ')(') {\n position++;\n }\n\n //if we checked all positions then we always found pairs\n if (position === length) {\n return true;\n } else {\n return false;\n }\n}", "function validParentheses(parens) {\n\tvar length = parens.length / 2;\n\n\tfor (var i = 0; i <= length; ++i) {\n\t\tparens = parens.replace('()', '');\n\t}\n\tconsole.log(parens == '');\n\treturn parens == '';\n}", "function validPar(str){\n var count = 0;\n for(var i = 0; i < str.length; i ++){\n if(str[i] == \"(\"){\n count++;\n }\n if(str[i] == \")\"){\n count--;\n }\n if(count < 0){\n return false;\n }\n }\n return true; \n }", "function isCorrect(paren){\n let counter= 0;\n for(let i=0; i<paren.length; i++) {\n if(paren[i]===\"(\"){\n counter++;\n }\n else if(paren[i]===\")\"){\n counter--;\n }\n \n if(counter<0){\n alert(\"This string is invalid\");\n }\n }\n if(counter===0){\n alert(\"This is valid\");\n }\n else{\n alert(\"This is invalid\");\n }\n}", "function parensValid(str) {\n const parensStack = [];\n\n for (const char of str) {\n if (char === \"(\") {\n parensStack.push(char);\n } else if (char === \")\") {\n if (parensStack.length === 0) {\n return false;\n } else {\n parensStack.pop();\n }\n }\n }\n return parensStack.length === 0;\n}", "function validParentheses(parens){\n let stack = 0;\n for (let char of parens.split(\"\")) {\n if (char === \")\" && stack === 0) {return false;}\n else if (char === \")\") {stack--;}\n else {stack++;}\n }\n return stack === 0;\n}", "function parensValid(str) {\n // setup\n var count = 0\n // some work\n for (let i = 0; i < str.length; i++) {\n if (count < 0) {\n return false\n }\n if (str[i] == \"(\") {\n count++\n }\n if (str[i] == \")\") {\n count--\n }\n }\n // return something\n // if (count > 0) {\n // return false\n // }\n\n // if (count == 0) {\n // return true\n // }\n return count == 0\n}", "function valid(str){\n x = 0\n y = 0\n z = 0\n for(var i = 0; i<str.length; i++){\n if(str[i] == '('){\n x +=1\n }\n else if(str[i] == ')'){\n x-=1\n }\n if (x< 0){\n return false\n }\n if(str[i] == '{'){\n y++\n }\n else if(str[i] == '}'){\n y--\n }\n if (y< 0){\n return false\n }\n if(str[i] == '['){\n z +=1\n }\n else if(str[i] == ']'){\n z-=1\n }\n if (z< 0){\n return false\n }\n }\n if (x == 0 & y == 0 & z == 0){\n return true\n }\n else{\n return false\n }\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}", "function parenthesis(e){switch(e){case\"(\":case\")\":case\"{\":case\"}\":case\"[\":case\"]\":return!0;default:return!1}}", "function validParen(string) {\n\n let openCount = 0;\n let closeCount = 0;\n\n if (string.length === 0) return true;\n\n for (let idx = 0; idx < string.length; idx++) {\n \n if (closeCount > openCount) return false\n\n if (string[idx] === \"(\") {\n openCount++\n }\n else if (string[idx] === \")\") {\n rightCount++\n }\n }\n \n if (closeCount === openCount) return true\n\n}", "function bracketsAllowed(str) {\n let open_bracket_idx = str.search(\"\\\\(\");\n let closed_bracket_idx = str.search(\"\\\\)\");\n if (open_bracket_idx == -1 || closed_bracket_idx == -1) {\n return true;\n }\n if (closed_bracket_idx - open_bracket_idx == 4) {\n return true;\n }\n return 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 paran(str) {\n let count = 0\n let splStr = str.split('')\n \n for(let i = 0; i < splStr.length; i++){\n if(count < 0){\n return false\n }\n if(splStr[i] === '('){\n count ++\n }\n else if(splStr[i] === ')'){\n count --\n }\n }\n if(count === 0){\n return true\n }\n else return false\n }", "function validBraces(str) {\n\tvar prev = '';\n\twhile (str.length != prev.length) {\n\t\tprev = str;\n\t\tstr = str.replace('()', '').replace('[]', '').replace('{}', '');\n\t}\n\treturn str.length === 0;\n}", "function validParentheses(parens){\n //data structure used : stack\n let valid = [];\n for(let i=0; i<parens.length; i++){\n if(parens[0]===')')return false;\n if(parens[i]==='('){\n valid.push(parens[i]);\n }\n else if(valid.length===0 && parens[i]===')')return false;\n else {\n valid.pop();\n }\n }\n return (valid.length === 0);\n}", "function validOne(str) {\n let left = 0;\n // iterate through string and have counter\n // if ( then add if ) then subtract to counter\n // if by the end you are not 0 then not valid paren\n for (let paren of str) {\n if (paren === '(') {\n left++;\n } else {\n left--;\n }\n }\n return left === 0;\n}", "function removeInvalidParentheses(str) {\n let removed = {count: 0};\n let left = remove(str, ['(', ')'], removed);\n let reversed = left.split('').reverse().join('');\n let right = remove(reversed, [')', '('], removed);\n console.log('Removed:', removed.count);\n return right.split('').reverse().join('');\n}", "function validParentheses(parentheses) {\n let count = 0\n for (let i = 0; i < parentheses.length; i++){\n if (parentheses[i]==='('){\n count ++\n } else if (parentheses[i]===')') {\n count --\n }\n if (count < 0){\n return false \n }\n }\n return !count\n}", "function checkBrackets(value){\n var isCorrect = true;\n var leftBrackets = 0;\n var rightBrackets = 0;\n var brackets = value.split(/[^()]/).filter(Boolean);\n for (var i = 0; i < brackets.length; i++) {\n var bracket = brackets[i];\n if (bracket == '(') {\n leftBrackets++;\n } else {\n rightBrackets++;\n }\n }\n if (brackets[0] == \")\") {\n isCorrect = false;\n }\n if (leftBrackets != rightBrackets) {\n isCorrect = false;\n }\n if (isCorrect) {\n return \"correct\";\n } else {\n return \"incorrect\";\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 validParentheses(parens) {\n return !Array.from(parens)\n .reduce((count, e) => {\n if (count === -1)\n return -1;\n else if (e === '(')\n return count + 1;\n else if (e === ')')\n return count - 1;\n else\n return -1;\n }, 0);\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 validParentheses(parens){\n let counter = 0;\n \n for (const paren of parens) {\n if (paren === '(') counter++;\n if (paren === ')') counter--;\n if (counter < 0) return false;\n }\n \n return counter === 0;\n}", "function f11(str) {\n const stack = [];\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '(') stack.push(str[i]);\n else if (str[i] === ')') stack.pop();\n }\n return !stack.length;\n}", "function validBraces (str){\n\tvar open = [];\n var unbalanced = false;\n\t\n\tfor(var i = 0; i < str.length; i++){\t\n\t\tif(/[\\(\\{\\[]/g.test(str[i])){\n\t\t\topen.push(str[i]);\n\t\t}\t\n\t\t\n\t\tif(str[i] === ')'){ \n\t\t\t (open[open.length - 1] === '(' && open.length > 0) ? \n\t\t\t\t open.pop() : unbalanced = true;\n\t\t}\n\t\n\t\tif(str[i] === ']'){ \n\t\t\t (open[open.length - 1] === '[' && open.length > 0) ? \n\t\t\t\t open.pop() : unbalanced = true;\n\t\t}\n\t\n\t\tif(str[i] === '}'){ \n\t\t\t (open[open.length - 1] === '{' && open.length > 0) ? \n\t\t\t\t open.pop() : unbalanced = true;\n\t\t}\t\n\t\t\n\t}\n\n\tif(open.length === 0 && !unbalanced){\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "static balancedParenthesis(string) {\n const openParenthesesStack = new Stack();\n for (let letter of string) {\n if (letter === '(') {\n openParenthesesStack.push(letter);\n } else if (letter === ')') {\n // if there is a closing parantheses for no previous opening one return false\n if (openParenthesesStack.isEmpty()) return false;\n // if the stack isn't empty pop one of the opening parantheeses\n openParenthesesStack.pop();\n }\n }\n return openParenthesesStack.isEmpty();\n }", "function hasParens(str, start, end) {\n return end - start > 1 && (str[start] === '(' && str[end - 1] === ')');\n }", "function matchingParens(str) {\n const stack = new Stack()\n if(!str) return null;\n for(let i=0; i<str.length; i++) {\n if(str[i] === '(')\n stack.push(str[i])\n if(str[i]===')') {\n if (stack.pop() === null)\n return false\n }\n }\n return(stack.top===null)\n}", "function telephoneCheck2(str) {\n let rex1 = /^(1\\s?)?\\d{3}([-\\s]?)\\d{3}\\2\\d{4}$/;\n let rex2 = /^(1\\s?)?\\(\\d{3}\\)\\s?\\d{3}[-\\s]?\\d{4}$/;\n\n if (rex1.test(str)) {\n console.log(\"rex 1, no parenthesis cases\");\n return true;\n }\n // return rex2.test(str) ? true : false;\n if (rex2.test(str)) {\n console.log(\"rex2 correct parenthesis\");\n return true;\n } else {\n console.log(\"else false\");\n return false;\n }\n}", "function parseParenthesesExpression() {\n nextToken() // \"(\"\n var node = parseExpression()\n if (currentToken() != \")\")\n return parseError(\"Expected ')'\")\n nextToken() // \")\"\n return node\n }", "function simple_form(name) {\n return RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])')\n } // booleans and numbers", "function validCharacters(str) {\r\n var regex = /^[0-9-()\" \"]*$/;\r\n return regex.test(str);\r\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 validBraces (str){\n\tconsole.log(str);\n\tvar open = [];\n\t\n\tfor(var i = 0; i < str.length; i++){\t\n\t\tif(/[\\(\\{\\[]/g.test(str[i])){\n\t\t\topen.push(str[i]);\n\t\t}\t\n\t\t\n\t\tif(str[i] === ')'){ \n\t\t\t (open[open.length - 1] === '(' && open.length > 0) ? \n\t\t\t\t open.pop() : return false;\n\t\t}\n\t\n\t\tif(str[i] === ']'){ \n\t\t\t (open[open.length - 1] === '[' && open.length > 0) ? \n\t\t\t\t open.pop() : return false;\n\t\t}\n\t\n\t\tif(str[i] === '}'){ \n\t\t\t (open[open.length - 1] === '{' && open.length > 0) ? \n\t\t\t\t open.pop() : return false;\n\t\t}\t\n\t\t\n\t\tconsole.log(open, 'open after if tests')\n\n\t\t\n\t}\n\n\tif(open.length === 0){\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "function bracket()\r\n{\r\nvar p=\"\";\r\nfor(var c=0;c<form.display.value.length;c++)\r\n{\r\n if(form.display.value[c]==\"(\" || form.display.value[c]==\")\")\r\n {\r\n p=p+form.display.value[c];\r\n }\r\n}\r\nvar z=isMatchingBrackets(p);\r\nreturn z;\r\n}", "function isOperators(str){\n if (str == \"(\" || str == \")\" || str == \"+\" || str == \"-\" || str == \"*\" || str == \"/\")return true;\n return false;\n}", "function paren(s, b) { return b ? '(' + s + ')' : s; }", "recognizeParenthesis(){\r\n let position = this.position;\r\n let line = this.line;\r\n let column = this.column;\r\n let character = this.input.charAt(position);\r\n\r\n this.position += 1;\r\n this.column += 1;\r\n\r\n if(character === '('){\r\n return new Token(TokenType.LeftParenthesis,'(', line, column);\r\n }\r\n\r\n return new Token(TokenType.RightParenthesis,')', line, column);\r\n }", "function validParentheses(parens) {\n // TODO\n const balance = [];\n for(let parentheses of parens) {\n\n }\n\n}", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "function isValidBrackets(expression) {\n var leftBracket = 0,\n index;\n\n for (index in expression) {\n if (expression[index] === '(') {\n leftBracket += 1;\n } else if (expression[index] === ')') {\n if (leftBracket === 0) {\n return 'incorrect';\n } else {\n leftBracket -= 1;\n }\n }\n }\n\n if (leftBracket === 0) {\n return 'correct';\n } else {\n return 'incorrect';\n }\n}", "function X(a){for(var b,c=[],d=/\\[([^\\]]*)\\]|\\(([^\\)]*)\\)|(LT|(\\w)\\4*o?)|([^\\w\\[\\(]+)/g;b=d.exec(a);)b[1]?// a literal string inside [ ... ]\nc.push(b[1]):b[2]?// non-zero formatting inside ( ... )\nc.push({maybe:X(b[2])}):b[3]?// a formatting token\nc.push({token:b[3]}):b[5]&&// an unenclosed literal string\nc.push(b[5]);return c}", "function parenthesisCheck(string){\n //iterate through string\n //push \"(\" parenthesis (only parenthesis) to stack when found\n //pop stack when \")\" found\n //if at end of string, stack has something, we have unclosed parenthesis\n //if we pop empty stack while iterating, we're missing open paren\n\n if(!string.length) return null;\n const parenStack = new Stack();\n for(let i=0; i < string.length; i++){\n if(string[i] === '(') {\n parenStack.push('(');\n }\n if(string[i] === ')') {\n if(isEmpty(parenStack)){\n console.log('you are missing a \"(\"');\n }\n parenStack.pop();\n }\n }\n if(!isEmpty(parenStack)) {\n console.log('you are missing a \")\"');\n return false;\n }\n return true;\n}", "function balancedBrackets(str) {\n let stack = [];\n for (let char of str) {\n if (char == \"(\") {\n stack.push(char);\n } else if (char == \")\") {\n if (stack.length == 0) {\n return false;\n }\n stack.pop();\n }\n }\n return stack.length == 0;\n}", "function minRemoveToMakeValid(s) {\n\tif(!s) return s;\n\tstack = [];\n\tfor(let i = 0; i < s.length; i++){\n\t\tif (stack.length === 0 && s[i] === ')') {\n\t\t\ts = s.slice(0,i) + s.slice(i+1);\n\t\t\ti--;\n\t\t} else if (s[i] === '(') {\n\t\t\tstack.push(s[i]);\n\t\t} else if (s[i] === ')') {\n\t\t\tstack.pop();\n\t\t}\n\t}\n\twhile (stack.length > 0) {\n\t\tlast = s.lastIndexOf('(');\n\t\ts = s.slice(0,last) + s.slice(last+1);\n\t\tstack.pop();\n\t}\n\treturn s;\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 validFirstCharacter(char) {\n const regex = new RegExp(\"[0-9\\\\(]\");\n return regex.test(char);\n}", "function validateCharacters(val) {\n if (/^[a-zA-Z()]+$/.test(val) && val != \"\") {\n return true;\n } else {\n return false;\n }\n}", "static validateBrackets (stringDefinition = ''){\n let leftBraceCount = (stringDefinition.match ('{') || []).length;\n let rightBraceCount = (stringDefinition.match ('}') || []).length;\n let leftParenCount = (stringDefinition.match ('(') || []).length;\n let rightParenCount = (stringDefinition.match (')') || []).length;\n let leftBoxBracketCount = (stringDefinition.match ('[') || []).length;\n let rightBoxBracketCount = (stringDefinition.match (']') || []).length;\n\n // If there are any braces, parentheses, or box brackets without pair, throw an error\n if (leftBraceCount != rightBraceCount ||\n leftParenCount != rightParenCount ||\n leftBoxBracketCount != rightBoxBracketCount) {\n\n let errorMessage = 'Not all brackets are closed';\n if (leftBraceCount != rightBraceCount) {\n errorMessage += `\\n\\tThere are ${leftBraceCount} '{' and ${rightBraceCount} '}'`;\n }\n if (leftParenCount != rightParenCount) {\n errorMessage += `\\n\\tThere are ${leftParenCount} '(' and ${rightParenCount} ')'`;\n }\n if (leftBoxBracketCount != rightBoxBracketCount) {\n errorMessage += `\\n\\tThere are ${leftBoxBracketCount} '[' and ${leftBoxBracketCount} ']'`;\n }\n throw new Error (errorMessage);\n }\n\n }", "function matchParen(substr,type,flag){ \n console.log(\"matchParen\");\n var parenTypes = [\n //standard parentheses for sage\n [\"\\\\left(\",\"\\\\right)\",\"(\",\")\"],\n [\"(\",\")\",\"(\",\")\"],\n\n //sage dictionary parens\n [\"\\\\left\\\\{\",\"\\\\right\\\\}\",\"numpy.array([\",\"])\"],\n [\"\\\\{\",\"\\\\}\",\"{\",\"}\"],\n [\"{\",\"}\",\"{\",\"}\"],\n\n //sage set parens\n [\"\\\\left[\",\"\\\\right]\",\"[\",\"]\"],\n [\"[\",\"]\",\"[\",\"]\"],\n\n //absolute value parens\n [\"|\",\"|\",\"abs(\",\")\"],\n [\"\\\\left|\",\"\\\\right|\",\"abs(\",\")\"],\n [\"lvert\",\"rvert\",\"abs(\",\")\"],\n [\"\\\\lvert\",\"\\\\rvert\",\"abs(\",\")\"],\n [\"left\\\\lvert\",\"right\\\\rvert\",\"abs(\",\")\"],\n\n\n //not sure how sage should handle these yet\n\n //says its used for angles \n //as in a function called angles()\n [\"left\\\\langle\",\"right\\\\rangle\",\"angles(\",\")\"],\n [\"\\\\langle\",\"\\\\rangle\",\"angles(\",\")\"],\n [\"langle\",\"rangle\",\"angles(\",\")\"],\n\n //cieling parens \n //used with ciel()\n [\"\\\\lceil\",\"\\\\rceil\",\"ceil(\",\")\"],\n [\"left\\\\lceil\",\"right\\\\rceil\",\"ceil(\",\")\"],\n [\"lceil\",\"rceil\",\"ceil(\",\")\"],\n\n //floor parens \n //used with floor()\n [\"left\\\\lfloor\",\"right\\\\rfloor\",\"floor(\",\")\"],\n [\"\\\\lfloor\",\"\\\\rfloor\",\"floor(\",\")\"],\n [\"lfloor\",\"rfloor\",\"floor(\",\")\"],\n\n //double pipes \n //supposedly used with a func norm()\n [\"left\\\\Lvert\",\"right\\\\Rvert\",\"norm(\",\")\"],\n [\"\\\\Lvert\",\"\\\\Rvert\",\"norm(\",\")\"],\n [\"Lvert\",\"Rvert\",\"norm(\",\")\"],\n\n ];\n\n //Names of parentheses (used for error messages)\n var parenthName = {\n \"\\\\left(\": \"parentheses\",\n \"(\": \"parentheses\",\n \"\\\\lceil\": \"parentheses\",\n \"left\\\\lceil\": \"parentheses\",\n \"lceil\": \"parentheses\",\n \"left\\\\lfloor\": \"parentheses\",\n \"\\\\lfloor\": \"parentheses\",\n \"lfloor\": \"parentheses\",\n \"\\\\left\\\\{\": \"brace\",\n \"\\\\{\": \"brace\",\n \"{\": \"brace\",\n \"\\\\left[\": \"bracket\",\n \"[\": \"bracket\",\n \"|\": \"pipe (|)\",\n \"\\\\left|\": \"pipe (|)\",\n \"lvert\": \"pipe (|)\",\n \"\\\\lvert\": \"pipe (|)\",\n \"left\\\\lvert\": \"pipe (|)\",\n \"left\\\\langle\": \"angle delimiter\",\n \"\\\\langle\": \"angle delimiter\",\n \"langle\": \"angle delimiter\",\n \"left\\\\Lvert\": \"double pipes (||)\",\n \"\\\\Lvert\": \"double pipes (||)\",\n \"Lvert\": \"double pipes (||)\"\n }\n\n console.log(\" lookup paren type: \"+type);\n var parenSet = \"\";\n for(var j=0,len=parenTypes.length;j<len;j++){\n //console.log(j+\" parentypes: \"+parenTypes[j]);\n if(parenTypes[j][0]==type){\n console.log(\" mached to paren type: \"+parenTypes[j]);\n parenSet=parenTypes[j];\n break;\n }\n }\n if(parenSet == \"\"){\n console.log(\" unknown paren type: \"+type);\n errors.push(\"Unknown parentheses type: '\"+type+\"'.\");\n return([parseLatex(substr.substring(type.length,substr.length)),substr.length]);\n }\n\n console.log(\" match paren type: \"+parenSet[0]+\" \"+parenSet[1]+\" on substring: \"+substr);\n //missing starting left paren\n if(substr.substring(0,parenSet[0].length) != parenSet[0]){\n console.error(\" \"+substr.substring(0,parenSet[0].length)+\" is not a left paren of form: \"+parenSet[0]);\n\n errors.push(\"Left \"+ parenthName[parenSet[0]] + \" is missing.\");\n\n if(flag != 1)return([parseLatex(substr),substr.length]);\n else return([substr,substr.length]);\n }\n\n var left = 0;\n var right = 0;\n var i = 0;\n while(i<=substr.length){\n if(right == left && i>1){\n console.log(\" parsing inner substring: \"+substr.substring(parenSet[0].length,i-parenSet[1].length));\n if(flag != 1) return([parenSet[2]+parseLatex(substr.substring(parenSet[0].length,i-parenSet[1].length))+parenSet[3],i]);\n else return([parseLatex(substr.substring(parenSet[0].length,i-parenSet[1].length)),i]);\n }\n else{\n //console.log(\" left: \"+left+\" right: \"+right+\" remaining string: \"+substr.substring(i));\n //console.log(\" match: \"+substr.substring(i,i+parenSet[1].length)+\" == \"+parenSet[0]+\" or \"+parenSet[1]);\n if(substr.substring(i,i+parenSet[0].length) == parenSet[0]){\n left++;\n i+=parenSet[0].length;\n //console.log(\" matched a left paren\");\n continue;\n }\n else if(substr.substring(i,i+parenSet[1].length) == parenSet[1]){\n right++;\n i+=parenSet[1].length;\n //console.log(\" matched a right paren\");\n continue;\n }\n else i++;\n }\n }\n errors.push(\"Right \"+ parenthName[parenSet[0]] + \" is missing.\");\n console.error(\"right paren: \"+parenSet[1]+\" is missing. check mathquill inserting parens\");\n if(flag != 1)return([parseLatex(substr.substring(parenSet[0].length)),substr.length]);\n else return([substr.substring(parenSet[0].length),substr.length]);\n}", "function removeSpacesInParentheses (str) {\n let letters = str.split(\"\");\n let newLetters = [];\n\n let inParentheses = false;\n for (let i = 0; i < letters.length; i++) {\n let currentLetter = letters[i];\n\n if (currentLetter === \"(\") {\n inParentheses = true;\n } else if (currentLetter === \")\") {\n inParentheses = false;\n } else if (inParentheses && currentLetter === \" \") {\n currentLetter = \"\";\n }\n\n newLetters.push(currentLetter);\n }\n \n return newLetters.join(\"\");\n}", "function isOperator(str) {\n if (str == \"(\" || str == \")\" || str == \"+\" || str == \"-\" || str == \"*\" || str == \"/\" || str == \".\")return true;\n return false;\n}", "function simple_form(name) {\n\t\treturn RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])');\n\t}", "function simple_form(name) {\n\t\treturn RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])');\n\t}", "function parentheses(expression){\n let stack = new Stack();\n for(let i=0; i<expression.length; i++){\n if(expression[i] === '('){\n stack.push('(');\n }\n if(expression[i] === ')'){\n if(stack.top === null){\n return false; \n }\n stack.pop();\n }\n }\n if(stack.top === null){\n return true;\n }\n else false;\n}", "function removeParentheses(expression) {\n \t\tlet flags = new Array(expression.length).fill(0).map((flag, index) => \n \t\t\texpression[index] == \"(\" ? 1 : (expression[index] == \")\" ? 2 : 0));\n \t\t//remove extra parentheses\n \t\tlet open, close = -1, curPair = -1;\n \t\tlet closeParentheses = flags.filter(flag => flag == 2).length;\n \t\tfor(let i = 0; i < closeParentheses; i++) {\n \t\t\tclose = flags.indexOf(2, close + 1);\n \t\t\topen = flags.lastIndexOf(1, close);\n \t\t\tlet enclosed = close - open == 1 || (flags[open + 1] < 0 && flags[open + 1] == flags[close - 1]);\n \t\t\t[flags[open], flags[close]] = !enclosed ? [curPair, curPair--] : [3, 3]; \n \t\t}\n \t\treturn flags.every(flag => flag == 3) ? \n \t\t\t\"NULL\" : flags.reduce((acc, val, index) => acc + (val == 3 ? \"\" : expression[index]), \"\");\n \t}", "function validBraces(braces) {\n\tlet re = /\\(\\)|\\{\\}|\\[\\]/;\n\treturn re.test(braces) ? validBraces(braces.replace(re, '')) : '' === braces;\n}", "static validInput(str) {\n const regExLetters = /[a-z]/gi;\n const regExChars = /[<>{}`\\\\]/gi;\n return !str.length || (regExLetters.test(str) && !regExChars.test(str));\n }", "function validBraces(braces) {\n\tvar close = { ')': '(', '}': '{', ']': '[' };\n\tvar operands = [];\n\tfor (let s of braces.split('')) {\n\t\tif (!close[s]) operands.push(s);\n\t\telse if (operands.pop() !== close[s]) return false;\n\t}\n\treturn operands.length === 0;\n}", "function parseExp(expression){\n console.log(\"Changing bracket expression to be friendly\");\n //examples: (TESTED)\n // 5(2)\n // (2)(2)\n // (2) + (2)\n // (5)2 + (2)((5))\n // 5+(2)((3-2)5)*3(1)\n let i = 1;\n while(i < expression.length){\n if(expression[i] === \"(\" && !isNaN(expression[i-1])){\n expression = expression.slice(0, i) + \"*\" + expression.slice(i);\n }else if(expression[i] === \"(\" && expression[i-1] === \")\"){\n expression = expression.slice(0, i) + \"*\" + expression.slice(i);\n }else if(!isNaN(expression[i]) && expression[i-1] === \")\"){\n expression = expression.slice(0, i) + \"*\" + expression.slice(i);\n }\n i++;\n }\n console.log(\"Returning \", expression);\n return expression;\n}", "matchBrackets() {\n const inputLength = this.inputExpression.length;\n for (let i = 0; i < inputLength; i++) {\n const char = this.inputExpression.charAt(i);\n switch (char) {\n case \"(\":\n case \"[\":\n case \"{\":\n this.stack.push(char);\n break;\n case \"]\":\n case \")\":\n case \"}\":\n if (!this.stack.isEmpty()) {\n const tmpChar = this.stack.pop();\n if (\n (tmpChar !== \"{\" && char == \"}\") ||\n (tmpChar !== \"[\" && char == \"]\") ||\n (tmpChar !== \"(\" && char == \")\")\n ) {\n this.isExpressionValid = false;\n this.errorCode = ErrorConstant.NO_MATCHING_OPENING_BRACKETS(\n char,\n this.inputExpression\n );\n }\n } else {\n this.isExpressionValid = false;\n this.errorCode = ErrorConstant.EXTRA_CLOSING_BRACKETS(\n char,\n this.inputExpression\n );\n }\n break;\n }\n // break the loop on the first mistake.\n if (!this.isExpressionValid) {\n break;\n }\n }\n if (this.isExpressionValid) {\n // There is still possibility that extra brackets being present here.\n if (!this.stack.isEmpty()) {\n this.isExpressionValid = false;\n this.errorCode = ErrorConstant.EXTRA_OPENING_BRACKETS(\n this.inputExpression\n );\n }\n }\n }", "function checkString(str){\n let bracketStack = [];\n let bracketDict = {\n '{':'}',\n '[':']',\n '(':')',\n }\n \n function closesLastBracket(current){\n if(bracketStack.length === 0) return false;\n\n let expectedLast = bracketDict[bracketStack[bracketStack.length - 1]];\n return expectedLast === current;\n }\n \n let valid = true;\n for(let i = 0; i < str.length; i++){\n switch(str[i]){\n case '{':\n case '[':\n case '(':\n bracketStack.push(str[i]);\n break;\n case '}':\n case ']':\n case ')':\n if(!closesLastBracket(str[i]))\n valid = false;\n else\n bracketStack.pop();\n break;\n }\n }\n \n if(bracketStack.length > 0) valid = false;\n\n return valid;\n}", "function tokenizeOpenedParenthesis(state) {\n var nextSymbolCode = state.css.charCodeAt(state.pos + 1);\n var tokensCount = state.tokens.length;\n var prevTokenCssPart = tokensCount ? state.tokens[tokensCount - 1][1] : '';\n\n if (prevTokenCssPart === 'url' && nextSymbolCode !== _globals.singleQuote && nextSymbolCode !== _globals.doubleQuote && nextSymbolCode !== _globals.space && nextSymbolCode !== _globals.newline && nextSymbolCode !== _globals.tab && nextSymbolCode !== _globals.feed && nextSymbolCode !== _globals.carriageReturn) {\n state.nextPos = state.pos;\n\n do {\n state.escaped = false;\n state.nextPos = state.css.indexOf(')', state.nextPos + 1);\n\n if (state.nextPos === -1) {\n (0, _unclosed2.default)(state, 'bracket');\n }\n\n state.escapePos = state.nextPos;\n\n while (state.css.charCodeAt(state.escapePos - 1) === _globals.backslash) {\n state.escapePos -= 1;\n state.escaped = !state.escaped;\n }\n } while (state.escaped);\n\n state.tokens.push(['brackets', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);\n state.pos = state.nextPos;\n } else {\n state.nextPos = findClosedParenthesisPosition(state.css, state.length, state.pos);\n state.cssPart = state.css.slice(state.pos, state.nextPos + 1);\n\n var foundParam = state.cssPart.indexOf('@') >= 0;\n var foundString = /['\"]/.test(state.cssPart);\n\n if (state.cssPart.length === 0 || state.cssPart === '...' || foundParam && !foundString) {\n // we're dealing with a mixin param block\n if (state.nextPos === -1) {\n (0, _unclosed2.default)(state, 'bracket');\n }\n\n state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);\n } else {\n var badBracket = _globals.badBracketPattern.test(state.cssPart);\n\n if (state.nextPos === -1 || badBracket) {\n state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);\n } else {\n state.tokens.push(['brackets', state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);\n state.pos = state.nextPos;\n }\n }\n }\n}", "function balancedParens(string) {\n return !string.split('').reduce((isNotBalanced, char) => {\n // covering the mistake in the first place\n if (isNotBalanced < 0 ) {\n return isNotBalanced;\n }\n\n // covering the normal scenario\n if (char == '(') return ++isNotBalanced;\n if (char == ')') return --isNotBalanced;\n\n return isNotBalanced;\n\n },0 );\n}", "function validPhoneNumber (n) {\n\n return n.charAt(0) == \"(\" &&\n n.charAt(4) == \")\" &&\n n.charAt(5) == \" \" &&\n n.charAt(9) == \"-\" &&\n n.length == 14 &&\n !isNaN(n.substring(1,4)) &&\n !isNaN(n.substring(6,9)) &&\n !isNaN(n.substring(10,n.length));\n}", "isValid(text) {\n if (typeof text !== 'string') {\n throw new InvalidInputError(`Unable to process text with value: ${text}`);\n }\n\n const stack = [];\n\n for (var i = 0; i < text.length; i++) {\n const char = text[i];\n\n switch (char) {\n case '(':\n case '{':\n case '[':\n\n stack.push(this.map[char]);\n\n break;\n\n case ')':\n case '}':\n case ']':\n\n // CASE:\n // Missing opening tag\n if (stack.length === 0) {\n return false;\n }\n\n const expected = stack.pop();\n\n // CASE:\n // Unexpected closing tag\n if (expected !== char) {\n return false;\n }\n\n break;\n default:\n\n }\n }\n\n // CASE:\n // Missing closing tag\n if (stack.length > 0) {\n return false;\n }\n\n // CASE:\n // Balanced tags!\n return true;\n }", "function rightContent(content) {\n var count_1 = 0;\n var count_2 = 0;\n for (var i = 0; i < content.length; i++) {\n if (content[i] == \"(\") count_1++;\n if (content[i] == \")\") count_2++;\n if (i - 1 >= 0) {\n if (content[i] == \")\" && content[i - 1] == \"(\") {\n throw \"Something is wrong\";\n }\n }\n }\n if (count_1 != count_2) throw \"Something is wrong\";\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}", "manipulatingRegularExpression(expresion) {\n let isContainOpeningBracket = '';\n let isContainingAND = '';\n let isContainingOR = '';\n var expressionArray;\n var expressionArray2=[];\n var validateExpression='';\n var newExp='';\n for (var i = 0; i < expresion.length; i++) {\n \n if (expresion[i] == '(') {\n if (i == 0) {\n newExp += \"( \";\n } else {\n newExp += \" ( \";\n }\n } else if (expresion[i] == ')') {\n if (i == expresion.length - 1) {\n newExp += \" )\";\n } else {\n newExp += \" ) \";\n }\n } else {\n newExp += expresion[i];\n }\n }\n expressionArray = newExp.trim().split(' ');\n for (var j = 0; j < expressionArray.length; j++) {\n if(isContainOpeningBracket==='('||isContainingAND==='and'||isContainingOR==='or') {\n if(expressionArray[j]==='') {\n //not adding spaces after '(' or 'and' or 'or'\n } else {\n expressionArray2.push(expressionArray[j])\n isContainOpeningBracket='';\n isContainingAND='';\n isContainingOR='';\n }\n }else {\n expressionArray2.push(expressionArray[j]);\n }\n if (expressionArray[j]==='(') {\n isContainOpeningBracket=isContainOpeningBracket+expressionArray[j];\n }\n if (expressionArray[j].toLowerCase()==='and') {\n isContainingAND=isContainingAND+expressionArray[j].toLowerCase();\n }\n if (expressionArray[j].toLowerCase()==='or') {\n isContainingOR=isContainingOR+expressionArray[j].toLowerCase();\n }\n //removing spaces before )\n if(expressionArray[j].indexOf(')')===0) {\n for (var valueIndex=expressionArray2.length-2;valueIndex>=0;valueIndex--) {\n if(expressionArray2[valueIndex].trim()==='') {\n expressionArray2.splice(valueIndex,1);\n }else {\n valueIndex=-1;\n }\n }\n }\n //removing spaces before 'and' 'or'\n if( expressionArray[j] && (expressionArray[j].toLowerCase()==='and' ||expressionArray[j].toLowerCase()==='or')) {\n for (var expIndex=expressionArray2.length-2;expIndex>=0;expIndex--) {\n if(expressionArray2[expIndex].trim()==='') {\n expressionArray2.splice(expIndex,1);\n } else {\n expIndex=-1;\n }\n }\n }\n }\n expressionArray=[];\n expressionArray=expressionArray2;\n for (var k = 0; k < expressionArray.length; k++) {\n if (expressionArray[k].length>=0) {\n if((expressionArray[k].toLowerCase()!=='and' && expressionArray[k].toLowerCase()!=='or'\n && expressionArray[k]!=='('&& expressionArray[k]!==')'&& expressionArray[k]!=='') &&\n (expressionArray[k+1]!==undefined && expressionArray[k+1].length>=0 &&\n (expressionArray[k+1].toLowerCase()!=='and' && expressionArray[k+1].toLowerCase()!=='or'\n && expressionArray[k+1]!=='('&& expressionArray[k+1]!==')'))) {\n expressionArray[k]=expressionArray[k]+' ';\n }\n if (expressionArray[k].toLowerCase() === 'and') {\n expressionArray[k] = ' and ';\n }\n if (expressionArray[k].toLowerCase() === 'or') {\n expressionArray[k] = ' or ';\n }\n if (expressionArray[k].length==0) {\n expressionArray[k] = ' ';\n }\n validateExpression = validateExpression + expressionArray[k];\n }\n }\n expresion=validateExpression;\n let validateExpForPlusSign = expresion.replace(/\\+/g, 'Acanthospermum');\n let validateExpForMinusSign = validateExpForPlusSign.replace(/\\-/g, 'Adenocalymma');\n expresion=validateExpForMinusSign;\n let regExpAnd = expresion.replace(/ and /g, '-');\n let regExp = regExpAnd.replace(/ or /g, '+');\n return regExp;\n \n }", "function validBraces(braces) {\n\twhile (/\\(\\)|\\[\\]|\\{\\}/g.test(braces)) {\n\t\tbraces = braces.replace(/\\(\\)|\\[\\]|\\{\\}/g, '');\n\t}\n\treturn !braces.length;\n}", "function matchParens(exp) {\n // 0\n // (())\n // +1 for left paren (push), -1 for right paren(pop)\n // if 0 at end = all matching\n // if -1 or +1 its wrong \n // if its not ( or ) then dont put in the stack \n // if NULL is too early, then it is missing a right paren\n\n let stack1 = new Stack();\n\n // (((45 + 34) * 5))\n // \n for(let i=0; i<exp.length; i++){\n let char = exp.slice(i, i+1);\n if (char === '(') {\n stack1.push(char);\n }\n else if(char === ')' && stack1.top) {\n stack1.pop()\n }\n else if(char === ')' && !stack1.top) {\n return console.log('you done missed a (')\n }\n }\n if(stack1.top) {\n return console.log('you done missed a )')\n }\n return console.log('you done did a good job')\n}", "function isCompoundString(iString) {\n var i, len = iString.length,\n tChar,\n nestingLevel = 0,\n suspiciousChars = ' +-*/()\\u2212\\u22c5',\n hasSuspiciousChars = false,\n hasUnparenthesizedChars = false;\n for (i = 0; i < len; ++i) {\n tChar = iString[i];\n hasSuspiciousChars = hasSuspiciousChars ||\n (suspiciousChars.indexOf(tChar) >= 0);\n if (tChar === '(') {\n ++ nestingLevel;\n }\n else if (nestingLevel && (tChar === ')')) {\n -- nestingLevel;\n }\n else if (!nestingLevel) {\n hasUnparenthesizedChars = true;\n }\n // If there are suspicious chars then _any_ unparenthesized chars\n // require parenthesization (e.g. \"(a+b)c\" ^ 2 should be parenthesized).\n // Note that this is an improvement over the heuristic GSP uses, which\n // itself is not implemented correctly in GSP 5.06.\n if (hasSuspiciousChars && hasUnparenthesizedChars)\n return true;\n }\n // If parentheses are unbalanced, then we should parenthesize\n return nestingLevel > 0;\n}", "function brackets(str) {\n var arr = str.split('');\n while (arr.length > 1 && arr[0] !== ']' && arr[arr.length - 1] !== '[') { //find pair '[]' and delete it from array\n arr.splice(0, 1);\n arr.splice(arr.indexOf(']'), 1);\n }\n return arr.length === 0 ? 'OK' : 'NOT OK';\n}", "function parseParenthesizedExpression(smiles, ctx) {\n var firstChar = smiles[0];\n var rest = smiles.slice(1);\n\n if (firstChar === \"(\") {\n var newCtx = _objectSpread2(_objectSpread2({}, ctx), {}, {\n parens: ctx.parens + \"(\"\n }); // increment the branch index\n\n\n newCtx = _inc(ctx, [\"idx\", ctx.idx.length - 1, 1]);\n var inBranchIdx = -1;\n\n if (ctx.idx[ctx.idx.length - 1][0] % 2 === 0) {\n // HACK(colin): this is so that we preserve the odd/even series in\n // indices in branches; the layout engine uses this to select\n // angles, and if we don't do this, editing one part of a molecule\n // can cause another to flop around oddly.\n // TODO(colin): this should just start at 0 all the time, and the\n // layout engine should figure out continuity.\n inBranchIdx = 0;\n }\n\n var parenCtx = _objectSpread2(_objectSpread2({}, newCtx), {}, {\n idx: newCtx.idx.concat([[inBranchIdx, 0]]),\n parens: newCtx.parens.concat(\"(\")\n });\n\n var parenExpr = parse$2(rest, parenCtx);\n var remainder = parse$2(sliceFromMatchingCloseParen(rest, [\"(\"]), newCtx);\n return [parenExpr].concat(remainder);\n } else if (firstChar === \")\") {\n if (ctx.parens[ctx.parens.length - 1] !== \"(\") {\n throw new ParseError$1(\"Mismatched parentheses\");\n }\n\n return null;\n } else {\n throw new ParseError$1(\"Invalid bare character: \" + firstChar);\n }\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 isBracketValid(Look) {\n try {\n var Bracket = new Array();\n for (var i = 0; i < Look.length; i++) {\n if (Look[i] == \"(\" || Look[i] == \")\") {\n Bracket.push(Look[i]);\n }\n }\n if (Bracket.length % 2 != 0) throw \"odd Brackets\";\n var count1 = 0, count2 = 0;\n for (i = 0; i < Bracket.length; i++) {\n if (Bracket[i] != \"(\") {\n ++count1;\n }\n if (Bracket[i] != \")\") {\n ++count2;\n }\n }\n if (count2 != count1) throw \"Brackets dispair\";\n return true;\n }\n catch(Error) {\n alert(Error);\n ClearAll();\n }\n}", "static demo() {\n let bracketMatch = new BracketMatch(`{a+(c+d)-b}`);\n bracketMatch.matchBrackets();\n bracketMatch.displayResult();\n\n bracketMatch.setExpression(`{a+9-(c+d-e+[a+b)}`); //un-even closing\n bracketMatch.matchBrackets();\n bracketMatch.displayResult();\n\n bracketMatch.setExpression(`{a+9-(c+d-e+[a+b])}}`); //extra closing\n bracketMatch.matchBrackets();\n bracketMatch.displayResult();\n\n bracketMatch.setExpression(`{{a+9-(c+d-e+[a+b])}`); //extra opening\n bracketMatch.matchBrackets();\n bracketMatch.displayResult();\n }", "function mightBeExpression(str, fields) {\n fields = fields || [];\n if (fields.indexOf(str.trim()) > -1) return true;\n return /[(){}./*?:&|=[+-]/.test(str);\n }", "function startsWithParenthesis(content) {\n\tif (content[0] == '(' || content[0] == '[' || content[0] == '{') {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function telephoneCheck(str) {\n\n var strCleaned = str.replace(/()\\)|\\(|-|\\s/g, \"\");\n\n if ((/\\(/g.test(str) == true && /\\)/g.test(str) == false ||\n /\\)/g.test(str) == true && /\\(/g.test(str) == false) || (strCleaned.length < 10 || strCleaned.length > 12) ||\n ((strCleaned.length == 12 || strCleaned.length == 11) && strCleaned[0] != 1) || (str.split(\" \")[0] > 1 && str.split(\" \").length > 1) || (str[0] == \"-\" || str.slice(\n str.search(/\\(/g), str.search(/\\)/g)).length > 4\n )\n ) {\n return false;\n }\n return true;\n}", "function bracket(value) {\n const len = value.length;\n if (len >= 2 && value[0] === \"(\" && value[len - 1] === \")\") {\n return value;\n }\n return `(${value})`;\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 lex(input) {\n let stack = [];\n let token = '';\n for (const char of input) {\n if (isParen(char) || isNotOperatorAlias(char)) {\n if (token !== '') {\n stack.push(token);\n token = '';\n }\n stack.push(char);\n } else if (char === ' ') {\n if (token !== '') {\n stack.push(token);\n token = '';\n }\n } else {\n token += char;\n }\n }\n if (token !== '') {\n stack.push(token);\n }\n\n // Convert operators to lower case.\n stack = stack.map(token => {\n if (isOperator(token.toLowerCase())) {\n return token.toLowerCase();\n } else {\n return token;\n }\n });\n\n return stack;\n}", "static validateUnaryOrBinaryString(expression) {\n FunctionUtils.validateArityAndAnyType(expression, 1, 2, returnType_1.ReturnType.String);\n }", "function oneOf(chars) {\n return function(input) {\n var match = new RegExp('[' + chars + ']');\n if(input.charAt(0).search(match) != -1) {\n return {rest: input.substr(1, input.length - 1),\n parsed: input.charAt(0),\n ast: input.charAt(0)};\n }\n else {\n return false;\n }\n };\n}", "function balanceParens(str) {\n // Counts opens - closed.\n let opens = 0;\n\n // First pass: Remove extra close-parens\n let firstPass = [];\n for (let char of str) {\n if (char === '(') {\n opens += 1;\n firstPass.push('(');\n } else if (char === ')') {\n if (opens === 0) {\n // We have to remove this character\n } else {\n opens -= 1;\n firstPass.push(')');\n }\n } else {\n firstPass.push(char);\n }\n }\n\n // Second pass: remove extra open-parens\n let output = [];\n for (let char of firstPass) {\n if (opens > 0 && char === '(') {\n // Remove this one\n opens -= 1;\n } else {\n output.push(char);\n }\n }\n\n return output.join('');\n}", "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 parseParenthesizedExpression(smiles, ctx) {\n\t var firstChar = smiles[0];\n\t var rest = smiles.slice(1);\n\t if (firstChar === \"(\") {\n\t var newCtx = _extends({}, ctx, { parens: ctx.parens + \"(\" });\n\t // increment the branch index\n\t newCtx = _inc(ctx, [\"idx\", ctx.idx.length - 1, 1]);\n\n\t var inBranchIdx = -1;\n\t if (ctx.idx[ctx.idx.length - 1][0] % 2 === 0) {\n\t // HACK(colin): this is so that we preserve the odd/even series in\n\t // indices in branches; the layout engine uses this to select\n\t // angles, and if we don't do this, editing one part of a molecule\n\t // can cause another to flop around oddly.\n\t // TODO(colin): this should just start at 0 all the time, and the\n\t // layout engine should figure out continuity.\n\t inBranchIdx = 0;\n\t }\n\t var parenCtx = _extends({}, newCtx, {\n\t idx: newCtx.idx.concat([[inBranchIdx, 0]]),\n\t parens: newCtx.parens.concat(\"(\")\n\t });\n\t var parenExpr = parse(rest, parenCtx);\n\t var remainder = parse(sliceFromMatchingCloseParen(rest, [\"(\"]), newCtx);\n\t return [parenExpr].concat(remainder);\n\t } else if (firstChar === \")\") {\n\t if (ctx.parens[ctx.parens.length - 1] !== \"(\") {\n\t throw new ParseError(\"Mismatched parentheses\");\n\t }\n\t return null;\n\t } else {\n\t throw new ParseError(\"Invalid bare character: \" + firstChar);\n\t }\n\t}", "function ab_Check(str)\n {\n return (/a...b/).test(str) || (/b...a/).test(str);\n }", "function isBalanced(str) {\n let brackets = str.replace(/[^\\(|\\)]/g, '');\n let count = 0;\n\n for (let i = 0; i < brackets.length; i += 1) {\n if (brackets[i] === '(') {\n count += 1;\n } else if (brackets[i] === ')') {\n count -= 1;\n }\n\n if (count < 0) {\n break;\n }\n }\n\n return count === 0;\n}", "function expressionIsComplete() {\n return !(left === \"\" || right === \"\" || operator === \"\"); \n}" ]
[ "0.7333383", "0.6978718", "0.6918531", "0.69021803", "0.68431556", "0.68228406", "0.68226886", "0.6651047", "0.66356325", "0.65786415", "0.6535797", "0.6478315", "0.6451493", "0.63995856", "0.63649476", "0.63547367", "0.62954086", "0.62896013", "0.6282761", "0.62640125", "0.6130375", "0.6084211", "0.6041129", "0.6033105", "0.6018361", "0.5954298", "0.590516", "0.5902197", "0.587762", "0.5876198", "0.583079", "0.5820886", "0.58146703", "0.5806254", "0.58008236", "0.5778975", "0.57766753", "0.5773441", "0.5769751", "0.57675016", "0.5748787", "0.57029796", "0.56948185", "0.56902903", "0.5675984", "0.56753546", "0.56731105", "0.564068", "0.5614324", "0.56073457", "0.5602495", "0.55880654", "0.5587952", "0.5579452", "0.55499196", "0.55357534", "0.5527514", "0.55199915", "0.5516339", "0.54932916", "0.54729533", "0.54565656", "0.54565656", "0.5439345", "0.5437096", "0.5432741", "0.5415847", "0.54157573", "0.54096204", "0.54074574", "0.5406465", "0.53914577", "0.53898185", "0.5387534", "0.5363134", "0.5362997", "0.5355023", "0.53538746", "0.5348462", "0.5336883", "0.53213704", "0.53127104", "0.53057075", "0.53024524", "0.52849084", "0.5266911", "0.52656746", "0.5262986", "0.5258366", "0.5251224", "0.52330494", "0.5213955", "0.5213422", "0.5200189", "0.51996803", "0.5195222", "0.51740605", "0.517127", "0.5144543", "0.5141585" ]
0.6675185
7
Can be solved using frequency Counter trying to solve via pointer approach
function noOfUniqueValues(arr){ let i=0; for(let j=1;j<arr.length;j++){ if(arr[j]!==arr[i]){ i++; arr[i]=arr[j] } } return i+1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countFreq() {\n diceFreq.fill(0);\n diceResults.forEach((el) => diceFreq[el - 1]++);\n}", "calculate_frequencies(node, choice, count) {\n let updates = 0;\n let freq = [];\n let arr = (choice === 0) ? node.row : (choice === 1) ? node.col : node.sqr;\n\n if (node.solved) {\n freq[node.value] = { solved: true };\n }\n else {\n add_all_possibles(node);\n }\n\n arr.forEach(index => {\n let sub_node = this.nodes[index];\n\n if (sub_node.solved) {\n freq[sub_node.value] = { solved: true };\n return;\n }\n\n add_all_possibles(sub_node);\n });\n\n for (var i = 1; i < freq.length; i++) {\n if (freq[i] == undefined) continue;\n if (!freq[i].solved && freq[i].indices.length === 1) {\n //console.log(`Index:${freq[i].indices[0]} is now ${i}`);\n updates++;\n if (!count) {\n this.nodes[freq[i].indices[0]].solve(i);\n this.propagate_update(freq[i].indices[0]);\n }\n }\n }\n\n return updates;\n\n function add_all_possibles(node) {\n node.possibles.forEach(pos => {\n if (freq[pos] == undefined) {\n freq[pos] = {\n indices: [node.index],\n solved: false\n }\n }\n else if (!freq[pos].solved) {\n freq[pos].indices.push(node.index);\n }\n });\n }\n }", "function frequencyCounter(arr){\n\n return arr.reduce((accum, next) =>{\n accum[next] = (accum[next] || 0) + 1;\n return accum\n }, {});\n}", "function calculateFrequencyDistribution(arr) {\n return arr.reduce((op, inp) => {\n op[inp] = op[inp] || 0;\n op[inp]++;\n return op;\n }, {})\n }", "function frequencyTable(arr){\n\n}", "function op1(map, val) { // O(1)\n // insert the val into the map \n // if the val already exists in the map\n // now also have to update the frequencies map \n if (map[val]) { \n // check if map[val] we need to decrement the\n // frequency of map[val]\n // increment its value \n map[val]++;\n // increment frequecy of map[val] in the frequency map\n } else {\n // otherwise, add it to the map with a value of 1\n map[val] = 1;\n // add map[val] to our frequencies map \n }\n}", "function getFreq(key) {\n return Math.pow(2, (key-49)/12) * 440;\n }", "function same_refractor(arr1, arr2) {\n\tlet freq1 = {};\n\tlet freq2 = {};\n\n\t// Adding to the keys each value of the arr1\n\t// with the value being the frequency\n\tfor (let i of arr1) {\n\t\tfreq1[i] = freq1[i] ? freq1[i] + 1 : 1;\n\t}\n\t// Same before but squared\n\tconsole.log(freq1);\n\tfor (let i of arr2) {\n\t\tfreq2[i] = freq2[i] ? freq2[i] + 1 : 1;\n\t}\n\tconsole.log(freq2);\n\n\t// Check if the result match\n\tfor (let key in freq1) {\n\t\t// 2**2 (4) exists in freq2?\n\t\tif (!freq2[key ** 2]) {\n\t\t\treturn false;\n\t\t}\n\t\t// Check freq the count\n\t\tif (freq1[key] !== freq2[key ** 2]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function byCount(arr) {\n var itm,\n a = [],\n L = arr.length,\n o = {};\n\n for (var i = 0; i < L; i++) {\n itm = arr[i];\n if (itm !== 0 && !itm) continue;\n if (o[itm] === undefined) o[itm] = 1;else ++o[itm];\n }\n\n for (var p in o) {\n a[a.length] = {\n item: p,\n frequency: o[p]\n };\n }\n\n return a.sort(function (a, b) {\n return o[b.item] - o[a.item];\n });\n } //function byCount", "function generateFrequencies()\n{\n\tfor(var note = 0; note < 127; ++note)\n\t{\n\t\tconst a = Math.pow(2,1.0/12.0); // comments pls\n\t\tFREQUENCIES[note] = 440 * Math.pow(a, note - 81);\n\t}\n}", "function registerFrequency(frequency){\n\n\t// need to store frequency in a data structure that allows O(1) look up on the phase and\n\t// the counts of repeats, there are two separate JS objects being used to achieve this.\n\t// There is an inherent need to ensure that these two data structures are kept in sync for\n\t// the relationships between them to remain true.\n\n\t// Does the passed frequency exist in the store yet?\n\tif (frequenciesSeen[frequency]) {\n\n\t\tlet countPassedFrequencySeen = frequenciesSeen[frequency];\n\n\t\t// Remove the frequency from the repeatsOfFrequencies Object for the current frequency count\n\t\t\n\t\t// If present in the repeatsOfFrequencies object already remove it\n\t\tif (repeatsOfFrequencies[countPassedFrequencySeen] && repeatsOfFrequencies[countPassedFrequencySeen][frequency]) {\n\t\t\tdelete repeatsOfFrequencies[countPassedFrequencySeen][frequency]\n\t\t}\n\n\t\t// Increment the value for passed frequency in the store\n\t\tfrequenciesSeen[frequency] = frequenciesSeen[frequency] + 1;\n\n\n // Create object for the current count if it does not exist\n if (!repeatsOfFrequencies[countPassedFrequencySeen]) {\n repeatsOfFrequencies[countPassedFrequencySeen] = {};\n }\n\n // Add to repeatsOfFrequencies object\n\t\trepeatsOfFrequencies[countPassedFrequencySeen][frequency] = {egg: true};\n\n console.log(`seen ${frequency} at least twice now...`)\n\n\t} else {\n\t\t// Add passed frequency to the store\n\t\tfrequenciesSeen[frequency] = 1;\n\n\t\t\n\n\t}\n\n}", "function _updateFrequency (f) {\n\t\t\n\t}", "function frequency() {\n let freq = [0, 0, 0, 0, 0, 0, 0];\n for (let i = 0; i < 7; i++) {\n for (let j = 0; j < dice.length; j++) {\n if (dice[j].value == i) {\n freq[i]++;\n }\n }\n }\n return freq;\n}", "function sameFrequency(int1, int2) {\n\n\n let freqObj = {};\n let arr1 = int1.toString().split('');\n let arr2 = int2.toString().split('');\n let value;\n\n \n if (!arr1 || !arr2) {\n return false;\n }\n else if (arr1.length !== arr2.length) {\n return false;\n }\n \n // Step 1\n for( let key in arr1) {\n value = arr1[key];\n freqObj[value] = (freqObj[value] || 0) + 1;\n }\n\n // console.log(freqObj);\n\n // Step 2\n for (let key in arr2) {\n value = arr2[key];\n freqObj[value]--;\n if (freqObj === -1) {\n return false;\n } \n }\n\n console.log(freqObj);\n\n // Step 3\n for (let key in freqObj) {\n if (freqObj[key] !== 0) {\n return false;\n }\n }\n\n return true;\n}", "function sortedFrequency(arr, target){\n\tlet first = findFirstLastOccurances(arr, target);\n\tif(first === -1) return - 1;\n\n\tlet last = findFirstLastOccurances(arr, target, false)\n\treturn last - first + 1;\n}", "function freq(arr) {\r\n var n = arr.length;\r\n var i, j, l;\r\n var frequency = 0;\r\n for (i = 0; i < n; i++) {\r\n l=0;\r\n for (j = 0; j < n; j++) {\r\n if (arr[i] == arr[j])\r\n l++;\r\n }\r\n if (frequency < l)\r\n frequency = l;\r\n \r\n }\r\n document.write(frequency);\r\n}", "function mapFreq(i){\n // var freq = i * SAMPLE_RATE / FFT_SIZE;\n var freq = i * SAMPLE_RATE / self.spectrum.length;\n return freq;\n }", "function frequencyQueries2(queries) {\n let collection = {};\n let results = [];\n let frequency = {}\n for(const [idx,q] of Object.entries(queries)) {\n // console.log(\"idx\", idx)\n if(q[0] === 1) {\n // 1 = insert x \n !collection[q[1]] ? collection[q[1]] = 1 : collection[q[1]] += 1\n frequency[collection[q[1]]] = [q[1]]\n }\n else if(q[0] === 2) {\n // 2 = delete y\n collection[q[1]] > 0 ? collection[q[1]] -= 1 : false\n }\n else if(q[0] === 3) {\n let myresult = 0;\n if(frequency[q[1]]){\n myresult = 1\n }\n results.push(myresult)\n }\n }\n console.log(\"SOLVED?\", results.join(', '))\n return results\n}", "function frequent(){\n var arr1=document.getElementById(\"demo\").value;\n var mf = 1;\n var m = 0;\n var item;\n for (var i=0; i<arr1.length; i++)\n {\n for (var j=i; j<arr1.length; j++)\n {\n if (arr1[i] == arr1[j])\n m++;\n if (mf<m)\n {\n mf=m; \n item = arr1[i];\n }\n }\n m=0;\n }\n document.getElementById(\"ans2\").innerHTML = (item+\" ( \" +mf +\" times ) \") ;\n}", "function myFunction() {\n let arr = [10,10,9,4,7,6,5,2,3,2,1];\n\n let index = findFrequency(arr);\n console.log(index);\n}", "function RansGetCumulativeFreq(R, bits) {\n return R & ((1<<bits)-1)\n}", "function freqQuery(queries) {\n // create the create function \n // init an array for our answers\n const answers = []; \n // use an object for our data structure \n const map = {};\n // have a frequencies map that stores frequencies \n // as keys and # of occurrences of those freqs\n // as values (to handle collision) \n const frequencies = {};\n // assume we have those three helper functions defined \n // loop through the queries O(n)\n for (let i = 0; i < queries.length; i++) {\n const op = queries[i][0];\n const val = queries[i][1];\n​\n // if currentQuery[0] === 1\n if (op === 1) {\n // insert x into our data structure\n // call our insert helper function \n op1(map, val);\n } else if (op === 2) {\n // if currentQuery[0] === 2\n // call our delete helper function \n op2(map, val);\n } else { // O(n^2)\n // if currentQuery[0] === 3 \n // call our checkFrequency helper function\n answers.push(op3(map, val)); // O(1)\n }\n }\n // return our answers array \n return answers; \n}", "function frequent(input) {\n let maximum = 0;\n let value = input[0];\n let hashmap = {};\n for (let i = 0; i < input.length; i++) {\n let element = input[i];\n if (hashmap[element]) {\n hashmap[element] += 1;\n if (hashmap[element] > maximum) {\n maximum = hashmap[element];\n value = element;\n }\n } else {\n hashmap[element] = 1;\n if (hashmap[element] > maximum) {\n maximum = hashmap[element];\n value = element;\n }\n }\n }\n console.log(hashmap);\n return value + \" ( \" + maximum + \" times )\";\n}", "function generateFrequencyLookup() {\n\n var i, j, note, NOTE_PREFIXES, NOTE_DISTANCES, NUMBER_OF_OCTAVES, lookUpTable = {};\n\n NUMBER_OF_OCTAVES = 10;\n\n NOTE_PREFIXES = ['C', 'C#', 'Db', 'D', 'D#', 'Eb', 'E', 'F', 'F#', 'Gb', 'G', 'G#', 'Ab', 'A', 'A#', 'Bb', 'B'];\n\n NOTE_DISTANCES = [-9, -8, -8, -7, -6, -6, -5, -4, -3, -3, -2, -1, -1, 0, 1, 1, 2];\n\n for (i = 0; i < NUMBER_OF_OCTAVES; i += 1) {\n for (j = 0; j < NOTE_PREFIXES.length; j += 1) {\n note = NOTE_PREFIXES[j] + i;\n lookUpTable[note] = Math.round(440 * Math.pow(2, i - 4 + NOTE_DISTANCES[j] / 12));\n }\n }\n\n return lookUpTable;\n\n }", "function mostFrequent(arr) {\n \n \n \n}", "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "_calculateTermFrequencies() {\n this._termFrequencies = new Map();\n this._words.forEach(word => {\n if (this._termFrequencies.has(word)) {\n this._termFrequencies.set(word, this._termFrequencies.get(word) + 1);\n } else {\n this._termFrequencies.set(word, 1);\n }\n });\n }", "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function mapFreq( i ) {\n // var freq = i * SAMPLE_RATE / FFT_SIZE;\n var freq = i * self.SAMPLE_RATE / self.spectrum.length;\n return freq;\n }", "buildCountMatrix() {\n // only consider words that occur more than once\n this.rawWords = Object.keys(this.dictionary).filter(word => this.dictionary[word].length > 1)\n this.rawWords.sort()\n\n console.log('this.rawWords', this.rawWords)\n // zero array\n this.A = Array(this.rawWords.length).fill().map(() => Array(this.documentCount).fill(0))\n\n this.rawWords.map((word, i) => {\n for (let k = 0; k < this.dictionary[word].length; k++) {\n const doc_i_k = this.dictionary[word][k];\n this.A[i][doc_i_k]++;\n }\n })\n console.log('this.A', this.A);\n\n this.tfIdf()\n }", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function freqCounter(str) {\n const freq = new Map();\n\n for (let el of str) {\n let elCount = freq.get(el) || 0;\n freq.set(el, elCount + 1);\n }\n return freq;\n}", "function mostFreqFunc(arr) {\n let firstCounter = 1;\n let realNumber = \"none\";\n // let compareNumber;\n for (let i = 0; i < arr.length; i++) {\n let counter = 0;\n for (let j = 0; j < arr.length; j++) {\n if (arr[i] === arr[j]) counter++;\n }\n if (counter > firstCounter) {\n firstCounter = counter;\n realNumber = arr[i];\n }\n else if (counter === firstCounter && counter !== 1 && realNumber !== arr[i]) {\n realNumber = \"none, there are many freq numbers\";\n }\n }\n console.log(`The most freq number is ${realNumber}`);\n console.log(`---------------------`);\n}", "function incrementCounter() {\n for (var i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function stringFrequency(){\n for(var i = 0; i < strLength; i++){\n frequencyMap.set(splitStrings[i], 0);\n }\n \n for(var i = 0; i < strLength; i++){\n if(frequencyMap.get(splitStrings[i]) === 0){\n uniqueWords.push(splitStrings[i]);\n }\n frequencyMap.set(splitStrings[i],\n frequencyMap.get(splitStrings[i]) + 1);\n }\n \n console.log(frequencyMap);\n return null;\n }", "function frequenceElements(array, K) {\n\n //hashmap strategy with Linear Space & Time Complexity\n\n /**\n * frequency = {1: 3, 6: 3, 2:1}\n * bucket= [null, [2],[1,6], null]\n */\n\n let frequency = {};\n let bucket = [];\n let results = [];\n\n //here I the frequence hashmap and create the bucket\n array.forEach((val, i) => {\n if (frequency[val]) {\n frequency[val] += 1;\n }else {\n frequency[val] = 1;\n bucket[i+1] = null;\n }\n });\n\n //here I organize the items inside the bucket\n for (i in frequency){\n if (!bucket[frequency[i]]){\n bucket[frequency[i]] = [i];\n }else {\n bucket[frequency[i]].push(i);\n }\n }\n\n //now I should organize the output of some items\n for (let i = bucket.length; i > 0, results.length < K; i--) {\n if (bucket[i] != null) {\n results.push(...bucket[i]);\n }\n }\n\n return results;\n}", "function largeStraightPoints() {\n let freq = frequency();\n for (let i = 2; i < freq.length; i++) {\n if (freq[i] != 1) {\n return 0;\n\n }\n }\n return 20;\n}", "function wordCountEnginePt2(document) {\n // your code goes here\n const frequencyCnt = {};\n document\n .toLowerCase()\n .split(' ')\n .forEach((word, index) => {\n word = word.replace(/[^a-z]/gi, '');\n if (word) {\n if (frequencyCnt[word]) {\n frequencyCnt[word] = {\n count: frequencyCnt[word].count + 1,\n index: Math.min(index, frequencyCnt[word].index),\n };\n } else {\n frequencyCnt[word] = { count: 1, index };\n }\n }\n });\n\n // [[word, {index, count}]]\n const returnArr = Object.keys(frequencyCnt).map(key => [\n key,\n frequencyCnt[key],\n ]);\n returnArr.sort(([_a, a], [_b, b]) => {\n if (b.count === a.count) {\n return a.index - b.index;\n } else {\n return b.count - a.count;\n }\n });\n\n return returnArr\n .map(innerArr => innerArr)\n .map(([key, { count }]) => [key, `${count}`]);\n}", "function ReferenceCounter() {\r\n}", "function findMode(arr) {\n let freqCounter = createFrequencyCounter(arr);\n let count = 0;\n let mostFrequent;\n\n for (let key in freqCounter) {\n //if value of key is more than count\n if (freqCounter[key] > count) {\n mostFrequent = key;\n count = freqCounter[key]\n }\n }\n return +mostFrequent;\n}", "function calculateIndex(){\n orig_parahs = Object.assign([], parahs);\n for(let i=0; i<parahs.length; i++){\n //remove special characters and convert to lower case\n var tempString = parahs[i].replace(/[123]|[`~!@#$%^&*()_|+\\-=?;:'\",.<>\\{\\}\\[\\]\\\\\\/]/gi, '');\n parahs[i] = tempString.toLowerCase();\n }\n\n //for each paragraph, update word_count with the frequency of words\n for(let [count, doc] of parahs.entries()){\n word_count = {};\n wordlist = doc.split(' ');\n wordCount();\n //use word_count for the paragraph to add/update frequency and occurrence of index[word]\n for(let [c,word] of wordlist.entries()){\n if(get(index, word, \"false\")===\"false\"){\n var freq = word_count[word];\n var idp = Object.keys(document_id)[count];\n //index is of the form {word:{freq:doc_id}}\n index[word] = {};\n index[word][freq] = idp;\n }\n else{\n var freq = word_count[word];\n var idp = Object.keys(document_id)[count];\n index[word][freq] = idp;\n }\n }\n }\n}", "function storeNumberOfOccurrencesInAWord(text){\r\n\tvar my_array=text.split(\" \");\r\n\tvar freqDict=new Dictionary();\r\n\tfor(var i=0;i<my_array.length;i++)\r\n\t{\r\n\t\tif(freqDict.find(my_array[i])==undefined)\r\n\t\t{\r\n\t\t\tfreqDict.add(my_array[i],1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tfreqDict.add(my_array[i],freqDict.find(my_array[i])+1);\r\n\t\t}\t\r\n\t\t\r\n\t}\r\n\treturn freqDict;\r\n\r\n}", "function findMode(arr) {\n let freqCounter = createFrequencyCounter(arr);\n \n let count = 0;\n let mostFrequent;\n \n for (let key in freqCounter) {\n if (freqCounter[key] > count) {\n mostFrequent = key;\n count = freqCounter[key];\n }\n }\n \n return +mostFrequent;\n }", "function doTF(tf)\r\n{\r\n termfrequency = {};\r\n var word = tf.split(' '); // individual words\r\n var count=0;\r\n \r\n for(var i = 0;i<tf.length;i++)\r\n {\r\n if(termfrequency.hasOwnProperty(word[i]))\r\n {\r\n // the word is already in the database:\r\n termfrequency[word[i]]++;\r\n arrfrequency++;\r\n }\r\n else\r\n {\r\n // the word is new:\r\n termfrequency[word[i]]=1;\r\n arrfrequency++;\r\n \r\n }\r\n for (var j = 0; j < arr.length; j++) {\r\n if (arr[j] == word[i]) {\r\n count++;\r\n } }\r\n}\r\n \r\n \r\n \r\n console.log(termfrequency);\r\n console.log(arrfrequency);\r\n console.log(word);\r\n console.log(count); \r\n return count;\r\n }", "updateFrequency(event) {\n if (event.type == 'mousedown' || event.type == 'mousemove') {\n this.calculateFrequency(event.x, event.y);\n mouse.x = event.x;\n mouse.y = event.y;\n } else if (event.type == 'touchstart' || event.type == 'touchmove') {\n let touch = event.touches[0];\n this.calculateFrequency(touch.pageX, touch.pageY);\n mouse.x = touch.pageX;\n mouse.y = touch.pageY;\n }\n }", "function track(match) {\n return counters[match] = (counters[match] || 0) + 1;\n }", "function compareFrequency(a, b) {\n //Compare the frequency of each array item\n //from the previous item\n return frequency[b] - frequency[a];\n }", "function difFreqChecker(a, b){\n\n // we create a result object of comparing a to b, and initialize our count at 0\n let results = freqDigits(a,b), result = 0;\n\n // for each key in our results\n Object.keys(results).forEach(function (key){\n\n // if the value of each key !== 0\n if (results[key] !== 0){\n\n // add the value of that key (which represents how many did not repeat) \n // to our result counter\n result += results[key];\n }\n });\n\n // return our result counter\n return result;\n}", "function counter() {\n return counter.count++; // counter++;\n }", "function frequencyQueries(queries) {\n let collection = {};\n let results = [];\n let max_freq = 0; // this is used to minimize the execution frequency of the nested for loop.\n\n // option 2\n for(const [idx,q] of Object.entries(queries)) {\n // console.log(\"idx\", idx)\n if(q[0] === 1) {\n // 1 = insert x \n !collection[q[1]] ? collection[q[1]] = 1 : collection[q[1]] += 1\n if(collection[q[1]]>max_freq){\n max_freq = collection[q[1]]\n }\n }\n else if(q[0] === 2) {\n // 2 = delete y\n collection[q[1]] > 0 ? collection[q[1]] -= 1 : false\n }\n else if(q[0] === 3) {\n let myresult=0;\n if(q[1]<=max_freq){\n for(const el in collection){\n if(collection[el] === q[1]) {\n myresult = 1\n break\n }\n }\n }\n results.push(myresult)\n }\n }\n console.log(\"SOLVED?\", results.join(', '))\n return results\n}", "function ReadFrequencies1(src, F, C, shift) {\n // Initialise; not in the specification - implicit?\n for (var i = 0; i < 256; i++) {\n\tF[i] = new Array(256);\n\tC[i] = new Array(256);\n\tfor (var j = 0; j < 256; j++)\n\t F[i][j] = 0;\n }\n\n // Fetch alphabet\n var A = ReadAlphabet(src);\n\n // Read F[]\n for (var i = 0; i < 256; i++) {\n\tif (!A[i])\n\t continue\n\n\tvar run = 0;\n\tfor (var j = 0; j < 256; j++) {\n\t if (!A[j])\n\t\tcontinue\n\n\t if (run > 0) {\n\t\trun--\n\t } else {\n\t\tF[i][j] = src.ReadUint7();\n\t\tif (F[i][j] == 0)\n\t\t run = src.ReadByte();\n\t }\n\t}\n\n\tNormaliseFrequencies0_Shift(F[i], shift)\n\n\t// Compute C[] from F[]\n\tC[i][0] = 0;\n\tfor (var j = 0; j < 256; j++)\n\t C[i][j+1] = C[i][j] + F[i][j];\n }\n}", "function op2(map, val) { // O(1)\n // delete the val from the map \n // if the val already exists in the map\n if (map[val]) {\n // decrement the old frequency of map[val]\n // decrement its value \n map[val]--;\n // increment the new frequency in map[val]\n }\n // otherwise, we don't do anything \n}", "function incrementByOne (counter) {\n\n counter[0] += 1;\n\n for (i = 0; i < counter.length; i++){\n\n if (counter[i] > i){\n counter[i] = 0;\n counter[(i+1)] += 1;\n }\n }\n\n return counter;\n }", "function ReadFrequencies0(src, F, C) {\n // Initialise; not in the specification - implicit?\n for (var i = 0; i < 256; i++)\n\tF[i] = 0;\n\n // Fetch alphabet\n var A = ReadAlphabet(src);\n\n // Fetch frequencies for the symbols listed in our alphabet\n for (var i = 0; i < 256; i++) {\n\tif (A[i] > 0)\n\t F[i] = src.ReadUint7()\n }\n\n NormaliseFrequencies0_Shift(F, 12)\n\n // Compute C[] from F[]\n C[0] = 0;\n for (var i = 0; i <= 255; i++)\n\tC[i+1] = C[i] + F[i];\n}", "function setFrequency(val)\r\n{\r\n\tfrequency = val;\r\n}", "function charFreq(word) {\n var freqListing = {};\nvar charArray=word.split('');\nfor (var i = 0; i<charArray.length; i ++){\n if (freqListing[charArray[i]]){\n freqListing[charArray[i]]+=1;\n }else{\n freqListing[charArray[i]]=1;\n }\n}\nreturn freqListing;\n}", "function charFreq(input) {\n var frequencies = {}, i, len, c;\n \n for (i = 0, len = input.length; i < len; i++) {\n c = input[i];\n \n if (typeof frequencies[c] === \"number\") {\n frequencies[c] += 1;\n } else {\n frequencies[c] = 1;\n }\n }\n \n return frequencies;\n}", "function mostFrequent(buf) {\n let win = -1;\n // Frequency of appearance\n Object.keys(buf).forEach(key => {\n if (win == -1) {\n win = key;\n } else if (buf[key] > buf[win]) {\n win = key;\n }\n });\n //console.log(buf);\n return win;\n}", "increment() {\n this[$referenceCount]++;\n }", "function sortByFrequencyUseArr(arr){\n const frequency = {};\n \n arr.forEach(item => {\n frequency[item] = (frequency[item] || 0) + 1;\n });\n //console.log(frequency)\n\n let sortable = arr.map(item => [item, frequency[item]]);\n //console.log(sortable);\n\n sortable.sort((a, b) => {\n if (a[1] === b[1]) {\n return b[0] - a[0]\n } \n return a[1] - b[1]\n });\n //console.log(sortable);\n\n return sortable.map(s => s[0]);\n}", "function getFreq(node) {\n\t\t\tif (typeof node === \"string\") {\n\t\t\t\treturn chars[node];\n\t\t\t} else {\n\t\t\t\treturn node.freq;\n\t\t\t}\n\t\t}", "function f1(maxdiff) {\n // 1\n\n let cnt=0;\n\n let l1=0;\n let l2=0;\n let l3=0;\n\n while (l1 < mem[0] - 1) {\n\n if (dist(mem[l1+1], mem[l1+2]) <= maxdiff) {\n cnt += 1\n }\n\n l1 += 1\n }\n\n return cnt\n}", "function analyse_frequency()\r\n{\r\n var i, j, temp;\r\n\r\n for(i=0; i<25; i++)\r\n {\r\n for(j=i+1; j<=25; j++)\r\n {\r\n if(message[i] < message[j])\r\n {\r\n temp = message[j];\r\n message[j] = message[i];\r\n message[i] = temp;\r\n temp = character[j];\r\n character[j] = character[i];\r\n character[i] = temp;\r\n }\r\n }\r\n }\r\n\r\n for(i=0; i<25; i++)\r\n {\r\n for(j=i+1; j<=25; j++)\r\n {\r\n if(character[i] > character[j])\r\n {\r\n temp = english[j];\r\n english[j] = english[i];\r\n english[i] = temp;\r\n temp = character[j];\r\n character[j] = character[i];\r\n character[i] = temp;\r\n }\r\n }\r\n }\r\n\r\n var subs = document.querySelectorAll(\".substitute\");\r\n for(var i=0;i<26;i++)\r\n {\r\n subs[i].innerHTML = english[i];\r\n }\r\n substitution();\r\n}", "function fn(s) {\n\tvar freq = [];\n\t(function(n) {\n\t\twhile (n < 26) {\n\t\t\tfreq.push(0);\n\t\t\tn++;\n\t\t}\n\t})(0);\n\tvar current;\n\tvar dual;\n\tfor (let i = 0; i < s.length; i++) {\n\t\tif (i < s.length - 3 && s[i + 1] === '(') {\n\t\t\tcurrent = freq[s[i] - 1];\n\t\t\tcurrent += +s[i + 2];\n\t\t\tfreq[s[i] - 1] = current;\n\t\t\ti += 3;\n\t\t} else if (i < s.length - 2 && s[i + 2] === '#') {\n\t\t\t\n\t\t\tif (i < s.length - 5 && s[i + 3] === '(') {\n\t\t\t\tdual = s[i] + s[i + 1] - 1;\n\t\t\t\tcurrent = freq[+dual];\n\t\t\t\tcurrent += +s[i + 4];\n\t\t\t\tfreq[+dual] = current;\n\t\t\t\ti += 5;\n\t\t\t} else {\n\t\t\t\tdual = s[i] + s[i + 1] - 1;\n\t\t\t\tcurrent = freq[+dual];\n\t\t\t\tcurrent++\n\t\t\t\tfreq[+dual] = current;\n\t\t\t\ti += 2;\n\t\t\t}\n\n\t\t} else {\n\t\t\tcurrent = freq[s[i] - 1];\n\t\t\tcurrent++\n\t\t\tfreq[s[i] - 1] = current;\n\t\t}\n\t}\n\treturn freq;\n}", "function frequency () {\n return Math.floor(Math.random() * (200 - 20) + 20)\n}", "buildCountMatrix() {\n\t\t// only consider words that occur more than once\n\t\tthis.rawWords = _.keys(this.dictionary).filter(word => this.dictionary[word].length > 1)\n this.rawWords.sort()\n \n console.log('this.rawWords', this.rawWords)\n\t\t// zero array\n this.A = Array(this.rawWords.length).fill().map(() => Array(this.documentCount).fill(0))\n\n this.rawWords.map((word, i) => {\n for (let k = 0; k < this.dictionary[word].length; k++) {\n const doc_i_k = this.dictionary[word][k];\n this.A[i][doc_i_k]++;\n }\n\t\t})\n console.log('this.A', this.A);\n\n this.tfIdf()\n }", "function isPalindrome(string){\n string = string.toLowerCase().trim();\n let freq = new HashMap();\n\n for(let i=0; i<string.length; i++){ \n let letter = string.charAt(i);\n //console.log('this value', freq._slots[freq._findSlot(letter)]);\n if(freq._slots[freq._findSlot(letter)]){\n freq._slots[freq._findSlot(letter)].value++;\n } else {\n freq.set(letter, 1);\n }\n console.log(freq);\n }\n\n console.log(freq._slots.length);\n let count = 0;\n for(let j=0; j<freq._slots.length; j++){\n // console.log('this is inside the j for loop', freq._slots[j])\n if(freq._slots[j] !== undefined){\n //console.log('And again',freq._slots[j])\n if(freq._slots[j].value % 2 !== 0){\n count++\n }\n }\n }\n console.log(count)\n if(count >= 2){\n console.log('false');\n } else {\n console.log('true')\n }\n}", "function sameFrequency(int1, int2) {\n let int1Frq = frequencyCounter(int1);\n let int2Frq = frequencyCounter(int2);\n console.log(int1Frq, int2Frq);\n\n for(key of int1Frq.keys()){\n if(int2Frq.has(key) === false) return false;\n if(int1Frq.get(key) !== int2Frq.get(key)) return false;\n }\n\n return true;\n}", "function findFrequent(){\n//var myArray=[3, 'a', 'a', 'a', 2, 3, 'a', 3, 'a', 2, 4, 9, 3, 2, 2, 2, 3, 2]; \nvar myArray=[3, 'a', 'a', 'a', 6, 3, 'a', 3, 'a', 6, 4, 9, 6, 6, 2, 2, 3, 2, 'c']; \nvar mf = 1; \nvar m = 0; \nvar item; \nfor (var i=0; i<myArray.length; i++) \n{ \n\tfor (var j=i; j<myArray.length; j++) \n\t{ \n\t\tif (myArray[i] == myArray[j]) \n\t\t\tm++; \n\t\tif (mf<m) \n\t\t{ \n\t\t\tmf=m; \n\t\t\titem = myArray[i]; \n\t\t} \n\t} \n\tm=0; \n} \nalert(item+\" ( \" +mf +\" times ) \") ; \n}", "setFrequency(aFrequency) {\n this.frequency = aFrequency;\n }", "function getFreqFromChar(char){\n\treturn pitchSetHira[char.charCodeAt(0) % pitchSetHira.length]\n}", "getFrequency(note) {\n return 440 * Math.pow(2, (note - 69) / 12);\n }", "function mostFreq(node){\n let freq = new Map()\n let mostFreqKey = null\n let maxOccurance = -Infinity\n visit(node)\n \n function visit(node){\n if(!node) return \n visit(node.left)\n visit(node.right)\n const count = (freq.get(node.val) || 0) + 1\n\n if(count > maxOccurance) {\n mostFreqKey = node.val\n maxOccurance = count\n }\n freq.set(node.value, count)\n }\n\n return mostFreqKey\n}", "count() {}", "function most_frequent(arr) {\n console.log(\"Most frequently occuring item in arr\");\n\n var counter = 0, new_count, max_index, visit = [];\n\n for(var i = 0; i < arr.length; i++)\n visit.push(false);\n \n\n for(var i = 0; i < arr.length; i++)\n {\n\n if(visit[i] == false)\n {\n new_count = 1; // first case we meet\n visit[i] = true;\n\n for(var j = i+1; j < arr.length; j++)\n {\n\n if(arr[j] === arr[i]) // notice this line\n {\n new_count++; // increase upon match\n visit[j] = true;\n }\n }\n\n if(new_count > counter)\n {\n counter = new_count;\n max_index = i;\n }\n }\n }\n\n console.log(arr[max_index] + \" occurs \" + counter + \" times\");\n }", "function charFreq(str) {\n var freq = {};\nfor (var i=0; i<str.length;i++) {\n var character = str.charAt(i);\n if (freq[character]) {\n freq[character]++;\n } else {\n freq[character] = 1;\n }\n}\n\nreturn freq;\n}", "function solution2(S, P, Q) {\n // Take two. After some research, realizing I was prefix summing the wrong thing: we don't\n // care about the sum of impact values (all that matters for those is relative min),\n // but we DO care about the counts of each nucleotide (starting with the lowest impact ones)\n\n // Init result array and 2d prefix count array\n const pCounts = [[0],[0],[0]]; // tracks sums of A, C, G nucleotides (don't need highest T)\n const result = [];\n\n // Create prefix counts array, one set of nucleotide counts for each step along the sequence\n for (let i = 0; i < S.length; i++){\n\n // Copy the previous counts for this set of counts - only one will change, done below\n pCounts[0].push(pCounts[0][i]);\n pCounts[1].push(pCounts[1][i]);\n pCounts[2].push(pCounts[2][i]);\n\n // Increment the corresponding nucleotide counter\n switch (S[i]){\n case \"A\":\n pCounts[0][i+1] += 1;\n break;\n case \"C\":\n pCounts[1][i+1] += 1;\n break;\n case \"G\":\n pCounts[2][i+1] += 1;\n break;\n }\n }\n\n // Now that prefix counts are created, for each query,\n // check for differences of each type in the P-Q range,\n // starting from lowest impact value\n for(let i = 0; i < Q.length; i++){\n // Check for A's (impact 1) - any increases in the A counts in range P-Q\n if(pCounts[0][Q[i]+1] - pCounts[0][P[i]] > 0){\n result.push(1);\n } else if(pCounts[1][Q[i]+1] - pCounts[1][P[i]] > 0){\n result.push(2);\n } else if(pCounts[2][Q[i]+1] - pCounts[2][P[i]] > 0){\n result.push(3);\n } else result.push(4)\n }\n return result;\n}", "function compareFrequency(a, b) {\n return frequency[b] - frequency[a];\n }", "function countOccurrences(wordArr) {\n let wordObj = {};\n\n wordArr.forEach(word => {\n wordObj[word] = wordObj[word] || 0;\n wordObj[word] += 1;\n }) \n \n logOccurrences(wordObj);\n return undefined;\n}", "function count(a, b, c, d) {\n //0, i, 1, 0\n // i32\n let l0 = 0;\n // i32\n let l1 = a;\n\n while (l1 < b) {\n if(f1(c) <= d) l0 += 1\n\n f2();\n l1 += 1\n }\n\n return l0;\n}", "function count(arr) {\n let arr1 = [], arr2 = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (arr1[arr[i]]) {\n arr1[arr[i]]++;\n } else {\n arr1[arr[i]] = 1;\n }\n }\nconsole.log('arr1:', arr1);\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] > 0) {\n arr2.push(i);\n arr1[i]--;\n i--;\n }\n }\n\n return arr2;\n}", "function frequent(array){\n var counter = 0;\n var maxCounter = 0;\n var item;\n for(var i = 0; i < array.length; i++){\n for(var j = i; j < array.length; j++){\n if(array[i] === array[j]){\n counter++; // broj ponavljanja trenutnog elementa\n }\n }\n if(counter > maxCounter){\n item = array[i]; //nalazi najcesci element areja\n maxCounter = counter; // broji ponavljanja najcesceg elementa\n }\n counter = 0; // resetujemo counter da ne bi racunao i pojave svih prethodnih elementa\n }\n return item;\n}", "calculateTermFrequency(term, doc) {\n let numOccurences = 0;\n for (let i = 0; i < doc.length; i++){\n if (doc[i].toLowerCase() == term.toLowerCase()){\n numOccurences++;\n }\n }\n return (numOccurences * 1.0 / (doc.length + 1))\n }", "function findFrequencies(song, e) {\n let arr = [];\n song.forEach(note => {\n frequencies.forEach(frequency => {\n if (note[0] === frequency[0]) {\n arr.push([note[0], frequency[1], note[1]]);\n }\n });\n });\n demo(arr, e);\n }", "setFrequency() {\r\n\r\n this.frequency = [];\r\n for (let i = 0; i < this.fftSize / 2; i++) {\r\n this.frequency[i] = i * this.sampleRate / this.fftSize;\r\n }\r\n }", "function getCount(){\ncardCounts = [{'name':'-1', 'value':0}, {'name': '0', 'value':0}, {'name':'1', 'value':0}];\ndiscard.forEach(function(card) {\n val = countValues[card];\n val = parseInt(val);\n cardCounts[val+1].value++;\n})\n}", "getFrequency() {\n return this.frequency;\n }", "getFrequency() {\n return this.frequency;\n }", "function frequencySort(s) {\n\t\n}", "function smallStraightPoints() {\n let freq = frequency();\n for (let i = 1; i < freq.length - 1; i++) {\n if (freq[i] != 1) {\n return 0;\n }\n }\n return 15;\n}", "function mostFrequentItem (arr) {\n\n var input = arr.sort()\n var freq = 1\n for (var i = 0 ; i < input.length ; i++)\n if(input[i] === input [i+1]){\n var total = (input.lastIndexOf(input[i])-input.indexOf(input[i]))+1\n if (total>freq)\n {\n freq = total;\n mostFreq = input[i]\n i = input.lastIndexOf(input[i])+1\n }\n }\n\n // return (mostFrequnetItem + \"(\" + mostFrequnet+\" times)\"\n return (mostFreq + \" (\" + total+\" times)\")\n}", "function freq(array) {\n let mostFreq = 1;\n let count = 0;\n let el;\n for (let i = 0; i < array.length; i++) {\n for (let j = i; j < array.length; j++) {\n if (array[i] === array[j]) {\n count++;\n }\n if (mostFreq < count) {\n mostFreq = count;\n el = array[i];\n }\n }\n count = 0;\n }\n return `${el} occurs ${mostFreq} times`;\n}", "function frequency(array) {\n\n var compare = 0; //We are going to compare using stored value\n var mostFrequent;\n var counter = 0\n\n for (var i = 0, len = array.length; i < len; i++) {\n var word = array[i];\n // check if word is new if so add to dict if not add to count\n if (counts[word] === undefined) {\n counts[word] = 1;\n } else {\n counts[word] = counts[word] + 1;\n }\n // if there is a new word with the highest value\n if (counts[word] > compare) {\n compare = counts[word];\n mostFrequent = array[i];\n }\n }\n return counts;\n}", "function getFrequencies(arr) {\n\tlet obj = {};\n\tarr.map(val => {\n\t\tif (!(val in obj)) {\n\t\t\tobj[val] = 1;\n\t\t} else {\n\t\t\tobj[val]++;\n\t\t}\n\t});\n\treturn obj;\n}", "function findMode(arr) {\n let itemCounter = {};\n for (let item of arr) {\n if (!itemCounter.hasOwnProperty(item)) {\n itemCounter[item] = 1;\n } else {\n itemCounter[item]++;\n }\n }\n let keys = Object.keys(itemCounter);\n let mode = keys[0];\n let frequents = [];\n for (let key of keys) {\n if (itemCounter[key] > itemCounter[mode]) {\n frequents = [];\n frequents.push(key);\n mode = key;\n } else if (itemCounter[key] == itemCounter[mode]) {\n frequents.push(key);\n }\n }\n console.log(itemCounter);\n return frequents;\n}", "function calculateKeyCapacityForChannel(imgInput, keys, channel) {\n\t//TODO maybe don't assume that channelOffset is channel - 1\n\tvar channelOffset = channel - 1;\n\tvar currPixel;\n\tfor (var i = 0; i < imgInput.data.length; i += 4) {\n\t\tcurrPixel = imgInput.data[i + channelOffset];\n\t\tfor (var j = 0; j < keys.length; j += 1) {\n\t\t\tif (currPixel >= keys[j].lowerBound && currPixel <= keys[j].upperBound) {\n\t\t\t\t//increment the frequency. if the frequency doesn't exist yet, set it to 1\n\t\t\t\tkeys[j].frequency = typeof keys[j].frequency === \"undefined\" ? 1 : keys[j].frequency + 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//sort the keys by ascending order of frequency\n\tkeys.sort(function(a, b) {\n\t\treturn a.frequency - b.frequency;\n\t});\n\t\n\t//now that the keys are in order, we can set their capacity\n\tfor(var i = 0; i < keys.length; i += 1) {\n\t\tkeys[i].capacity = i + 1;\n\t}\n\t\n\treturn keys;\n}", "function frequencyFor(event, journal) {\n let frequency = [0, 0, 0, 0];\n for (let i = 0; i < journal.length; i++) {\n let entry = journal[i], index = 0;\n if (entry.events.includes(event)) index += 1;\n if (entry.squirrel) index += 2;\n frequency[index] += 1;\n }\n return frequency;\n}", "function countUniqueValuesWithOnePointer(arr) {\n if (!arr.length) return 0;\n let counter = 1;\n\n for (let i = 0; i < arr.length - 1; i++) {\n if (arr[i] !== arr[i + 1]) counter++;\n }\n\n return counter;\n}", "function Counter() {\n // Note that it does not use 'this'!\n }" ]
[ "0.6646957", "0.6198939", "0.61736786", "0.6111287", "0.59843534", "0.5921587", "0.5836337", "0.5832837", "0.58219665", "0.5811309", "0.57978106", "0.57860434", "0.5733541", "0.5730377", "0.5725221", "0.5693766", "0.5684609", "0.5671703", "0.56406194", "0.5639945", "0.5635796", "0.5622028", "0.5616428", "0.5585562", "0.5563059", "0.5557369", "0.5557369", "0.5557369", "0.5553534", "0.55526114", "0.55435586", "0.55383724", "0.5536677", "0.5535817", "0.55042785", "0.5491623", "0.54881364", "0.5487017", "0.54816103", "0.54770374", "0.5458395", "0.54496163", "0.5447349", "0.54459405", "0.544021", "0.54142857", "0.5411816", "0.5403604", "0.5402984", "0.5385803", "0.53802377", "0.53800255", "0.5374605", "0.5356085", "0.53554314", "0.5347637", "0.5343458", "0.53370583", "0.5330535", "0.5329675", "0.5319665", "0.5309977", "0.53098124", "0.53048277", "0.5301844", "0.5292678", "0.52911514", "0.5287151", "0.52840614", "0.5264542", "0.526042", "0.5255951", "0.5254408", "0.5252066", "0.52420545", "0.52352047", "0.523148", "0.5230888", "0.5230029", "0.52289706", "0.5225145", "0.5221576", "0.52165127", "0.5212251", "0.5210511", "0.5202744", "0.51847833", "0.5183251", "0.51747066", "0.51747066", "0.5172315", "0.5172299", "0.5169826", "0.5168088", "0.5165032", "0.51558834", "0.51473665", "0.5146627", "0.5139882", "0.51338303", "0.5131226" ]
0.0
-1
TODO: Not fully implemented for POC
render() { return ( <div class="form-group"> <label class="label" for="features">Key features</label> { this.state.features.map( feature => ( <input class="input input--shortest input--feature" name="features" type="text" value={ feature } /> ))} <button class={style.features__button} onClick={ this.handleClick }>Add feature</button> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "protected internal function m252() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "obtain(){}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "transient protected internal function m189() {}", "transient final private internal function m170() {}", "__previnit(){}", "_firstRendered() { }", "static rendered () {}", "static rendered () {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "transient private protected public internal function m181() {}", "constructor () { super() }", "transient final private protected internal function m167() {}", "constructor () {\r\n\t\t\r\n\t}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "static transient final private internal function m43() {}", "constructor() {\n\n\t}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.61969167", "0.6143896", "0.6123826", "0.5969905", "0.5703632", "0.5662298", "0.56346583", "0.554736", "0.551884", "0.5475792", "0.5447084", "0.53429925", "0.53429925", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5332564", "0.5302173", "0.528007", "0.52567446", "0.52560806", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5252505", "0.5205789", "0.51984346", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849", "0.5173849" ]
0.0
-1
notify parent that tween has ended
tweenHasEnded (characterUID) { // console.warn(`tweenHasEnded HAPPY GO LUCKY ${characterUID}`); if (this.props.onTweenFinish) { this.props.onTweenFinish(characterUID); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "notifyAnimationEnd() {}", "function TweenComplete() {\n tweenSlide.eventComplete(function () {\n // Reset 'style' & 'transform' for slide\n that.ResetTFSlideCss();\n // Update the variable in toggle-end\n that.TOSLIDE.End();\n fxCSS.status = null;\n });\n }", "onAnimationEnd() {\n\n }", "endTraj( obj ){\n this.scene.event.compareColor();\n obj.body.setVelocity(0)\n obj.setDepth(10)\n this.tweenStop = true;\n this.scene.event.tweenBg = false;\n\n this.scene.tweens.add({\n targets: obj,\n x: this.x,\n y: this.y,\n scale: 0,\n duration: 2000,\n ease: \"Power1\",\n // repeat: -1\n onComplete: (tween)=>{\n this.scene.tweens.add({\n targets: this.sprite3,\n scale: 10,\n duration: 3000,\n ease: \"Power1\",\n onComplete: (tween)=>{\n console.log(this.scene.level)\n this.scene.scene.start(\"Credit\");\n }\n });\n }\n });\n }", "function tween (opts, parent) {\n\n /* from opts.prop and parent we can call getParentObject and return the object we will target this function, from opts.prop\n * we can also get the propertyName to call ON the target object\n * * * */\n var target = getParentObject(opts.prop, parent),\n propName = getPropName(opts.prop);\n\n /* if */\n\n /* apply an add or subtract to the appropriate value on the reference object based the relationship\n * of its value compared to stop's value\n * * * */\n\n /* Subtract the delta time (time since last frame) from the duration in order to control the length of time\n * that this animation is alive\n * * * */\n parent.duration -= SceneManager.delta;\n\n /* If duration has run out then set animating to false and let the handler destroy the object that owns\n * this function\n * * * */\n if ( parent.duration <= 0 || !addOrSubtract(target, propName, opts, parent) ) {\n parent.mesh.isAnimating = false;\n parent.isAnimating = false;\n }\n\n}", "function _sh_switch_workspace_tween_completed( ){\n\tTweener.removeTweens( this );\n}", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "remove() {\n this.parent.removeTween(this);\n }", "transitionCompleted() {\n // implement if needed\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "gameWon() {\n this.wellDone.y = 0\n this.wellDone.visible = true\n var tween = this.add\n .tween(this.wellDone)\n .to({ y: 250 }, 1500, 'Bounce.easeOut', true)\n }", "function onEnd() {\n wrapper.classed( 'no-transition', true );\n wrapperNode.removeEventListener( 'transitionend', onEnd );\n }", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "function onEnd() {\n //console.log('' + this);\n scope.emit('end', this);\n }", "_animationDoneListener(event) {\n this._animationEnd.next(event);\n }", "end() {\n Object.assign(this.previousState, this.state); // Save the previous state\n this.state.inside = false;\n\n // Notify the nodes\n this.notify();\n }", "function _onAnimationEnd () {\n clearTimeout(transitionEndTimeout);\n $target.off(events);\n animationEnded();\n deferred.resolve();\n }", "onTransitionEnd() {\n this.nextKeyframe();\n }", "handleAnimationEnd(e) {\r\n\t\tthis.ended=true;\r\n\t\te.stopPropagation();\r\n\t\tif (this.props.onAnimateEnd) this.props.onAnimateEnd({\r\n\t\t\tcomponent:this,\r\n\t\t\tnativeEvent:e\r\n\t\t});\r\n\t}", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid garbage\n // collection during the animation and because the black box updates need it.\n if (this._oldContainer) {\n this._oldContainer.removeFromParent();\n this._oldContainer.destroy();\n this._oldContainer = null;\n }\n\n if (this._delContainer) {\n this._delContainer.removeFromParent();\n this._delContainer.destroy();\n this._delContainer = null;\n }\n\n // Fire ready event saying animation is finished.\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }", "onEnd() {\n\t\tthis.debug('onEnd');\n\t}", "function dragComplete() {\r\n if (!_endReached) {\r\n _scaleNum = 1;\r\n TweenMax.to($('#leverRedBall'), 1.5, { y: 0, scaleX: _scaleNum, scaleY: _scaleNum, ease: Expo.easeOut });\r\n TweenMax.to($('#leverPole'), 1.5, { rotationX: 0, transformPerspective: 1000, transformOrigin: \"50% 100%\" });\r\n }\r\n }", "handleAnimationEnd() {\n this.isAnimating = false;\n this.index = (this.index + 1) % this.greetings.length;\n\n setTimeout(() => this.updateGreeting(), 500);\n }", "onComplete() {\n this.stopAudio();\n if (this.chains > 0) {\n this.chains--;\n }\n if (this.debug) {\n console.log('Animation completed chains left: ', this.chains);\n }\n if (this.destroyOnComplete && this.chains === 0) {\n if (this.destroyDelay > 0) {\n if (this.debug) {\n console.log(`Wall will be removed after ${ this.destroyDelay } seconds`);\n }\n setTimeout(() => {\n this.disposeWall();\n }, this.destroyDelay * 1000);\n } else {\n this.disposeWall();\n }\n }\n }", "animationEnded(e) {\n // wipe the slot of our drawer\n this.title = \"\";\n while (dom(this).firstChild !== null) {\n dom(this).removeChild(dom(this).firstChild);\n }\n if (this.invokedBy) {\n async.microTask.run(() => {\n setTimeout(() => {\n this.invokedBy.focus();\n }, 500);\n });\n }\n }", "function animationCompleted()\n{\n // Remove the tick event listener.\n TweenMax.ticker.removeEventListener(\"tick\");\n\n // Reenable the test button.\n animationTest.disabled = false;\n}", "end(event) {\n\n }", "_onEnd() {}", "function updateToEnd()\n{\n for ( var i = 0; i < script.api.tweenObjects.length; i++)\n {\n var tweenObject = script.api.tweenObjects[i];\n\n var copiedValue = {\n \"r\": (script.loopType == 3) ? tweenObject.startValue.r : tweenObject.endValue.r,\n \"g\": (script.loopType == 3) ? tweenObject.startValue.g : tweenObject.endValue.g,\n \"b\": (script.loopType == 3) ? tweenObject.startValue.b : tweenObject.endValue.b,\n \"a\": (script.loopType == 3) ? tweenObject.startValue.a : tweenObject.endValue.a\n };\n\n updateColorComponent( tweenObject.component, copiedValue );\n }\n}", "onTranslationEnded() {\n }", "end() {\n this.cancel();\n this.callback();\n }", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "done() {\n this.calc();\n this.stop();\n\n this.el.fire('drawdone');\n }", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "fadeOut() {\n const self = this;\n // \"Unload\" Animation - onComplete callback\n TweenMax.to($(this.oldContainer), 0.4, {\n opacity: 0,\n onComplete: () => {\n this.fadeIn();\n }\n });\n }", "_update(time) {\n var i = this.tweens.length;\n while(i--) {\n // cache the current tween\n var tween = this.tweens[i];\n if ( tween && tween._update(time) === true ) {\n this.remove( tween );\n tween._onTweenerFinish();\n tween._prevTime = undefined;\n }\n }\n }", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function finished(ev){if(ev&&ev.target!==element[0])return;if(ev)$timeout.cancel(timer);element.off($mdConstant.CSS.TRANSITIONEND,finished);// Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n\tresolve();}", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "_onEndAnim() {\n if (this._indicator) {\n this._indicator.getParent().removeChild(this._indicator);\n this._indicator = null;\n }\n }", "onStop () {\n this.leave()\n }", "function transitionEnd() {\n\t\t\t\t\tif (bouncing) {\n\t\t\t\t\t\tbouncing = false;\n\t\t\t\t\t\treboundScroll();\n\t\t\t\t\t}\n\n\t\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\t}", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function finished(ev) {\n if (ev && ev.target !== element[0]) return;\n\n if (ev) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function completeOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n transitionComplete();\n }", "function completeOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n transitionComplete();\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._openAnimationDone(totalTime);\n }\n else if (toState === 'exit') {\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._openAnimationDone(totalTime);\n }\n else if (toState === 'exit') {\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "_onAnimEnd() {\n this._shape.removeIndicators();\n this._shape.setCoords(this._coords, this._baseCoords);\n }", "function endEvent(){}", "_onTweenerFinish () {\n this._setPlaybackState('stop');\n this._playbackComplete();\n }", "endGame(){\n score.addToScore(this.result, 'somejsontoken');\n this.scene.pause();\n const sceneEnd = this.scene.get('end');\n sceneEnd.scene.start();\n //this.scene.add(\"end\", new End(this.result));\n }", "function end() {\n this.removeEventListener('transitionend', end, false);\n var replies = this.querySelectorAll('.reply');\n\n for (var i = 0; i < replies.length; i++) {\n replies[i].style.transform = 'rotateX(0)';\n replies[i].style.opacity = 1;\n }\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "function end(event) {\n\t\t\t_moving = false;\n\t\t}", "fadeUp(){\n this.animating = true;\n const item = this.getItem({foreground:this.index})\n \n this.tween = fromTo(\n this.setArtToNextAndCloak(item),\n DISSOLVE_DURATION / 1000,\n {opacity:0},\n {opacity:1, ease:Power4.easeOut, onComplete:this.onFadeUpComplete}\n )\n \n }", "function onPlayerEnd () {\n\t\t\tfireMetricsEvent(0);\n\t\t}", "onFinish() {\n\t\tif (this.props.onFinish) {\n\t\t\tthis.props.onFinish();\n\t\t}\n\t}", "_onLoopEvent() {\n this._looped += 1;\n\n // Signal the state has finished\n if (this._looped === this._babylonLoopCount) {\n this._finished = this._babylonNumAnimations - 1;\n this._onFinishedEvent();\n }\n }", "end() {\n this.isOver = true;\n this.isRunning = false;\n\n if (typeof this.onGameOver === 'function') {\n this.onGameOver();\n }\n }", "function onSlideChangeEnd()\n\t{\n\t\tisAnimating = false;\n\t}", "finish() {\n this.done = true;\n }", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "setupTween() {\n this.tween = this.getInitialTweenInstance(this.wall.position);\n this.tween.onStart(() => {\n this.onStart();\n if (this.debug) {\n console.log('Animation start');\n console.log(this.tween);\n }\n if (this.wall.position.distanceTo(this.tween._valuesEnd) > 0) {\n this.playAudio();\n }\n });\n this.tween.onComplete(() => this.onComplete());\n }", "function fadeOut() {\n transitionPlane.emit('fadeOut');\n setTimeout(setBackwards, 100);\n}", "onMessageEnd() { }", "OnAnimationEnd() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "hideDialogue() {\n if(this.dialogueHidden) {\n return false;\n }\n\n this.tweens.add({\n targets: [this.dialogueFrame, this.dialogueMask],\n ease: 'Cubic',\n y: \"+=\" + this.dialogueFrame.height,\n duration: 300,\n onStart: () => {\n this.inTransition = true;\n },\n onComplete: () => {\n this.inTransition = false;\n this.dialogueHidden = true;\n this.checkBlock();\n }\n });\n\n }", "animateDepart() {\n if (defined(this._selectionIndicatorTween)) {\n if (!this._selectionIndicatorIsAppearing) {\n // Already disappearing, don't restart the animation.\n return;\n }\n this._selectionIndicatorTween.cancelTween();\n this._selectionIndicatorTween = undefined;\n }\n this._selectionIndicatorIsAppearing = false;\n\n var that = this;\n this._selectionIndicatorTween = this._tweens.add({\n startObject: {\n scale: 1.0,\n opacity: 1.0\n },\n stopObject: {\n scale: 1.5,\n opacity: 0.0\n },\n duration: 1.6,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n update: function(value) {\n that.opacity = value.opacity;\n that.transform = \"scale(\" + value.scale + \") rotate(0deg)\";\n that.updateStyle();\n },\n complete: function() {\n that._selectionIndicatorTween = undefined;\n },\n cancel: function() {\n that._selectionIndicatorTween = undefined;\n }\n });\n console.log('selectionIndicatorTween', this._selectionIndicatorTween);\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "static finish() {\n this.progress = 100;\n setTimeout(() => {\n this.bar.style.width = `${this.progress}%`;\n }, 100);\n setTimeout(() => {\n this.parent.style.height = '0px';\n }, 1000);\n }", "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }", "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }", "onBrushEnd() {\n this.resizing = false;\n this.stillValue = NaN;\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "endTransitionHandler(e) {\n if (this.active === true) {\n this.changeToDeactive();\n } else if (this.active === false) {\n this.transitionEndListenerOff();\n }\n }", "end() {\n this.status = 'finished';\n }", "onFinish() {}", "async onEnd() {\n\t\tawait this.say('Exiting...');\n\t}", "stop () {\n listener.end();\n }", "animateFill () {\n TweenMax.to(this, 1, {\n fillingProgress: 1,\n onComplete: event => {\n const tl = new TimelineMax({ delay: 2 })\n tl.to(this.fillingDotToLine, 1, { strokeWidth: 0 })\n tl.set(this, { fillingProgress: 0 })\n tl.set(this.fillingDotToLine, { strokeWidth: this.thickness })\n }\n })\n }", "function animateOut() {\n\n chartRing.selectAll('.chart-ring')\n .style('opacity', 1)\n .transition()\n .duration(DURATION)\n .delay(function (d, i) {\n return (DELAY + (i * 100));\n })\n .style('opacity', 0);\n }", "function onHarpoonContainerTweenChange(evt) {\n var theTween = evt.target;\n var theHarpoonContainer = theTween.target;\n for (var i = 0; i < enemies.length; ++i) {\n\n var pt = enemies[i].globalToLocal(theHarpoonContainer.x, theHarpoonContainer.y);\n\n if (enemies[i].hitTest(pt.x, pt.y)) {\n var splash = createjs.Sound.createInstance(\"splash\");\n splash.volume = splash.volume * .6;\n splash.play();\n\n // we hit the enemy... KILL IT!\n createjs.Tween.get(enemies[i], { override: true })\n .to({\n scaleX: 1.25,\n scaleY: 1.25\n }, 200)\n .to({\n scaleX: 1,\n scaleY: 1,\n rotation: 360\n }, 1000)\n\n .to({\n alpha: 0\n }, 100)\n\n .call(function (evt) {\n stage.removeChild(evt.currentTarget);\n stage.removeChild(theTween.target);\n Score = Score + 10;\n printScore();\n })\n .call(function () {\n spawnEnemy();\n })\n ;\n\n // remove it from the array\n enemies.splice(i, 1);\n // we removed an item from the array, fix the index so we dont skip checking any enemies.\n --i;\n\n }\n }\n }", "endTease() {\r\n this.endScript();\r\n this.cycler.end();\r\n }", "function drawCompleteNotify(transition, node) {\n if (transition.ease) {\n transition.each(\"end\", report);\n } else {\n report();\n }\n\n function report() {\n var eventInfo = {detail: {drawComplete:true}, bubbles:true};\n node.dispatchEvent(new CustomEvent(\"chart\", eventInfo));\n }\n }", "function endMove(event) {\n current.win.style.opacity = 1;\n }", "end() {\n this.endZoomInMode();\n this.endHandMode();\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "end() {\n this.log('end');\n }", "function onSlideChangeEnd()\n {\n isAnimating = false;\n }" ]
[ "0.74193245", "0.6730198", "0.65552783", "0.65159416", "0.64879155", "0.6447675", "0.6397675", "0.6158307", "0.6116692", "0.6091322", "0.60566294", "0.5942789", "0.5925302", "0.5907035", "0.58980256", "0.58743864", "0.58632576", "0.58577156", "0.5826781", "0.5821376", "0.57939875", "0.57862777", "0.5768261", "0.57516116", "0.57388085", "0.57199866", "0.5694603", "0.5692392", "0.56853545", "0.56650466", "0.56611294", "0.5653362", "0.56378007", "0.5614235", "0.5611506", "0.56097245", "0.5603234", "0.5557626", "0.555608", "0.55542785", "0.55319864", "0.55303985", "0.55293816", "0.5519683", "0.55116236", "0.55089056", "0.55089056", "0.5499716", "0.54967827", "0.54967827", "0.5490924", "0.54890287", "0.54890287", "0.54890287", "0.5478211", "0.5478211", "0.5452418", "0.54415673", "0.5421923", "0.5415691", "0.54103094", "0.54073477", "0.5392548", "0.53921884", "0.538791", "0.5381209", "0.5374647", "0.53708935", "0.53661656", "0.53650653", "0.53625095", "0.53608257", "0.5360221", "0.53556114", "0.5339977", "0.5334031", "0.53314465", "0.53301203", "0.5323949", "0.5323777", "0.5323777", "0.53141886", "0.5301934", "0.5301934", "0.5301934", "0.5301135", "0.5298091", "0.52907866", "0.52897394", "0.5288035", "0.5276563", "0.5271938", "0.52689177", "0.52674675", "0.52640885", "0.52637315", "0.5260388", "0.52548707", "0.5248225", "0.5223887" ]
0.67982423
1
Interacts with smart contract to buy PCT
async function buyPCT() { // Converts integer as Eth to Wei, let amount = await ethers.utils.parseEther(transAmount.toString()); try { await erc20.buyToken(transAmount, { value: amount }); // Listens for event on blockchain await erc20.on("PCTBuyEvent", (from, to, amount) => { setPendingFrom(from.toString()); setPendingTo(to.toString()); setPendingAmount(amount.toString()); setIsPending(true); }) } catch (err) { if (typeof err.data !== 'undefined') { setErrMsg("Error: " + err.data.message); } setIsError(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async approveCompound(){\n let spender = Compound.util.getAddress(Compound.cDAI, process.env.ETH_NETWORK);\n //spender = '0xF0d0EB522cfa50B716B3b1604C4F0fA6f04376AD'; //cDAI\n console.log('spender: ' + spender);\n let param = cDAI.methods().approve.call({ spender: spender, amount: '3000000000000000000' });\n //let address = '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa';//DAI\n let address = Compound.util.getAddress(Compound.DAI, process.env.ETH_NETWORK);\n console.log('address: ' + address);\n console.log(param);\n this.printInputData(param.data);\n console.log('data: ' + param.data);\n\n let parameter = {\n address: address,\n amount: param.amount,\n data: param.data\n };\n\n let currency = process.env.ETH;\n console.log('Start Bitgo SDK interaction');\n await this.bitgo.unlock();\n let transaction = await this.bitgo.sendBitGoTx([parameter], currency);\n await this.bitgo.lock();\n return transaction;\n }", "async function sellPCT() {\n\t\ttry {\n\t\t\tawait erc20.sellToken(transAmount);\n\t\t\t// Listens for event on blockchain\n\t\t\tawait erc20.on(\"PCTSellEvent\", (from, to, amount) => {\n\t\t\t\tsetPendingFrom(from.toString());\n\t\t\t\tsetPendingTo(to.toString());\n\t\t\t\tsetPendingAmount(amount.toString());\n\t\t\t\tsetIsPending(true);\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tif (typeof err.data !== 'undefined') {\n\t\t\t\tsetErrMsg(\"Error: \" + err.data.message);\n\t\t\t}\n\t\t\tsetIsError(true);\n\t\t}\n\t}", "function I(t,e){if(!s)var s=\"https://ambrpay.io/api\";var a=e,n=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(a||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var n=s+\"/smartContractAddresses\";return r.getRequest(n,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,n,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(n=e,!n.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=n.wallet?n.wallet:t.receiverWallet,!a.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==n.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==n.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==n.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)n.daysInterval=parseInt(t.interval);else if(-1==n.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=n.transferOut),n.acceptedCryptoCurrencies.Ethereum.price>0)return n.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=n.currencyCode){if(o<1)throw\"the minimum amount is \"+n.currencyCode+\" 1.00 \";return r.getExchangePrice(n.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*n.fee,c=1e18*c/1e18,a.utils.isAddress(n.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+n.priceLimitPercentage/100);return new Promise((function(t,i){var l=new a.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,n.daysInterval,a.utils.toWei(d.toString(),\"ether\"),u,a.utils.toWei(c.toString(),\"ether\")).send({value:a.utils.toWei(o.toString(),\"ether\"),gas:5e5,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(a){var c={subscriptionPlanId:n.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:a.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return a.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,a){var n=s+\"/price/\"+t+\"/\"+e+\"/\"+a;return r.getRequest(n)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var a=new XMLHttpRequest;a.open(\"GET\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){if(4==a.readyState&&200==a.status)return e(a.responseText);4==a.readyState&&200!=a.status&&s(a.responseText)},a.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,a){var n=new XMLHttpRequest;n.open(\"POST\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){4==n.readyState&&200==n.status?s(n.responseText):4==n.readyState&&200!=n.status&&a(n.responseText)},n.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==a&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(n)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var n=new a.eth.Contract(r.ABI.abi,r.contractAddress),i=n.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,a){if(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(n){return a.eth.getBalance(n,(function(n,r){if(n)return s(n);var i=a.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,n){var i=new a.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){n(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(n).send({value:a.utils.toWei(t),gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(a.utils.toWei(t)).send({gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "async function firstTx() {\n // counterfactual addresses\n const nonce = await buildNonceForAddress(dao, 0, provider);\n const newAddress = await calculateNewProxyAddress(dao, nonce);\n votingAggregator = newAddress;\n\n // function signatures\n const newAppInstanceSignature =\n 'newAppInstance(bytes32,address,bytes,bool)';\n const createSignature = 'createPermission(address,address,bytes32,address)';\n const grantSignature = 'grantPermission(address,address,bytes32)';\n const aggregatorInitSignature = 'initialize(string,string,uint8)';\n const addPowerSourceSignature =\n 'addPowerSource(address _sourceAddr, uint8 _sourceType, uint256 _weight)';\n\n // app initialisation payloads\n const aggregatorInitPayload = await encodeActCall(aggregatorInitSignature, [\n 'Inbox',\n 'INBOX',\n 18,\n ]);\n\n // package first transaction\n // issues\n // 1. Promises 😩 aggregator address is not being resolved before calling second `encodeActCall`. HardCoded to move on\n // 2. `addPowerSourceSignature` requires an enum, not sure how to handle this other than changing it to `uint8`\n // 3. `_executionScript` requires meta data, can i use anything i like?\n // 4. the aggregator is failing to execute `you may not have permission` error when trying to vote\n const calldatum = await Promise.all([\n encodeActCall(newAppInstanceSignature, [\n utils.namehash('voting-aggregator.open.aragonpm.eth'),\n votingAggregator,\n aggregatorInitPayload,\n false,\n ]),\n encodeActCall(createSignature, [\n sabVoting,\n votingAggregator,\n keccak256('ADD_POWER_SOURCE_ROLE'),\n sabVoting,\n ]),\n encodeActCall(createSignature, [\n sabVoting,\n votingAggregator,\n keccak256('MANAGE_POWER_SOURCE_ROLE'),\n sabVoting,\n ]),\n encodeActCall(createSignature, [\n sabVoting,\n votingAggregator,\n keccak256('MANAGE_WEIGHTS_ROLE'),\n sabVoting,\n ]),\n encodeActCall(addPowerSourceSignature, [comToken, 1, 1]),\n ]);\n\n // Encode all actions into a single EVM script.\n const actions = calldatum.map((calldata) => ({\n to: acl,\n calldata,\n }));\n\n const script = encodeCallScript(actions);\n\n await execAppMethod(dao, sabVoting, 'newVote', [script, 'title'], env);\n}", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function tally() {\n\n // Ethereum Account needs to be unlocked.\n if(!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n // Make sure we are in the correct phase.\n if(state != 2) {\n alert(\"Please wait until VOTE Phase\");\n return;\n }\n var reg = anonymousvotingAddr.totalregistered();\n var voted = anonymousvotingAddr.totalvoted();\n\n // Make sure everyone has voted!\n if(!reg.equals(voted)) {\n alert(\"Please wait for everyone to vote\");\n return;\n }\n\n //TODO: Check that all votes have been cast..\n // Can do this by checking the public 'votecast' mapping...\n web3.personal.unlockAccount(web3.eth.accounts[accountindex],password);\n var res = anonymousvotingAddr.computeTally.sendTransaction({from:web3.eth.accounts[accountindex], gas: 4200000});\n document.getElementById(\"tallybutton\").innerHTML = \"Waiting for Ethereum to confirm tally\";\n txlist(\"Compute Tally: \" + res);\n}", "async sendCUSD(){\n\n //Show the sending modal. \n this.setState({\n accountModalVisible : false,\n paymentsModalVisible : false,\n sendingModal : true,\n })\n\n /* Personal credentials to send CUSD. */\n let from_eth = this.state.publicKey\n let privateK = this.state.privateKey\n\n /* Person we will send eth to */\n let to_eth = this.state.eth_address\n \n // Amount to send. \n let amount = web3.utils.toWei(this.state.amount, 'ether')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n let web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n // Contract ABI’s\n let ABI = require(\"../contracts/MetaToken.json\");\n\n // Contract Ropsten Addresses\n let ADDRESS = \"0x67450c8908e2701abfa6745be3949ad32acf42d8\";\n\n let jsonFile = ABI;\n let abi = jsonFile.abi;\n let deployedAddress = ADDRESS;\n let cusd = new web3js.eth.Contract(abi, deployedAddress);\n\n\n //Create an ether wallet with the private key. \n let wallet = new ethers.Wallet(privateK)\n \n \n let to = cusd.options.address\n\n let data = cusd.methods.transfer(to_eth, amount).encodeABI()\n\n // let gasPrice = web3.utils.toWei('25', 'gwei')\n let gasPrice = await web3js.eth.getGasPrice()\n\n let gas = Math.ceil((await cusd.methods.transfer(to_eth, amount).estimateGas({ from: from_eth }))*1.2)\n \n // let nonce = await cusd.methods.replayNonce(from_eth).call();\n\n let nonce = await web3js.eth.getTransactionCount(from_eth);\n\n\n\n let transaction = {\n nonce: nonce,\n gasPrice: \"0x\" + gasPrice * 1.40, \n gasLimit: 2100000,\n to: to,\n value: 0,\n data: data,\n chainId: 3\n }\n \n // web3js.eth.signTransaction(tx, privateK).then((s) => {\n // console.log(s)\n // })\n \n \n\n //Sign promise. \n let signPromise = wallet.sign(transaction)\n\n \n\n // //Sign promise and return the transaction. \n signPromise.then((signedTransaction) => {\n\n\n web3js.eth.sendSignedTransaction(signedTransaction).on('receipt', (receipt) => { \n \n }).catch((err) => {\n \n }).then((final_receipt) => {\n\n //Make send success true. \n this.setState({\n sendSuccess : true \n })\n\n });\n\n })\n\n\n\n\n\n }", "trade() {\n let trade = {\n tokens: 2,\n priceWhenBought: 300,\n sold: false,\n status: \"PENDING\",\n }\n let investorId = \"5cbcc9c37892164cf88ae99b\";\n let brokerId = \"5cbccaa47892164cf88ae99c\";\n let cryptoId = \"5cbdc9b236e23d6b581fb43e\";\n this.investorService.requestTrade(investorId, brokerId, cryptoId, trade).then(regi => {\n console.log(\"Buy\");\n console.log(regi);\n });\n }", "async function main() {\n const otokenToBuy = '0xbceb20506a60a59a45109e12d245ac7e2daf2f60' // sender token\n const weth = '0xd0a1e359811322d97991e03f863a0c30c2cf029c' // signer token\n \n const swap = '0x79fb4604f2D7bD558Cda0DFADb7d61D98b28CA9f'\n const shortAction = '0xcA50033F6c3e286D9891f6658298f6EbfD9A8D43'\n \n const [, signer] = await hre.ethers.getSigners();\n\n\n // amount of otoken to buy\n const senderAmount = (0.9 * 1e8).toString()\n const collateralAmount = (0.9 * 1e18).toString()\n\n // amount of weth signer is paying\n const signerAmount = (0.1 * 1e18).toString()\n\n // use the second address derived from the mnemonic\n \n const order = createOrder({\n signer: {\n wallet: signer.address,\n token: weth,\n amount: signerAmount,\n },\n sender: {\n wallet: shortAction,\n token: otokenToBuy,\n amount: senderAmount,\n },\n expiry: parseInt((Date.now() / 1000).toString()) + 86400\n })\n\n const signedOrder = await signOrder(order, signer, swap);\n\n console.log(`signedOrder`, signedOrder)\n \n // Fill the order!\n const ShortAction = await hre.ethers.getContractFactory('ShortOTokenActionWithSwap');\n const shortActionContract = await ShortAction.attach(shortAction)\n await shortActionContract.mintAndSellOToken(collateralAmount, senderAmount, signedOrder)\n}", "function send_contract() {\n console.log(\"Sending contract\");\n\n // get hash of contract to enable reopening later if needed\n previous_contract_hash = consumer.commitmentTx._getHash();\n previous_contract_hash = reverse_array(previous_contract_hash);\n console.log('previous_contract_hash: ');\n print_array(previous_contract_hash);\n\n // TODO: handle edge case where first payment is also last\n var sigtype = Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_SINGLE;\n consumer.incrementPaymentBy(min_initial_payment, sigtype);\n last_increment = min_initial_payment;\n var signature_buffer = get_payment_update_signature(sigtype);\n refund_amount = consumer.paymentTx.outputs[0].satoshis;\n //console.log(\"contract hash: \" + consumer.commitmentTx.id);\n console.log(\"paymentTx.paid = \" + consumer.paymentTx.paid);\n console.log(\"refund_amount: \" + refund_amount);\n\n /*\n console.log(\"refund_amount: \" + refund_amount);\n// console.log(\"multisig script: \" + consumer.commitmentTx.outscript.toHex());\n console.log(\"paymentTx: \" + consumer.paymentTx.id);\n console.log(\"changeAddress: \" + consumer.paymentTx.changeAddress.toString());\n console.log(\"changeScript: \" + consumer.paymentTx._changeScript.toString());\n //console.log(\"commitment_script: \" + consumer.commitmentTx.outputs[0].script.toString());\n */\n var msg = new Message({\n \"type\": Message.MessageType.PROVIDE_CONTRACT,\n \"provide_contract\": {\n \"tx\": consumer.commitmentTx.toBuffer(),\n \"initial_payment\": {\n \"client_change_value\": refund_amount,\n \"signature\": signature_buffer\n }\n }\n });\n send_message(msg);\n set_channel_state(CHANNEL_STATES.SENT_CONTRACT);\n}", "async instantiate(ctx){\n console.log('************ Pharnet Transporter Smart Contract Instantiated *************');\n\t}", "async function main() {\n \n // const url = \"https://eth-ropsten.alchemyapi.io/v2/124IV9lnccOe5WGemFFqps7iLpzbCuT8\";\n // const web3 = new Web3(url);\n // const { address } = await web3.eth.accounts.privateKeyToAccount('0xbffa6ced3da1080e210f2a11c8c4c4b10e60fe3a0db3bf5f60260aea162a4d97');\n // console.log(\n // \"Deploying contracts with the account:\", \n // address\n // );\n // const contract = new web3.eth.Contract(NFT.abi);\n // const deployment = contract.deploy({\n // data: NFT.bytecode,\n // });\n // const gas = await deployment.estimateGas();\n\n // const signTransaction = new web3.eth.accounts.signTransaction({\n // data: NFT.bytecode,\n // from: address,\n // gas: gas,\n // gasPrice:'0x02540be400',\n // }, '0xbffa6ced3da1080e210f2a11c8c4c4b10e60fe3a0db3bf5f60260aea162a4d97');\n \n // const {\n // options: { address: contractAddress },\n // } = await web3.deployment.send({ from:address, gas:gas }); \n // const nftContract = new web3.eth.Contract(NFT.abi, contractAddress);\n // console.log(\"NFT Contract Address:\", nftContract.address);\n // console.log(nftContract); \n \n \n\n const [deployer] = await ethers.getSigners();\n\n console.log(\n \"Deploying contracts with the account:\",\n deployer.address\n );\n \n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const nftContract = await ethers.getContractFactory(\"NFT\");\n const myContract = await nftContract.deploy();\n\n console.log(\"Contract address:\", myContract.address);\n}", "async function purchase() {\n\n // SHOW LOADING SCREEN\n dispatch({\n type: 'show-prompt',\n payload: 'loading'\n })\n\n // FETCH THE TOKEN PRICE\n const token_price = await read({\n contract: 'token',\n func: 'price',\n }, state)\n\n // ATTEMPT TO BUY TOKENS\n const result = await write({\n contract: 'token',\n func: 'purchase',\n args: [input.amount.value],\n payable: input.amount.value * token_price\n }, state)\n\n // SLEEP FOR 2 SECONDS TO SMOOTHEN TRANSITION\n await sleep(2)\n\n // EVERYTHING WENT FINE\n if (result.success) {\n\n // CREATE TOAST MESSAGE\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'good',\n msg: 'tokens purchased'\n }\n })\n\n // OTHERWISE, SHOW ERROR\n } else {\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'bad',\n msg: result.reason\n }\n })\n }\n\n // HIDE THE PROMPT WINDOW\n dispatch({ type: 'hide-prompt' })\n }", "async deposit_pug_ewt_clp(amount) {\n if (amount != 0) {\n const user_farm_0 = await this.state.farmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"20000\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n if (this.state.pMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n const allowed = await this.state.farmContracts[0].methods\n .approve(this.state.pmasterChefAddress, allow)\n .send({ from: this.state.account });\n\n //TODO: 2\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.pMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "async function buy(_hash,_id, _account,_key){\r\n return new Promise(async(resolve) =>{\r\n let _contract = await getContract();\r\n\r\n const d = _contract.methods.buy(_id);\r\n\r\n checkTransaction(_hash,_account,_key,d).then(res =>{\r\n resolve(res);\r\n });\r\n });\r\n}", "buyStandardPack(node) {\n console.log(\"Buying standard pack of Kards for: \" + node);\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n return web3.eth.getAccounts().then(accounts => {\n return contract.methods.buyStandardPack().send({\n from: accounts[0],\n gas: this.targetGasLimit,\n value: web3.utils.toWei(this.standardPackCost, 'ether')\n })\n })\n });\n }", "async function payf(){\r\n var web3=new Web3(window.ethereum)\r\n\t\r\n window.ethereum.enable()\r\n\r\n var a=\"0x8E381898f5ed1Ce23e09F1D16375721E44dABa09\";\r\n var amount=1;\r\n const accounts = await web3.eth.getAccounts();\r\n \r\n web3.eth.sendTransaction({\r\n to:a,\r\n value:amount,\r\n from:accounts[0]\r\n },(err,transactionId)=>{\r\n if(err){\r\n console.log(\"failed\",err)\r\n }\r\n else{\r\n console.log(\"success\",transactionId);\r\n }\r\n }\r\n )\r\n\r\n\r\n}", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', 'sherlocked123@gmail.com', 'sherlocked123@gmail.com', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', 'a12@gmail.com', 'a12@gmail.com', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', 'a@gmail.com', 'a@gmail.com', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, 'a@gmail.com','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', 'b012@gmail.com', 'b012@gmail.com', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', 'b123@gmail.com', 'b012@gmail.com', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', 'b012@gmail.com', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', 'a1234@gmail.com', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "function deploy_contract() {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n console.log(\"The gas block limit is: \" + block.gasLimit.toString());\n if (!error) {\n var transaction_object = {\n chainId: web3.utils.toHex(newBlockchain.getChainId()),\n from: document.getElementById(\"public_key_input\").value,\n gasPrice: web3.utils.toHex(gas_price),\n gas: web3.utils.toHex(block.gasLimit.toString()),\n data: bytecode\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Please wait for about 10 seconds for transaction to be confirmed ...\";\n setTimeout(function() {\n web3.eth.getTransactionReceipt(sent_tx, function(err, res_rec) {\n if (!err) {\n if (res_rec != null && res_rec != undefined) {\n //console.log(\"Success, we now have a transaction receipt: \" + JSON.stringify(res_rec));\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Contract address: \" + res_rec[\"contractAddress\"];\n newContract.setAddress(res_rec[\"contractAddress\"]);\n console.log(\"New contract at: \" + newContract.getAddress());\n var multiswapContractInstance = new web3.eth.Contract(abi, res_rec[\"contractAddress\"]);\n newContract.setContractInstanceObject(multiswapContractInstance);\n }\n } else {\n console.log(\"Unable to get transaction receipt \" + err);\n }\n });\n }, 60000);\n\n } else {\n console.log(\"*\\nSend signed transaction failed: \" + error);\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n}", "async function send() {\n // make sure `data` starts with 0x\n const contract = new caver.klay.Contract(LoonGEM.abi, '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF');\n const pebToken = caver.utils.toPeb(50000000, 'KLAY');\n const data = await contract.methods.transfer(receiverAddress, pebToken).encodeABI();\n\n const { rawTransaction: senderRawTransaction } = await caver.klay.accounts.signTransaction({\n type: 'FEE_DELEGATED_SMART_CONTRACT_EXECUTION',\n from: sender.address,\n to: '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF',\n data: data,\n gas: '3000000',\n value: 0,\n }, sender.privateKey);\n\n // signed raw transaction\n console.log(\"Raw TX:\\n\", senderRawTransaction);\n \n // send fee delegated transaction with fee payer information\n caver.klay.sendTransaction({\n senderRawTransaction: senderRawTransaction,\n feePayer: payer.address\n })\n .on('transactionHash', function (hash) {\n console.log(\">>> tx_hash for deploy =\", hash);\n })\n .on('receipt', function (receipt) {\n console.log(\">>> receipt arrived: \", receipt);\n })\n .on('error', function (err) {\n console.error(\">>> error: \", err);\n });\n}", "async function main() {\n\n const CONTRACTS = [ \n { address: \"0xCdB0c60EA5bF50641A570E25875EAB6c889E949d\", abi : DYNAMIC_FARM_ABI, rewardToken: \"dynamicTracker\", stakeToken: \"lpt\"},\n { address: \"0x030cF06D8A39d5Ef4b169EAc0D4D5B0c51b42194\", abi : DYNAMIC_FARM_ABI, rewardToken: \"dynamicTracker\", stakeToken: \"lpt\"}\n ];\n \n const App = await init_ethers();\n \n _print(`Initialized ${App.YOUR_ADDRESS}`);\n _print(\"Reading smart contracts...\\n\");\n \n var tokens = {};\n var prices = {};\n let tvl = 0;\n \n for (const c of CONTRACTS) {\n try {\n const { staked_tvl } =await loadSynthetixPool(App, tokens, prices, c.abi, c.address, c.rewardToken, c.stakeToken);\n tvl += staked_tvl;\n }\n catch (ex) {\n console.error(ex);\n }\n }\n const BOARDROOM_ADDRESS = \"0x175B1A116028508aC3A4e4B62722b845C3bD1ab3\";\n const ORACLE_ADDRESS = \"0x3a9a1cec3546b4fb810756cd3ad072a3d6345a8a\"\n const DAI_DST_ADDRESS = \"0x706b21bf60adb79d2326d39086e4c27766193185\"\n const REWARD_TOKEN_ADDRESS = \"0xfa9c3dc54baa9eefbe9453b1f3b3b93ad2af0a77\";\n\n const br_tvl = await loadBoardroom(App, prices, BOARDROOM_ADDRESS, ORACLE_ADDRESS, DAI_DST_ADDRESS, REWARD_TOKEN_ADDRESS,\n \"DSTR\", \"DST\", 4, 0.1, 2, 1, 24);\n tvl += br_tvl.staked_tvl;\n _print_bold(`Total staked: $${formatMoney(tvl)}`);\n\n hideLoading();\n }", "submitOrder() {\n // First give the exchange the appropriate allowance\n // NOTE if the submitOrder fails the exchange still has the allowance\n this.state.token.approve(\n this.state.exchange.address,\n this.state.bidAmount*10**this.state.tokenDecimals, {\n from: this.web3.eth.accounts[this.state.defaultAccount],\n gas: 1e6\n }, (err, res) => {\n if (err) console.error(err)\n else console.log(res)\n // Submit the order to the exchange\n this.state.exchange.submitOrder(\n this.state.token.address,\n this.state.bidAmount*10**this.state.tokenDecimals,\n '0', // Ether address\n this.state.askAmount*10**18 /* harcoded ETH decimal places */, {\n from: this.web3.eth.accounts[this.state.defaultAccount],\n gas: 1e6\n }, (err, res) => {\n if (err) console.error(err)\n else console.log(res)\n }\n )\n })\n }", "async transfer({\n account,\n key\n }, {\n token,\n to,\n amount\n }) {\n let confirmSig = null;\n let from = account;\n let response = await this.client.request(\"transact\", {\n token,\n from,\n to,\n amount,\n confirmSig,\n }).catch(err => {\n throw err;\n });\n\n let json = response.result.result;\n if (!json) {\n throw \"Invalid transaction\";\n }\n let tx = Transaction.fromJSON(json);\n\n // let prefix = \"\\x19Ethereum Signed Message:\\n32\";\n // let txHashed = this.web3.utils.soliditySha3(prefix, tx.hash());\n let txHashed = tx.hash();\n let signature = await this.web3.eth.accounts.sign(txHashed, key).signature;\n tx.setSignature(signature);\n\n let signedTransaction = tx.toJSON();\n response = await this.client.request(\"submitTransact\", {\n signedTransaction,\n }).catch(err => {\n throw err;\n });\n\n // wait for the tx to be mined\n let found = -1;\n let blkNum;\n let root;\n let nTries = 0;\n while (found < 0 && nTries < 20) {\n await utils.sleep(500);\n // get latest block\n response = await this.client.request(\"getLatestBlock\", {}).catch(err => {\n throw err;\n });\n if (!response || !response.result || !response.result.result) {\n throw \"Blocks do not exist\";\n }\n let block = Block.fromJSON(response.result.result);\n blkNum = block.blockHeader.blockNumber;\n root = utils.addHexPrefix(block.blockHeader.merkleRoot);\n let txData = tx.data();\n found = block.transactions.findIndex(_tx => {\n return _tx === txData;\n });\n nTries += 1;\n }\n if (found < 0) {\n throw \"Transaction to confirm is not found or has yet been mined. This could mean that the transaction is not valid or insufficient balance.\";\n }\n let txIndex = found;\n\n // wait for the tx to be mined and then submit confirm signature\n // let confirmationHashed = this.web3.utils.soliditySha3(\n // prefix,\n // this.web3.utils.soliditySha3(tx.hash(), root),\n // );\n let confirmationHashed = this.web3.utils.soliditySha3(tx.hash(), root);\n let confirmSignature = await this.web3.eth.accounts.sign(confirmationHashed, key).signature;\n\n // submit confirm\n response = await this.client.request(\"confirmTx\", {\n blkNum,\n txIndex,\n confirmSignature,\n }).catch(err => {\n throw err;\n });\n\n return response;\n }", "async function fundNocust() {\n await nocustManager.deposit(\n BOB_PUB, // Account from which to make a deposit (its private key needs to be in the Web3 instance)\n web3.utils.toWei('0.1','ether'), // Amount to deposit\n web3.utils.toWei('10','gwei'), // Gas price, 10 Gwei\n 150000 // Gas Limit\n );\n}", "function placeBuyOrder (p) {\n\n}", "async sendSafePay() {\n\t\ttry {\n\n\t\t\tconst tx = await this._contract.sendSafepay(\n\t\t\t\tthis._order_state.orderno,\n\t\t\t\t{\n\t\t\t\t\tvalue: this._order_state.expected_total\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tawait tx.wait();\n\n\t\t\tthis._changeOrderState(\"Waiting for invoice\");\n\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t}\n\t}", "async function sendCoins() {\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount()\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n const contract = new ethers.Contract(bvgTokenAddress, BVGToken.abi, signer);\n // We parse the amount to be sent. eg : amount of BVG to be sent = ethers.utils.parseEther(amount BVG written on the UI)\n // since BVG and Ether has the same decimal 18\n // For a token with another value of the decimal, we should update our parse method\n const parsedAmount = ethers.utils.parseEther(amount);\n const transation = await contract.transfer(userAccount, parsedAmount);\n await transation.wait();\n console.log(`${ethers.utils.formatEther(parsedAmount)} BVG successfully sent to ${userAccount}`);\n }\n }", "async function main() {\n const contractName = \"UniLion\";\n const [ deployer ] = await hre.ethers.getSigners();\n const network = await hre.ethers.provider.getNetwork() // needs to be this router address for testnet in order for swapbnb to work\n const routerAddress = (network.name == \"bnb\") ? \"0x10ED43C718714eb63d5aA57B78B54704E256024E\" : \"0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3\" // or testnet: 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3, 0xD99D1c33F9fC3444f8101754aBC46c52416550D1\n const balance = await deployer.getBalance();\n console.log(`Deploying on network: ${network.name}, using router address ${routerAddress}`)\n console.log(`Deploying Contract with Account: ${deployer.address}`) \n console.log(`Account Balance: ${balance.toString()}`) \n const contract = await hre.ethers.getContractFactory(contractName);\n const unilion = await contract.deploy(routerAddress, snipers.addresses);\n await unilion.deployed();\n console.log(\"UniLion Contract Deployed:\", unilion.address);\n if (network.name != 'unknown') {\n let blockchainHost = (network.name != 'bnbt') ? \"bscscan.com\" : \"testnet.bscscan.com\"\n console.log(`Contract URL: https://${blockchainHost}/address/${unilion.address}`)\n }\n console.log(`Console Script: const token = await (await ethers.getContractFactory(\"${contractName}\")).attach(\"${unilion.address}\")`)\n}", "async function makeBet() {\n if (!bettingValue) return;\n if (typeof window.ethereum !== \"undefined\") {\n await requestAccount();\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n console.log(\"provider in set: \", { provider });\n const signer = provider.getSigner();\n const contract = new ethers.Contract(greeterAddress, Betting.abi, signer);\n const transaction = await contract.makeBet(bettingValue, {\n value: ethers.utils.parseEther(\"0.05\"),\n });\n await transaction.wait();\n console.log(\"transaction done\");\n }\n }", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\n });\n }", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "async connectToContract(){\n\n await this.auctionContract.connect( App.provider.getSigner(), this.auctionContract.contractAddress);\n this.auctionContract.registerToEvents(sellerUI);\n }", "async function fetchAccountData() {\r\n\r\n // Get a Web3 instance for the wallet\r\n const web3 = new Web3(provider);\r\n\r\n console.log(\"Web3 instance is\", web3);\r\n\r\n // Get connected chain id from Ethereum node\r\n const chainId = await web3.eth.getChainId();\r\n // Load chain information over an HTTP API\r\n const chainData = evmChains.getChain(chainId);\r\n\r\n // Load Presale Contract\r\n const presale = new web3.eth.Contract(contract_abi,contract_address);\r\n\r\n // Get list of accounts of the connected wallet\r\n const accounts = await web3.eth.getAccounts();\r\n\r\n // MetaMask does not give you all accounts, only the selected account\r\n console.log(\"Got accounts\", accounts);\r\n selectedAccount = accounts[0];\r\n\r\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\r\n\r\n // Presale Whitelist\r\n if (chainId == 56) {\r\n const whitelistedaddress = await presale.methods.checkWhitelist(selectedAccount).call();\r\n console.log(whitelistedaddress)\r\n document.querySelector(\"#whitelisted-address\").textContent = whitelistedaddress;\r\n console.log ('Right Network') \r\n } else {\r\n document.querySelector(\"#whitelisted-address\").textContent = 'Connect on Binance Smart Chain';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n // Reserved Tokens\r\n const enteredpresale = await presale.methods.enteredPresale(selectedAccount).call({from : selectedAccount}, function(error, result){\r\n console.log(result);\r\n});\r\n if (chainId == 56 && enteredpresale == true) {\r\n const reserved = await presale.methods._TokensReserved(selectedAccount).call();\r\n reservedtokens = Number(reserved) / 1e9;\r\n console.log(reservedtokens)\r\n const checkcontrib = await presale.methods.checkContribution(selectedAccount).call();\r\n console.log(checkcontrib)\r\n checkcontribution = Number(checkcontrib) / 1e18;\r\n console.log(checkcontribution)\r\n document.querySelector(\"#contribution-amount\").textContent = Number(checkcontribution) + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = Number(reservedtokens) + ' JDT'; \r\n } else {\r\n test = 0;\r\n document.querySelector(\"#contribution-amount\").textContent = 0 + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = 0 + ' JDT';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n\r\n // Display fully loaded UI for wallet data\r\n document.querySelector(\"#prepare\").style.display = \"none\";\r\n document.querySelector(\"#connected\").style.display = \"block\";\r\n}", "async function main() {\n const [deployer] = await ethers.getSigners();\n\n console.log(\"Deploying account:\", await deployer.getAddress());\n console.log(\n \"Deploying account balance:\",\n (await deployer.getBalance()).toString(),\n \"\\n\"\n );\n\n const NFTXV1Buyout = await ethers.getContractFactory(\"NFTXV1Buyout\");\n const v1Buyout = await upgrades.deployProxy(NFTXV1Buyout, [], {\n initializer: \"__NFTXV1Buyout_init\",\n });\n await v1Buyout.deployed();\n\n console.log(\"NFTXV1Buyout:\", v1Buyout.address);\n\n const ProxyController = await ethers.getContractFactory(\n \"ProxyControllerSimple\"\n );\n\n const proxyController = await ProxyController.deploy(v1Buyout.address);\n await proxyController.deployed();\n console.log(\"ProxyController address:\", proxyController.address);\n\n console.log(\"\\nUpdating proxy admin...\");\n\n await upgrades.admin.changeProxyAdmin(\n v1Buyout.address,\n proxyController.address\n );\n\n console.log(\"Fetching implementation addresses...\");\n\n await proxyController.fetchImplAddress({\n gasLimit: \"150000\",\n });\n\n console.log(\"Implementation address:\", await proxyController.impl());\n\n console.log(\"Transfering ownerships...\");\n await v1Buyout.transferOwnership(founderAddress);\n await proxyController.transferOwnership(founderAddress);\n\n console.log(\"\");\n}", "function marketBuy () {\n\n}", "async function deployContract() {\n /*\n `miniERC20.constructor` is construct method of `MiniERC20` contract,\n send constructor encoded transaction to deploy a contract,\n await till transaction `executed` to get receipt.\n */\n const receipt = await miniERC20\n .constructor('MiniERC20', 18, 'MC', 10000)\n .sendTransaction({ from: accountAlice })\n .executed();\n\n console.log('receipt', JSON.stringify(receipt, null, 2));\n // outcomeStatus == 0 means success, got created contract address '0x8ba2e83e8d58ad37c91ad72ea35961846b16793b'\n /*\n receipt {\n \"index\": 0,\n \"epochNumber\": 711763,\n \"outcomeStatus\": 0,\n \"gasUsed\": \"1054467\",\n \"gasFee\": \"1054467000000000\",\n \"blockHash\": \"0xb70ae9034ee2393f02d9afa4c5b2624f17f78ebdc06f6ec00c9421246fde1717\",\n \"contractCreated\": \"CFXTEST:TYPE.CONTRACT:ACF4F4B8VZPM4R8KDNNW7J43PGCG0FX3HPKZE0ZZEU\",\n \"from\": \"CFXTEST:TYPE.USER:AAR7X4R8MKRNW39GGS8RZ40J1ZNWH5MRRPUFPR2U76\",\n \"logs\": [],\n \"logsBloom\": \"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n \"stateRoot\": \"0x27ef34b1b70e3ee86d3154086c79d9ec8e391e33ffad046f232e47826079237a\",\n \"to\": null,\n \"transactionHash\": \"0x0215231b0f9f108dee4fc2a7b12f32ab5e14992d59506c05f96410fe6715c1d1\",\n \"txExecErrorMsg\": null\n }\n */\n}", "async accept({\n orderKey,\n quantity,\n acceptedPaymentMethod,//Not yet in action\n }) {\n\n await this.transact({\n name: 'accept',\n data: {\n order_key: orderKey,\n counterparty: await this.getAccountName(),\n quantity: quantity.toString(),\n }\n });\n }", "deploy() {\n if (this.deployed && this.contractAddress) {\n console.log(\"Deploy function already called\");\n this.UserContract = this.USER.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.JoeContract = this.JOE.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.StoreContract = this.STORE.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n\n return new Promise((resolve) => {resolve(this.contractAddress)});\n }\n\n // else deploy the contract\n return this.STORE.then((web3) => {\n let bytecode = KaleidoKardsContract.bytecode;\n let abi = KaleidoKardsContract.abi;\n\n let contract = new web3.eth.Contract(abi);\n console.log(\"Getting kard_store account to deploy new contract\");\n return web3.eth.getAccounts().then((accounts) => {\n console.log(\"Deploying new contract from address: \" + accounts[0]);\n return contract.deploy({data: bytecode}).send({data: bytecode, from: accounts[0], gasPrice: 0, gas: 2000000})\n .then( (response) => {\n this.contractAddress = response._address;\n console.log(\"Successfully deployed at address: \" + this.contractAddress);\n\n this.UserContract = this.USER.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.JoeContract = this.JOE.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.StoreContract = this.STORE.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.deployed = true;\n return this.contractAddress;\n });\n })\n })\n\n }", "async function createTransaction() {\n // Get a fee estimate from Smart Fee:\n const smartFeeResponse = await request({\n url: `https://api.smartfee.live/latest`,\n headers: {\n 'X-API-KEY': smartFeeApiKey\n }\n })\n const smartFeeResponseObject = JSON.parse(smartFeeResponse)\n // Use the 2-block target.\n const twoBlockFeeRateSatsPerKb = smartFeeResponseObject.feeByBlockTarget[\"2\"]\n\n\n // Send a BitGo transaction with a custom fee rate:\n const wallet = await bitgo.coin('tbtc').wallets().get({ id: WALLET_ID })\n const sendParams = {\n feeRate: twoBlockFeeRateSatsPerKb,\n // TODO: replace below with your transaction info:\n /*\n recipients: [{\n amount: 0.01 * 1e8,\n address: '2NFfxvXpAWjKng7enFougtvtxxCJ2hQEMo4',\n }, {\n amount: 0.01 * 1e8,\n address: '2MsMFw75RKRiMb548q6W4jrJ63jwvvDdR2w',\n }],\n walletPassphrase: 'secretpassphrase1a5df8380e0e30'\n */\n }\n const result = await wallet.sendMany(sendParams)\n console.dir(result)\n}", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) {\n return this.okPressed = false;\n }\n\n if(!confirm(this._$filter(\"translate\")(\"EXCHANGE_WARNING\"))) {\n this.okPressed = false;\n return;\n }\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n });\n });\n\n var parameter = JSON.stringify({ip_address:this.externalIP,nem_address:this.address, btc_address:this.btc_sender, eth_address:this.eth_sender});\n this._$http.post(this.url + \"/api/sphinks\", parameter).then((res) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init(res);\n return;\n });\n }, (err) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "async function send(secretKey, sendto, amount, cached_work) {\n var dd;\n\tvar address = await nanopay.secretKeytoaddr(secretKey);\n\tvar sddsf_address = await accountdig(address);\n\tvar cbal = sddsf_address.balance;\n\tvar previous = sddsf_address.frontier;\n var pow = null;\n console.log(\"Send function cached work: \",cached_work);\n if(typeof cached_work !== undefined && cached_work !== \"\") {\n pow = cached_work;\n }else {\n\t pow = await hybridWork(previous);\n }\n console.log(\"POW: \",pow);\n\n\tvar x = new BigNumber('1000000000000000000000000000000');\n\tvar xx = x.multipliedBy(amount).toFixed();\n\tvar puki = new BigNumber(cbal);\n\tvar balance = puki.minus(xx);\n\n\tvar balancex = balance.toFixed(0);\n\n\tif (balancex >= 0) {\n\t\tdd = {\n\t\t\tbalance: balancex,\n\t\t\tlink: sendto,\n\t\t\tprevious: previous,\n\t\t\trepresentative: address,\n\t\t\twork: pow,\n\t\t};\n console.log(dd);\n\t\tvar xxx = await nanocurrency.createBlock(secretKey, dd);\n\t\tvar retr = await publish(xxx.block);\n\t} else {\n\t\tvar retr = { error: 'no_balance' };\n\t}\n\n\treturn retr;\n}", "async deposit_ammo_usdc_clp(amount) {\n if (amount != 0) {\n const user_gs_farm_0 = await this.state.gfarmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"2\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n\n if (this.state.GMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n const allowed = await this.state.gfarmContracts[0].methods\n .approve(this.state.gmasterChefAddress, allow)\n .send({\n from: this.state.account,\n });\n\n //* Fee GS\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.gMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "function transferFundingP1(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n if (Number(person1Release > 0)) {\r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:person1,quantity:person1Release + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n if (Number(person2Release) <= 0) {\r\n // finish - nothing to release\r\n finalReturn(outputMessage);\r\n } else {\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n })\r\n .catch(function (err) { console.log('error102'); }) \r\n }) \r\n } else {\r\n // skip to person2\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n}", "function bid() {\n // this calls the \"add\" function defined in the Solidity contract\n // the last argument is a callback to handle the result\n CONTRACT.bid( function(error, result) {\n if(error) { console.log(error) }\n })\n}", "async function example1 () {\n exchange['options']['defaultType'] = 'spot'; // very important set spot as default type\n\n await exchange.loadMarkets ();\n\n // fetch spot balance\n const balance = await exchange.fetchBalance ();\n console.log (balance)\n\n // create order\n const symbol = 'LTC/USDT';\n const createOrder = await exchange.createOrder (symbol, 'limit', 'buy', 50, 0.1);\n console.log ('Created order id:', createOrder['id'])\n\n // cancel order\n const cancelOrder = await exchange.cancelOrder (createOrder['id'], symbol);\n\n // Check canceled orders (bybit does not have a single endpoint to check orders\n // we have to choose whether to check open or closed orders and call fetchOpenOrders\n // or fetchClosedOrders respectively\n const canceledOrders = await exchange.fetchClosedOrders (symbol);\n console.log (canceledOrders);\n}", "initiate_key_exchange(recipients, offchain=0, peer=null) {\n\n let recipient = \"\";\n let parties_to_exchange = 2;\n\n if (Array.isArray(recipients)) {\n if (recipients.length > 0) {\n recipients.sort();\n recipient = recipients[0];\n parties_to_exchange = recipients.length;\n }\n else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n } else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n\nconsole.log(\"recipient is: \" + recipient);\n if (recipient == \"\") { return; }\n\n let tx = this.app.wallet.createUnsignedTransactionWithDefaultFee(recipient, (parties_to_exchange * this.app.wallet.wallet.default_fee));\n\n //\n // we had an issue creating the transaction, try zero-fee\n //\n if (!tx) {\nconsole.log(\"zero fee tx creating...\");\n tx = this.app.wallet.createUnsignedTransaction(recipient, 0.0, 0.0);\n }\n\n tx.msg.module = this.name;\n tx.msg.request = \"key exchange request\";\n tx.msg.alice_publickey = this.app.keys.initializeKeyExchange(recipient);\n\n //\n // does not currently support n > 2\n //\n if (parties_to_exchange > 2) {\n for (let i = 1; i < parties_to_exchange; i++) {\n tx.transaction.to.push(new saito.slip(recipients[i], 0.0));\n }\n }\n\n tx = this.app.wallet.signTransaction(tx);\n\n if (offchain == 0) {\n this.app.network.propagateTransaction(tx);\n } else {\n let data = {};\n data.module = \"Encrypt\";\n\t data.tx = tx;\nconsole.log(\"sending request on network\");\n this.app.network.sendPeerRequest(\"diffie hellman key exchange\", data, peer);\n }\n this.saveEncrypt();\n\n }", "function newItem() {\n console.log(\"\\nnewItem clicked\");\n this_contract.newItem(\"Test 2\", 500, 10, {from: from_account, gas: 500000}).then(function(value) {\n console.log(value.valueOf());\n console.log(web3.eth.getTransactionReceipt(value));\n }).catch(function(e) {\n console.log(e);\n });\n}", "function buy() {\n try {\n request\n .show(new Promise(function(resolve) {\n resolve({\n total: {label: 'Total', amount: {currency: 'USD', value: '1.00'}},\n });\n }))\n .then(function(result) {\n print(JSON.stringify(result.details));\n return result.complete('success');\n })\n .catch(function(error) {\n print(error);\n });\n } catch (error) {\n print(error);\n }\n}", "takeExtra(token) {\n if (!blockchain.requireAuth(this._getFarm(), \"active\")) {\n throw \"only approved contracts can issue\";\n }\n\n if (token != \"iost\") {\n throw \"currently only iost is supported\";\n }\n\n const queue = this._getQueue();\n const lastTime = this._getLastTime();\n const now = Math.floor(tx.time / 1e9);\n\n var amountToSend = new BigNumber(0);\n\n for (let i = 0; i < queue.length; ++i) {\n const time = Math.min(now, queue[i].startTime + 3600 * 24);\n const lastTimeI = Math.max(lastTime, queue[i].startTime);\n const amount = new BigNumber(queue[i].delta).times(\n time - lastTimeI).div(3600 * 24);\n amountToSend = amountToSend.plus(amount);\n }\n\n const oldBalance = this._getBalance();\n const newBalance = new BigNumber(blockchain.call(\"token.iost\", \"balanceOf\", [\"iost\", blockchain.contractName()])[0]);\n\n // Queue in\n if (newBalance.minus(oldBalance).gte(MINIMUM_IOST_UNIT)) {\n // Every time the iost balance goes up, it will be distributed in the next\n // 24 hours evenly.\n const delta = newBalance.minus(oldBalance);\n queue.push({\n startTime: now,\n delta: delta.toFixed(IOST_PRECISION, ROUND_DOWN)\n });\n\n this._setBalance(newBalance.toFixed(IOST_PRECISION, ROUND_DOWN));\n }\n\n // Queue out\n if (queue[0] && lastTime >= queue[0].startTime + 24 * 3600) {\n queue.shift();\n }\n\n this._setQueue(queue);\n\n // amountToSend should be less than current balance in case\n // there is calculator error due to rounding.\n if (amountToSend.gt(newBalance)) {\n amountToSend = newBalance;\n }\n\n if (amountToSend.lt(MINIMUM_IOST_UNIT)) {\n return \"0\";\n }\n\n this._setLastTime(now);\n\n const amountToSendStr = amountToSend.toFixed(IOST_PRECISION, ROUND_DOWN);\n\n // Now send iost to farm.\n blockchain.callWithAuth(\"token.iost\", \"transfer\",\n [\"iost\",\n blockchain.contractName(),\n this._getFarm(),\n amountToSendStr,\n \"take extra\"]);\n\n // Update iost balance before we go.\n this._setBalance(blockchain.call(\"token.iost\", \"balanceOf\", [\"iost\", blockchain.contractName()])[0]);\n\n return amountToSendStr;\n }", "async function main() {\n\n let frequency = 1;\n let price = ethers.utils.parseEther(\"1\");\n let fee = ethers.utils.parseEther(\"0.03\");\n let name = \"Roam Fantom Lottery\";\n let recipient = '0x19FF17645bd4930745e632284422555466675e44';\n let modulus = 2;\n\n // This is just a convenience check\n if (network.name === \"hardhat\") {\n console.warn(\n \"You are trying to deploy a contract to the Hardhat Network, which\" +\n \"gets automatically created and destroyed each time. Use the Hardhat\" +\n \" option '--network localhost'\"\n );\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n\n console.log(\"Account Balance:\", (await deployer.getBalance()).toString());\n\n const Lotto = await ethers.getContractFactory(\"FantomLottery\");\n const lottery = await Lotto.deploy(name, frequency, ethers.utils.parseEther(\"1\"), modulus, ethers.utils.parseEther(\"0.03\"), recipient);\n\n await lottery.deployed();\n\n console.log(\"Lotto Address:\", lottery.address);\n\n // We also save the contract's artifacts and address in the frontend directory\n saveFrontendFiles(lottery);\n}", "contributePiggy (playerContribution, minContribution) {\r\n let self = this\r\n\r\n self.contributionStatus = 'contributing'\r\n\r\n // Format contribution\r\n playerContribution = playerContribution.replace(/,/g, '.')\r\n playerContribution = playerContribution.replace(/^\\./g, '0.')\r\n\r\n // Check user contribution\r\n if (playerContribution === '') {\r\n self.contributionError = this.$t('lang.ethereummixin.contributionNotValid')\r\n return false\r\n } else if (playerContribution < minContribution) {\r\n self.contributionError = this.$t('lang.ethereummixin.contributionTooLow') + ' (' + minContribution + ')'\r\n return false\r\n }\r\n\r\n // Dial node\r\n self.dialJs()\r\n\r\n // Contribute\r\n self.web3js.eth.getAccounts()\r\n .then(function (accounts) {\r\n console.log(accounts)\r\n let currentAddress = accounts[0]\r\n\r\n if (self.abi && self.contractAddress) {\r\n // Get contract\r\n var contract = new self.web3js.eth.Contract(self.abi, self.contractAddress)\r\n // Send contribution\r\n contract.methods.contribute().send({value: Units.convert(playerContribution, 'eth', 'wei'), from: currentAddress})\r\n .on('transactionHash', function (hash) {\r\n console.log('as contributed', hash)\r\n self.contributionStatus = 'contributed'\r\n self.$store.state.ethLoading.contribution = true\r\n self.$store.state.ethPendingTx = hash\r\n self.dialog = true\r\n })\r\n .on('receipt', function (receipt) {\r\n console.log('Contribution receipt:', receipt)\r\n self.$store.state.ethLoading.contribution = false\r\n self.getEthGameData()\r\n self.notify(self.$t('lang.ethereummixin.notification.contribute.title'), self.$t('lang.ethereummixin.notification.contribute.text'))\r\n })\r\n .on('confirmation', function (confirmationNumber, receipt) {\r\n // console.log('confirmation:', confirmationNumber, receipt)\r\n })\r\n .on('error', function (error) {\r\n console.log('error:', error)\r\n })\r\n }\r\n })\r\n }", "function setupContractConnection(){\n // do work\n writeNumber(Math.floor(Math.random()*100));\n}", "async payBill(ctx, requestNumber) {\n console.info('============= START : payBill ===========');\n const requestAsBytes = await ctx.stub.getState(requestNumber); // get the from chaincode state\n\n if (!requestAsBytes || requestAsBytes.length === 0) {\n throw new Error(`request ${requestNumber} does not exist`);\n }\n const request = JSON.parse(requestAsBytes.toString());\n // simulates changing the abstract state.\n request.paid = true;\n await ctx.stub.putState(requestNumber, Buffer.from(JSON.stringify(request)));\n\n return request;\n console.info('============= END : payBill ===========');\n }", "async function callContractMethod(src, mother, contractAddress, gasValue, inchainID, inByteCode, showErr = false) {\n // src is walletaddress\n var txcount = chain3.mc.getTransactionCount(src);\n var rawTx = {\n from: src,\n to: contractAddress,\n nonce: chain3.intToHex(txcount),\n gasPrice: chain3.intToHex(41000000000),\n gasLimit: chain3.intToHex(gasValue),\n value: '0x',\n data: inByteCode,\n chainId: chain3.intToHex(inchainID)\n }\n log.debug(JSON.stringify(rawTx));\n\n var cmd1 = chain3.signTransaction(rawTx, mother);\n\n var hash = await chain3.mc.sendRawTransaction(cmd1, function (err, hash) {\n if (!err) {\n\n log.debug(\"send contract raw command at:\" + hash);\n\n if (showErr) {\n var filter = chain3.mc.filter('latest');\n var result = filter.watch(function (error, result) {\n var receipt = chain3.mc.getTransactionReceipt(hash);\n if (!error && receipt && receipt.blockNumber != null) {\n filter.stopWatching();\n if (Debug == 1) {\n log.debug(result);\n log.debug(receipt);\n log.debug(\"System contract filter finish========================\");\n var transaction = chain3.mc.getTransaction(hash);\n log.debug(transaction);\n }\n } else {\n log.debug(\"no receipt and continue lisenting...\");\n }\n });\n }\n } else {\n log.error(err);\n //filter.stopWatching();\n }\n });\n\n}", "sendBill() {}", "async function sell(_hash,_tokens,_price,_account,_key){\r\n return new Promise(async(resolve) =>{\r\n let _contract = await getContract();\r\n\r\n const d = _contract.methods.sell(_tokens,_price);\r\n \r\n checkTransaction(_hash,_account,_key,d).then(res =>{\r\n resolve(res);\r\n });\r\n });\r\n}", "async function pauseTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(data.sender);\n const recepientaddress = new PublicKey(data.receiver);\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodePauseInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "function proposeGame() {\n\t\t console.log(\"proposed\")\n\t\t var val = document.getElementById(\"proposeValue\").value; \n\t\t val = web3.toWei(val, \"ether\");\n\t\t contractInstance.proposeGame(val, merkleRoot, {from: web3.eth.accounts[0], value: val}, function(err, txHash) {\n\t\t if (err) {\n\t\t console.log(err);\n\t\t return;\n\t\t } else {\n\t\t\t console.log(txHash);\n\t\t\t}\n\t\t });\n\t\t}", "function DeployContract(eth_accountAddr,eth_bytecode){\n\n\t// if( typeof eth_arguments != undefined)\n\t// {\n\t// \tvar _arguments = eth_arguments;\n\t// }\n\tdataString = {\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"id\":1,\"params\":[{\n\t\t\"from\": eth_accountAddr,\n\t\t\"data\":eth_bytecode,\n\n\t}]}\n\toptions = {\n url: REQUESTURL,\n method:'POST',\n headers:headers,\n body: dataString,\n json: true\n\t}\n\treturn options;\n}", "function buy (msg, name, amt){\n //check for invalid inputs\n if (amt <= 0){\n msg.reply(\"Error: Please enter a number greater than zero.\");\n return;\n }\n\n //get list of currencies\n getList(msg).then((data) => {\n\n //holds price of desired currency\n var price;\n //holds the final total of desired currency\n var total;\n //get current market price of coin per dollar\n switch(name){\n case 'btc':\n price = amt * data.BTC.USD;\n break;\n case 'eth':\n price = amt * data.ETH.USD;\n break;\n case 'etc':\n price = amt * data.ETC.USD;\n break;\n case 'doge':\n price = amt * data.DOGE.USD;\n break;\n //if currency not found\n default:\n msg.channel.send(\"Error: Currency not found\");\n return;\n break;\n } //end switch\n //round purchase amt\n var price = Math.round(price*100)/100\n //make sure player has enough money\n if (price > player[msg.member.id].money){\n msg.reply(\"Error: Not enough money :\\(\");\n return;\n }\n\n //take the money\n player[msg.member.id].money = player[msg.member.id].money - price\n //add the appropriate coin\n switch(name){\n case 'btc':\n player[msg.member.id].btc = player[msg.member.id].btc + amt;\n total = player[msg.member.id].btc;\n break;\n case 'eth':\n player[msg.member.id].eth = player[msg.member.id].eth + amt;\n total = player[msg.member.id].eth;\n break;\n case 'etc':\n player[msg.member.id].etc = player[msg.member.id].etc + amt;\n total = [msg.member.id].etc;\n break;\n case 'doge':\n player[msg.member.id].doge = player[msg.member.id].doge + amt;\n total = player[msg.member.id].doge;\n break;\n //if currency not found\n default:\n msg.channel.send(\"Error: Currency not found\");\n return;\n break;\n }\n //update the JSON file\n fs.writeFile(\"./src/players.json\", JSON.stringify(player), (err)=> {\n if (err) console.log(err);\n });\n\n //success message\n msg.reply(\"Congratulations! You have bought \" + amt + \" \" + name + \" for a total of $\" + price + \"\\nCurrent total: \" + total + \"\\nMoney: $\" + player[msg.member.id].money);\n });\n}", "function transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n if (Number(person2Release > 0)) {\r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:person2,quantity:person2Release + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n finalReturn(outputMessage);\r\n })\r\n .catch(function (err) { console.log('error103'); }) \r\n }) \r\n } else {\r\n // finish\r\n finalReturn(outputMessage);\r\n }\r\n}", "async instantiate(ctx) {\n console.log(\"Smart Contract Instantiated\");\n }", "componentDidMount() {\n this.state.web3.eth.getGasPrice((err, res) => this.setState({ gasPrice : res.toNumber() }));\n const contract = require('truffle-contract');\n const patents = contract(Patents);\n patents.setProvider(this.state.web3.currentProvider);\n patents.at(Constants.CONTRACT_ADDRESS.patents).then(instance => { // for ROPSTEN\n // patents.deployed().then(instance => { // for LOCAL RPC\n this.setState({contractInstance: instance});\n return instance.hasAccount.call(this.state.web3.eth.accounts[0]);\n }).then(registered => {\n this.setState({ currentAccountRegistered: registered });\n return this.state.contractInstance.depositPrice.call();\n }).then(price => {\n this.setState({depositPrice: price.toNumber()});\n return this.state.contractInstance.getEthPrice.call(price.toNumber());\n }).then(ethPrice => {\n this.setState({ etherPrice: ethPrice })\n }).catch(() => this.setState({ contractInstance: null }));\n this.state.web3.currentProvider.on('accountsChanged', accounts => {\n this.state.contractInstance.hasAccount.call(accounts[0]).then(registered => {\n this.setState({currentAccountRegistered: registered});\n })\n });\n }", "async function propTransfer() {\n let accounts = await web3.eth.getAccounts();\n let Twill = await contract.methods\n .transferWill(\n toowner,\n newTestatorName,\n newBeneficiary,\n newBeneficiaryAddress,\n newOwnerHomeAddress\n )\n .send({ from: accounts[0] });\n console.log(\"result====\", Twill);\n }", "async function sendTx(addr){\n let myAddresses = [CONFIG.FAUCET_ADDRESS];\n // console.log(myAddresses);\n let utxos = await avm.getUTXOs(myAddresses);\n // console.log(utxos.getAllUTXOs());\n let sendAmount = new BN(CONFIG.DROP_SIZE);\n\n\n // If balance is lower than drop size, throw an insufficient funds error\n let balance = await avm.getBalance(CONFIG.FAUCET_ADDRESS, CONFIG.ASSET_ID);\n let balanceVal = new BN(balance.balance);\n\n if(sendAmount.gt(balanceVal)){\n console.log(\"Insufficient funds. Remaining AVAX: \",balanceVal.toString());\n return {\n status: 'error',\n message: 'Insufficient funds to create the transaction. Please file an issues on the repo: https://github.com/ava-labs/faucet-site'\n }\n }\n // console.log(avm.getBlockchainID());\n let unsigned_tx = await avm.buildBaseTx(utxos, sendAmount, CONFIG.ASSET_ID,[addr], myAddresses, myAddresses ).catch(err => {\n console.log(err);\n });\n\n // Meaning an error occurred\n if(unsigned_tx.status){\n return unsigned_tx;\n }\n\n let signed_tx = avm.signTx(unsigned_tx);\n let txid = await avm.issueTx(signed_tx);\n\n console.log(`(X) Sent a drop with tx id: ${txid} to address: ${addr}`);\n return txid;\n}", "buy(passenger, airline, flightNumber, timestamp, amount, callback) {\n let self = this;\n let payload = {\n passenger: passenger,\n airline: airline,\n flightNumber: flightNumber,\n timestamp: timestamp,\n amount: amount\n }\n self.flightSuretyApp.methods\n .buy(payload.airline, payload.flightNumber, payload.timestamp)\n .send({ from: payload.passenger, value: payload.amount, gas: 4712388, gasPrice: 100000000000}, (error, result) => {\n callback(error, payload);\n });\n }", "function requestApproval() {\n tokenInst.approve(\n addrHOLD,\n truePlanCost,\n { gasPrice: web3.toWei('50', 'gwei') },\n function (error, result) {\n\n if (!error && result) {\n var data;\n console.log('approval sent to network.');\n var url = 'https://etherscan.io/tx/' + result;\n var link = '<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">View Transaction</a>';\n console.log('waiting for approval ...');\n data = {\n txhash: result,\n account_type: selectedPlanId,\n txtype: 1, // Approval\n };\n apiService(data, '/transaction/create/', 'POST')\n .done(function (response) {\n location.href = response.tx_url;\n });\n }\n else {\n console.error(error);\n console.log('You rejected the transaction');\n }\n });\n}", "function processChasePay() {\n\n try {\n var apiClient = new CybersourceRestApi.ApiClient();\n var instance = new CybersourceRestApi.PaymentApi(apiClient);\n\n var clientReferenceInformation = new CybersourceRestApi.V2paymentsClientReferenceInformation();\n clientReferenceInformation.code = \"TC_MPOS_Paymentech_3\";\n\n var evm = new CybersourceRestApi.V2paymentsPointOfSaleInformationEmv();\n evm.cardSequenceNumber = \"123\";\n evm.tags = \"9C01019A031207109F33036040209F1A0207849F370482766E409F3602001F82025C009F2608EF7753429A5D16B19F100706010A03A00000950580000400009F02060000000700009F6E0482766E409F5B04123456789F2701809F3403AB12349F0902AB129F4104AB1234AB9F0702AB129F0610123456789012345678901234567890AB9F030200005F2A0207849F7C031234569F350123\";\n\n var pointOfSaleInformation = new CybersourceRestApi.V2paymentsPointOfSaleInformation();\n pointOfSaleInformation.terminalId = \"terminal\";\n pointOfSaleInformation.cardPresent = \"Y\";\n pointOfSaleInformation.entryMode = \"QRCode\";\n pointOfSaleInformation.terminalCapability = \"4\";\n pointOfSaleInformation.evm = evm;\n\n var processingInformation = new CybersourceRestApi.V2paymentsProcessingInformation();\n processingInformation.commerceIndicator = \"retail\";\n processingInformation.paymentSolution = \"007\";\n\n var billTo = new CybersourceRestApi.V2paymentsOrderInformationBillTo();\n billTo.country = \"US\";\n billTo.lastName = \"Deo\";\n billTo.address2 = \"Address 2\";\n billTo.address1 = \"201 S. Division St.\";\n billTo.postalCode = \"48104-2201\";\n billTo.locality = \"Ann Arbor\";\n billTo.administrativeArea = \"MI\";\n billTo.firstName = \"John\";\n billTo.phoneNumber = \"999999999\";\n billTo.district = \"MI\";\n billTo.buildingNumber = \"123\";\n billTo.company = \"Visa\";\n billTo.email = \"test@cybs.com\";\n\n var amountDetails = new CybersourceRestApi.V2paymentsOrderInformationAmountDetails();\n amountDetails.totalAmount = \"115.00\";\n amountDetails.currency = \"USD\";\n\n var orderInformation = new CybersourceRestApi.V2paymentsOrderInformation();\n orderInformation.billTo = billTo;\n orderInformation.amountDetails = amountDetails;\n\n var tokenizedCard = new CybersourceRestApi.V2paymentsPaymentInformationTokenizedCard();\n tokenizedCard.transactionType = \"1\";\n tokenizedCard.requestorId = \"12345678901\";\n\n var card = new CybersourceRestApi.V2paymentsPaymentInformationCard();\n card.type = \"001\",\n card.trackData = \";4111111111111111=21121019761186800000?\";\n\n var paymentInformation = new CybersourceRestApi.V2paymentsPaymentInformation();\n paymentInformation.tokenizedCard = tokenizedCard;\n paymentInformation.card = card;\n\n var request = new CybersourceRestApi.CreatePaymentRequest();\n request.clientReferenceInformation = clientReferenceInformation;\n request.pointOfSaleInformation = pointOfSaleInformation;\n request.processingInformation = processingInformation;\n request.orderInformation = orderInformation;\n request.paymentInformation = paymentInformation;\n\n instance.createPayment(request, function (error, data, response) {\n if (error) {\n console.log(\"Error : \" + error);\n console.log(\"Error : \" + error.stack);\n console.log(\"Error status code : \" + error.statusCode);\n }\n else if (data) {\n console.log(\"Data : \" + JSON.stringify(data));\n }\n console.log(\"Response : \" + JSON.stringify(response));\n\n });\n } catch (error) {\n console.log(error);\n }\n}", "voteNumber(number, cb) {\n // Grab Aion Bet\n let voteCallObject;\n let bet = (this.refs['aion-bet'].value).toString();\n console.log('bet =', bet);\n if (!aiwaInjected) { // Check AIWA is enabled\n alert(\"You will need to have AIWA enabled to place a vote\");\n\n } else if (!bet || parseFloat(bet) < this.state.minimumBet) {\n alert('You must bet more than the minimum')\n cb()\n\n } else {\n // Create TX Object\n voteCallObject = {\n from: this.state.accounts,\n to: contractAddress,\n gas: 2000000,\n value: web3.utils.toNAmp(bet),\n data: myContract.methods.bet(number).encodeABI()\n }\n\n // Pop up AIWA\n aiwa.eth.sendTransaction(\n voteCallObject\n ).then(function(txHash){\n console.log('txHash:', txHash);\n if (window.confirm('Click \"OK\" to see transaction hash.')) {\n window.open(\n 'https://mastery.aion.network/#/transaction/'+ txHash,\n '_blank' // <- This is what makes it open in a new window.\n );\n };\n cb()\n });\n }\n }", "async function main() {\n // This is just a convenience check\n if (network.name === \"hardhat\") {\n console.warn(\n \"You are trying to deploy a contract to the Hardhat Network, which\" +\n \"gets automatically created and destroyed every time. Use the Hardhat\" +\n \" option '--network localhost'\"\n );\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n const Ante_alUSDSupplyTest = await ethers.getContractFactory(\"Ante_alUSDSupplyTest\");\n const ante_alUSDSupplyTest = await Ante_alUSDSupplyTest.deploy();\n await ante_alUSDSupplyTest.deployed();\n console.log(\"Ante_alUSDSupplyTest address:\", ante_alUSDSupplyTest.address);\n const a = await ante_alUSDSupplyTest.CheckTransmuterVL();\n console.log(a.toString());\n const b = await ante_alUSDSupplyTest.CheckAlchemistVL();\n console.log(b.toString());\n const c = await ante_alUSDSupplyTest.CheckTransmuterBVL();\n console.log(c.toString());\n const d = await ante_alUSDSupplyTest.CheckAlchemistYVAVL();\n console.log(d.toString());\n const e = await ante_alUSDSupplyTest.CheckTransmuterBYVAVL();\n console.log(e.toString());\n const USDbalance = await ante_alUSDSupplyTest.checkBalance();\n console.log(\"Ante_alUSDSupplyTest balance:\", USDbalance.toString());\n const USDcirculating = await ante_alUSDSupplyTest.checkCirculating();\n console.log(\"Ante_alUSDSupplyTest supply:\", USDcirculating.toString());\n const USDresult = await ante_alUSDSupplyTest.checkTestPasses();\n console.log(\"Ante_alUSDSupplyTest result:\", USDresult);\n\n const Ante_alETHSupplyTest = await ethers.getContractFactory(\"Ante_alETHSupplyTest\");\n const ante_alETHSupplyTest = await Ante_alETHSupplyTest.deploy();\n await ante_alETHSupplyTest.deployed();\n console.log(\"Ante_alETHSupplyTest address:\", ante_alETHSupplyTest.address);\n const f = await ante_alETHSupplyTest.CheckTransmuterVL();\n console.log(f.toString());\n const g = await ante_alETHSupplyTest.CheckAlchemistVL();\n console.log(g.toString());\n const h = await ante_alETHSupplyTest.CheckAlchemistYVAVL();\n console.log(h.toString());\n const i = await ante_alETHSupplyTest.CheckTransmuterBYVAVL();\n console.log(i.toString());\n const ETHbalance = await ante_alETHSupplyTest.checkBalance();\n console.log(\"Ante_alETHSupplyTest balance:\", ETHbalance.toString());\n const ETHcirculating = await ante_alETHSupplyTest.checkCirculating();\n console.log(\"Ante_alETHSupplyTest supply:\", ETHcirculating.toString());\n const ETHresult = await ante_alETHSupplyTest.checkTestPasses();\n console.log(\"Ante_alETHSupplyTest result:\", ETHresult);\n \n}", "function money() {\n let commands = {\n atm: 'wallet',\n purse: 'wallet',\n wallet(target, room, user) {\n if (!this.canBroadcast()) return;\n Economy.get((target || user.userid), function(amount) {\n let currency = Wulu.Economy.currency_name;\n if (amount !== 1) currency += 's';\n this.sendReplyBox(`${target || user.name} has ${amount} ${currency}.`);\n room.update();\n }.bind(this));\n },\n\n 'generatemoney': 'givemoney',\n givemoney(target, room, user) {\n if (!user.can('givemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/givemoney [user], [amount] - Give a user a certain amount of money.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.give(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was given ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has given you ${amount} ${currency}. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n takemoney(target, room, user) {\n if (!user.can('takemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/takemoney [user], [amount] - Take a certain amount of money from a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.take(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was losted ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has taken ${amount} ${currency} from you. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n transfer: 'transfermoney',\n transfermoney(target, room, user) {\n if (!target || target.indexOf(',') < 0) return this.sendReply('/transfer [user], [amount] - Transfer a certain amount of money to a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let targetName = this.targetUsername;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${targetName} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n let self = this;\n Economy.get(user.userid, function(userAmount) {\n if (amount > userAmount) return self.sendReply('You cannot transfer more money than what you have.');\n Economy.give(targetName, amount, function(targetTotal) {\n Economy.take(user.userid, amount, function(userTotal) {\n let targetCash = targetTotal !== 1 ? currency_name + 's' : currency_name;\n let userCash = userTotal !== 1 ? currency_name + 's' : currency_name;\n self.sendReply(`You have successfully transferred ${amount} ${currency} to ${targetName}. You now have ${userTotal} ${userCash}.`);\n self.sendReply(`${user.name} has transferred ${amount} ${currency} to you. You now have ${targetTotal} ${targetCash}.`);\n });\n });\n });\n },\n\n moneyladder: 'richestuser',\n richladder: 'richestuser',\n richestusers: 'richestuser',\n richestuser(target, room) {\n if (!this.canBroadcast()) return;\n let self = this;\n let display = `<center><u><b>Richest Users</b></u></center><br>\n <table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n <tbody>\n <tr>\n <th>Rank</th>\n <th>Username</th>\n <th>Money</th>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n User.find().sort({money: -1}).limit(10).exec(function(err, users) {\n if (err) return;\n users.forEach((user, index) => {\n display += `<tr>\n <td>${index + 1}</td>\n <td>${user.name}</td>\n <td>${user.money}</td>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n });\n display += '</tbody></table>';\n self.sendReply('|raw|' + display);\n room.update();\n });\n }\n };\n\n Object.merge(CommandParser.commands, commands);\n}", "async sendTransactionToContract(targetAddress,numberOfTokens) {\n\n // load AbI through interface. \n let iface = new ethers.utils.Interface(/** ABI */);\n\n params: [{\n \"from\": accounts[0] ,\n \"to\": /** Token_contract_Address */,\n \"gas\": \"0x76c0\", // 30400\n \"gasPrice\": \"0x9184e72a000\", // 10000000000000\n \"value\": \"0\", // 2441406250\n \"data\": iface.functions.transfer.encode([ targetAddress, numberOfTokens ])\n }]\n\n ethereum.sendAsync({\n method: 'eth_sendTransaction',\n params: params,\n from: accounts[0], // Provide the user's account to use.\n }, (err, response) => {\n if (error) {\n if (error.code === 4001) { // EIP 1193 userRejectedRequest error\n console.log('Please connect to MetaMask.')\n } else {\n console.error(error)\n }\n } else {\n // this method will return a transaction hash on success.\n const result = response.result\n console.log(result)\n }\n })\n }", "async action(crypto, dataPeriods, currentBitcoinPrice) {\n // let stopped = this.stopLoss(0.1);\n // if (stopped) return;\n\n // stopped = this.takeProfit(this.takeProfitRatio);\n // if (stopped) return;\n\n let ema = await this.getEMA(dataPeriods);\n let currEMA = ema[ema.length - 1];\n\n var diff = (currentBitcoinPrice / currEMA * 100) - 100;\n\n if (!this.isInTrade()) {\n let bigDown = diff < -this.adaptativeDownTrigger();\n if (bigDown) {\n // BUY condition\n this.timeInTrade = 0;\n return this.buy();\n } else {\n return this.hold();\n }\n } else {\n this.timeInTrade++;\n let objectivePrice = this.getObjective();\n let bigUp = diff > this.adaptativeUpTrigger();\n if (currentBitcoinPrice > objectivePrice || bigUp) {\n return this.sell();\n } else {\n return this.hold();\n }\n }\n }", "function blockchainBid(propertyContract,invNum){\n var myContract = new web3.eth.Contract(ABI,propertyContract);\n\n if( invNum==1 ){\n investor = investor1; //\"0x3d06bdf9a9c2ace9a75ae2004589c5608b767a00\";\n amount = 100000;\n }else if( invNum==2 ){\n investor = investor2; //\"0xf8306b56f5c85a993b988b1f29d84efbf7c54a48\";\n amount = 200000;\n }else if( invNum==3 ){\n investor = investor3; //\"0x64644d2306b88ee641491fbe432459d8c7bafccf\";\n amount = 300000;\n }else{\n return(\"Must sepcify an investor number\");\n }\n\n myContract.methods.submitBid(\n \"investor no.\"+invNum,\n invNum*1000\n ).send({from: investor, gas: 1500000, value: amount}, function(err,result){\n console.log(result);\n propStatus = result;\n });\n\n return( \"Investor no.\"+invNum+\" submitted a bid for \"+amount+\" wei!\");\n\n}", "function buyItem() {\n\n}", "async function initTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender); \n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"; // Zebec program id\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: false,\n isWritable: true,\n },\n {\n // master pda to store fund\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n // pda to store data //sender and recepient\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n const explorerhash = {\n transactionhash: signature,\n };\n return explorerhash;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "function buy(){\n \n}", "async function example1 () {\n exchange['options']['defaultType'] = 'swap';\n exchange.options['defaultMarginMode'] = 'cross' // or isolated\n await exchange.loadMarkets ();\n\n const symbol = 'ADA/USDT:USDT';\n\n // fetchBalance\n const balance = await exchange.fetchBalance ();\n console.log (balance)\n\n // set the desired leverage (has to be made before placing the order and for a specific symbol)\n const leverage = 8;\n const leverage_response = await exchange.setLeverage(leverage, symbol)\n\n // create limit order\n const amount = 50;\n const price = 0.3 // adjust this accordingly\n const createOrder = await exchange.createOrder (symbol, 'limit', 'buy', amount, price);\n console.log ('Created order id:', createOrder['id'])\n}", "function testContract(address) {\n // Reference to the deployed contract\n const token = contract.at(address);\n // Destination account for test\n const dest_account = '0x002D61B362ead60A632c0e6B43fCff4A7a259285';\n\n // Assert initial account balance, should be 100000\n const balance1 = token.balances.call(web3.eth.coinbase);\n console.log(balance1 == 1000000);\n\n // Call the transfer function\n token.transfer(dest_account, 100, {from: web3.eth.coinbase}, (err, res) => {\n // Log transaction, in case you want to explore\n console.log('tx: ' + res);\n // Assert destination account balance, should be 100 \n const balance2 = token.balances.call(dest_account);\n console.log(balance2 == 100);\n });\n}", "function buyPart(item) {\n let protoBotCopy = protoBot\n let shopCopy = shop\n \n if(item.purchased == false){\n \n\n for (let i=0; i < shopCopy.length; i++){\n if(i == item.id - 1){\n \n shopCopy[i].purchased = true\n \n setShop(shopCopy)\n \n } \n }\n \n protoBotCopy.items.push(item)\n if(item.cost < balance){\n let cost = item.cost\n\n setBalance(balance - cost)\n setProtoBot(protoBotCopy)\n \n } else return alert('you do not have enough money')\n } else return alert('Item is already purchased')\n \n}", "async function main () {\n\n /**\n * Fetch your personal wallet's balance\n */\n //let myBalanceWei = web3.eth.getBalance(web3.eth.defaultAccount).toNumber()\n let myBalanceWei = await web3.eth.getBalance(web3.eth.defaultAccount)\n\n let myBalance = fromWei(myBalanceWei)\n \n log(`Your wallet wei balance is currently ${myBalanceWei} ETH`.green)\n\n log(`Your wallet balance is currently ${myBalance} ETH`.green)\n\n\n /**\n * With every new transaction you send using a specific wallet address,\n * you need to increase a nonce which is tied to the sender wallet.\n */\n let nonce = await web3.eth.getTransactionCount(web3.eth.defaultAccount)\n log(`The outgoing transaction count for your wallet address is: ${nonce}`.magenta)\n\n\n /**\n * Fetch the current transaction gas prices from https://ethgasstation.info/\n */\n let gasPrices = await getCurrentGasPrices()\n\n log('wallet: ' + process.env.WALLET_ADDRESS)\n log('testnet: ' + testnet)\n log('chain id: ' + process.env.CHAIN_ID)\n log('chain_name: ' + process.env.CHAIN_NAME)\n log('chain_hardfork: ' + process.env.CHAIN_HARDFORK)\n\n /**\n * Build a new transaction object and sign it locally.\n */\n let details = {\n \"to\": process.env.DESTINATION_WALLET_ADDRESS,\n \"value\": web3.utils.numberToHex( toWei(amountToSend) ),\n \"gas\": 21000,\n \"gasPrice\": gasPrices.low * 1000000000, // converts the gwei price to wei\n \"nonce\": nonce,\n \"chainId\": process.env.CHAIN_ID // EIP 155 chainId - mainnet: 1, rinkeby: 4\n }\n\n const transaction = new EthereumTx(details, {chain:process.env.CHAIN_NAME, hardfork: process.env.CHAIN_HARDFORK})\n\n /**\n * This is where the transaction is authorized on your behalf.\n * The private key is what unlocks your wallet.\n */\n transaction.sign( Buffer.from(process.env.WALLET_PRIVATE_KEY, 'hex') )\n\n\n /**\n * Now, we'll compress the transaction info down into a transportable object.\n */\n const serializedTransaction = transaction.serialize()\n\n /**\n * Note that the Web3 library is able to automatically determine the \"from\" address based on your private key.\n */\n\n const addr = transaction.from.toString('hex')\n log(`Based on your private key, your wallet address is ${addr}`.yellow)\n\n /**\n * We're ready! Submit the raw transaction details to the provider configured above.\n */\n await web3.eth.sendSignedTransaction('0x' + serializedTransaction.toString('hex') )\n .catch( error => { console.log (error) } )\n\n /*\n let transactionReceipt = await web3.eth.getTransactionReceipt() \n console.log (\"recibo\"+ transactionReceipt)\n let transactionId = transactionReceipt.transactionHash\n console.log (\"transactionId\"+ transactionId)\n */\n\n /**\n * We now know the transaction ID, so let's build the public Etherscan url where\n * the transaction details can be viewed.\n */\n //const url = `https://rinkeby.etherscan.io/tx/${transactionId}`\n //log(url.cyan)\n\n let contract_abi = [ { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isWaitingValidationAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isReservedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setTokenAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getBlockchainAccount\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"enableChangeAccount\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"isChangeAccountEnabled\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"string\", \"name\": \"str\", \"type\": \"string\" } ], \"name\": \"isValidHash\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"pure\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"renounceOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isRedemptionAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getRedemptionAddress\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"changeAccountLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"validateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByValidatorAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getIdLegalFinancialAgreement\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForRegistryValidation\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"owner\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForDisbursement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getAccountState\", \"outputs\": [ { \"internalType\": \"int256\", \"name\": \"\", \"type\": \"int256\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getLegalEntityInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isAvailableAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getLegalEntityInfoByCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"novoCampo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"invalidateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForSettlement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isTokenAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setRedemptionAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"registryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"transferOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountRegistration\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"oldAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountChange\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountValidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountInvalidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"previousOwner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"OwnershipTransferred\", \"type\": \"event\" } ]\n\n var myContract = new web3.eth.Contract(contract_abi, process.env.CONTRACT_ADDRESS, {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n});\n\n\n\n// using the callback\n await myContract.methods.getResponsibleForDisbursement().call({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log ('The disbursement responsible is : ' + result);\n });\n\n let outraABI = [ { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"decrease\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"increase\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"triple\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"double\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]\n\n var counterContract = new web3.eth.Contract(outraABI, \"0xB87b994174CA4af8FD7E9e7DED2036564Ba53829\", {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n });\n\n// using the callback\n// Infura has not activated the method eth_sendTransaction because this method needs unlocked accounts on the ethereum node. \n await counterContract.methods.increase(1).send({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log (result);\n })\n\n log(`Note: please allow for 30 seconds before transaction appears on Etherscan`.magenta)\n\n process.exit()\n}", "function payMoney(pmcData, body, sessionID) {\n item.resetOutput();\n let output = item.getOutput();\n let tmpTraderInfo = trader_f.traderServer.getTrader(body.tid, sessionID);\n let currencyTpl = getCurrency(tmpTraderInfo.data.currency);\n\n // delete barter things(not a money) from inventory\n if (body.Action === 'TradingConfirm') {\n for (let index in body.scheme_items) {\n let item = undefined;\n\n for (let element of pmcData.Inventory.items) {\n if (body.scheme_items[index].id === element._id) {\n item = element;\n }\n }\n\n if (item !== undefined) {\n if (!isMoneyTpl(item._tpl)) {\n output = move_f.removeItem(pmcData, item._id, output, sessionID);\n body.scheme_items[index].count = 0;\n } else {\n currencyTpl = item._tpl;\n break;\n }\n }\n }\n }\n\n // find all items with currency _tpl id\n const moneyItems = itm_hf.findMoney(\"tpl\", pmcData, currencyTpl);\n\n // prepare a price for barter\n let barterPrice = 0;\n \n for (let item of body.scheme_items) {\n barterPrice += item.count;\n }\n\n // prepare the amount of money in the profile\n let amountMoney = 0;\n \n for (let item of moneyItems) {\n amountMoney += item.upd.StackObjectsCount;\n }\n\n // if no money in inventory or amount is not enough we return false\n if (moneyItems.length <= 0 || amountMoney < barterPrice) {\n return false;\n }\n\n let leftToPay = barterPrice;\n\n for (let moneyItem of moneyItems) {\n let itemAmount = moneyItem.upd.StackObjectsCount;\n\n if (leftToPay >= itemAmount) {\n leftToPay -= itemAmount;\n output = move_f.removeItem(pmcData, moneyItem._id, output, sessionID);\n } else {\n moneyItem.upd.StackObjectsCount -= leftToPay;\n leftToPay = 0;\n output.data.items.change.push(moneyItem);\n }\n\n if (leftToPay === 0) {\n break;\n }\n }\n\n // set current sale sum\n // convert barterPrice itemTpl into RUB then convert RUB into trader currency\n let saleSum = pmcData.TraderStandings[body.tid].currentSalesSum += fromRUB(inRUB(barterPrice, currencyTpl), getCurrency(tmpTraderInfo.data.currency));\n\n pmcData.TraderStandings[body.tid].currentSalesSum = saleSum;\n trader_f.traderServer.lvlUp(body.tid, sessionID);\n output.data.currentSalesSums[body.tid] = saleSum;\n\n // save changes\n logger.logSuccess(\"Items taken. Status OK.\");\n item.setOutput(output);\n return true;\n}", "async function bidContract(tokenid, amount) {\n const bidder_my_address = await newAddress()\n console.log('Bidder address is ' + bidder_my_address + '. Seller will need this to accept bid')\n\n const aKey = await newKey()\n console.log('Bidder public key is ' + aKey + '. Seller will need this to accept bid')\n\n // bidder bid 2 minima\n return createBidTransaction(amount, BIDDER_SCRIPT_ADDRESS, bidder_my_address, aKey, tokenid);\n\n}", "async function createSmartContracts() {\n console.log('Setting smart contract scripts...');\n AUCTION_SCRIPT_ADDRESS = await createAuctionContract()\n \n BIDDER_SCRIPT_ADDRESS = await createBidContract()\n\n listAuctions()\n}", "async getAddClaimTransaction(claim, passport, passphrase, secondaryPassportId, secondaryAddress) {\n let neo = this;\n return new Promise(async (resolve, reject) => {\n if (!claim) {\n reject(\"claims not provided\");\n }\n if (!passport) {\n reject(\"passport not provided\");\n }\n if (!passphrase) {\n reject(\"passphrase not provided\");\n }\n\n \n let bridgeContractHash = _bridgeContractHash;\n if (bridgeContractHash.startsWith(\"0x\")) {\n bridgeContractHash = bridgeContractHash.slice(2);\n }\n const address = passport.wallets[0].address;\n const addressScriptHash = this._getAddressScriptHash(address);\n const secondaryAddressScriptHash = this._getAddressScriptHash(secondaryAddress);\n const privateKey = await this.getWifFromNep2Key(passport.wallets[0].key, passphrase);\n const account = new _neon.wallet.Account(privateKey);\n\n //invoke <contracthash> \"addclaim\" [address, identity, claimtypeid, claimvalue, createdon, provider]\n //address\n //identity\n //claimtypeid\n //claimvalue\n //createdon\n //provider = the account paying the tokens for the action\n const props = {\n scriptHash: bridgeContractHash,\n operation: 'addclaim',\n args: [\n secondaryAddressScriptHash,\n secondaryPassportId,\n claim.claimTypeId,\n _crypto.CryptoUtility.hexEncode(claim.claimValue),\n claim.createdOn,\n secondaryAddressScriptHash\n ]\n }\n\n const provider = new _neon.api.neoscan.instance(\"MainNet\");\n const gasFee = 0;\n const additionalInvocationGas = 0;\n const additionalIntents = [];\n const script = _neon.sc.createScript(props);\n const gas = additionalInvocationGas;\n const intent = additionalIntents;\n const config = {\n api: provider,\n account: account,\n intents: intent,\n script: script,\n fees: gasFee,\n gas: gas\n };\n\n _neon.api.fillSigningFunction(config)\n .then(c => { return _neon.api.fillUrl(c) })\n .then(c => { return _neon.api.fillBalance(c) })\n .then(c => { return _neon.api.createInvocationTx(c) })\n .then(c => {\n c.tx.addRemark(this._getRandom(5));\n c.tx.attributes.push(\n new _neon.tx.TransactionAttribute({\n usage: 32,\n data: addressScriptHash\n })\n );\n c.tx.attributes.push(\n new _neon.tx.TransactionAttribute({\n usage: 32,\n data: secondaryAddressScriptHash\n })\n );\n return c;\n })\n .then(c => { return _neon.api.signTx(c) })\n .then(c => {\n resolve(c.tx);\n })\n .catch(c => {\n reject(\"Error getting add claim transaction\");\n });\n });\n }", "async function checkBet() {\n if (typeof window.ethereum !== \"undefined\") {\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n // could suffice to use provider, but then one gets a diferent adress in setBetting\n // so we can use signer in both places or come up with a different id mechanism (probably bet id or so)\n const contract = new ethers.Contract(greeterAddress, Betting.abi, signer);\n\n console.log(\"provider in fetch: \", { provider });\n try {\n const data = await contract.checkBet();\n // const data = await contract.payMeBack(10 ** 17);\n console.log(\"data: \", { data });\n console.log(\"data: \", convertHex(data));\n } catch (err) {\n console.log(\"Error: \", err);\n }\n }\n }", "checkPermissionsModify(result, contracts, currentWallet, appName) {\n const { sellNum } = this.props;\n const { nightElf } = this.state;\n const wallet = {\n address: currentWallet.address\n };\n contractChange(nightElf, result, currentWallet, appName).then(result => {\n if (sellNum && !result) {\n nightElf.chain.contractAt(\n contracts.multiToken,\n wallet,\n (err, contract) => {\n if (contract) {\n this.getApprove(contract);\n }\n }\n );\n } else {\n message.info('Contract renewal completed...', 3);\n this.setState({\n sellBtnLoading: false\n });\n }\n });\n }", "function buy_booster(data) {\n\n var str = data;\n var res = str.split(\"-\", 3);\n\n let booster_id = res[1];\n\n let value = game.boosterdata[booster_id].currentPrice;\n\n\n rig_wars_contract = web3.eth.contract(abi).at(contract_address);\n\n\n rig_wars_contract.BuyBooster.sendTransaction(booster_id, { from: account, value: value, gasPrice: game.default_gas_price }, function (err, ress) {\n waitForReceipt(ress, function (receipt) {\n console.log('Force!');\n update_balance(1);\n contract_init();\n });\n });\n\n}", "function steemToEth(){\n\n getCurrentBalance()\n .then(data => checkAmounts(data, 'steem'))\n .then(data => {\n getTradeAddress('steem', 'eth', ETH_ADDRESS).then( data => {\n let json = JSON.parse(data)\n sendTransfer(TRADE_AMOUNT, json.inputAddress, json.inputMemo)\n })\n })\n .catch(data => {\n console.log(data)\n })\n}", "async function createAuction() {\n if (!tokenId) return;\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount();\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n const contract = new ethers.Contract(repoAddress, Repo.abi, signer);\n try {\n const tx = await contract.createAuction(signer.getAddress(), tokenAddress, tokenId, biddingTime, startingBid);\n console.log(await contract.getAuction(0));\n console.log('data: ', tx);\n } catch (err) {\n console.log(\"Error: \", err);\n }\n\n }\n }", "claimWin(gameId, contractGameId) {\r\n return new Promise((resolve, reject) => {\r\n socket.emitWithAuth('sign game', gameId, contractGameId, walletService.walletAddress, function (err, signature) {\r\n if (err) {\r\n console.error(\"ContractService.claimWin: failed to sign the game\", err);\r\n reject(err);\r\n } else {\r\n const signObj = ethUtil.fromRpcSig(signature);\r\n const tx = {\r\n transactionName: 'claimWin',\r\n types: ['bytes12', 'uint8', 'bytes32', 'bytes32'],\r\n params: [ethUtil.addHexPrefix(contractGameId), signObj.v, ethUtil.addHexPrefix(signObj.r), ethUtil.addHexPrefix(signObj.s)],\r\n address: contractAddress,\r\n value: 0\r\n };\r\n console.log(tx);\r\n\r\n walletService.sendTxWithData(tx)\r\n .then(txHash => {\r\n resolve(txHash);\r\n })\r\n .catch(error => {\r\n console.error(\"ContractService.claimWin: \", error);\r\n reject(error);\r\n });\r\n }\r\n });\r\n });\r\n }", "buy(amount, bank) {\n if (bank.withdraw(amount * this.cost)) {\n this.totSharesBought += amount;\n this.shares += amount;\n }\n }", "function createAndRequestTaskID(){\r\n \r\n //request the smart contract to create a task id\r\n myContract.methods.createCurrentTaskID().send({from: userAccount,gas:3000000},function(error, result){\r\n if(!error)\r\n { \r\n alert(\"Time to work on the task\");\r\n //if succesuffly created task id then get the current task id\r\n getTaskID();\r\n }\r\n else\r\n console.error(error);\r\n });\r\n\r\n }", "async function sendTx() {\n console.log('sending transaction...')\n txResponse = await wallet.sendTransaction(txData)\n const txReceipt = await txResponse.wait()\n console.log('\\nView Tx with Block Explorer:\\n', '\\nhttps://alfajores-blockscout.celo-testnet.org/search?q='+txReceipt.transactionHash+'\\n')\n}", "async sendOrders()\n\t{\n\t\tvar currentBlock = await EtherMiumApi.getCurrentBlockNumber();\n\t\ttry {\n\t\t\tfor (let token of this.tokensList)\n\t\t\t{\n\t\t\t\tvar found_buy_order = false;\n\t\t\t\tvar found_sell_order = false;\n\n\t\t\t\t// check if there active orders\n\t\t\t\tvar orders = await EtherMiumApi.getMyTokenOrders(token[0]);\n\n\t\t\t\tfor (let order of orders)\n\t\t\t\t{\n\t\t\t\t\tif (order.is_buy)\n\t\t\t\t\t{\n\t\t\t\t\t\tfound_buy_order = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfound_sell_order = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (found_buy_order && found_sell_order) continue;\n\n\t\t\t\t// get the latest ticker for the token\n\t\t\t\tvar ticker = await EtherMiumApi.getTickers(token[0], this.ethAddress);\n\n\t\t\t\tif (!found_buy_order)\n\t\t\t\t{\n\t\t\t\t\tvar balance = await EtherMiumApi.getMyBalance(this.ethAddress);\n\t\t\t\t\tif (balance.decimal_adjusted_balance - balance.decimal_adjusted_in_orders < 0.2)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.error(`[updateOrders] Insufficient balance to place BUY order`);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar highestBid = ticker.highestBid;\n\n\t\t\t\t\tvar orderPrice = new BigNumber(highestBid).times(1-this.buyOrderMarkUp);\n\t\t\t\t\tvar amount = new BigNumber(this.orderEthValue).div(orderPrice).toFixed(8);\n\n\t\t\t\t\tvar result = await EtherMiumApi.placeLimitOrder(\n\t\t\t\t\t\t'BUY', \n\t\t\t\t\t\torderPrice.toFixed(0), \n\t\t\t\t\t\tamount, \n\t\t\t\t\t\ttoken[0], \n\t\t\t\t\t\ttoken[1], \n\t\t\t\t\t\tthis.ethAddress, \n\t\t\t\t\t\t18, \n\t\t\t\t\t\tcurrentBlock+this.orderLife\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (!found_sell_order)\n\t\t\t\t{\n\t\t\t\t\tvar balance = await EtherMiumApi.getMyBalance(token[0]);\n\t\t\t\t\tvar lowestAsk = ticker.lowestAsk;\n\t\t\t\t\tif ((balance.decimal_adjusted_balance - balance.decimal_adjusted_in_orders)*lowestAsk < 0.2)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.error(`[updateOrders] Insufficient balance to place SELL order`);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar orderPrice = new BigNumber(lowestAsk).times(1+this.sellOrderMarkUp);\n\t\t\t\t\tvar amount = new BigNumber(this.orderEthValue).div(orderPrice).toFixed(8);\n\n\t\t\t\t\tvar result = await EtherMiumApi.placeLimitOrder(\n\t\t\t\t\t\t'SELL', \n\t\t\t\t\t\torderPrice.toFixed(0), \n\t\t\t\t\t\tamount, \n\t\t\t\t\t\ttoken[0], \n\t\t\t\t\t\ttoken[1], \n\t\t\t\t\t\tthis.ethAddress, \n\t\t\t\t\t\t18, \n\t\t\t\t\t\tcurrentBlock+this.orderLife\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\tconsole.error(`[updateOrders] Error=${error.message}`);\n\t\t}\n\t}", "async sendSpendTokensTransaction(amount, paymentIdentifier, recipient, passport, passphrase, wait) {\n let neo = this;\n return new Promise(async (resolve, reject) => {\n if (!amount) {\n reject(\"amount not provided\");\n }\n if (!passport) {\n reject(\"passport not provided\");\n }\n if (!passphrase) {\n reject(\"passphrase not provided\");\n }\n\n if (!recipient)\n recipient = _bridgeContractAddress;\n\n try {\n let addressScriptHash = this._getAddressScriptHash(passport.wallets[0].address);\n let recipientScriptHash = this._getAddressScriptHash(recipient);\n let args = [\n addressScriptHash,\n passport.id,\n recipientScriptHash,\n amount,\n addressScriptHash\n ];\n\n //invoke <contracthash> \"spend\" [address, identity, amount, provider]\n //address = your public neo address being used to sign the invocation / tx\n //identity = bridge passport id to deposit funds to\n //recipient = the recipient address for the payment\n //amount = number of tokens\n //provider = the account paying the tokens for the action\n let tx = await this._createAndSignTransaction(_bridgeContractHash, 'spend', args, passport, passphrase, paymentIdentifier);\n\n //Relay the transaction\n if (wait)\n resolve(await this._relayTransactionWaitStatus(tx));\n else\n resolve(this._relayTransaction(tx));\n }\n catch (err) {\n reject(err);\n return;\n }\n });\n }", "async function withdrawTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender);\n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: true,\n isWritable: true,\n },\n {\n // master pda\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n {\n // data storage pda\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeWithdrawInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "async send(receiverP, sendValue) {\n const amount = AmountMath.make(brand, sendValue);\n const payment = await E(purse).withdraw(amount);\n try {\n await E(receiverP).receive(payment);\n } catch (e) {\n // Recover the failed payment.\n await E(purse).deposit(payment);\n throw e;\n }\n }", "get(bet_param) {\n const _this = this;\n const t = this.t;\n bet_param = this.processBarrier(bet_param);\n const contract_map = {\n ASIANU: (param) => {\n return t.translate('[currency] [amount] payout if the last tick of [underlying] is strictly higher than the average of the [tick_count] ticks.', param);\n },\n ASIAND: (param) => {\n return t.translate('[currency] [amount] payout if the last tick of [underlying] is strictly lower than the average of the [tick_count] ticks.', param);\n },\n CALL: (param) => {\n if (param.tick_expiry === 1) { // Tick trade\n return t.translate('[currency] [amount] payout if [underlying] after [tick_count] ticks is strictly higher than [entry_spot].', param)\n }\n\n if (param.is_forward_starting === 1) {\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n param.date_start = _this.getDateTime(param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [duration] after [date_start].', param)\n }\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n // Daily normal constracts.\n param.date_expiry = 'close on ' + _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [date_expiry].', param)\n }\n\n if (param.fixed_expiry === 1) { //Fixed expiry\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [date_expiry].', param)\n }\n // Intraday normal contracts having duration in minutes, seconds, or hours.\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [duration] after contract start time.', param)\n },\n DIGITDIFF: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is not [barrier] after [tick_count] ticks.', param);\n },\n DIGITEVEN: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is even after [tick_count] ticks.', param);\n },\n DIGITMATCH: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is [barrier] after [tick_count] ticks.', param);\n },\n DIGITODD: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is odd after [tick_count] ticks.', param);\n },\n DIGITOVER: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is higher than [barrier] after [tick_count] ticks.', param);\n },\n DIGITUNDER: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is lower than [barrier] after [tick_count] ticks.', param);\n },\n EXPIRYMISS: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at [duration] after contract start time.', param);\n },\n EXPIRYRANGE: (param) => {\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at [duration] after contract start time.', param);\n },\n NOTOUCH: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through [duration] after contract start time.', param);\n },\n ONETOUCH: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through [duration] after contract start time.', param);\n },\n PUT: (param) => {\n if (param.tick_expiry === 1) { // Tick trade\n return t.translate('[currency] [amount] payout if [underlying] after [tick_count] ticks is strictly lower than [entry_spot].', param)\n }\n\n if (param.is_forward_starting === 1) {\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n param.date_start = _this.getDateTime(param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [duration] after [date_start].', param)\n }\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n // Daily normal constracts.\n param.date_expiry = 'close on ' + _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [date_expiry].', param)\n }\n\n if (param.fixed_expiry === 1) { //Fixed expiry\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [date_expiry].', param)\n }\n // Intraday normal contracts having duration in minutes, seconds, or hours.\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [duration] after contract start time.', param)\n },\n SPREAD: () => {\n return t.translate('Legacy contract. No further information is available.');\n }\n };\n if(typeof contract_map[bet_param.bet_type] === 'undefined'){\n return 'Invalid short code.';\n }\n return contract_map[bet_param.bet_type](bet_param);\n }", "async function main(){\n // return 0;\n accounts = await web3.eth.getAccounts();\n \n //return 0;\n web3.eth.defaultAccount = accounts[1];\n address = web3.eth.defaultAccount;\n \n tc = await new web3.eth.Contract(JSON.parse(JSON.stringify(abi)) ).deploy({ data: bytecode }).send({from:address , gas: '1000000', value: '2000000000'} );\n \n await tc.methods.setDataToDb(2 ,2 , \"Ahmad\", \"Khan\").send({from: accounts[0]}).then(transaction => {\n landModule.create({land_id: 2, age: 2, first_name: \"Ahmad\", last_name: \"Khan\"}, (err, resp) => {\n if(err) {\n console.log(error);\n }\n else {\n console.log('adeedeeeee');\n }\n });\n });\n await tc.methods.GetValue(2).call().then( function( value ) { console.log( \"Current Value: \", value ); } );\n}" ]
[ "0.6989427", "0.68070185", "0.6780074", "0.67103094", "0.6587158", "0.6583129", "0.65667874", "0.65234774", "0.65128905", "0.64936507", "0.64729595", "0.6448512", "0.64294785", "0.6427884", "0.6357085", "0.6284114", "0.6282304", "0.6257249", "0.62560284", "0.6250145", "0.6244345", "0.62287134", "0.6208633", "0.6200395", "0.6195548", "0.61727595", "0.6164086", "0.61611605", "0.6144556", "0.6093981", "0.60847634", "0.6081713", "0.6064512", "0.6057077", "0.60492665", "0.6043409", "0.6043254", "0.6034098", "0.60272825", "0.60164577", "0.60080224", "0.60002613", "0.598303", "0.5978834", "0.59727937", "0.59700257", "0.59623915", "0.5945547", "0.5944064", "0.5934304", "0.5933427", "0.592985", "0.5926281", "0.5923554", "0.59224665", "0.5921645", "0.5921038", "0.590631", "0.5904312", "0.59039545", "0.5901574", "0.5894216", "0.5892871", "0.58920825", "0.5889628", "0.5884903", "0.5882325", "0.587928", "0.5875094", "0.5874618", "0.58595264", "0.58535236", "0.5852768", "0.5849367", "0.58449244", "0.58420396", "0.58362645", "0.5834811", "0.5834056", "0.58312213", "0.58295935", "0.58285946", "0.5824949", "0.5820413", "0.5818894", "0.5814639", "0.58129716", "0.5811649", "0.5798965", "0.57978565", "0.5792387", "0.5789599", "0.57869816", "0.5782613", "0.5782022", "0.57796466", "0.5772957", "0.5772911", "0.5772151", "0.5770702" ]
0.7291198
0
Interacts with smart contract to sell PCT
async function sellPCT() { try { await erc20.sellToken(transAmount); // Listens for event on blockchain await erc20.on("PCTSellEvent", (from, to, amount) => { setPendingFrom(from.toString()); setPendingTo(to.toString()); setPendingAmount(amount.toString()); setIsPending(true); }) } catch (err) { if (typeof err.data !== 'undefined') { setErrMsg("Error: " + err.data.message); } setIsError(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async instantiate(ctx){\n console.log('************ Pharnet Transporter Smart Contract Instantiated *************');\n\t}", "async approveCompound(){\n let spender = Compound.util.getAddress(Compound.cDAI, process.env.ETH_NETWORK);\n //spender = '0xF0d0EB522cfa50B716B3b1604C4F0fA6f04376AD'; //cDAI\n console.log('spender: ' + spender);\n let param = cDAI.methods().approve.call({ spender: spender, amount: '3000000000000000000' });\n //let address = '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa';//DAI\n let address = Compound.util.getAddress(Compound.DAI, process.env.ETH_NETWORK);\n console.log('address: ' + address);\n console.log(param);\n this.printInputData(param.data);\n console.log('data: ' + param.data);\n\n let parameter = {\n address: address,\n amount: param.amount,\n data: param.data\n };\n\n let currency = process.env.ETH;\n console.log('Start Bitgo SDK interaction');\n await this.bitgo.unlock();\n let transaction = await this.bitgo.sendBitGoTx([parameter], currency);\n await this.bitgo.lock();\n return transaction;\n }", "function I(t,e){if(!s)var s=\"https://ambrpay.io/api\";var a=e,n=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(a||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var n=s+\"/smartContractAddresses\";return r.getRequest(n,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,n,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(n=e,!n.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=n.wallet?n.wallet:t.receiverWallet,!a.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==n.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==n.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==n.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)n.daysInterval=parseInt(t.interval);else if(-1==n.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=n.transferOut),n.acceptedCryptoCurrencies.Ethereum.price>0)return n.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=n.currencyCode){if(o<1)throw\"the minimum amount is \"+n.currencyCode+\" 1.00 \";return r.getExchangePrice(n.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*n.fee,c=1e18*c/1e18,a.utils.isAddress(n.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+n.priceLimitPercentage/100);return new Promise((function(t,i){var l=new a.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,n.daysInterval,a.utils.toWei(d.toString(),\"ether\"),u,a.utils.toWei(c.toString(),\"ether\")).send({value:a.utils.toWei(o.toString(),\"ether\"),gas:5e5,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(a){var c={subscriptionPlanId:n.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:a.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return a.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,a){var n=s+\"/price/\"+t+\"/\"+e+\"/\"+a;return r.getRequest(n)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var a=new XMLHttpRequest;a.open(\"GET\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){if(4==a.readyState&&200==a.status)return e(a.responseText);4==a.readyState&&200!=a.status&&s(a.responseText)},a.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,a){var n=new XMLHttpRequest;n.open(\"POST\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){4==n.readyState&&200==n.status?s(n.responseText):4==n.readyState&&200!=n.status&&a(n.responseText)},n.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==a&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(n)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var n=new a.eth.Contract(r.ABI.abi,r.contractAddress),i=n.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,a){if(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(n){return a.eth.getBalance(n,(function(n,r){if(n)return s(n);var i=a.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,n){var i=new a.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){n(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(n).send({value:a.utils.toWei(t),gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(a.utils.toWei(t)).send({gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function send_contract() {\n console.log(\"Sending contract\");\n\n // get hash of contract to enable reopening later if needed\n previous_contract_hash = consumer.commitmentTx._getHash();\n previous_contract_hash = reverse_array(previous_contract_hash);\n console.log('previous_contract_hash: ');\n print_array(previous_contract_hash);\n\n // TODO: handle edge case where first payment is also last\n var sigtype = Signature.SIGHASH_ANYONECANPAY | Signature.SIGHASH_SINGLE;\n consumer.incrementPaymentBy(min_initial_payment, sigtype);\n last_increment = min_initial_payment;\n var signature_buffer = get_payment_update_signature(sigtype);\n refund_amount = consumer.paymentTx.outputs[0].satoshis;\n //console.log(\"contract hash: \" + consumer.commitmentTx.id);\n console.log(\"paymentTx.paid = \" + consumer.paymentTx.paid);\n console.log(\"refund_amount: \" + refund_amount);\n\n /*\n console.log(\"refund_amount: \" + refund_amount);\n// console.log(\"multisig script: \" + consumer.commitmentTx.outscript.toHex());\n console.log(\"paymentTx: \" + consumer.paymentTx.id);\n console.log(\"changeAddress: \" + consumer.paymentTx.changeAddress.toString());\n console.log(\"changeScript: \" + consumer.paymentTx._changeScript.toString());\n //console.log(\"commitment_script: \" + consumer.commitmentTx.outputs[0].script.toString());\n */\n var msg = new Message({\n \"type\": Message.MessageType.PROVIDE_CONTRACT,\n \"provide_contract\": {\n \"tx\": consumer.commitmentTx.toBuffer(),\n \"initial_payment\": {\n \"client_change_value\": refund_amount,\n \"signature\": signature_buffer\n }\n }\n });\n send_message(msg);\n set_channel_state(CHANNEL_STATES.SENT_CONTRACT);\n}", "async function buyPCT() {\n\t\t// Converts integer as Eth to Wei,\n\t\tlet amount = await ethers.utils.parseEther(transAmount.toString());\n\t\ttry {\n\t\t\tawait erc20.buyToken(transAmount, { value: amount });\n\t\t\t// Listens for event on blockchain\n\t\t\tawait erc20.on(\"PCTBuyEvent\", (from, to, amount) => {\n\t\t\t\tsetPendingFrom(from.toString());\n\t\t\t\tsetPendingTo(to.toString());\n\t\t\t\tsetPendingAmount(amount.toString());\n\t\t\t\tsetIsPending(true);\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tif (typeof err.data !== 'undefined') {\n\t\t\t\tsetErrMsg(\"Error: \" + err.data.message);\n\t\t\t}\n\t\t\tsetIsError(true);\n\t\t}\n\t}", "async function main() {\n \n // const url = \"https://eth-ropsten.alchemyapi.io/v2/124IV9lnccOe5WGemFFqps7iLpzbCuT8\";\n // const web3 = new Web3(url);\n // const { address } = await web3.eth.accounts.privateKeyToAccount('0xbffa6ced3da1080e210f2a11c8c4c4b10e60fe3a0db3bf5f60260aea162a4d97');\n // console.log(\n // \"Deploying contracts with the account:\", \n // address\n // );\n // const contract = new web3.eth.Contract(NFT.abi);\n // const deployment = contract.deploy({\n // data: NFT.bytecode,\n // });\n // const gas = await deployment.estimateGas();\n\n // const signTransaction = new web3.eth.accounts.signTransaction({\n // data: NFT.bytecode,\n // from: address,\n // gas: gas,\n // gasPrice:'0x02540be400',\n // }, '0xbffa6ced3da1080e210f2a11c8c4c4b10e60fe3a0db3bf5f60260aea162a4d97');\n \n // const {\n // options: { address: contractAddress },\n // } = await web3.deployment.send({ from:address, gas:gas }); \n // const nftContract = new web3.eth.Contract(NFT.abi, contractAddress);\n // console.log(\"NFT Contract Address:\", nftContract.address);\n // console.log(nftContract); \n \n \n\n const [deployer] = await ethers.getSigners();\n\n console.log(\n \"Deploying contracts with the account:\",\n deployer.address\n );\n \n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const nftContract = await ethers.getContractFactory(\"NFT\");\n const myContract = await nftContract.deploy();\n\n console.log(\"Contract address:\", myContract.address);\n}", "trade() {\n let trade = {\n tokens: 2,\n priceWhenBought: 300,\n sold: false,\n status: \"PENDING\",\n }\n let investorId = \"5cbcc9c37892164cf88ae99b\";\n let brokerId = \"5cbccaa47892164cf88ae99c\";\n let cryptoId = \"5cbdc9b236e23d6b581fb43e\";\n this.investorService.requestTrade(investorId, brokerId, cryptoId, trade).then(regi => {\n console.log(\"Buy\");\n console.log(regi);\n });\n }", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "async connectToContract(){\n\n await this.auctionContract.connect( App.provider.getSigner(), this.auctionContract.contractAddress);\n this.auctionContract.registerToEvents(sellerUI);\n }", "async sendCUSD(){\n\n //Show the sending modal. \n this.setState({\n accountModalVisible : false,\n paymentsModalVisible : false,\n sendingModal : true,\n })\n\n /* Personal credentials to send CUSD. */\n let from_eth = this.state.publicKey\n let privateK = this.state.privateKey\n\n /* Person we will send eth to */\n let to_eth = this.state.eth_address\n \n // Amount to send. \n let amount = web3.utils.toWei(this.state.amount, 'ether')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n let web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n // Contract ABI’s\n let ABI = require(\"../contracts/MetaToken.json\");\n\n // Contract Ropsten Addresses\n let ADDRESS = \"0x67450c8908e2701abfa6745be3949ad32acf42d8\";\n\n let jsonFile = ABI;\n let abi = jsonFile.abi;\n let deployedAddress = ADDRESS;\n let cusd = new web3js.eth.Contract(abi, deployedAddress);\n\n\n //Create an ether wallet with the private key. \n let wallet = new ethers.Wallet(privateK)\n \n \n let to = cusd.options.address\n\n let data = cusd.methods.transfer(to_eth, amount).encodeABI()\n\n // let gasPrice = web3.utils.toWei('25', 'gwei')\n let gasPrice = await web3js.eth.getGasPrice()\n\n let gas = Math.ceil((await cusd.methods.transfer(to_eth, amount).estimateGas({ from: from_eth }))*1.2)\n \n // let nonce = await cusd.methods.replayNonce(from_eth).call();\n\n let nonce = await web3js.eth.getTransactionCount(from_eth);\n\n\n\n let transaction = {\n nonce: nonce,\n gasPrice: \"0x\" + gasPrice * 1.40, \n gasLimit: 2100000,\n to: to,\n value: 0,\n data: data,\n chainId: 3\n }\n \n // web3js.eth.signTransaction(tx, privateK).then((s) => {\n // console.log(s)\n // })\n \n \n\n //Sign promise. \n let signPromise = wallet.sign(transaction)\n\n \n\n // //Sign promise and return the transaction. \n signPromise.then((signedTransaction) => {\n\n\n web3js.eth.sendSignedTransaction(signedTransaction).on('receipt', (receipt) => { \n \n }).catch((err) => {\n \n }).then((final_receipt) => {\n\n //Make send success true. \n this.setState({\n sendSuccess : true \n })\n\n });\n\n })\n\n\n\n\n\n }", "function tally() {\n\n // Ethereum Account needs to be unlocked.\n if(!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n // Make sure we are in the correct phase.\n if(state != 2) {\n alert(\"Please wait until VOTE Phase\");\n return;\n }\n var reg = anonymousvotingAddr.totalregistered();\n var voted = anonymousvotingAddr.totalvoted();\n\n // Make sure everyone has voted!\n if(!reg.equals(voted)) {\n alert(\"Please wait for everyone to vote\");\n return;\n }\n\n //TODO: Check that all votes have been cast..\n // Can do this by checking the public 'votecast' mapping...\n web3.personal.unlockAccount(web3.eth.accounts[accountindex],password);\n var res = anonymousvotingAddr.computeTally.sendTransaction({from:web3.eth.accounts[accountindex], gas: 4200000});\n document.getElementById(\"tallybutton\").innerHTML = \"Waiting for Ethereum to confirm tally\";\n txlist(\"Compute Tally: \" + res);\n}", "async function main() {\n const otokenToBuy = '0xbceb20506a60a59a45109e12d245ac7e2daf2f60' // sender token\n const weth = '0xd0a1e359811322d97991e03f863a0c30c2cf029c' // signer token\n \n const swap = '0x79fb4604f2D7bD558Cda0DFADb7d61D98b28CA9f'\n const shortAction = '0xcA50033F6c3e286D9891f6658298f6EbfD9A8D43'\n \n const [, signer] = await hre.ethers.getSigners();\n\n\n // amount of otoken to buy\n const senderAmount = (0.9 * 1e8).toString()\n const collateralAmount = (0.9 * 1e18).toString()\n\n // amount of weth signer is paying\n const signerAmount = (0.1 * 1e18).toString()\n\n // use the second address derived from the mnemonic\n \n const order = createOrder({\n signer: {\n wallet: signer.address,\n token: weth,\n amount: signerAmount,\n },\n sender: {\n wallet: shortAction,\n token: otokenToBuy,\n amount: senderAmount,\n },\n expiry: parseInt((Date.now() / 1000).toString()) + 86400\n })\n\n const signedOrder = await signOrder(order, signer, swap);\n\n console.log(`signedOrder`, signedOrder)\n \n // Fill the order!\n const ShortAction = await hre.ethers.getContractFactory('ShortOTokenActionWithSwap');\n const shortActionContract = await ShortAction.attach(shortAction)\n await shortActionContract.mintAndSellOToken(collateralAmount, senderAmount, signedOrder)\n}", "async function firstTx() {\n // counterfactual addresses\n const nonce = await buildNonceForAddress(dao, 0, provider);\n const newAddress = await calculateNewProxyAddress(dao, nonce);\n votingAggregator = newAddress;\n\n // function signatures\n const newAppInstanceSignature =\n 'newAppInstance(bytes32,address,bytes,bool)';\n const createSignature = 'createPermission(address,address,bytes32,address)';\n const grantSignature = 'grantPermission(address,address,bytes32)';\n const aggregatorInitSignature = 'initialize(string,string,uint8)';\n const addPowerSourceSignature =\n 'addPowerSource(address _sourceAddr, uint8 _sourceType, uint256 _weight)';\n\n // app initialisation payloads\n const aggregatorInitPayload = await encodeActCall(aggregatorInitSignature, [\n 'Inbox',\n 'INBOX',\n 18,\n ]);\n\n // package first transaction\n // issues\n // 1. Promises 😩 aggregator address is not being resolved before calling second `encodeActCall`. HardCoded to move on\n // 2. `addPowerSourceSignature` requires an enum, not sure how to handle this other than changing it to `uint8`\n // 3. `_executionScript` requires meta data, can i use anything i like?\n // 4. the aggregator is failing to execute `you may not have permission` error when trying to vote\n const calldatum = await Promise.all([\n encodeActCall(newAppInstanceSignature, [\n utils.namehash('voting-aggregator.open.aragonpm.eth'),\n votingAggregator,\n aggregatorInitPayload,\n false,\n ]),\n encodeActCall(createSignature, [\n sabVoting,\n votingAggregator,\n keccak256('ADD_POWER_SOURCE_ROLE'),\n sabVoting,\n ]),\n encodeActCall(createSignature, [\n sabVoting,\n votingAggregator,\n keccak256('MANAGE_POWER_SOURCE_ROLE'),\n sabVoting,\n ]),\n encodeActCall(createSignature, [\n sabVoting,\n votingAggregator,\n keccak256('MANAGE_WEIGHTS_ROLE'),\n sabVoting,\n ]),\n encodeActCall(addPowerSourceSignature, [comToken, 1, 1]),\n ]);\n\n // Encode all actions into a single EVM script.\n const actions = calldatum.map((calldata) => ({\n to: acl,\n calldata,\n }));\n\n const script = encodeCallScript(actions);\n\n await execAppMethod(dao, sabVoting, 'newVote', [script, 'title'], env);\n}", "async deposit_pug_ewt_clp(amount) {\n if (amount != 0) {\n const user_farm_0 = await this.state.farmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"20000\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n if (this.state.pMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n const allowed = await this.state.farmContracts[0].methods\n .approve(this.state.pmasterChefAddress, allow)\n .send({ from: this.state.account });\n\n //TODO: 2\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.pMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "function placeBuyOrder (p) {\n\n}", "async function main() {\n const contractName = \"UniLion\";\n const [ deployer ] = await hre.ethers.getSigners();\n const network = await hre.ethers.provider.getNetwork() // needs to be this router address for testnet in order for swapbnb to work\n const routerAddress = (network.name == \"bnb\") ? \"0x10ED43C718714eb63d5aA57B78B54704E256024E\" : \"0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3\" // or testnet: 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3, 0xD99D1c33F9fC3444f8101754aBC46c52416550D1\n const balance = await deployer.getBalance();\n console.log(`Deploying on network: ${network.name}, using router address ${routerAddress}`)\n console.log(`Deploying Contract with Account: ${deployer.address}`) \n console.log(`Account Balance: ${balance.toString()}`) \n const contract = await hre.ethers.getContractFactory(contractName);\n const unilion = await contract.deploy(routerAddress, snipers.addresses);\n await unilion.deployed();\n console.log(\"UniLion Contract Deployed:\", unilion.address);\n if (network.name != 'unknown') {\n let blockchainHost = (network.name != 'bnbt') ? \"bscscan.com\" : \"testnet.bscscan.com\"\n console.log(`Contract URL: https://${blockchainHost}/address/${unilion.address}`)\n }\n console.log(`Console Script: const token = await (await ethers.getContractFactory(\"${contractName}\")).attach(\"${unilion.address}\")`)\n}", "async instantiate(ctx) {\n console.log(\"Smart Contract Instantiated\");\n }", "async function purchase() {\n\n // SHOW LOADING SCREEN\n dispatch({\n type: 'show-prompt',\n payload: 'loading'\n })\n\n // FETCH THE TOKEN PRICE\n const token_price = await read({\n contract: 'token',\n func: 'price',\n }, state)\n\n // ATTEMPT TO BUY TOKENS\n const result = await write({\n contract: 'token',\n func: 'purchase',\n args: [input.amount.value],\n payable: input.amount.value * token_price\n }, state)\n\n // SLEEP FOR 2 SECONDS TO SMOOTHEN TRANSITION\n await sleep(2)\n\n // EVERYTHING WENT FINE\n if (result.success) {\n\n // CREATE TOAST MESSAGE\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'good',\n msg: 'tokens purchased'\n }\n })\n\n // OTHERWISE, SHOW ERROR\n } else {\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'bad',\n msg: result.reason\n }\n })\n }\n\n // HIDE THE PROMPT WINDOW\n dispatch({ type: 'hide-prompt' })\n }", "async function main() {\n\n const CONTRACTS = [ \n { address: \"0xCdB0c60EA5bF50641A570E25875EAB6c889E949d\", abi : DYNAMIC_FARM_ABI, rewardToken: \"dynamicTracker\", stakeToken: \"lpt\"},\n { address: \"0x030cF06D8A39d5Ef4b169EAc0D4D5B0c51b42194\", abi : DYNAMIC_FARM_ABI, rewardToken: \"dynamicTracker\", stakeToken: \"lpt\"}\n ];\n \n const App = await init_ethers();\n \n _print(`Initialized ${App.YOUR_ADDRESS}`);\n _print(\"Reading smart contracts...\\n\");\n \n var tokens = {};\n var prices = {};\n let tvl = 0;\n \n for (const c of CONTRACTS) {\n try {\n const { staked_tvl } =await loadSynthetixPool(App, tokens, prices, c.abi, c.address, c.rewardToken, c.stakeToken);\n tvl += staked_tvl;\n }\n catch (ex) {\n console.error(ex);\n }\n }\n const BOARDROOM_ADDRESS = \"0x175B1A116028508aC3A4e4B62722b845C3bD1ab3\";\n const ORACLE_ADDRESS = \"0x3a9a1cec3546b4fb810756cd3ad072a3d6345a8a\"\n const DAI_DST_ADDRESS = \"0x706b21bf60adb79d2326d39086e4c27766193185\"\n const REWARD_TOKEN_ADDRESS = \"0xfa9c3dc54baa9eefbe9453b1f3b3b93ad2af0a77\";\n\n const br_tvl = await loadBoardroom(App, prices, BOARDROOM_ADDRESS, ORACLE_ADDRESS, DAI_DST_ADDRESS, REWARD_TOKEN_ADDRESS,\n \"DSTR\", \"DST\", 4, 0.1, 2, 1, 24);\n tvl += br_tvl.staked_tvl;\n _print_bold(`Total staked: $${formatMoney(tvl)}`);\n\n hideLoading();\n }", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', 'sherlocked123@gmail.com', 'sherlocked123@gmail.com', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', 'a12@gmail.com', 'a12@gmail.com', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', 'a@gmail.com', 'a@gmail.com', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, 'a@gmail.com','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', 'b012@gmail.com', 'b012@gmail.com', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', 'b123@gmail.com', 'b012@gmail.com', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', 'b012@gmail.com', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', 'a1234@gmail.com', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "async function example1 () {\n exchange['options']['defaultType'] = 'spot'; // very important set spot as default type\n\n await exchange.loadMarkets ();\n\n // fetch spot balance\n const balance = await exchange.fetchBalance ();\n console.log (balance)\n\n // create order\n const symbol = 'LTC/USDT';\n const createOrder = await exchange.createOrder (symbol, 'limit', 'buy', 50, 0.1);\n console.log ('Created order id:', createOrder['id'])\n\n // cancel order\n const cancelOrder = await exchange.cancelOrder (createOrder['id'], symbol);\n\n // Check canceled orders (bybit does not have a single endpoint to check orders\n // we have to choose whether to check open or closed orders and call fetchOpenOrders\n // or fetchClosedOrders respectively\n const canceledOrders = await exchange.fetchClosedOrders (symbol);\n console.log (canceledOrders);\n}", "async function main() {\n\n let frequency = 1;\n let price = ethers.utils.parseEther(\"1\");\n let fee = ethers.utils.parseEther(\"0.03\");\n let name = \"Roam Fantom Lottery\";\n let recipient = '0x19FF17645bd4930745e632284422555466675e44';\n let modulus = 2;\n\n // This is just a convenience check\n if (network.name === \"hardhat\") {\n console.warn(\n \"You are trying to deploy a contract to the Hardhat Network, which\" +\n \"gets automatically created and destroyed each time. Use the Hardhat\" +\n \" option '--network localhost'\"\n );\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n\n console.log(\"Account Balance:\", (await deployer.getBalance()).toString());\n\n const Lotto = await ethers.getContractFactory(\"FantomLottery\");\n const lottery = await Lotto.deploy(name, frequency, ethers.utils.parseEther(\"1\"), modulus, ethers.utils.parseEther(\"0.03\"), recipient);\n\n await lottery.deployed();\n\n console.log(\"Lotto Address:\", lottery.address);\n\n // We also save the contract's artifacts and address in the frontend directory\n saveFrontendFiles(lottery);\n}", "async function main() {\n const [deployer] = await ethers.getSigners();\n\n console.log(\"Deploying account:\", await deployer.getAddress());\n console.log(\n \"Deploying account balance:\",\n (await deployer.getBalance()).toString(),\n \"\\n\"\n );\n\n const NFTXV1Buyout = await ethers.getContractFactory(\"NFTXV1Buyout\");\n const v1Buyout = await upgrades.deployProxy(NFTXV1Buyout, [], {\n initializer: \"__NFTXV1Buyout_init\",\n });\n await v1Buyout.deployed();\n\n console.log(\"NFTXV1Buyout:\", v1Buyout.address);\n\n const ProxyController = await ethers.getContractFactory(\n \"ProxyControllerSimple\"\n );\n\n const proxyController = await ProxyController.deploy(v1Buyout.address);\n await proxyController.deployed();\n console.log(\"ProxyController address:\", proxyController.address);\n\n console.log(\"\\nUpdating proxy admin...\");\n\n await upgrades.admin.changeProxyAdmin(\n v1Buyout.address,\n proxyController.address\n );\n\n console.log(\"Fetching implementation addresses...\");\n\n await proxyController.fetchImplAddress({\n gasLimit: \"150000\",\n });\n\n console.log(\"Implementation address:\", await proxyController.impl());\n\n console.log(\"Transfering ownerships...\");\n await v1Buyout.transferOwnership(founderAddress);\n await proxyController.transferOwnership(founderAddress);\n\n console.log(\"\");\n}", "async function send() {\n // make sure `data` starts with 0x\n const contract = new caver.klay.Contract(LoonGEM.abi, '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF');\n const pebToken = caver.utils.toPeb(50000000, 'KLAY');\n const data = await contract.methods.transfer(receiverAddress, pebToken).encodeABI();\n\n const { rawTransaction: senderRawTransaction } = await caver.klay.accounts.signTransaction({\n type: 'FEE_DELEGATED_SMART_CONTRACT_EXECUTION',\n from: sender.address,\n to: '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF',\n data: data,\n gas: '3000000',\n value: 0,\n }, sender.privateKey);\n\n // signed raw transaction\n console.log(\"Raw TX:\\n\", senderRawTransaction);\n \n // send fee delegated transaction with fee payer information\n caver.klay.sendTransaction({\n senderRawTransaction: senderRawTransaction,\n feePayer: payer.address\n })\n .on('transactionHash', function (hash) {\n console.log(\">>> tx_hash for deploy =\", hash);\n })\n .on('receipt', function (receipt) {\n console.log(\">>> receipt arrived: \", receipt);\n })\n .on('error', function (err) {\n console.error(\">>> error: \", err);\n });\n}", "submitOrder() {\n // First give the exchange the appropriate allowance\n // NOTE if the submitOrder fails the exchange still has the allowance\n this.state.token.approve(\n this.state.exchange.address,\n this.state.bidAmount*10**this.state.tokenDecimals, {\n from: this.web3.eth.accounts[this.state.defaultAccount],\n gas: 1e6\n }, (err, res) => {\n if (err) console.error(err)\n else console.log(res)\n // Submit the order to the exchange\n this.state.exchange.submitOrder(\n this.state.token.address,\n this.state.bidAmount*10**this.state.tokenDecimals,\n '0', // Ether address\n this.state.askAmount*10**18 /* harcoded ETH decimal places */, {\n from: this.web3.eth.accounts[this.state.defaultAccount],\n gas: 1e6\n }, (err, res) => {\n if (err) console.error(err)\n else console.log(res)\n }\n )\n })\n }", "submitAuction(objectDescription){\n this.auctionHouseContract.submitAuction(objectDescription);\n }", "function deploy_contract() {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n console.log(\"The gas block limit is: \" + block.gasLimit.toString());\n if (!error) {\n var transaction_object = {\n chainId: web3.utils.toHex(newBlockchain.getChainId()),\n from: document.getElementById(\"public_key_input\").value,\n gasPrice: web3.utils.toHex(gas_price),\n gas: web3.utils.toHex(block.gasLimit.toString()),\n data: bytecode\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Please wait for about 10 seconds for transaction to be confirmed ...\";\n setTimeout(function() {\n web3.eth.getTransactionReceipt(sent_tx, function(err, res_rec) {\n if (!err) {\n if (res_rec != null && res_rec != undefined) {\n //console.log(\"Success, we now have a transaction receipt: \" + JSON.stringify(res_rec));\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Contract address: \" + res_rec[\"contractAddress\"];\n newContract.setAddress(res_rec[\"contractAddress\"]);\n console.log(\"New contract at: \" + newContract.getAddress());\n var multiswapContractInstance = new web3.eth.Contract(abi, res_rec[\"contractAddress\"]);\n newContract.setContractInstanceObject(multiswapContractInstance);\n }\n } else {\n console.log(\"Unable to get transaction receipt \" + err);\n }\n });\n }, 60000);\n\n } else {\n console.log(\"*\\nSend signed transaction failed: \" + error);\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n}", "sendBill() {}", "deploy() {\n if (this.deployed && this.contractAddress) {\n console.log(\"Deploy function already called\");\n this.UserContract = this.USER.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.JoeContract = this.JOE.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.StoreContract = this.STORE.then(web3 => {\n return new web3.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n\n return new Promise((resolve) => {resolve(this.contractAddress)});\n }\n\n // else deploy the contract\n return this.STORE.then((web3) => {\n let bytecode = KaleidoKardsContract.bytecode;\n let abi = KaleidoKardsContract.abi;\n\n let contract = new web3.eth.Contract(abi);\n console.log(\"Getting kard_store account to deploy new contract\");\n return web3.eth.getAccounts().then((accounts) => {\n console.log(\"Deploying new contract from address: \" + accounts[0]);\n return contract.deploy({data: bytecode}).send({data: bytecode, from: accounts[0], gasPrice: 0, gas: 2000000})\n .then( (response) => {\n this.contractAddress = response._address;\n console.log(\"Successfully deployed at address: \" + this.contractAddress);\n\n this.UserContract = this.USER.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.JoeContract = this.JOE.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.StoreContract = this.STORE.then(response => {\n // return new response.eth.Contract(KaleidoKardsContract.abi, '0xb7a996f99afff30a8a7c5b95aa9617f0985da9ee');\n return new response.eth.Contract(KaleidoKardsContract.abi, this.contractAddress);\n });\n this.deployed = true;\n return this.contractAddress;\n });\n })\n })\n\n }", "async function sell(_hash,_tokens,_price,_account,_key){\r\n return new Promise(async(resolve) =>{\r\n let _contract = await getContract();\r\n\r\n const d = _contract.methods.sell(_tokens,_price);\r\n \r\n checkTransaction(_hash,_account,_key,d).then(res =>{\r\n resolve(res);\r\n });\r\n });\r\n}", "checkPermissionsModify(result, contracts, currentWallet, appName) {\n const { sellNum } = this.props;\n const { nightElf } = this.state;\n const wallet = {\n address: currentWallet.address\n };\n contractChange(nightElf, result, currentWallet, appName).then(result => {\n if (sellNum && !result) {\n nightElf.chain.contractAt(\n contracts.multiToken,\n wallet,\n (err, contract) => {\n if (contract) {\n this.getApprove(contract);\n }\n }\n );\n } else {\n message.info('Contract renewal completed...', 3);\n this.setState({\n sellBtnLoading: false\n });\n }\n });\n }", "async instantiate(ctx){\n console.log('Pharmanet Contract instantiated')\n }", "function processChasePay() {\n\n try {\n var apiClient = new CybersourceRestApi.ApiClient();\n var instance = new CybersourceRestApi.PaymentApi(apiClient);\n\n var clientReferenceInformation = new CybersourceRestApi.V2paymentsClientReferenceInformation();\n clientReferenceInformation.code = \"TC_MPOS_Paymentech_3\";\n\n var evm = new CybersourceRestApi.V2paymentsPointOfSaleInformationEmv();\n evm.cardSequenceNumber = \"123\";\n evm.tags = \"9C01019A031207109F33036040209F1A0207849F370482766E409F3602001F82025C009F2608EF7753429A5D16B19F100706010A03A00000950580000400009F02060000000700009F6E0482766E409F5B04123456789F2701809F3403AB12349F0902AB129F4104AB1234AB9F0702AB129F0610123456789012345678901234567890AB9F030200005F2A0207849F7C031234569F350123\";\n\n var pointOfSaleInformation = new CybersourceRestApi.V2paymentsPointOfSaleInformation();\n pointOfSaleInformation.terminalId = \"terminal\";\n pointOfSaleInformation.cardPresent = \"Y\";\n pointOfSaleInformation.entryMode = \"QRCode\";\n pointOfSaleInformation.terminalCapability = \"4\";\n pointOfSaleInformation.evm = evm;\n\n var processingInformation = new CybersourceRestApi.V2paymentsProcessingInformation();\n processingInformation.commerceIndicator = \"retail\";\n processingInformation.paymentSolution = \"007\";\n\n var billTo = new CybersourceRestApi.V2paymentsOrderInformationBillTo();\n billTo.country = \"US\";\n billTo.lastName = \"Deo\";\n billTo.address2 = \"Address 2\";\n billTo.address1 = \"201 S. Division St.\";\n billTo.postalCode = \"48104-2201\";\n billTo.locality = \"Ann Arbor\";\n billTo.administrativeArea = \"MI\";\n billTo.firstName = \"John\";\n billTo.phoneNumber = \"999999999\";\n billTo.district = \"MI\";\n billTo.buildingNumber = \"123\";\n billTo.company = \"Visa\";\n billTo.email = \"test@cybs.com\";\n\n var amountDetails = new CybersourceRestApi.V2paymentsOrderInformationAmountDetails();\n amountDetails.totalAmount = \"115.00\";\n amountDetails.currency = \"USD\";\n\n var orderInformation = new CybersourceRestApi.V2paymentsOrderInformation();\n orderInformation.billTo = billTo;\n orderInformation.amountDetails = amountDetails;\n\n var tokenizedCard = new CybersourceRestApi.V2paymentsPaymentInformationTokenizedCard();\n tokenizedCard.transactionType = \"1\";\n tokenizedCard.requestorId = \"12345678901\";\n\n var card = new CybersourceRestApi.V2paymentsPaymentInformationCard();\n card.type = \"001\",\n card.trackData = \";4111111111111111=21121019761186800000?\";\n\n var paymentInformation = new CybersourceRestApi.V2paymentsPaymentInformation();\n paymentInformation.tokenizedCard = tokenizedCard;\n paymentInformation.card = card;\n\n var request = new CybersourceRestApi.CreatePaymentRequest();\n request.clientReferenceInformation = clientReferenceInformation;\n request.pointOfSaleInformation = pointOfSaleInformation;\n request.processingInformation = processingInformation;\n request.orderInformation = orderInformation;\n request.paymentInformation = paymentInformation;\n\n instance.createPayment(request, function (error, data, response) {\n if (error) {\n console.log(\"Error : \" + error);\n console.log(\"Error : \" + error.stack);\n console.log(\"Error status code : \" + error.statusCode);\n }\n else if (data) {\n console.log(\"Data : \" + JSON.stringify(data));\n }\n console.log(\"Response : \" + JSON.stringify(response));\n\n });\n } catch (error) {\n console.log(error);\n }\n}", "function bid() {\n // this calls the \"add\" function defined in the Solidity contract\n // the last argument is a callback to handle the result\n CONTRACT.bid( function(error, result) {\n if(error) { console.log(error) }\n })\n}", "function marketBuy () {\n\n}", "async accept({\n orderKey,\n quantity,\n acceptedPaymentMethod,//Not yet in action\n }) {\n\n await this.transact({\n name: 'accept',\n data: {\n order_key: orderKey,\n counterparty: await this.getAccountName(),\n quantity: quantity.toString(),\n }\n });\n }", "async function fundNocust() {\n await nocustManager.deposit(\n BOB_PUB, // Account from which to make a deposit (its private key needs to be in the Web3 instance)\n web3.utils.toWei('0.1','ether'), // Amount to deposit\n web3.utils.toWei('10','gwei'), // Gas price, 10 Gwei\n 150000 // Gas Limit\n );\n}", "async function deployContract() {\n /*\n `miniERC20.constructor` is construct method of `MiniERC20` contract,\n send constructor encoded transaction to deploy a contract,\n await till transaction `executed` to get receipt.\n */\n const receipt = await miniERC20\n .constructor('MiniERC20', 18, 'MC', 10000)\n .sendTransaction({ from: accountAlice })\n .executed();\n\n console.log('receipt', JSON.stringify(receipt, null, 2));\n // outcomeStatus == 0 means success, got created contract address '0x8ba2e83e8d58ad37c91ad72ea35961846b16793b'\n /*\n receipt {\n \"index\": 0,\n \"epochNumber\": 711763,\n \"outcomeStatus\": 0,\n \"gasUsed\": \"1054467\",\n \"gasFee\": \"1054467000000000\",\n \"blockHash\": \"0xb70ae9034ee2393f02d9afa4c5b2624f17f78ebdc06f6ec00c9421246fde1717\",\n \"contractCreated\": \"CFXTEST:TYPE.CONTRACT:ACF4F4B8VZPM4R8KDNNW7J43PGCG0FX3HPKZE0ZZEU\",\n \"from\": \"CFXTEST:TYPE.USER:AAR7X4R8MKRNW39GGS8RZ40J1ZNWH5MRRPUFPR2U76\",\n \"logs\": [],\n \"logsBloom\": \"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n \"stateRoot\": \"0x27ef34b1b70e3ee86d3154086c79d9ec8e391e33ffad046f232e47826079237a\",\n \"to\": null,\n \"transactionHash\": \"0x0215231b0f9f108dee4fc2a7b12f32ab5e14992d59506c05f96410fe6715c1d1\",\n \"txExecErrorMsg\": null\n }\n */\n}", "async createPO(ctx, buyerCRN, sellerCRN, drugName, quantity) {\n let errorMessage;\n let verifyBuyerOrRetailer = ctx.clientIdentity.getMSPID();\n //Verify if the function is called by either Buyer or Retailer.\n if (verifyBuyerOrRetailer === 'distributorMSP' || verifyBuyerOrRetailer === 'retailerMSP') {\n //Retrieving the buyer and seller details in an Array.\n let buyerDetails = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.company', buyerCRN);\n let sellerDetails = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.company', sellerCRN);\n let drugDetails = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.drug', drugName);\n //verifying if the Buyer and Seller and Drug are registered on the network\n if (buyerDetails.length !== 0 && sellerDetails.length !== 0 && drugDetails.length !== 0) {\n //converting the arrays into Json objects\n let buyerJsonObject = JSON.parse(buyerDetails[0]);\n let buyerName = buyerJsonObject.name;\n let sellerJsonObject = JSON.parse(sellerDetails[0]);\n let sellerName = sellerJsonObject.name;\n let buyerRole = buyerJsonObject.organisationRole;\n let sellerRole = sellerJsonObject.organisationRole;\n //Verifying the hirerachy of the Organisation\n if ((buyerRole === 'distributor' && sellerRole === 'manufacturer') || (buyerRole === 'retailer' && sellerRole === 'distributor')) {\n //Create a Request object to add the details of the PO on the blockchain\n let requestObject = {\n poId: {\n buyerCRN: buyerCRN,\n drugName: drugName\n },\n drugName: drugName,\n quantity: quantity,\n buyer: {\n buyerCRN: buyerCRN,\n buyerName: buyerName\n },\n seller: {\n sellerCRN: sellerCRN,\n sellerName: sellerName\n }\n };\n //Create the instance of the model class to save it to blockchain\n let poObj = PO.createInstance(requestObject);\n await ctx.poList.addPO(poObj);\n //returns the Jason object\n return poObj;\n } else {\n errorMessage = {\n message: 'Hierarchy of the organisation is not satisfied'\n }\n return errorMessage;\n }\n } else {\n errorMessage = {\n message: 'Please enter valid buyer and seller details'\n }\n return errorMessage;\n }\n } else {\n errorMessage = {\n message: 'Only Retailer or Distributor can create a Purchase Order'\n }\n return errorMessage;\n }\n }", "function placeSellOrder (p) {\n\n}", "buyStandardPack(node) {\n console.log(\"Buying standard pack of Kards for: \" + node);\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n return web3.eth.getAccounts().then(accounts => {\n return contract.methods.buyStandardPack().send({\n from: accounts[0],\n gas: this.targetGasLimit,\n value: web3.utils.toWei(this.standardPackCost, 'ether')\n })\n })\n });\n }", "function transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n if (Number(person2Release > 0)) {\r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:person2,quantity:person2Release + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n finalReturn(outputMessage);\r\n })\r\n .catch(function (err) { console.log('error103'); }) \r\n }) \r\n } else {\r\n // finish\r\n finalReturn(outputMessage);\r\n }\r\n}", "initiate_key_exchange(recipients, offchain=0, peer=null) {\n\n let recipient = \"\";\n let parties_to_exchange = 2;\n\n if (Array.isArray(recipients)) {\n if (recipients.length > 0) {\n recipients.sort();\n recipient = recipients[0];\n parties_to_exchange = recipients.length;\n }\n else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n } else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n\nconsole.log(\"recipient is: \" + recipient);\n if (recipient == \"\") { return; }\n\n let tx = this.app.wallet.createUnsignedTransactionWithDefaultFee(recipient, (parties_to_exchange * this.app.wallet.wallet.default_fee));\n\n //\n // we had an issue creating the transaction, try zero-fee\n //\n if (!tx) {\nconsole.log(\"zero fee tx creating...\");\n tx = this.app.wallet.createUnsignedTransaction(recipient, 0.0, 0.0);\n }\n\n tx.msg.module = this.name;\n tx.msg.request = \"key exchange request\";\n tx.msg.alice_publickey = this.app.keys.initializeKeyExchange(recipient);\n\n //\n // does not currently support n > 2\n //\n if (parties_to_exchange > 2) {\n for (let i = 1; i < parties_to_exchange; i++) {\n tx.transaction.to.push(new saito.slip(recipients[i], 0.0));\n }\n }\n\n tx = this.app.wallet.signTransaction(tx);\n\n if (offchain == 0) {\n this.app.network.propagateTransaction(tx);\n } else {\n let data = {};\n data.module = \"Encrypt\";\n\t data.tx = tx;\nconsole.log(\"sending request on network\");\n this.app.network.sendPeerRequest(\"diffie hellman key exchange\", data, peer);\n }\n this.saveEncrypt();\n\n }", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) {\n return this.okPressed = false;\n }\n\n if(!confirm(this._$filter(\"translate\")(\"EXCHANGE_WARNING\"))) {\n this.okPressed = false;\n return;\n }\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n });\n });\n\n var parameter = JSON.stringify({ip_address:this.externalIP,nem_address:this.address, btc_address:this.btc_sender, eth_address:this.eth_sender});\n this._$http.post(this.url + \"/api/sphinks\", parameter).then((res) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init(res);\n return;\n });\n }, (err) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "async function createSmartContracts() {\n console.log('Setting smart contract scripts...');\n AUCTION_SCRIPT_ADDRESS = await createAuctionContract()\n \n BIDDER_SCRIPT_ADDRESS = await createBidContract()\n\n listAuctions()\n}", "async function deployContract() {\n\n const contract = `[\n {\n \"prim\": \"storage\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"bool\", \"annots\": [ \"%active\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%chips_player1\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"int\", \"annots\": [ \"%chips_player2\" ] }, { \"prim\": \"int\", \"annots\": [ \"%winner\" ] } ] }\n ],\n \"annots\": [ \"%baseState\" ]\n },\n { \"prim\": \"string\", \"annots\": [ \"%id\" ] }\n ]\n }\n ]\n },\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%nextParty\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"address\", \"annots\": [ \"%address\" ] }, { \"prim\": \"mutez\", \"annots\": [ \"%bond\" ] } ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"bool\", \"annots\": [ \"%hasBond\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"mutez\", \"annots\": [ \"%looserClaim\" ] }, { \"prim\": \"key\", \"annots\": [ \"%pk\" ] } ] }\n ]\n }\n ],\n \"annots\": [ \"%party1\" ]\n }\n ]\n },\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"address\", \"annots\": [ \"%address\" ] }, { \"prim\": \"mutez\", \"annots\": [ \"%bond\" ] } ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"bool\", \"annots\": [ \"%hasBond\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"mutez\", \"annots\": [ \"%looserClaim\" ] }, { \"prim\": \"key\", \"annots\": [ \"%pk\" ] } ] }\n ]\n }\n ],\n \"annots\": [ \"%party2\" ]\n },\n { \"prim\": \"int\", \"annots\": [ \"%seq\" ] }\n ]\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"prim\": \"parameter\",\n \"args\": [\n {\n \"prim\": \"or\",\n \"args\": [\n {\n \"prim\": \"or\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%seq\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%chips_player1\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"int\", \"annots\": [ \"%chips_player2\" ] }, { \"prim\": \"int\", \"annots\": [ \"%winner\" ] } ] }\n ],\n \"annots\": [ \"%state\" ]\n }\n ],\n \"annots\": [ \"%msg1\" ]\n },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%seq\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%chips_player1\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"int\", \"annots\": [ \"%chips_player2\" ] }, { \"prim\": \"int\", \"annots\": [ \"%winner\" ] } ] }\n ],\n \"annots\": [ \"%state\" ]\n }\n ],\n \"annots\": [ \"%msg2\" ]\n }\n ]\n },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%party\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"signature\", \"annots\": [ \"%sig1\" ] }, { \"prim\": \"signature\", \"annots\": [ \"%sig2\" ] } ] }\n ]\n }\n ],\n \"annots\": [ \"%channelAccuseDoubleMove\" ]\n },\n {\n \"prim\": \"pair\",\n \"args\": [\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%seq\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%chips_player1\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"int\", \"annots\": [ \"%chips_player2\" ] }, { \"prim\": \"int\", \"annots\": [ \"%winner\" ] } ] }\n ],\n \"annots\": [ \"%state\" ]\n }\n ],\n \"annots\": [ \"%msg\" ]\n },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"signature\", \"annots\": [ \"%sig1\" ] }, { \"prim\": \"signature\", \"annots\": [ \"%sig2\" ] } ] }\n ],\n \"annots\": [ \"%channelNewState\" ]\n }\n ]\n },\n {\n \"prim\": \"or\",\n \"args\": [\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"int\", \"annots\": [ \"%party\" ] }, { \"prim\": \"signature\", \"annots\": [ \"%sig\" ] } ], \"annots\": [ \"%channelRenounce\" ] },\n {\n \"prim\": \"or\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%channelSetBond\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"int\", \"annots\": [ \"%party\" ] },\n {\n \"prim\": \"pair\",\n \"args\": [\n { \"prim\": \"signature\", \"annots\": [ \"%sig\" ] },\n { \"prim\": \"pair\", \"args\": [ { \"prim\": \"int\", \"annots\": [ \"%bet\" ] }, { \"prim\": \"int\", \"annots\": [ \"%winning_party\" ] } ], \"annots\": [ \"%sub\" ] }\n ]\n }\n ],\n \"annots\": [ \"%play\" ]\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"prim\": \"code\",\n \"args\": [\n [\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF_LEFT\",\n \"args\": [\n [\n {\n \"prim\": \"IF_LEFT\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [ [ [] ], [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.active\" } ] }, { \"prim\": \"FAILWITH\" } ] ] ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"False\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: params.msg1.seq == params.msg2.seq\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"NEQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: sp.pack(params.msg1) != sp.pack(params.msg2)\" } ] },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party1.pk, params.sig1, sp.pack(sp.record(id = self.data.id, name = 'state', seq = params.msg1.seq, state = params.msg1.state)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party1.pk, params.sig2, sp.pack(sp.record(id = self.data.id, name = 'state', seq = params.msg2.seq, state = params.msg2.state)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n { \"prim\": \"IF_NONE\", \"args\": [ [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ], [ [] ] ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" }\n ]\n ],\n [\n [\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party2.pk, params.sig1, sp.pack(sp.record(id = self.data.id, name = 'state', seq = params.msg1.seq, state = params.msg1.state)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party2.pk, params.sig2, sp.pack(sp.record(id = self.data.id, name = 'state', seq = params.msg2.seq, state = params.msg2.state)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n { \"prim\": \"IF_NONE\", \"args\": [ [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ], [ [] ] ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ],\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [ [ [] ], [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.active\" } ] }, { \"prim\": \"FAILWITH\" } ] ] ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"LT\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.seq < params.msg.seq\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party1.pk, params.sig1, sp.pack(sp.record(id = self.data.id, name = 'state', seq = params.msg.seq, state = params.msg.state)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party2.pk, params.sig2, sp.pack(sp.record(id = self.data.id, name = 'state', seq = params.msg.seq, state = params.msg.state)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DROP\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] }\n ]\n ]\n ]\n }\n ],\n [\n {\n \"prim\": \"IF_LEFT\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [ [ [] ], [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.active\" } ] }, { \"prim\": \"FAILWITH\" } ] ] ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"False\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"renounce\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party1.pk, params.sig, sp.pack(sp.record(id = self.data.id, name = 'renounce')))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n { \"prim\": \"IF_NONE\", \"args\": [ [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ], [ [] ] ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n { \"prim\": \"IF_NONE\", \"args\": [ [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ], [ [] ] ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ],\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"renounce\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PACK\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party2.pk, params.sig, sp.pack(sp.record(id = self.data.id, name = 'renounce')))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n { \"prim\": \"IF_NONE\", \"args\": [ [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ], [ [] ] ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n { \"prim\": \"IF_NONE\", \"args\": [ [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ], [ [] ] ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ],\n [\n {\n \"prim\": \"IF_LEFT\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.active\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: ~ self.data.party1.hasBond\" } ] },\n { \"prim\": \"FAILWITH\" }\n ]\n ],\n [ [] ]\n ]\n },\n { \"prim\": \"AMOUNT\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.party1.bond == sp.amount\" } ] },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"True\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ],\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: ~ self.data.party2.hasBond\" } ] },\n { \"prim\": \"FAILWITH\" }\n ]\n ],\n [ [] ]\n ]\n },\n { \"prim\": \"AMOUNT\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.party2.bond == sp.amount\" } ] },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"True\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ]\n ]\n },\n { \"prim\": \"DROP\" },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] }\n ]\n ],\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.active\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.nextParty == params.party\" } ] },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"6\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"0\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.baseState.winner == 0\" } ] }, { \"prim\": \"FAILWITH\" } ]\n ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"GE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: params.sub.winning_party >= 1\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"LE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: params.sub.winning_party <= 2\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"0\" } ] },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"LT\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: params.sub.bet > 0\" } ] }, { \"prim\": \"FAILWITH\" } ] ]\n ]\n },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"GE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.baseState.chips_player2 >= params.sub.bet\" } ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"6\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"7\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"6\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"7\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"8\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"2000\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"0\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"NEQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"False\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ],\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"False\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ]\n ]\n }\n ]\n ],\n [ { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] } ]\n ]\n }\n ]\n ],\n [ { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] } ]\n ]\n }\n ]\n ],\n [\n [\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"GE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [ { \"prim\": \"string\" }, { \"string\": \"WrongCondition: self.data.baseState.chips_player1 >= params.sub.bet\" } ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"6\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"7\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"8\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"6\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"7\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"2000\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"0\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"NEQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"False\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ],\n [\n [\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"bool\" }, { \"prim\": \"False\" } ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" },\n { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SUB\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"ADD\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CONTRACT\", \"args\": [ { \"prim\": \"unit\" } ] },\n {\n \"prim\": \"IF_NONE\",\n \"args\": [\n [ [ { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] }, { \"prim\": \"FAILWITH\" } ] ],\n [ [] ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"unit\" }, { \"prim\": \"Unit\" } ] },\n { \"prim\": \"TRANSFER_TOKENS\" },\n { \"prim\": \"CONS\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ]\n ]\n }\n ]\n ],\n [ { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] } ]\n ]\n }\n ]\n ],\n [ { \"prim\": \"NIL\", \"args\": [ { \"prim\": \"operation\" } ] } ]\n ]\n }\n ]\n ]\n ]\n },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"1\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"COMPARE\" },\n { \"prim\": \"EQ\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [\n [\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party1.pk, params.sig, sp.pack(sp.record(id = self.data.id, name = 'state', seq = self.data.seq, state = self.data.baseState)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n }\n ]\n ],\n [\n [\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%seq\", \"%state\" ] },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"string\" }, { \"string\": \"state\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"PAIR\", \"annots\": [ \"%id\", \"%name\" ] },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PACK\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"4\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CHECK_SIGNATURE\" },\n {\n \"prim\": \"IF\",\n \"args\": [\n [ [] ],\n [\n [\n {\n \"prim\": \"PUSH\",\n \"args\": [\n { \"prim\": \"string\" },\n {\n \"string\":\n \"WrongCondition: sp.check_signature(self.data.party2.pk, params.sig, sp.pack(sp.record(id = self.data.id, name = 'state', seq = self.data.seq, state = self.data.baseState)))\"\n }\n ]\n },\n { \"prim\": \"FAILWITH\" }\n ]\n ]\n ]\n }\n ]\n ]\n ]\n },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DUP\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CDR\" },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"5\" } ] },\n { \"prim\": \"DUP\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"6\" } ] },\n { \"prim\": \"CDR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"CAR\" },\n { \"prim\": \"PUSH\", \"args\": [ { \"prim\": \"int\" }, { \"int\": \"3\" } ] },\n { \"prim\": \"SUB\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"PAIR\" },\n { \"prim\": \"DUG\", \"args\": [ { \"int\": \"3\" } ] },\n { \"prim\": \"DIG\", \"args\": [ { \"int\": \"2\" } ] },\n { \"prim\": \"DROP\" },\n { \"prim\": \"SWAP\" },\n { \"prim\": \"DROP\" }\n ]\n ]\n ]\n }\n ]\n ]\n }\n ]\n ]\n },\n { \"prim\": \"PAIR\" }\n ]\n ]\n }\n]`;\n const storage = '{\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' { \"prim\": \"True\" },\\n' +\n ' { \"prim\": \"Pair\", \"args\": [ { \"prim\": \"Pair\", \"args\": [ { \"int\": \"1000\" }, { \"prim\": \"Pair\", \"args\": [ { \"int\": \"1000\" }, { \"int\": \"0\" } ] } ] }, { \"string\": \"1234\" } ] }\\n' +\n ' ]\\n' +\n ' },\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' { \"int\": \"1\" },\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' { \"prim\": \"Pair\", \"args\": [ { \"string\": \"tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi\" }, { \"int\": \"10000000\" } ] },\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [ { \"prim\": \"False\" }, { \"prim\": \"Pair\", \"args\": [ { \"int\": \"0\" }, { \"string\": \"edpkuvNy6TuQ2z8o9wnoaTtTXkzQk7nhegCHfxBc4ecsd4qG71KYNG\" } ] } ]\\n' +\n ' }\\n' +\n ' ]\\n' +\n ' }\\n' +\n ' ]\\n' +\n ' },\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [\\n' +\n ' { \"prim\": \"Pair\", \"args\": [ { \"string\": \"tz1Rp4Bv8iUhYnNoCryHQgNzN2D7i3L1LF9C\" }, { \"int\": \"10000000\" } ] },\\n' +\n ' {\\n' +\n ' \"prim\": \"Pair\",\\n' +\n ' \"args\": [ { \"prim\": \"False\" }, { \"prim\": \"Pair\", \"args\": [ { \"int\": \"0\" }, { \"string\": \"edpkufVmvzkm4oFQ7WcF5NJbq9BFB2mWRsm4Dyh2spMDuDxWSQWHuT\" } ] } ]\\n' +\n ' }\\n' +\n ' ]\\n' +\n ' },\\n' +\n ' { \"int\": \"0\" }\\n' +\n ' ]\\n' +\n ' }\\n' +\n ' ]\\n' +\n ' }\\n' +\n ' ]\\n' +\n '}';\n\n const result = await conseiljs.TezosNodeWriter.sendContractOriginationOperation(tezosNode, keyStore, 0, undefined,\n 100000, '', 1000, 100000, contract, storage, conseiljs.TezosParameterFormat.Micheline);\n console.log(`Injected operation group id ${result.operationGroupID}`);\n}", "componentDidMount() {\n this.state.web3.eth.getGasPrice((err, res) => this.setState({ gasPrice : res.toNumber() }));\n const contract = require('truffle-contract');\n const patents = contract(Patents);\n patents.setProvider(this.state.web3.currentProvider);\n patents.at(Constants.CONTRACT_ADDRESS.patents).then(instance => { // for ROPSTEN\n // patents.deployed().then(instance => { // for LOCAL RPC\n this.setState({contractInstance: instance});\n return instance.hasAccount.call(this.state.web3.eth.accounts[0]);\n }).then(registered => {\n this.setState({ currentAccountRegistered: registered });\n return this.state.contractInstance.depositPrice.call();\n }).then(price => {\n this.setState({depositPrice: price.toNumber()});\n return this.state.contractInstance.getEthPrice.call(price.toNumber());\n }).then(ethPrice => {\n this.setState({ etherPrice: ethPrice })\n }).catch(() => this.setState({ contractInstance: null }));\n this.state.web3.currentProvider.on('accountsChanged', accounts => {\n this.state.contractInstance.hasAccount.call(accounts[0]).then(registered => {\n this.setState({currentAccountRegistered: registered});\n })\n });\n }", "async send(receiverP, sendValue) {\n const amount = AmountMath.make(brand, sendValue);\n const payment = await E(purse).withdraw(amount);\n try {\n await E(receiverP).receive(payment);\n } catch (e) {\n // Recover the failed payment.\n await E(purse).deposit(payment);\n throw e;\n }\n }", "function blockchainBid(propertyContract,invNum){\n var myContract = new web3.eth.Contract(ABI,propertyContract);\n\n if( invNum==1 ){\n investor = investor1; //\"0x3d06bdf9a9c2ace9a75ae2004589c5608b767a00\";\n amount = 100000;\n }else if( invNum==2 ){\n investor = investor2; //\"0xf8306b56f5c85a993b988b1f29d84efbf7c54a48\";\n amount = 200000;\n }else if( invNum==3 ){\n investor = investor3; //\"0x64644d2306b88ee641491fbe432459d8c7bafccf\";\n amount = 300000;\n }else{\n return(\"Must sepcify an investor number\");\n }\n\n myContract.methods.submitBid(\n \"investor no.\"+invNum,\n invNum*1000\n ).send({from: investor, gas: 1500000, value: amount}, function(err,result){\n console.log(result);\n propStatus = result;\n });\n\n return( \"Investor no.\"+invNum+\" submitted a bid for \"+amount+\" wei!\");\n\n}", "function toPay(){\n \n}", "async quote (params) {\n await this.factory.connect()\n\n // save a webfinger call if it's on the same domain\n const receiver = this.utils.resolveSpspIdentifier(params.destination)\n debug('making SPSP quote to', receiver)\n\n return ILP.SPSP.quote(\n await this.factory.create({ username: params.user.username }),\n {\n receiver,\n sourceAmount: params.sourceAmount,\n destinationAmount: params.destinationAmount\n }\n )\n }", "function OnlineCommand() {\r\n var my = this;\r\n\r\n var calculation = new CalculationProfit();\r\n\r\n this.LoginKey = Store.InvestorAccount.LoginKey;\r\n this.InvestorName = Store.InvestorAccount.NickName;\r\n this.ListOnlineCommand = Store.ListOpenTrade;\r\n this.ListSymbolClient = Store.ListSymbol;\r\n this.ListPendingOrder = Store.ListPendingOrder;\r\n //this.ListBinaryTrading = Store.BinaryTrading;\r\n this.InvestorAccount = Store.InvestorAccount;\r\n\r\n this.MakeBuySellCommand = null;\r\n\r\n //Get IsHeged Symbol\r\n this.GetIsHedgedSymbol = function (SymbolName) {\r\n var isHedged = null;\r\n var count = my.ListSymbolClient.length;\r\n for (var i = 0; i < count; i++) {\r\n if (my.ListSymbolClient[i].SymbolName == SymbolName) {\r\n isHedged = my.ListSymbolClient[i].IsHedged;\r\n }\r\n }\r\n return isHedged;\r\n }\r\n\r\n //Check IsReadOnly Of InvestorAccount\r\n this.CheckIsReadOnly = function () {\r\n var isReadOnly = false;\r\n\r\n if (my.InvestorAccount.AccountReadOnly == \"True\") {\r\n isReadOnly = true;\r\n MessageNoticeControl.ShowMessage(\"ACCOUNT READ ONLY\", 3);\r\n }\r\n\r\n return isReadOnly;\r\n }\r\n\r\n //test order\r\n this.TestOrder = function (symbolName) {\r\n //====Test account read only======\r\n var mess = null;\r\n //------\r\n var isReadOnly = my.CheckIsReadOnly();\r\n if (isReadOnly == true) {\r\n mess = \"ACCOUNT REAL ONLY\";\r\n }\r\n else {\r\n var symbol = Store.GetSymbolBySymbolName(symbolName);\r\n if (symbol == null) {\r\n mess = \"SYMBOL DON'T EXIST\";\r\n }\r\n else {\r\n var isMarketClose = Store.TestMarketClosed();\r\n if (isMarketClose == true) {\r\n mess = \"YOUR ORDER INVALID. MARKET CLOSED.\";\r\n }\r\n }\r\n //else {\r\n // if (symbol.IsHolyday == \"True\") {\r\n // mess = \"YOUR ORDER INVALID. MARKET HOLIDAY.\";\r\n // }\r\n // else {\r\n // var isMarketClose = Store.TestMarketClosed();\r\n // if (isMarketClose == true) {\r\n // mess = \"YOUR ORDER INVALID. MARKET CLOSED.\";\r\n // }\r\n // else {\r\n // var isMarketStop = Store.TestMarketStop(symbolName);\r\n // if (isMarketStop == true) {\r\n // mess = \"YOUR ORDER INVALID. MARKET STOP.\";\r\n // }\r\n // else {\r\n // var onlineTick = Store.GetOnlineTickBySymbolName(symbolName);\r\n // if (onlineTick.IsOnHold == true) {\r\n // mess = \"YOUR ORDER INVALID. SYMBOL HOLD\";\r\n // }\r\n // } \r\n // }\r\n // }\r\n //}\r\n }\r\n //-----\r\n return mess;\r\n }\r\n //Calculation Account\r\n this.CalculationAccount = function (objCommand) {\r\n\r\n var Equity = 0;\r\n var Margin = 0;\r\n var Profit = 0;\r\n var MarginLevel = 0;\r\n var Size = 0;\r\n\r\n var tempListCommand = [];\r\n CalculationMargin(objCommand);\r\n\r\n\r\n if (my.ListOnlineCommand != null && my.ListOnlineCommand.length > 0) {\r\n var count = my.ListOnlineCommand.length;\r\n for (var i = 0; i < count; i++) {\r\n var isH = \"False\";\r\n isH = my.GetIsHedgedSymbol(my.ListOnlineCommand[i].SymbolName);\r\n my.ListOnlineCommand[i].IsHedged = isH;\r\n tempListCommand.push(my.ListOnlineCommand[i]);\r\n Profit += Number(my.ListOnlineCommand[i].Profit);\r\n }\r\n }\r\n\r\n var isHCommand = my.GetIsHedgedSymbol(objCommand.SymbolName);\r\n\r\n objCommand.IsHedged = isHCommand;\r\n\r\n if (objCommand.IsBuy == \"True\") {\r\n objCommand.TypeID = 1;\r\n }\r\n else {\r\n objCommand.TypeID = 2;\r\n }\r\n\r\n tempListCommand.push(objCommand);\r\n\r\n //---total margin-----------\r\n var totalMargin = parseFloat(my.InvestorAccount.Margin) + parseFloat(my.InvestorAccount.FreezeMargin);\r\n\r\n if (objCommand.CommandType == \"BuyStop\" || objCommand.CommandType == \"SellStop\" ||\r\n objCommand.CommandType == \"BuyLimit\" || objCommand.CommandType == \"SellLimit\") {\r\n\r\n if (my.ListPendingOrder != null) {\r\n var countPending = my.ListPendingOrder.length;\r\n for (var i = 0; i < countPending; i++) {\r\n CalculationMargin(my.ListPendingOrder[i]);\r\n totalMargin += parseFloat(my.ListPendingOrder[i].Margin);\r\n }\r\n }\r\n }\r\n\r\n totalMargin += objCommand.Margin;\r\n\r\n Equity = parseFloat(my.InvestorAccount.Balance) + parseFloat(my.InvestorAccount.Credit) + Profit;\r\n MarginLevel = (Equity * 100) / totalMargin;\r\n\r\n newInvestorAccount = new Object;\r\n\r\n newInvestorAccount.Balance = parseFloat(my.InvestorAccount.Balance);\r\n newInvestorAccount.Credit = parseFloat(my.InvestorAccount.Credit);\r\n newInvestorAccount.Equity = Equity;\r\n newInvestorAccount.Margin = Margin;\r\n newInvestorAccount.Profit = Profit;\r\n newInvestorAccount.MarginLevel = MarginLevel;\r\n\r\n return newInvestorAccount;\r\n\r\n }\r\n\r\n //Rend Client Code\r\n this.RendClientCode = function () {\r\n\r\n var ClientCode = \"\";\r\n ClientCode = my.InvestorName + \"_\" + Math.floor(Math.random() * 11111111);\r\n var tempClientCode = \"\";\r\n var isOk = false;\r\n while (isOk == false) {\r\n if (my.ListOnlineCommand != null && my.ListOnlineCommand.length > 0) {\r\n var count = my.ListOnlineCommand.length;\r\n for (var i = 0; i < count; i++) {\r\n if (my.ListOnlineCommand[i].ClientCode == ClientCode) {\r\n ClientCode = my.InvestorName + \"_\" + Math.floor(Math.random() * 11111111);\r\n isOk = false;\r\n break;\r\n }\r\n else {\r\n isOk = true;\r\n }\r\n }\r\n }\r\n else {\r\n isOk = true;\r\n }\r\n\r\n if (my.ListPendingOrder != null && my.ListPendingOrder.length > 0) {\r\n var count = my.ListPendingOrder.length;\r\n for (var i = 0; i < count; i++) {\r\n if (my.ListPendingOrder[i].ClientCode == ClientCode) {\r\n ClientCode = my.InvestorName + \"_\" + Math.floor(Math.random() * 11111111);\r\n isOk = false;\r\n break;\r\n }\r\n else {\r\n isOk = true;\r\n }\r\n }\r\n }\r\n else {\r\n isOk = true;\r\n } \r\n }\r\n return ClientCode;\r\n }\r\n\r\n //Function Make Online Command: Sell Or Buy Commnad\r\n this.MakeOnlineCommand = function (openPrice, size, stopLoss, takeProfit, symbolName, comment, isBuy, clientCode, mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(symbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n objCommand = new Command();\r\n\r\n objCommand.OpenPrice = openPrice;\r\n objCommand.Size = size;\r\n objCommand.StopLoss = stopLoss;\r\n objCommand.TakeProfit = takeProfit;\r\n objCommand.SymbolName = symbolName;\r\n objCommand.Comment = comment;\r\n objCommand.IsBuy = isBuy.toLowerCase();\r\n\r\n var day = new Date(ViewFacade.CurrentTime);\r\n var date = day.getDate();\r\n var month = day.getMonth() + 1;\r\n var year = day.getFullYear() + 2;\r\n\r\n objCommand.FinishDate = date + 'Ʊ' + month + 'Ʊ' + year;\r\n\r\n //Build Client Code\r\n if (clientCode == '') {\r\n var ClientCode = my.RendClientCode();\r\n objCommand.ClientCode = ClientCode;\r\n }\r\n else {\r\n objCommand.ClientCode = clientCode;\r\n }\r\n\r\n var result = false;\r\n objCommand.InvestorID = my.InvestorAccount.InvestorID;\r\n\r\n var newInvestorAccount = new Object;\r\n\r\n //calculation Account\r\n newInvestorAccount = my.CalculationAccount(objCommand)\r\n\r\n if (objCommand.IsBuy == \"true\") {\r\n if (newInvestorAccount != null) {\r\n ///Check Condition Validate Account < Or > 100% \r\n if (newInvestorAccount.MarginLevel > 100) {\r\n //Sent request len server (ham BuyCommand)\r\n getString = new AddCommand();\r\n var str = getString.BuyCommand(objCommand.ClientCode, objCommand.InvestorID, objCommand.OpenPrice, objCommand.Size, objCommand.StopLoss, objCommand.TakeProfit, objCommand.SymbolName, objCommand.Comment, my.LoginKey, objCommand.FinishDate);\r\n //--------\r\n if (mess != undefined) {\r\n MessageNoticeControl.ShowMessage(mess, 2);\r\n objResult.Mess = mess;\r\n }\r\n //====send cmd==========\r\n OnlineCommand.CommandProcessing = objCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n }\r\n else{\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(\"NOT ENOUGH MONEY\", 3);\r\n objResult.Mess = \"NOT ENOUGH MONEY\";\r\n return objResult;\r\n }\r\n }\r\n }\r\n else {\r\n if (newInvestorAccount != null) {\r\n ///Check Condition Validate Account < Or > 100%\r\n if (newInvestorAccount.MarginLevel > 100) {\r\n //Sent request len server (ham BuyCommand)\r\n getString = new AddCommand();\r\n var str = getString.SellCommand(objCommand.ClientCode, objCommand.InvestorID, objCommand.OpenPrice, objCommand.Size, objCommand.StopLoss, objCommand.TakeProfit, objCommand.SymbolName, objCommand.Comment, my.LoginKey, objCommand.FinishDate);\r\n //--------\r\n if (mess != undefined) {\r\n MessageNoticeControl.ShowMessage(mess, 2);\r\n objResult.Mess = mess;\r\n }\r\n //====send cmd==========\r\n OnlineCommand.CommandProcessing = objCommand;\r\n Store.IsProcessingOrder = true;\r\n ViewFacade.Connection.DoSend(str);\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n }\r\n else{\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(\"NOT ENOUGH MONEY\", 3);\r\n objResult.Mess = \"NOT ENOUGH MONEY\";\r\n return objResult;\r\n }\r\n }\r\n }\r\n //----\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Make Buy Limit Command\r\n this.BuyLimitCommand = function (openPrice, size, stopLoss, takeProfit, symbolName, comment, isBuy, mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(symbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n objCommand = new Command();\r\n objCommand.OpenPrice = openPrice;\r\n objCommand.Size = size;\r\n objCommand.StopLoss = stopLoss;\r\n objCommand.TakeProfit = takeProfit;\r\n objCommand.SymbolName = symbolName;\r\n objCommand.Comment = comment;\r\n objCommand.IsBuy = isBuy;\r\n\r\n var day = new Date(ViewFacade.CurrentTime);\r\n var date = day.getDate();\r\n var month = day.getMonth() + 1;\r\n var year = day.getFullYear() + 2;\r\n\r\n objCommand.FinishDate = date + 'Ʊ' + month + 'Ʊ' + year;\r\n\r\n objCommand.InvestorID = my.InvestorAccount.InvestorID;\r\n objCommand.ClientCode = my.RendClientCode();\r\n\r\n var newInvestorAccount = new Object;\r\n\r\n var newDealMessage = new Object;\r\n objCommand.CommandType = \"BuyLimit\";\r\n\r\n newInvestorAccount = my.CalculationAccount(objCommand);\r\n\r\n if (newInvestorAccount != null) {\r\n\r\n ///Check Condition Validate Account < Or > 100%\r\n if (newInvestorAccount.MarginLevel > 100) {\r\n\r\n //Sent request len server (ham BuyCommand)\r\n getString = new AddCommand();\r\n var str = getString.BuyLimit(objCommand.ClientCode, objCommand.InvestorID, objCommand.OpenPrice, objCommand.Size, objCommand.StopLoss, objCommand.TakeProfit, objCommand.SymbolName, objCommand.Comment, my.LoginKey, objCommand.FinishDate);\r\n //--------\r\n if (mess != undefined) {\r\n MessageNoticeControl.ShowMessage(mess, 2);\r\n objResult.Mess = mess;\r\n }\r\n //--------\r\n OnlineCommand.CommandProcessing = objCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n }\r\n else {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(\"NOT ENOUGH MONEY\", 3);\r\n objResult.Mess = \"NOT ENOUGH MONEY\";\r\n return objResult;\r\n }\r\n\r\n }\r\n //-----\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Make Sell Limit Command\r\n this.SellLimitCommand = function (openPrice, size, stopLoss, takeProfit, symbolName, comment, isBuy, mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(symbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n objCommand = new Command();\r\n objCommand.OpenPrice = openPrice;\r\n objCommand.Size = size;\r\n objCommand.StopLoss = stopLoss;\r\n objCommand.TakeProfit = takeProfit;\r\n objCommand.SymbolName = symbolName;\r\n objCommand.Comment = comment;\r\n objCommand.IsBuy = isBuy;\r\n\r\n var day = new Date(ViewFacade.CurrentTime);\r\n var date = day.getDate();\r\n var month = day.getMonth() + 1;\r\n var year = day.getFullYear() + 2;\r\n\r\n objCommand.FinishDate = date + 'Ʊ' + month + 'Ʊ' + year;\r\n //===================\r\n\r\n objCommand.InvestorID = my.InvestorAccount.InvestorID;\r\n objCommand.ClientCode = my.RendClientCode();\r\n\r\n var newInvestorAccount = new Object;\r\n\r\n var newDealMessage = new Object;\r\n objCommand.CommandType = \"SellLimit\";\r\n\r\n newInvestorAccount = my.CalculationAccount(objCommand);\r\n\r\n if (newInvestorAccount != null) {\r\n\r\n ///Check Condition Validate Account < Or > 100%\r\n ///\r\n if (newInvestorAccount.MarginLevel > 100) {\r\n //Sent request len server (ham BuyCommand)\r\n getString = new AddCommand();\r\n var str = getString.SellLimit(objCommand.ClientCode, objCommand.InvestorID, objCommand.OpenPrice, objCommand.Size, objCommand.StopLoss, objCommand.TakeProfit, objCommand.SymbolName, objCommand.Comment, my.LoginKey, objCommand.FinishDate);\r\n //--------\r\n if (mess != undefined) {\r\n MessageNoticeControl.ShowMessage(mess, 2);\r\n objResult.Mess = mess;\r\n }\r\n //--------\r\n //send\r\n OnlineCommand.CommandProcessing = objCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n }\r\n else{\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(\"NOT ENOUGH MONEY\", 3);\r\n objResult.Mess = \"NOT ENOUGH MONEY\";\r\n return objResult;\r\n }\r\n\r\n }\r\n //-----\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Make Buy Stop Command\r\n this.BuyStopCommand = function (openPrice, size, stopLoss, takeProfit, symbolName, comment, isBuy, mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(symbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n objCommand = new Command();\r\n objCommand.OpenPrice = openPrice;\r\n objCommand.Size = size;\r\n objCommand.StopLoss = stopLoss;\r\n objCommand.TakeProfit = takeProfit;\r\n objCommand.SymbolName = symbolName;\r\n objCommand.Comment = comment;\r\n objCommand.IsBuy = isBuy;\r\n\r\n var day = new Date(ViewFacade.CurrentTime);\r\n var date = day.getDate();\r\n var month = day.getMonth() + 1;\r\n var year = day.getFullYear() + 2;\r\n\r\n objCommand.FinishDate = date + 'Ʊ' + month + 'Ʊ' + year;\r\n\r\n objCommand.InvestorID = my.InvestorAccount.InvestorID;\r\n objCommand.ClientCode = my.RendClientCode();\r\n\r\n var newInvestorAccount = new Object;\r\n\r\n var newDealMessage = new Object;\r\n objCommand.CommandType = \"BuyStop\";\r\n\r\n newInvestorAccount = my.CalculationAccount(objCommand);\r\n\r\n if (newInvestorAccount != null) {\r\n\r\n ///Check Condition Validate Account < Or > 100%\r\n ///\r\n if (newInvestorAccount.MarginLevel > 100) {\r\n //Sent request len server (ham BuyCommand)\r\n getString = new AddCommand();\r\n var str = getString.BuyStop(objCommand.ClientCode, objCommand.InvestorID, objCommand.OpenPrice, objCommand.Size, objCommand.StopLoss, objCommand.TakeProfit, objCommand.SymbolName, objCommand.Comment, my.LoginKey, objCommand.FinishDate);\r\n //--------\r\n if (mess != undefined) {\r\n MessageNoticeControl.ShowMessage(mess, 2);\r\n objResult.Mess = mess;\r\n }\r\n //--------\r\n //send\r\n OnlineCommand.CommandProcessing = objCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n }\r\n else {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(\"NOT ENOUGH MONEY\", 3);\r\n objResult.Mess = \"NOT ENOUGH MONEY\";\r\n return objResult;\r\n }\r\n\r\n }\r\n //----\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Make Sell Stop Command\r\n this.SellStopCommand = function (openPrice, size, stopLoss, takeProfit, symbolName, comment, isBuy, mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(symbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n objCommand = new Command();\r\n objCommand.OpenPrice = openPrice;\r\n objCommand.Size = size;\r\n objCommand.StopLoss = stopLoss;\r\n objCommand.TakeProfit = takeProfit;\r\n objCommand.SymbolName = symbolName;\r\n objCommand.Comment = comment;\r\n objCommand.IsBuy = isBuy;\r\n\r\n var day = new Date(ViewFacade.CurrentTime);\r\n var date = day.getDate();\r\n var month = day.getMonth() + 1;\r\n var year = day.getFullYear() + 2;\r\n\r\n objCommand.FinishDate = date + 'Ʊ' + month + 'Ʊ' + year;\r\n\r\n objCommand.InvestorID = my.InvestorAccount.InvestorID;\r\n objCommand.ClientCode = my.RendClientCode();\r\n\r\n var newInvestorAccount = new Object;\r\n\r\n var newDealMessage = new Object;\r\n objCommand.CommandType = \"SellStop\";\r\n\r\n newInvestorAccount = my.CalculationAccount(objCommand);\r\n\r\n if (newInvestorAccount != null) {\r\n\r\n ///Check Condition Validate Account < Or > 100%\r\n ///\r\n if (newInvestorAccount.MarginLevel > 100) {\r\n //Sent request len server (ham BuyCommand)\r\n getString = new AddCommand();\r\n var str = getString.SellStop(objCommand.ClientCode, objCommand.InvestorID, objCommand.OpenPrice, objCommand.Size, objCommand.StopLoss, objCommand.TakeProfit, objCommand.SymbolName, objCommand.Comment, my.LoginKey, objCommand.FinishDate);\r\n //--------\r\n if (mess != undefined) {\r\n MessageNoticeControl.ShowMessage(mess, 2);\r\n objResult.Mess = mess;\r\n }\r\n //--------\r\n OnlineCommand.CommandProcessing = objCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n }\r\n else{\r\n Store.IsProcessingOrder = false;\r\n objResult.Mess = \"NOT ENOUGH MONEY\";\r\n return objResult;\r\n }\r\n\r\n }\r\n //----\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Update Pending Command\r\n this.UpdatePendingCommand = function (CommandID, CommandCode, OpenPrice, StopLoss, TakeProfit, Comment, SymbolName, Mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(SymbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n newCommand = new Object();\r\n newCommand.CommandID = CommandID;\r\n newCommand.ClientCode = CommandCode;\r\n newCommand.OpenPrice = OpenPrice;\r\n newCommand.StopLoss = StopLoss;\r\n newCommand.TakeProfit = TakeProfit;\r\n newCommand.Comment = Comment;\r\n newCommand.SymbolName = SymbolName;\r\n\r\n //Sent request len server\r\n getString = new AddCommand();\r\n var str = getString.UpdateOnlineCommand(CommandID, OpenPrice, StopLoss, TakeProfit, Comment, my.LoginKey, Store.InvestorAccount.InvestorID);\r\n //--------\r\n if (Mess != undefined) {\r\n MessageNoticeControl.ShowMessage(Mess, 2);\r\n objResult.Mess = Mess;\r\n }\r\n //--------\r\n OnlineCommand.CommandProcessing = newCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n //===============\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Update Online Command\r\n this.UpdateOnlineCommand = function (CommandID, CommandCode, OpenPrice, StopLoss, TakeProfit, Comment, SymbolName, Mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(SymbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n newCommand = new Object();\r\n newCommand.CommandID = CommandID;\r\n newCommand.ClientCode = CommandCode;\r\n newCommand.OpenPrice = OpenPrice;\r\n newCommand.StopLoss = StopLoss;\r\n newCommand.TakeProfit = TakeProfit;\r\n newCommand.Comment = Comment;\r\n\r\n //Sent request len server\r\n getString = new AddCommand();\r\n var str = getString.UpdateOnlineCommand(CommandID, OpenPrice, StopLoss, TakeProfit, Comment, my.LoginKey, Store.InvestorAccount.InvestorID);\r\n //--------\r\n if (Mess != undefined) {\r\n MessageNoticeControl.ShowMessage(Mess, 2);\r\n objResult.Mess = Mess;\r\n }\r\n //--------\r\n OnlineCommand.CommandProcessing = newCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n //console.log(\"clear time out\");\r\n }, 2000);\r\n ViewFacade.Connection.DoSend(str);\r\n //================\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n\r\n //Function Close Command\r\n this.CloseCommand = function (CommandID, CommandCode, ClosePrice, Size, SymbolName, Mess) {\r\n //------\r\n var objResult = new Object();\r\n objResult.Mess = \"\";\r\n objResult.Result = false;\r\n //------\r\n var resultMess = my.TestOrder(SymbolName);\r\n if (resultMess != null) {\r\n Store.IsProcessingOrder = false;\r\n MessageNoticeControl.ShowMessage(resultMess, 3);\r\n objResult.Mess = resultMess;\r\n return objResult;\r\n }\r\n //-----\r\n newCommand = new Object();\r\n newCommand.CommandID = CommandID;\r\n newCommand.ClientCode = CommandCode;\r\n newCommand.ClosePrice = ClosePrice;\r\n newCommand.Size = Size;\r\n newCommand.SymbolName = SymbolName;\r\n\r\n //=====Test exist of commandID============\r\n var value01 = Store.TestPendingOrderExist(CommandID);\r\n if (value01 == false) {\r\n var value02 = Store.TestOpenTradeExist(CommandID);\r\n if (value02 == false) {\r\n Store.IsProcessingOrder = false;\r\n return false;\r\n }\r\n }\r\n\r\n //====send cmd==========\r\n getString = new AddCommand();\r\n var str = getString.CloseCommand(CommandID, ClosePrice, Size, SymbolName, my.LoginKey, Store.InvestorAccount.InvestorID);\r\n //--------\r\n if (Mess != undefined) {\r\n MessageNoticeControl.ShowMessage(Mess, 2);\r\n objResult.Mess = Mess;\r\n }\r\n //--------\r\n OnlineCommand.CommandProcessing = newCommand;\r\n Store.IsProcessingOrder = true;\r\n Store.ProcessOrderID = setTimeout(function () {\r\n clearTimeout(Store.ProcessOrderID);\r\n Store.ProcessOrderID = null;\r\n //console.log(\"clear time out\");\r\n }, 2000);\r\n\r\n ViewFacade.Connection.DoSend(str);\r\n //=========\r\n objResult.Result = true;\r\n return objResult;\r\n }\r\n //==================================\r\n //Client Cancel Request\r\n this.NotifyClientCancelRequest = null;\r\n this.ClientCancelRequest = function (symbolName, clientCode, investorID) {\r\n Store.IsProcessingOrder = false;\r\n ViewFacade.CancelRequest(false);\r\n OnlineCommand.CommandProcessing = null;\r\n getString = new AddCommand();\r\n var str = getString.ClientCancelRequest(symbolName, clientCode, investorID);\r\n ViewFacade.Connection.DoSend(str);\r\n }\r\n}", "async function main() {\r\n const MyNFT = await ethers.getContractFactory(\"Gear\")\r\n\r\n // Start deployment, returning a promise that resolves to a contract object\r\n const myNFT = await MyNFT.deploy()\r\n console.log(\"Contract deployed to address:\", myNFT.address)\r\n}", "function money() {\n let commands = {\n atm: 'wallet',\n purse: 'wallet',\n wallet(target, room, user) {\n if (!this.canBroadcast()) return;\n Economy.get((target || user.userid), function(amount) {\n let currency = Wulu.Economy.currency_name;\n if (amount !== 1) currency += 's';\n this.sendReplyBox(`${target || user.name} has ${amount} ${currency}.`);\n room.update();\n }.bind(this));\n },\n\n 'generatemoney': 'givemoney',\n givemoney(target, room, user) {\n if (!user.can('givemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/givemoney [user], [amount] - Give a user a certain amount of money.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.give(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was given ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has given you ${amount} ${currency}. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n takemoney(target, room, user) {\n if (!user.can('takemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/takemoney [user], [amount] - Take a certain amount of money from a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.take(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was losted ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has taken ${amount} ${currency} from you. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n transfer: 'transfermoney',\n transfermoney(target, room, user) {\n if (!target || target.indexOf(',') < 0) return this.sendReply('/transfer [user], [amount] - Transfer a certain amount of money to a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let targetName = this.targetUsername;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${targetName} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n let self = this;\n Economy.get(user.userid, function(userAmount) {\n if (amount > userAmount) return self.sendReply('You cannot transfer more money than what you have.');\n Economy.give(targetName, amount, function(targetTotal) {\n Economy.take(user.userid, amount, function(userTotal) {\n let targetCash = targetTotal !== 1 ? currency_name + 's' : currency_name;\n let userCash = userTotal !== 1 ? currency_name + 's' : currency_name;\n self.sendReply(`You have successfully transferred ${amount} ${currency} to ${targetName}. You now have ${userTotal} ${userCash}.`);\n self.sendReply(`${user.name} has transferred ${amount} ${currency} to you. You now have ${targetTotal} ${targetCash}.`);\n });\n });\n });\n },\n\n moneyladder: 'richestuser',\n richladder: 'richestuser',\n richestusers: 'richestuser',\n richestuser(target, room) {\n if (!this.canBroadcast()) return;\n let self = this;\n let display = `<center><u><b>Richest Users</b></u></center><br>\n <table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n <tbody>\n <tr>\n <th>Rank</th>\n <th>Username</th>\n <th>Money</th>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n User.find().sort({money: -1}).limit(10).exec(function(err, users) {\n if (err) return;\n users.forEach((user, index) => {\n display += `<tr>\n <td>${index + 1}</td>\n <td>${user.name}</td>\n <td>${user.money}</td>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n });\n display += '</tbody></table>';\n self.sendReply('|raw|' + display);\n room.update();\n });\n }\n };\n\n Object.merge(CommandParser.commands, commands);\n}", "function sendInvoke (scriptHash, operation, arg1, arg2, assetType, assetAmount) {\n console.log('invoking contract from content script')\n var args = [arg1, arg2]\n\n // var tx = {'operation': 'putvalue', 'args': args, 'scriptHash': 'b3a14d99a3fb6646c78bf2f4e2f25a7964d2956a', 'amount': price, 'type': 'GAS' }\n var tx = {'operation': operation, 'args': args, 'scriptHash': scriptHash, 'amount': assetAmount, 'type': assetType }\n\n // send invoke contract\n chrome.runtime.sendMessage({'msg': 'sendInvoke', 'tx': tx}, function(response) {\n if (response && response.error) {\n console.log('contentInit sendInvoke error: '+response.error)\n window.postMessage(response.error, '*')\n\n } else if (response && response.msg){\n console.log('contentInit sendInvoke response: '+response.msg)\n // TODO: send invoke result to page\n window.postMessage(response.msg, '*')\n } else {\n console.log('content sendInvoke unexpected error')\n }\n })\n}", "function pricehandler(assistant) { \n request(EXT_BITCOIN_API_URL + EXT_PRICE, function(error,response,body) {\n //The fulfitlment logic for returning the bitcoin c DLL\n console.log(\"priceHandler response: \" + JSON.stringify(response) + \"Body :\" + body);\n const msg = \"Right now the price of bitcoin \" + body + \"USD\";\n assistant.tell(msg);\n });\n }", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\n });\n }", "async transfer({\n account,\n key\n }, {\n token,\n to,\n amount\n }) {\n let confirmSig = null;\n let from = account;\n let response = await this.client.request(\"transact\", {\n token,\n from,\n to,\n amount,\n confirmSig,\n }).catch(err => {\n throw err;\n });\n\n let json = response.result.result;\n if (!json) {\n throw \"Invalid transaction\";\n }\n let tx = Transaction.fromJSON(json);\n\n // let prefix = \"\\x19Ethereum Signed Message:\\n32\";\n // let txHashed = this.web3.utils.soliditySha3(prefix, tx.hash());\n let txHashed = tx.hash();\n let signature = await this.web3.eth.accounts.sign(txHashed, key).signature;\n tx.setSignature(signature);\n\n let signedTransaction = tx.toJSON();\n response = await this.client.request(\"submitTransact\", {\n signedTransaction,\n }).catch(err => {\n throw err;\n });\n\n // wait for the tx to be mined\n let found = -1;\n let blkNum;\n let root;\n let nTries = 0;\n while (found < 0 && nTries < 20) {\n await utils.sleep(500);\n // get latest block\n response = await this.client.request(\"getLatestBlock\", {}).catch(err => {\n throw err;\n });\n if (!response || !response.result || !response.result.result) {\n throw \"Blocks do not exist\";\n }\n let block = Block.fromJSON(response.result.result);\n blkNum = block.blockHeader.blockNumber;\n root = utils.addHexPrefix(block.blockHeader.merkleRoot);\n let txData = tx.data();\n found = block.transactions.findIndex(_tx => {\n return _tx === txData;\n });\n nTries += 1;\n }\n if (found < 0) {\n throw \"Transaction to confirm is not found or has yet been mined. This could mean that the transaction is not valid or insufficient balance.\";\n }\n let txIndex = found;\n\n // wait for the tx to be mined and then submit confirm signature\n // let confirmationHashed = this.web3.utils.soliditySha3(\n // prefix,\n // this.web3.utils.soliditySha3(tx.hash(), root),\n // );\n let confirmationHashed = this.web3.utils.soliditySha3(tx.hash(), root);\n let confirmSignature = await this.web3.eth.accounts.sign(confirmationHashed, key).signature;\n\n // submit confirm\n response = await this.client.request(\"confirmTx\", {\n blkNum,\n txIndex,\n confirmSignature,\n }).catch(err => {\n throw err;\n });\n\n return response;\n }", "async function main() {\n const [deployer] = await ethers.getSigners();\n\n console.log(\"Deploying contracts with the account:\", deployer.address);\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const Factory = await ethers.getContractFactory(\"StakefishServicesContractFactory\");\n const factory = await Factory.deploy(100_000); // 10% commission\n\n console.log(\"StakefishServicesContractFactory address:\", factory.address);\n console.log(\"StakefishServicesContract impl address:\", await factory.getServicesContractImpl())\n}", "async function example1 () {\n exchange['options']['defaultType'] = 'swap';\n exchange.options['defaultMarginMode'] = 'cross' // or isolated\n await exchange.loadMarkets ();\n\n const symbol = 'ADA/USDT:USDT';\n\n // fetchBalance\n const balance = await exchange.fetchBalance ();\n console.log (balance)\n\n // set the desired leverage (has to be made before placing the order and for a specific symbol)\n const leverage = 8;\n const leverage_response = await exchange.setLeverage(leverage, symbol)\n\n // create limit order\n const amount = 50;\n const price = 0.3 // adjust this accordingly\n const createOrder = await exchange.createOrder (symbol, 'limit', 'buy', amount, price);\n console.log ('Created order id:', createOrder['id'])\n}", "function transferFundingP1(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n if (Number(person1Release > 0)) {\r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:person1,quantity:person1Release + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n if (Number(person2Release) <= 0) {\r\n // finish - nothing to release\r\n finalReturn(outputMessage);\r\n } else {\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n })\r\n .catch(function (err) { console.log('error102'); }) \r\n }) \r\n } else {\r\n // skip to person2\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n}", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "function eosRequest(method, elementID) {\n console.log(method, elementID);\n switch (method) {\n case 'pull':\n switch (elementID) {\n case 'hat-hotspot':\n break;\n\n case 'claim-notifications':\n break;\n\n }\n break;\n\n case 'push':\n switch (elementID) {\n case 'want-button':\n $('#purchase-response').hide();\n $('#want-response').show();\n break;\n\n case 'purchase-button':\n eos.contract('promoteit')\n .then((contract) => {\n console.log(\"CONTRACT INIT\");\n contract.buyitem( {\n \"serialnum\": \"0\",\n \"buyername\": \"james\"\n }, {authorization: EOS_CONFIG.contractSender} ) \n .then((res) => {\n console.log(\"POST CALL\");\n console.log(res);\n $('#purchase-response').show();\n $('#want-response').hide();\n $('#hidden-hat').show();\n }).catch((err) => { console.log(err) })\n }).catch((err) => { console.log(err) })\n break;\n\n case 'add-item-button':\n $('#add-item-button').hide();\n $('#add-item-response').show();\n setTimeout(function() {$('#claim-notifications').show()}, 3000);\n break;\n\n case 'receive-reward-button':\n $('#receive-reward-button').hide();\n $('#receive-reward-response').show();\n $('#claim-notifications').hide();\n $('#token-balance-amount').html('3.45');\n break;\n }\n break;\n }\n}", "async function fetchAccountData() {\r\n\r\n // Get a Web3 instance for the wallet\r\n const web3 = new Web3(provider);\r\n\r\n console.log(\"Web3 instance is\", web3);\r\n\r\n // Get connected chain id from Ethereum node\r\n const chainId = await web3.eth.getChainId();\r\n // Load chain information over an HTTP API\r\n const chainData = evmChains.getChain(chainId);\r\n\r\n // Load Presale Contract\r\n const presale = new web3.eth.Contract(contract_abi,contract_address);\r\n\r\n // Get list of accounts of the connected wallet\r\n const accounts = await web3.eth.getAccounts();\r\n\r\n // MetaMask does not give you all accounts, only the selected account\r\n console.log(\"Got accounts\", accounts);\r\n selectedAccount = accounts[0];\r\n\r\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\r\n\r\n // Presale Whitelist\r\n if (chainId == 56) {\r\n const whitelistedaddress = await presale.methods.checkWhitelist(selectedAccount).call();\r\n console.log(whitelistedaddress)\r\n document.querySelector(\"#whitelisted-address\").textContent = whitelistedaddress;\r\n console.log ('Right Network') \r\n } else {\r\n document.querySelector(\"#whitelisted-address\").textContent = 'Connect on Binance Smart Chain';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n // Reserved Tokens\r\n const enteredpresale = await presale.methods.enteredPresale(selectedAccount).call({from : selectedAccount}, function(error, result){\r\n console.log(result);\r\n});\r\n if (chainId == 56 && enteredpresale == true) {\r\n const reserved = await presale.methods._TokensReserved(selectedAccount).call();\r\n reservedtokens = Number(reserved) / 1e9;\r\n console.log(reservedtokens)\r\n const checkcontrib = await presale.methods.checkContribution(selectedAccount).call();\r\n console.log(checkcontrib)\r\n checkcontribution = Number(checkcontrib) / 1e18;\r\n console.log(checkcontribution)\r\n document.querySelector(\"#contribution-amount\").textContent = Number(checkcontribution) + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = Number(reservedtokens) + ' JDT'; \r\n } else {\r\n test = 0;\r\n document.querySelector(\"#contribution-amount\").textContent = 0 + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = 0 + ' JDT';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n\r\n // Display fully loaded UI for wallet data\r\n document.querySelector(\"#prepare\").style.display = \"none\";\r\n document.querySelector(\"#connected\").style.display = \"block\";\r\n}", "takeExtra(token) {\n if (!blockchain.requireAuth(this._getFarm(), \"active\")) {\n throw \"only approved contracts can issue\";\n }\n\n if (token != \"iost\") {\n throw \"currently only iost is supported\";\n }\n\n const queue = this._getQueue();\n const lastTime = this._getLastTime();\n const now = Math.floor(tx.time / 1e9);\n\n var amountToSend = new BigNumber(0);\n\n for (let i = 0; i < queue.length; ++i) {\n const time = Math.min(now, queue[i].startTime + 3600 * 24);\n const lastTimeI = Math.max(lastTime, queue[i].startTime);\n const amount = new BigNumber(queue[i].delta).times(\n time - lastTimeI).div(3600 * 24);\n amountToSend = amountToSend.plus(amount);\n }\n\n const oldBalance = this._getBalance();\n const newBalance = new BigNumber(blockchain.call(\"token.iost\", \"balanceOf\", [\"iost\", blockchain.contractName()])[0]);\n\n // Queue in\n if (newBalance.minus(oldBalance).gte(MINIMUM_IOST_UNIT)) {\n // Every time the iost balance goes up, it will be distributed in the next\n // 24 hours evenly.\n const delta = newBalance.minus(oldBalance);\n queue.push({\n startTime: now,\n delta: delta.toFixed(IOST_PRECISION, ROUND_DOWN)\n });\n\n this._setBalance(newBalance.toFixed(IOST_PRECISION, ROUND_DOWN));\n }\n\n // Queue out\n if (queue[0] && lastTime >= queue[0].startTime + 24 * 3600) {\n queue.shift();\n }\n\n this._setQueue(queue);\n\n // amountToSend should be less than current balance in case\n // there is calculator error due to rounding.\n if (amountToSend.gt(newBalance)) {\n amountToSend = newBalance;\n }\n\n if (amountToSend.lt(MINIMUM_IOST_UNIT)) {\n return \"0\";\n }\n\n this._setLastTime(now);\n\n const amountToSendStr = amountToSend.toFixed(IOST_PRECISION, ROUND_DOWN);\n\n // Now send iost to farm.\n blockchain.callWithAuth(\"token.iost\", \"transfer\",\n [\"iost\",\n blockchain.contractName(),\n this._getFarm(),\n amountToSendStr,\n \"take extra\"]);\n\n // Update iost balance before we go.\n this._setBalance(blockchain.call(\"token.iost\", \"balanceOf\", [\"iost\", blockchain.contractName()])[0]);\n\n return amountToSendStr;\n }", "buy(passenger, airline, flightNumber, timestamp, amount, callback) {\n let self = this;\n let payload = {\n passenger: passenger,\n airline: airline,\n flightNumber: flightNumber,\n timestamp: timestamp,\n amount: amount\n }\n self.flightSuretyApp.methods\n .buy(payload.airline, payload.flightNumber, payload.timestamp)\n .send({ from: payload.passenger, value: payload.amount, gas: 4712388, gasPrice: 100000000000}, (error, result) => {\n callback(error, payload);\n });\n }", "async getAddClaimTransaction(claim, passport, passphrase, secondaryPassportId, secondaryAddress) {\n let neo = this;\n return new Promise(async (resolve, reject) => {\n if (!claim) {\n reject(\"claims not provided\");\n }\n if (!passport) {\n reject(\"passport not provided\");\n }\n if (!passphrase) {\n reject(\"passphrase not provided\");\n }\n\n \n let bridgeContractHash = _bridgeContractHash;\n if (bridgeContractHash.startsWith(\"0x\")) {\n bridgeContractHash = bridgeContractHash.slice(2);\n }\n const address = passport.wallets[0].address;\n const addressScriptHash = this._getAddressScriptHash(address);\n const secondaryAddressScriptHash = this._getAddressScriptHash(secondaryAddress);\n const privateKey = await this.getWifFromNep2Key(passport.wallets[0].key, passphrase);\n const account = new _neon.wallet.Account(privateKey);\n\n //invoke <contracthash> \"addclaim\" [address, identity, claimtypeid, claimvalue, createdon, provider]\n //address\n //identity\n //claimtypeid\n //claimvalue\n //createdon\n //provider = the account paying the tokens for the action\n const props = {\n scriptHash: bridgeContractHash,\n operation: 'addclaim',\n args: [\n secondaryAddressScriptHash,\n secondaryPassportId,\n claim.claimTypeId,\n _crypto.CryptoUtility.hexEncode(claim.claimValue),\n claim.createdOn,\n secondaryAddressScriptHash\n ]\n }\n\n const provider = new _neon.api.neoscan.instance(\"MainNet\");\n const gasFee = 0;\n const additionalInvocationGas = 0;\n const additionalIntents = [];\n const script = _neon.sc.createScript(props);\n const gas = additionalInvocationGas;\n const intent = additionalIntents;\n const config = {\n api: provider,\n account: account,\n intents: intent,\n script: script,\n fees: gasFee,\n gas: gas\n };\n\n _neon.api.fillSigningFunction(config)\n .then(c => { return _neon.api.fillUrl(c) })\n .then(c => { return _neon.api.fillBalance(c) })\n .then(c => { return _neon.api.createInvocationTx(c) })\n .then(c => {\n c.tx.addRemark(this._getRandom(5));\n c.tx.attributes.push(\n new _neon.tx.TransactionAttribute({\n usage: 32,\n data: addressScriptHash\n })\n );\n c.tx.attributes.push(\n new _neon.tx.TransactionAttribute({\n usage: 32,\n data: secondaryAddressScriptHash\n })\n );\n return c;\n })\n .then(c => { return _neon.api.signTx(c) })\n .then(c => {\n resolve(c.tx);\n })\n .catch(c => {\n reject(\"Error getting add claim transaction\");\n });\n });\n }", "async function bidContract(tokenid, amount) {\n const bidder_my_address = await newAddress()\n console.log('Bidder address is ' + bidder_my_address + '. Seller will need this to accept bid')\n\n const aKey = await newKey()\n console.log('Bidder public key is ' + aKey + '. Seller will need this to accept bid')\n\n // bidder bid 2 minima\n return createBidTransaction(amount, BIDDER_SCRIPT_ADDRESS, bidder_my_address, aKey, tokenid);\n\n}", "async function payf(){\r\n var web3=new Web3(window.ethereum)\r\n\t\r\n window.ethereum.enable()\r\n\r\n var a=\"0x8E381898f5ed1Ce23e09F1D16375721E44dABa09\";\r\n var amount=1;\r\n const accounts = await web3.eth.getAccounts();\r\n \r\n web3.eth.sendTransaction({\r\n to:a,\r\n value:amount,\r\n from:accounts[0]\r\n },(err,transactionId)=>{\r\n if(err){\r\n console.log(\"failed\",err)\r\n }\r\n else{\r\n console.log(\"success\",transactionId);\r\n }\r\n }\r\n )\r\n\r\n\r\n}", "async function main() {\n\n const [deployer] = await ethers.getSigners();\n\n console.log(\n \"Deploying contracts with the account:\",\n deployer.address\n );\n\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const Granola = await ethers.getContractFactory(\"Granola\");\n const granolaToken = await Granola.deploy();\n\n console.log(\"Token address:\", granolaToken.address);\n}", "async function send(secretKey, sendto, amount, cached_work) {\n var dd;\n\tvar address = await nanopay.secretKeytoaddr(secretKey);\n\tvar sddsf_address = await accountdig(address);\n\tvar cbal = sddsf_address.balance;\n\tvar previous = sddsf_address.frontier;\n var pow = null;\n console.log(\"Send function cached work: \",cached_work);\n if(typeof cached_work !== undefined && cached_work !== \"\") {\n pow = cached_work;\n }else {\n\t pow = await hybridWork(previous);\n }\n console.log(\"POW: \",pow);\n\n\tvar x = new BigNumber('1000000000000000000000000000000');\n\tvar xx = x.multipliedBy(amount).toFixed();\n\tvar puki = new BigNumber(cbal);\n\tvar balance = puki.minus(xx);\n\n\tvar balancex = balance.toFixed(0);\n\n\tif (balancex >= 0) {\n\t\tdd = {\n\t\t\tbalance: balancex,\n\t\t\tlink: sendto,\n\t\t\tprevious: previous,\n\t\t\trepresentative: address,\n\t\t\twork: pow,\n\t\t};\n console.log(dd);\n\t\tvar xxx = await nanocurrency.createBlock(secretKey, dd);\n\t\tvar retr = await publish(xxx.block);\n\t} else {\n\t\tvar retr = { error: 'no_balance' };\n\t}\n\n\treturn retr;\n}", "handleOfferSubmit(peerIdx) {\n this.props.handleContractCommand(this.props.contract, 'offer', peerIdx);\n }", "function newItem() {\n console.log(\"\\nnewItem clicked\");\n this_contract.newItem(\"Test 2\", 500, 10, {from: from_account, gas: 500000}).then(function(value) {\n console.log(value.valueOf());\n console.log(web3.eth.getTransactionReceipt(value));\n }).catch(function(e) {\n console.log(e);\n });\n}", "async publish(hash, wif, preface) {\n try {\n // Create an EC Key Pair from the user-supplied WIF.\n const ecPair = _this.bchjs.ECPair.fromWIF(wif)\n\n // Generate the public address that corresponds to this WIF.\n const ADDR = _this.bchjs.ECPair.toCashAddress(ecPair)\n // console.log(`Publishing ${hash} to ${ADDR}`)\n\n // Pick a UTXO controlled by this address.\n const u = await _this.bchjs.Blockbook.utxo(ADDR)\n const utxo = findBiggestUtxo(u)\n\n // instance of transaction builder\n const transactionBuilder = new _this.bchjs.TransactionBuilder()\n\n //const satoshisToSend = SATOSHIS_TO_SEND\n const originalAmount = utxo.satoshis\n const vout = utxo.vout\n const txid = utxo.txid\n\n // add input with txid and index of vout\n transactionBuilder.addInput(txid, vout)\n\n // TODO: Compute the 1 sat/byte fee.\n const fee = 500\n\n // Send the same amount - fee.\n transactionBuilder.addOutput(ADDR, originalAmount - fee - PSF_DONATION)\n\n // Default preface, or override if user specified.\n let prefaceStr = \"IPFS UPDATE\"\n if (preface) prefaceStr = preface\n\n // Add the memo.cash OP_RETURN to the transaction.\n const script = [\n _this.bchjs.Script.opcodes.OP_RETURN,\n Buffer.from(\"6d02\", \"hex\"),\n Buffer.from(`${prefaceStr} ${hash}`)\n ]\n\n //console.log(`script: ${util.inspect(script)}`);\n const data = _this.bchjs.Script.encode2(script)\n //console.log(`data: ${util.inspect(data)}`);\n transactionBuilder.addOutput(data, 0)\n\n // Send a 2000 sat donation to PSF for creating and maintaining this software.\n transactionBuilder.addOutput(bchDonation(\"psf\").donations, PSF_DONATION)\n\n // Sign the transaction with the HD node.\n let redeemScript\n transactionBuilder.sign(\n 0,\n ecPair,\n redeemScript,\n transactionBuilder.hashTypes.SIGHASH_ALL,\n originalAmount\n )\n\n // build tx\n const tx = transactionBuilder.build()\n // output rawhex\n const hex = tx.toHex()\n // console.log(`TX hex: ${hex}`)\n //console.log(` `);\n\n // Broadcast transation to the network\n const txidStr = await _this.bchjs.RawTransactions.sendRawTransaction(hex)\n\n return txidStr\n } catch (err) {\n console.error(`Error in memo-push/publish()`)\n throw err\n }\n }", "async deposit_ammo_usdc_clp(amount) {\n if (amount != 0) {\n const user_gs_farm_0 = await this.state.gfarmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"2\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n\n if (this.state.GMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n const allowed = await this.state.gfarmContracts[0].methods\n .approve(this.state.gmasterChefAddress, allow)\n .send({\n from: this.state.account,\n });\n\n //* Fee GS\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.gMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "async submitHandler() {\n const inputsAreValid = (this.state.newTitle !== \"\") && (this.state.newOffset !== \"\") && (parseFloat(this.state.amount) >= 0.001);\n if (inputsAreValid) {\n this.setState({bodyLoading: true});\n\n const accounts = await window.web3.eth.getAccounts();\n const sender = accounts[0];\n const vote = this.props.contract;\n\n const weiAmount = web3.utils.toWei(this.state.amount.toString(), \"ether\");\n\n // submit proposal\n try {\n await vote.methods.create(this.state.newTitle, this.state.newOffset).send({from: sender, value: weiAmount})\n .on(\"transactionHash\", (hash) => {\n this.setState({newTitle: \"\"});\n this.setState({newOffset: \"\"});\n this.setState({amount: \"0.001\"});\n this.setState({componentState: \"home\"});\n this.props.refresh();\n window.alert(\"Your Proposal Has Been Successfully Created.\");\n })\n .on(\"error\", (error) => {\n this.setState({transactionFailed: true});\n console.error(\"Transaction failed (Preston)\", error);\n });\n } catch (error) {\n this.setState({transactionFailed: true});\n console.error(\"Rejection hurts (Preston)\", error);\n }\n\n this.setState({bodyLoading: false});\n }\n }", "async sendSafePay() {\n\t\ttry {\n\n\t\t\tconst tx = await this._contract.sendSafepay(\n\t\t\t\tthis._order_state.orderno,\n\t\t\t\t{\n\t\t\t\t\tvalue: this._order_state.expected_total\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tawait tx.wait();\n\n\t\t\tthis._changeOrderState(\"Waiting for invoice\");\n\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t}\n\t}", "function proposeGame() {\n\t\t console.log(\"proposed\")\n\t\t var val = document.getElementById(\"proposeValue\").value; \n\t\t val = web3.toWei(val, \"ether\");\n\t\t contractInstance.proposeGame(val, merkleRoot, {from: web3.eth.accounts[0], value: val}, function(err, txHash) {\n\t\t if (err) {\n\t\t console.log(err);\n\t\t return;\n\t\t } else {\n\t\t\t console.log(txHash);\n\t\t\t}\n\t\t });\n\t\t}", "get(bet_param) {\n const _this = this;\n const t = this.t;\n bet_param = this.processBarrier(bet_param);\n const contract_map = {\n ASIANU: (param) => {\n return t.translate('[currency] [amount] payout if the last tick of [underlying] is strictly higher than the average of the [tick_count] ticks.', param);\n },\n ASIAND: (param) => {\n return t.translate('[currency] [amount] payout if the last tick of [underlying] is strictly lower than the average of the [tick_count] ticks.', param);\n },\n CALL: (param) => {\n if (param.tick_expiry === 1) { // Tick trade\n return t.translate('[currency] [amount] payout if [underlying] after [tick_count] ticks is strictly higher than [entry_spot].', param)\n }\n\n if (param.is_forward_starting === 1) {\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n param.date_start = _this.getDateTime(param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [duration] after [date_start].', param)\n }\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n // Daily normal constracts.\n param.date_expiry = 'close on ' + _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [date_expiry].', param)\n }\n\n if (param.fixed_expiry === 1) { //Fixed expiry\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [date_expiry].', param)\n }\n // Intraday normal contracts having duration in minutes, seconds, or hours.\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [duration] after contract start time.', param)\n },\n DIGITDIFF: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is not [barrier] after [tick_count] ticks.', param);\n },\n DIGITEVEN: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is even after [tick_count] ticks.', param);\n },\n DIGITMATCH: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is [barrier] after [tick_count] ticks.', param);\n },\n DIGITODD: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is odd after [tick_count] ticks.', param);\n },\n DIGITOVER: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is higher than [barrier] after [tick_count] ticks.', param);\n },\n DIGITUNDER: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is lower than [barrier] after [tick_count] ticks.', param);\n },\n EXPIRYMISS: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at [duration] after contract start time.', param);\n },\n EXPIRYRANGE: (param) => {\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at [duration] after contract start time.', param);\n },\n NOTOUCH: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through [duration] after contract start time.', param);\n },\n ONETOUCH: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through [duration] after contract start time.', param);\n },\n PUT: (param) => {\n if (param.tick_expiry === 1) { // Tick trade\n return t.translate('[currency] [amount] payout if [underlying] after [tick_count] ticks is strictly lower than [entry_spot].', param)\n }\n\n if (param.is_forward_starting === 1) {\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n param.date_start = _this.getDateTime(param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [duration] after [date_start].', param)\n }\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n // Daily normal constracts.\n param.date_expiry = 'close on ' + _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [date_expiry].', param)\n }\n\n if (param.fixed_expiry === 1) { //Fixed expiry\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [date_expiry].', param)\n }\n // Intraday normal contracts having duration in minutes, seconds, or hours.\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [duration] after contract start time.', param)\n },\n SPREAD: () => {\n return t.translate('Legacy contract. No further information is available.');\n }\n };\n if(typeof contract_map[bet_param.bet_type] === 'undefined'){\n return 'Invalid short code.';\n }\n return contract_map[bet_param.bet_type](bet_param);\n }", "async function deployTellorx(_network, _pk, _nodeURL) {\n console.log(\"deploy tellor 3\")\n await run(\"compile\")\n\n var net = _network\n\n\n ///////////////Connect to the network\n let privateKey = _pk;\n var provider = new ethers.providers.JsonRpcProvider(_nodeURL)\n let wallet = new ethers.Wallet(privateKey, provider)\n\n\n ////////////// Deploy Tellor 3\n\n //////////////// Extension\n console.log(\"Starting deployment for extension contract...\")\n const extfac = await ethers.getContractFactory(\"contracts/tellor3/Extension.sol:Extension\", wallet)\n const extfacwithsigner = await extfac.connect(wallet)\n const extension = await extfac.deploy()\n console.log(\"Extension contract deployed to: \", extension.address)\n\n await extension.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Extension contract deployed to:\", \"https://etherscan.io/address/\" + extension.address);\n console.log(\" Extension transaction hash:\", \"https://etherscan.io/tx/\" + extension.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Extension contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + extension.address);\n console.log(\" Extension transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + extension.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n\n\n //////////////// Tellor (Test)\n console.log(\"Starting deployment for tellor contract...\")\n const telfac = await ethers.getContractFactory(\"contracts/tellor3/Mocks/TellorTest.sol:TellorTest\", wallet)\n const telfacwithsigner = await telfac.connect(wallet)\n const tellor = await telfac.deploy(extension.address)\n console.log(\"Tellor contract deployed to: \", tellor.address)\n\n await tellor.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Tellor contract deployed to:\", \"https://etherscan.io/address/\" + tellor.address);\n console.log(\" Tellor transaction hash:\", \"https://etherscan.io/tx/\" + tellor.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Tellor contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + tellor.address);\n console.log(\" Tellor transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + tellor.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n //////////////// Master\n console.log(\"Starting deployment for master contract...\")\n const masfac = await ethers.getContractFactory(\"contracts/tellor3/TellorMaster.sol:TellorMaster\", wallet)\n const masfacwithsigner = await masfac.connect(wallet)\n const master = await masfac.deploy(tellor.address, tellor.address) // use same addr for _OLD_TELLOR and _newTellor?\n console.log(\"Master contract deployed to: \", master.address)\n\n await master.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Master contract deployed to:\", \"https://etherscan.io/address/\" + master.address);\n console.log(\" Master transaction hash:\", \"https://etherscan.io/tx/\" + master.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Master contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + master.address);\n console.log(\" Master transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + master.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n /////////// Deploy Tellor X\n console.log(\"deploy tellor X\")\n\n ////////////////Governance\n console.log(\"Starting deployment for governance contract...\")\n const gfac = await ethers.getContractFactory(\"contracts/testing/TestGovernance.sol:TestGovernance\", wallet)\n const gfacwithsigner = await gfac.connect(wallet)\n const governance = await gfacwithsigner.deploy(master.address)\n console.log(\"Governance contract deployed to: \", governance.address)\n\n await governance.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Governance contract deployed to:\", \"https://etherscan.io/address/\" + governance.address);\n console.log(\" Governance transaction hash:\", \"https://etherscan.io/tx/\" + governance.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Governance contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + governance.address);\n console.log(\" Governance transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + governance.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n /////////////Oracle\n console.log(\"Starting deployment for Oracle contract...\")\n const ofac = await ethers.getContractFactory(\"contracts//testing/TestOracle.sol:TestOracle\", wallet)\n const ofacwithsigner = await ofac.connect(wallet)\n const oracle = await ofacwithsigner.deploy(master.address)\n await oracle.deployed();\n\n\n if (net == \"mainnet\") {\n console.log(\"oracle contract deployed to:\", \"https://etherscan.io/address/\" + oracle.address);\n console.log(\" oracle transaction hash:\", \"https://etherscan.io/tx/\" + oracle.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"oracle contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + oracle.address);\n console.log(\" oracle transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + oracle.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n ///////////Treasury\n console.log(\"Starting deployment for Treasury contract...\")\n const tfac = await ethers.getContractFactory(\"contracts/testing/TestTreasury.sol:TestTreasury\", wallet)\n const tfacwithsigner = await tfac.connect(wallet)\n const treasury = await tfacwithsigner.deploy(master.address)\n await treasury.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"treasury contract deployed to:\", \"https://etherscan.io/address/\" + treasury.address);\n console.log(\" treasury transaction hash:\", \"https://etherscan.io/tx/\" + treasury.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"treasury contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + treasury.address);\n console.log(\" treasury transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + treasury.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n console.log(\"treasury Contract verified\")\n\n //////////////Controler\n console.log(\"Starting deployment for Controller contract...\")\n const cfac = await ethers.getContractFactory(\"contracts/Controller.sol:Controller\", wallet)\n const cfacwithsigners = await cfac.connect(wallet)\n const controller = await cfacwithsigners.deploy(governance.address, oracle.address, treasury.address)\n await controller.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"The controller contract was deployed to:\", \"https://etherscan.io/address/\" + controller.address);\n console.log(\" transaction hash:\", \"https://etherscan.io/tx/\" + controller.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"The controller contract was deployed to:\", \"https://rinkeby.etherscan.io/address/\" + controller.address);\n console.log(\" transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + controller.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n tellorTest = await ethers.getContractAt(\"contracts/tellor3/Mocks/TellorTest.sol:TellorTest\", master.address)\n await tellorTest.connect(wallet).setBalanceTest(wallet.address, ethers.BigNumber.from(\"1000000000000000000000000\"))\n await master.connect(wallet).changeTellorContract(controller.address)\n tellorNew = await ethers.getContractAt(\"contracts/Controller.sol:Controller\", master.address)\n await tellorNew.connect(wallet).init()\n\n console.log(\"TellorX deployed! You have 1 million test TRB in your wallet.\")\n\n console.log('submitting extension contract for verification...');\n await run(\"verify:verify\",\n {\n address: extension.address,\n },\n )\n console.log(\"extension contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for tx confirmation...');\n await controller.deployTransaction.wait(7)\n\n console.log('submitting contract for verification...');\n\n await run(\"verify:verify\",\n {\n address: controller.address,\n constructorArguments: [governance.address, oracle.address, treasury.address]\n },\n )\n console.log(\"Controller contract verified\")\n\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for tellor tx confirmation...');\n await tellor.deployTransaction.wait(7)\n\n console.log('submitting tellor contract for verification...');\n await run(\"verify:verify\",\n {\n address: tellor.address,\n constructorArguments: [extension.address]\n },\n )\n console.log(\"tellor contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for master tx confirmation...');\n await master.deployTransaction.wait(7)\n\n console.log('submitting master contract for verification...');\n await run(\"verify:verify\",\n {\n address: master.address,\n constructorArguments: [tellor.address, tellor.address]\n },\n )\n console.log(\"master contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for governance tx confirmation...');\n await governance.deployTransaction.wait(7)\n\n console.log('submitting governance contract for verification...');\n await run(\"verify:verify\",\n {\n address: governance.address,\n constructorArguments: [master.address]\n },\n )\n console.log(\"governance contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for treasury tx confirmation...');\n await treasury.deployTransaction.wait(7)\n\n console.log('submitting Treasury contract for verification...');\n\n await run(\"verify:verify\", {\n contract: \"contracts/testing/TestTreasury.sol:TestTreasury\",\n address: treasury.address,\n constructorArguments: [master.address]\n },\n )\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for Oracle tx confirmation...');\n await oracle.deployTransaction.wait(7)\n\n console.log('submitting Oracle contract for verification...');\n\n await run(\"verify:verify\",\n {\n contract: \"contracts/testing/TestOracle.sol:TestOracle\",\n address: oracle.address,\n constructorArguments: [master.address]\n },\n )\n\n console.log(\"Oracle contract verified\")\n}", "async function main() {\n // This is just a convenience check\n if (network.name === \"hardhat\") {\n console.warn(\n \"You are trying to deploy a contract to the Hardhat Network, which\" +\n \"gets automatically created and destroyed every time. Use the Hardhat\" +\n \" option '--network localhost'\"\n );\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n const Ante_alUSDSupplyTest = await ethers.getContractFactory(\"Ante_alUSDSupplyTest\");\n const ante_alUSDSupplyTest = await Ante_alUSDSupplyTest.deploy();\n await ante_alUSDSupplyTest.deployed();\n console.log(\"Ante_alUSDSupplyTest address:\", ante_alUSDSupplyTest.address);\n const a = await ante_alUSDSupplyTest.CheckTransmuterVL();\n console.log(a.toString());\n const b = await ante_alUSDSupplyTest.CheckAlchemistVL();\n console.log(b.toString());\n const c = await ante_alUSDSupplyTest.CheckTransmuterBVL();\n console.log(c.toString());\n const d = await ante_alUSDSupplyTest.CheckAlchemistYVAVL();\n console.log(d.toString());\n const e = await ante_alUSDSupplyTest.CheckTransmuterBYVAVL();\n console.log(e.toString());\n const USDbalance = await ante_alUSDSupplyTest.checkBalance();\n console.log(\"Ante_alUSDSupplyTest balance:\", USDbalance.toString());\n const USDcirculating = await ante_alUSDSupplyTest.checkCirculating();\n console.log(\"Ante_alUSDSupplyTest supply:\", USDcirculating.toString());\n const USDresult = await ante_alUSDSupplyTest.checkTestPasses();\n console.log(\"Ante_alUSDSupplyTest result:\", USDresult);\n\n const Ante_alETHSupplyTest = await ethers.getContractFactory(\"Ante_alETHSupplyTest\");\n const ante_alETHSupplyTest = await Ante_alETHSupplyTest.deploy();\n await ante_alETHSupplyTest.deployed();\n console.log(\"Ante_alETHSupplyTest address:\", ante_alETHSupplyTest.address);\n const f = await ante_alETHSupplyTest.CheckTransmuterVL();\n console.log(f.toString());\n const g = await ante_alETHSupplyTest.CheckAlchemistVL();\n console.log(g.toString());\n const h = await ante_alETHSupplyTest.CheckAlchemistYVAVL();\n console.log(h.toString());\n const i = await ante_alETHSupplyTest.CheckTransmuterBYVAVL();\n console.log(i.toString());\n const ETHbalance = await ante_alETHSupplyTest.checkBalance();\n console.log(\"Ante_alETHSupplyTest balance:\", ETHbalance.toString());\n const ETHcirculating = await ante_alETHSupplyTest.checkCirculating();\n console.log(\"Ante_alETHSupplyTest supply:\", ETHcirculating.toString());\n const ETHresult = await ante_alETHSupplyTest.checkTestPasses();\n console.log(\"Ante_alETHSupplyTest result:\", ETHresult);\n \n}", "function setupContractConnection(){\n // do work\n writeNumber(Math.floor(Math.random()*100));\n}", "async instantiate(ctx) {\r\n\r\n\r\n\r\n console.log('Registrar Smart Contract Instantiated');\r\n\r\n\r\n\r\n }", "function payMoney(pmcData, body, sessionID) {\n item.resetOutput();\n let output = item.getOutput();\n let tmpTraderInfo = trader_f.traderServer.getTrader(body.tid, sessionID);\n let currencyTpl = getCurrency(tmpTraderInfo.data.currency);\n\n // delete barter things(not a money) from inventory\n if (body.Action === 'TradingConfirm') {\n for (let index in body.scheme_items) {\n let item = undefined;\n\n for (let element of pmcData.Inventory.items) {\n if (body.scheme_items[index].id === element._id) {\n item = element;\n }\n }\n\n if (item !== undefined) {\n if (!isMoneyTpl(item._tpl)) {\n output = move_f.removeItem(pmcData, item._id, output, sessionID);\n body.scheme_items[index].count = 0;\n } else {\n currencyTpl = item._tpl;\n break;\n }\n }\n }\n }\n\n // find all items with currency _tpl id\n const moneyItems = itm_hf.findMoney(\"tpl\", pmcData, currencyTpl);\n\n // prepare a price for barter\n let barterPrice = 0;\n \n for (let item of body.scheme_items) {\n barterPrice += item.count;\n }\n\n // prepare the amount of money in the profile\n let amountMoney = 0;\n \n for (let item of moneyItems) {\n amountMoney += item.upd.StackObjectsCount;\n }\n\n // if no money in inventory or amount is not enough we return false\n if (moneyItems.length <= 0 || amountMoney < barterPrice) {\n return false;\n }\n\n let leftToPay = barterPrice;\n\n for (let moneyItem of moneyItems) {\n let itemAmount = moneyItem.upd.StackObjectsCount;\n\n if (leftToPay >= itemAmount) {\n leftToPay -= itemAmount;\n output = move_f.removeItem(pmcData, moneyItem._id, output, sessionID);\n } else {\n moneyItem.upd.StackObjectsCount -= leftToPay;\n leftToPay = 0;\n output.data.items.change.push(moneyItem);\n }\n\n if (leftToPay === 0) {\n break;\n }\n }\n\n // set current sale sum\n // convert barterPrice itemTpl into RUB then convert RUB into trader currency\n let saleSum = pmcData.TraderStandings[body.tid].currentSalesSum += fromRUB(inRUB(barterPrice, currencyTpl), getCurrency(tmpTraderInfo.data.currency));\n\n pmcData.TraderStandings[body.tid].currentSalesSum = saleSum;\n trader_f.traderServer.lvlUp(body.tid, sessionID);\n output.data.currentSalesSums[body.tid] = saleSum;\n\n // save changes\n logger.logSuccess(\"Items taken. Status OK.\");\n item.setOutput(output);\n return true;\n}", "function DeployContract(eth_accountAddr,eth_bytecode){\n\n\t// if( typeof eth_arguments != undefined)\n\t// {\n\t// \tvar _arguments = eth_arguments;\n\t// }\n\tdataString = {\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"id\":1,\"params\":[{\n\t\t\"from\": eth_accountAddr,\n\t\t\"data\":eth_bytecode,\n\n\t}]}\n\toptions = {\n url: REQUESTURL,\n method:'POST',\n headers:headers,\n body: dataString,\n json: true\n\t}\n\treturn options;\n}", "async function buy(_hash,_id, _account,_key){\r\n return new Promise(async(resolve) =>{\r\n let _contract = await getContract();\r\n\r\n const d = _contract.methods.buy(_id);\r\n\r\n checkTransaction(_hash,_account,_key,d).then(res =>{\r\n resolve(res);\r\n });\r\n });\r\n}", "function marketSell () {\n}", "function contractCall(contract, method, params) {\n return new Promise((resolve, reject) => {\n contract.call(PASSWD, CONTRACTNAME, method, params, ABI, (err, res) => {\n if (err) { console.error(err); reject(err) }\n else { resolve(res) }\n })\n })\n}", "async handleFormEvent(event) {\n // stop default behaviour\n event.preventDefault();\n\n // collect form data\n let desired_link = event.target.desired_link.value;\n let bounty = event.target.bounty.value;\n let price_per = event.target.price_per.value;\n let private_key = \"5J8GwbXpAfgj89gSUH4j63uknX9vdsQBVXctjW2tDuuxgGfNvi2\";\n\n // prepare variables for the switch below to send transactions\n let actionName = \"\";\n let actionData = {};\n\n // define actionName and action according to event type\n switch (event.type) {\n case \"submit\":\n actionName = \"bidscreate\";\n actionData = {\n bidder: \"acmesuper\",\n desired_link: desired_link,\n bounty: bounty,\n price_per: price_per\n };\n break;\n default:\n return;\n }\n\n // eosjs function call: connect to the blockchain\n const eos = Eos({keyProvider: private_key, httpEndpoint: 'http://www.cookie-store.my.to:8888'});\n const result = await eos.transaction({\n actions: [{\n account: \"cookie.store\",\n name: actionName,\n authorization: [{\n actor: \"acmesuper\",\n permission: \"active\",\n }],\n data: actionData,\n }],\n });\n\n console.log(result);\n\n let payment_memo = result.transaction.transaction.actions[0].account + \" \" + result.transaction.transaction.actions[0].name;\n console.log(payment_memo);\n let payment_data = {from: \"acmesuper\", to: \"cookie.store\", quantity: bounty, memo: payment_memo};\n console.log(payment_data)\n\n const payment_result = await eos.transaction({\n actions: [{\n account: \"eosio.token\",\n name: \"transfer\",\n authorization: [{\n actor: \"acmesuper\",\n permission: \"active\",\n }],\n data: payment_data,\n }],\n });\n\n console.log(payment_result);\n\n this.getCookiesTable();\n }", "async function example3 () {\n exchange['options']['defaultType'] = 'swap'; // very important set swap as default type\n await exchange.loadMarkets ();\n\n // fetch USDC swap balance\n // when no symbol is available we can show our intent\n // of using USDC endpoints by either using defaultSettle in options or\n // settle in params\n // Using Options: exchange['options']['defaultSettle'] = 'USDC';\n // Using params:\n const balanceParams = {\n 'settle': 'USDC'\n }\n const balance = await exchange.fetchBalance (balanceParams);\n console.log (balance)\n\n // create order and open position\n // taking into consideration that USDC markets do not support\n // market orders\n const symbol = 'BTC/USD:USDC';\n const amount = 0.1;\n const price = 29940 // adjust this accordingly\n const createOrder = await exchange.createOrder (symbol, 'limit', 'buy', amount, price);\n console.log ('Created order id:', createOrder['id'])\n\n // check if the order was filled and the position opened\n const symbols = [ symbol ];\n const positions = await exchange.fetchPositions (symbols);\n console.log (positions)\n\n // close position (assuming it was already opened) by issuing an order in the opposite direction\n const params = {\n 'reduce_only': true\n }\n const closePositionOrder = await exchange.createOrder (symbol, 'limit', 'sell', amount, price, params);\n console.log (closePositionOrder);\n}", "async function example2 () {\n exchange['options']['defaultType'] = 'swap';\n exchange.options['defaultMarginMode'] = 'cross' // or isolated\n await exchange.loadMarkets ();\n\n const symbol = 'ADA/USDT:USDT';\n\n // fetchBalance\n const balance = await exchange.fetchBalance ();\n console.log (balance)\n\n // set the desired leverage (has to be made before placing the order and for a specific symbol)\n const leverage = 8;\n const leverage_response = await exchange.setLeverage(leverage, symbol)\n\n // create market order and open position\n const amount = 50;\n const createOrder = await exchange.createOrder (symbol, 'market', 'buy', amount);\n console.log ('Created order id:', createOrder['id'])\n\n // check if the order was filled and the position opened\n const position = await exchange.fetchPositions (symbol);\n console.log (position)\n\n // close position (assuming it was already opened) by issuing an order in the opposite direction\n const params = {\n 'reduce_only': true\n }\n const closePositionOrder = await exchange.createOrder (symbol, 'market', 'sell', amount, undefined, params);\n console.log (closePositionOrder);\n}", "contributePiggy (playerContribution, minContribution) {\r\n let self = this\r\n\r\n self.contributionStatus = 'contributing'\r\n\r\n // Format contribution\r\n playerContribution = playerContribution.replace(/,/g, '.')\r\n playerContribution = playerContribution.replace(/^\\./g, '0.')\r\n\r\n // Check user contribution\r\n if (playerContribution === '') {\r\n self.contributionError = this.$t('lang.ethereummixin.contributionNotValid')\r\n return false\r\n } else if (playerContribution < minContribution) {\r\n self.contributionError = this.$t('lang.ethereummixin.contributionTooLow') + ' (' + minContribution + ')'\r\n return false\r\n }\r\n\r\n // Dial node\r\n self.dialJs()\r\n\r\n // Contribute\r\n self.web3js.eth.getAccounts()\r\n .then(function (accounts) {\r\n console.log(accounts)\r\n let currentAddress = accounts[0]\r\n\r\n if (self.abi && self.contractAddress) {\r\n // Get contract\r\n var contract = new self.web3js.eth.Contract(self.abi, self.contractAddress)\r\n // Send contribution\r\n contract.methods.contribute().send({value: Units.convert(playerContribution, 'eth', 'wei'), from: currentAddress})\r\n .on('transactionHash', function (hash) {\r\n console.log('as contributed', hash)\r\n self.contributionStatus = 'contributed'\r\n self.$store.state.ethLoading.contribution = true\r\n self.$store.state.ethPendingTx = hash\r\n self.dialog = true\r\n })\r\n .on('receipt', function (receipt) {\r\n console.log('Contribution receipt:', receipt)\r\n self.$store.state.ethLoading.contribution = false\r\n self.getEthGameData()\r\n self.notify(self.$t('lang.ethereummixin.notification.contribute.title'), self.$t('lang.ethereummixin.notification.contribute.text'))\r\n })\r\n .on('confirmation', function (confirmationNumber, receipt) {\r\n // console.log('confirmation:', confirmationNumber, receipt)\r\n })\r\n .on('error', function (error) {\r\n console.log('error:', error)\r\n })\r\n }\r\n })\r\n }", "async submitVoteHandler() {\n const vote = this.props.contract;\n const accounts = await window.web3.eth.getAccounts();\n const sender = accounts[0];\n\n const weiBal = await window.web3.eth.getBalance(sender);\n const ethBal = window.web3.utils.fromWei(weiBal, \"ether\");\n\n const inputAmount = this.state.ethDeposited;\n const inputInWei = window.web3.utils.toWei(inputAmount.toString(), \"ether\");\n const voteIsValid = !(this.state.yaySelected && this.state.naySelected) && (this.state.yaySelected || this.state.naySelected);\n const votesYay = this.state.yaySelected && !this.state.naySelected;\n\n if (voteIsValid) {\n // verify input amount before initiating transaction.\n if (inputAmount == 0) {\n window.alert(\"Deposit amount can not be zero.\");\n }\n else if (inputAmount > this.state.proposal.max_deposit) {\n window.alert(\"Deposit amount exceeded allowance.\");\n }\n else if (inputAmount > parseFloat(ethBal)) {\n window.alert(\"Your balance is insufficient.\");\n }\n else {\n this.setState({isLoading: true});\n // vote\n try {\n await vote.methods.vote(this.state.proposal.id, votesYay).send({from: sender, value: inputInWei})\n .on(\"transactionHash\", (hash) => {\n window.alert(\"Vote casted successfully.\");\n this.setState({voteCasted: true});\n })\n .on(\"error\", (error) => {\n this.setState({isLoading: false});\n this.props.err();\n console.error(\"Transaction failed (Preston)\", error);\n });\n } catch (error) {\n this.setState({isLoading: false});\n this.props.err();\n console.error(\"Rejection hurts (Preston)\", error);\n }\n }\n }\n else {\n window.alert(\"Vote or die.\"); // South Park Reference.\n }\n }", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function testContract(address) {\n // Reference to the deployed contract\n const token = contract.at(address);\n // Destination account for test\n const dest_account = '0x002D61B362ead60A632c0e6B43fCff4A7a259285';\n\n // Assert initial account balance, should be 100000\n const balance1 = token.balances.call(web3.eth.coinbase);\n console.log(balance1 == 1000000);\n\n // Call the transfer function\n token.transfer(dest_account, 100, {from: web3.eth.coinbase}, (err, res) => {\n // Log transaction, in case you want to explore\n console.log('tx: ' + res);\n // Assert destination account balance, should be 100 \n const balance2 = token.balances.call(dest_account);\n console.log(balance2 == 100);\n });\n}" ]
[ "0.67187506", "0.6597626", "0.6564653", "0.64804304", "0.6382265", "0.6372014", "0.6367808", "0.63591576", "0.63151", "0.6226985", "0.6194143", "0.6170448", "0.6164739", "0.61347854", "0.61236125", "0.6079861", "0.6065798", "0.60639936", "0.60616034", "0.6054455", "0.6020632", "0.6010529", "0.5996609", "0.59959465", "0.5955289", "0.5950959", "0.5947366", "0.59450936", "0.5938939", "0.59299105", "0.591337", "0.590579", "0.59029156", "0.58852875", "0.5885236", "0.5867178", "0.58353245", "0.5823309", "0.58187455", "0.5798028", "0.57979536", "0.57913107", "0.5790783", "0.5776152", "0.5772942", "0.5769231", "0.57636404", "0.57558936", "0.5750163", "0.57501364", "0.5745808", "0.573766", "0.57342255", "0.57330537", "0.57303053", "0.572669", "0.5713638", "0.5702788", "0.56938833", "0.5691548", "0.56897664", "0.568845", "0.5678072", "0.56729215", "0.5670797", "0.5669624", "0.5669178", "0.5664009", "0.5662984", "0.5655134", "0.56541634", "0.56513137", "0.5642857", "0.56416214", "0.56367415", "0.56360424", "0.5635858", "0.5633042", "0.56308484", "0.5620479", "0.56127983", "0.5606967", "0.5603857", "0.5602343", "0.5601714", "0.56010634", "0.55959433", "0.55884886", "0.558587", "0.55836135", "0.55748713", "0.55701274", "0.55627084", "0.555741", "0.555741", "0.555741", "0.555741", "0.555741", "0.555741", "0.5556647" ]
0.6857746
0
Sets state for value to be transacted Clears extant alerts
function valueChange(value) { setTransAmount(value); setIsPending(false); setIsError(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clear_alert() {\n let action = {\n type: 'clear/set',\n data: \"\",\n }\n store.dispatch(action);\n }", "_resetValueStateMessage() {\n this._setValueStateMessage(this._previousValueState.state, this._previousValueState.message);\n }", "reset(value) {\n super.reset(value);\n this._setConfirmedValue();\n }", "setAdjustmentSendingStatus(state, status) {\n state.adjustmentSendingStatus = status\n }", "function setEntityState(entity,state) {\n entity.state = state\n server.baseServer.broadcast('server','entity',{uuid:entity.uuid, state:state})\n }", "[Type.CHANGE_STATEUS_ALERT](state, payload) {\n state.alert = payload\n }", "function onStageListUnChecked(){\n document.getElementById(\"onstagelistMsg\").value='off';\n}", "setIssued() {\n this.currentState = btState.ISSUED;\n }", "resetValues(){\n this.setState({\n modal: false,\n station: this.state.stations[0].station_name,\n datatype: 'temperature',\n keyword: 'above',\n value: null,\n secondValue: null,\n email: true,\n sms: false,\n webpage: false,\n threshold: '1 hour',\n error: {}\n })\n this.toggleAddAlert();\n }", "_setValueStateMessage(valueState, message) {\n this.valueState = valueState;\n // element was created in constructor\n this._valueStateElement.innerText = message;\n }", "function changeState(ev) {\n DialogService.showConfirmInactivation(ev, function (option) {\n if (option === true) {\n vm.test.$remove(function () {\n vm.test.active = false;\n }, function (res) {\n Toast.genericErrorMessage();\n $log.error(res.data.message);\n });\n }\n });\n }", "function setStatus(value){\n\tlocalStorage.setItem(\"activate\", value);\n}", "constructor(){\n super();\n this.setTxMessage(undefined);\n this.setTxStatus(undefined);\n this.setTxContent(undefined);\n }", "function changeState(ev, test) {\n DialogService.showConfirmInactivation(ev, function (option) {\n if (option === true) {\n vm.testService.$remove({ testId: test._id }, function () {\n test.active = !test.active;\n filter();\n }, function (res) {\n Toast.genericErrorMessage();\n $log.error(res.data.message);\n });\n }\n });\n }", "function resetSSEState() {\n repository.deployState = \"\";\n repository.deployCalloutType = \"info\";\n repository.deployedTaskInformation = null;\n\n sseObj = null;\n }", "function resetSSEState() {\n repository.deployState = \"\";\n repository.deployCalloutType = \"info\";\n repository.deployedTaskInformation = null;\n\n sseObj = null;\n }", "toggleStatus(value){\n LayoutAnimation.spring();\n this.setState({status: value, switchOnOff: value});\n if (value === false){\n this.deleteAlert();\n }else{\n this.currentPos();\n this.updateLocations();\n }\n }", "set transaction(aValue) {\n this._transaction = aValue;\n }", "doAction (value) {\n if (!this._params.simulate) {\n this._actuator.write(value.state === true ? 1 : 0, () => {\n this.addValue(value.state)\n })\n } else {\n this.addValue(value.state)\n }\n\n value.status = 'completed'\n\n console.info('Changed value of %s to %s', this._model.name, value.state)\n }", "function setActionState(inContext, inState) {\n\t\t\t\tsetState(inContext, inState);\n\t\t}", "changeStatusEdit(state) {\n state.statusEditData = !this.state.statusEditData\n }", "value(value) {\n this.performAction();\n this.activeId = value;\n this.performAction();\n }", "function deactivateIntelAmtCCMEx(dev, state) {\n if (state != 0) {\n dev.consoleMsg(\"Failed to deactivate Intel AMT CCM.\");\n removeAmtDevice(dev, 53);\n } else {\n // Update the device\n dev.aquired = {};\n dev.aquired.controlMode = 0; // 1 = CCM, 2 = ACM\n dev.aquired.state = 0; // Not activated\n delete dev.acctry;\n delete dev.amtstack;\n UpdateDevice(dev);\n\n if (dev.policy.amtPolicy == 1) { // Deactivation policy, we are done.\n dev.consoleMsg(\"Deactivation successful.\");\n dev.consoleMsg(\"Done.\");\n removeAmtDevice(dev, 54);\n } else {\n // Wait 20 seconds before attempting any operation on this device\n dev.consoleMsg(\"Deactivation successful, holding for 1 minute...\");\n var f = function askMeiState() {\n askMeiState.dev.pendingUpdatedMeiState = 1;\n askMeiState.dev.controlMsg({ action: 'mestate' });\n }\n f.dev = dev;\n setTimeout(f, 60000);\n }\n }\n }", "set actuatorState(value) { this._actuatorState = value; }", "updateTelValue(state, telValue) {\r\n state.telValue = telValue;\r\n }", "clear() {\n let me = this;\n\n me.value = me.clearToOriginalValue ? me.originalConfig.value : null;\n me.fire('clear');\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "AcceptChanges() {\n this.State = tp.DataRowState.Unchanged;\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "fireUncheck(value) {\n this.writeValue(value);\n }", "function changeSend(val) {\n setSend(val);\n }", "activeInactiveState(evt, status, id) {\n if (status == 1) {\n status = 0;\n } else {\n status = 1;\n }\n const r = window.confirm(\"Do you want to change status ?\");\n if (r == true) {\n const postData = {\n status: status,\n };\n axios\n .put(Url + `api/state/update/${id}`, postData)\n .then((res) => {\n toast.success(res.data.message);\n window.location.reload();\n })\n .catch((err) => {\n //console.log(\"err\",err)\n toast.error(\"Error occured at API end (\" + err.message + \")\");\n });\n }\n }", "function clearPendingValueStatus(){\n _.each(pendingValueStatus, function(value){\n value.save({\"status\": \"ok\"}, {wait: true});\n });\n}", "function deTrigger()\n{\n setState( StatesEnum.armed );\n}", "setSaved(store, saved) {\n store.commit('SET_SAVED', saved)\n logger.debug('saved', saved)\n\n Timeout.clear('clear-saved-value-timer')\n Timeout.set(\n 'clear-saved-value-timer',\n () => {\n store.dispatch('setSaved', false)\n },\n 10000,\n )\n }", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "reset() {\n emitter.emit('reset_state')\n }", "function resetLocalState() {\n $scope.transactionSent = null;\n $scope.transactionNeedsApproval = null;\n clearReturnedTxData();\n }", "async set_state(value)\n { console.log(\"NEEO is setting setate to \"+value);\n await this._yObject.set_state(value ?YRelay.STATE_B:YRelay.STATE_A);\n this._state = value;\n }", "[Type.CHANGE_STATUS_CONFIRM](state, payload) {\n state.statusConfirm = payload\n }", "function sendStateUpdate () { \n //console.log('sending state %s', state)\n client.publish('LED/state', state);\n}", "clearStates() {\n // applications should extend this to actually do something, assuming they can save locally\n }", "function clearValue() {\n setEmail(\"\");\n setPassword(\"\");\n }", "setNormal() {\n this.currentState = shtState.NORMAL;\n }", "function updateStatus(emailId, softDelete) {\r\n\tvar status = \"\";\r\n\tvar changedStatus = 0;\r\n\tif(softDelete == 0) {\r\n\t\tstatus = \"Deactivate\";\r\n\t\tchangedStatus = 1;\r\n\t} else {\r\n\t\tstatus = \"Activate\";\r\n\t\tchangedStatus = 0;\r\n\t}\r\n\r\n\talertify.set({ buttonReverse: true });\r\n\talertify.confirm(\"Are you sure you want to \"+status+\" \"+emailId+\"?\", function (e) {\r\n\t\tif (e) {\r\n\t\t\tvar userDelete = Spine.Model.sub();\r\n\t\t\tuserDelete.configure(\"/admin/manageuser/updateStatus\", \"emailId\", \"updatedStt\");\r\n\t\t\tuserDelete.extend( Spine.Model.Ajax );\r\n\t\t\t//Populate the model with data to transfer\r\n\t\t\tvar modelPopulator = new userDelete({ \r\n\t\t\t\temailId: emailId,\r\n\t\t\t\tupdatedStt: changedStatus\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\tmodelPopulator.save(); //POST\r\n\t\t\tuserDelete.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t\t\t});\r\n\t\t\tuserDelete.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\t\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\t\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t\t\tvar statusCode = obj.statusCode;\r\n\t\t\t\tif (statusCode == 401) {\r\n\t\t\t\t\talertify.alert(\"Unable to \"+status+\" \"+emailId);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//alertify.set({ delay: 2700 });\r\n\t\t\t\t\talertify.alert(\"User has been \"+status+\"d successfully.\");\r\n\t\t\t\t}\r\n\t\t\t\tfetchExistingUsersManageUser();\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n}", "updateEmailValue(state, emailValue) {\r\n state.emailValue = emailValue;\r\n }", "function resetValue() {\n\t\t\t}", "function ClearStatusMsg() \n {\n\n SetStatusMsg(\"StatusMsg\", \"\");\n }", "function lockStageUnchecked(){\n document.getElementById(\"lockStageMsg\").value='false';\n}", "function clearCurrent() {\n $log.debug(\"send-flow-state clearCurrent()\");\n state = {\n countryCode: ''\n , documentType: ''\n , documents: []\n , documentsMeta: {}\n , identity: null\n , isRecovery: false\n , kycIsSubmitted: false\n , recoverySuccess: false\n , result: ''\n , status: ''\n };\n }", "function securityState(state) {\n that.stateMachine.securityMachine = state;\n that.Log.WriteLog(\"La seguridad está en: \" + that.stateMachine.securityMachine, ci_syslog_1.Logger.Severities.Debug);\n }", "function updateStatus(emailId, softDelete) {\r\n\tvar status = \"\";\r\n\tvar changedStatus = 0;\r\n\tif(softDelete == 0) {\r\n\t\tstatus = \"Deactivate\";\r\n\t\tchangedStatus = 1;\r\n\t} else {\r\n\t\tstatus = \"Activate\";\r\n\t\tchangedStatus = 0;\r\n\t}\r\n\r\n\talertify.set({ buttonReverse: true });\r\n\talertify.confirm(\"Are you sure you want to \"+status+\" \"+emailId+\"?\", function (e) {\r\n\t\tif (e) {\r\n\t\t\tvar userDelete = Spine.Model.sub();\r\n\t\t\tuserDelete.configure(\"/admin/manageuser/updateStatus\", \"emailId\", \"updatedStt\");\r\n\t\t\tuserDelete.extend( Spine.Model.Ajax );\r\n\t\t\t//Populate the model with data to transfer\r\n\t\t\tvar modelPopulator = new userDelete({ \r\n\t\t\t\temailId: emailId,\r\n\t\t\t\tupdatedStt: changedStatus\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\tmodelPopulator.save(); //POST\r\n\t\t\tuserDelete.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t\t\t});\r\n\t\t\tuserDelete.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\t\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\t\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\t\t\tvar statusCode = obj.statusCode;\r\n\t\t\t\tif (statusCode == 401) {\r\n\t\t\t\t\talertify.alert(\"Unable to \"+status+\" \"+emailId);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//alertify.set({ delay: 2700 });\r\n\t\t\t\t\talertify.alert(\"User has been \"+status+\"d successfully.\");\r\n\t\t\t\t}\r\n\t\t\t\tpopulateTable(obj.existingUsers);\r\n\t\t\t\tfetchExistingUsersByUserTypeAndGroup();\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}", "setWhen(context, payload){\n context.commit('cancellationTime', payload); \n }", "setTrading() {\n this.currentState = cpState.TRADING;\n }", "clearStatus() {\n\t\treturn this.setStatus('');\n\t}", "function setActionState(inContext, inState) {\n setState(inContext, inState);\n }", "reset() {\r\n this.activeState = this.config.initial;\r\n }", "setFee(state) {\n document.getElementById(\n \"en__field_supporter_transaction_fee\"\n ).checked = !!state;\n }", "change() {\n this._updateValueProperty();\n\n this.sendAction('action', this.get('value'), this);\n }", "resetState() {\n this.state = 'pending'\n }", "setIssued() {\n this.currentState = cpState.ISSUED;\n }", "function blockHandler (state, context) {\n // TODO: in the future we won't disburse every time there is a withdrawal,\n // we will wait until we're ready to make a checkpoint (e.g. a few\n // times a day or when the signatory set has changed)\n if (state.withdrawals.length === 0) return\n if (state.signingTx != null) return\n\n let inputs = state.utxos\n state.utxos = []\n\n let outputs = state.withdrawals\n state.withdrawals = []\n\n state.signingTx = {\n inputs,\n outputs,\n signatures: [],\n signedVotingPower: 0\n }\n }", "setIssued() {\n this.currentState = gpState.ISSUED;\n }", "function _setEntry(context, address, stateValue) {\n //code here\n let msgBytes = encoder.encode(stateValue);\n let entries = {\n [address]: msgBytes\n };\n return context.setState(entries);\n}", "function lockStageChecked(){\n document.getElementById(\"lockStageMsg\").value='true';\n}", "set state (value) {\n this._mem.state = value;\n }", "setSubscriptionState(context, level) {\n context.commit('setSubscriptionState', level);\n }", "function sendState(theState, theSource, theIndex) {\r\n //checks the sent state and which element to act upon\r\n if (theState === on) {\r\n //sets the background on error\r\n //console.log(theIndex);\r\n setbackonError(theSource, \"yellow\");\r\n } else if (theState === off) {\r\n //sets the background after positve validation\r\n setbackonError(theSource, \"white\");\r\n }\r\n else{\r\n //nothing happens!\r\n }\r\n }", "set Emissive(value) {}", "reportMyState(state) {\n this.myState = state\n this.sendMyState()\n }", "function setState(value) {\n state = value;\n appView.filterAll();\n }", "function setHeat(state){\r\n if(ENV==\"devel\") digitalWrite(HEAT_PIN,state);\r\n else digitalWrite(HEAT_PIN,!state);\r\n}", "reset() {\n show(cacheDOM.setButton);\n hide(cacheDOM.setDisplay, cacheDOM.snoozeButton, cacheDOM.stopButton);\n this.alarm.hours = 0;\n this.alarm.minutes = 0;\n this.alarm.isSet = false;\n }", "setWaletInvestVaue(store, { value }) {}", "cancelAlert() {\n SimVar.SetSimVarValue('L:WT_CJ4_WPT_ALERT', 'number', 0);\n }", "set state(value) {\n defineProperty(this, '_state$', {configurable: true, value: value});\n }", "resetActionStates() {\r\n let oldStates = this._actionStates.map(x => x);\r\n this._actionStates = [];\r\n this.emit('reset.actionstates', oldStates);\r\n return this;\r\n }", "function leaveEditState() {\n var row = $(this);\n var quantityCell = row.children('td.quantity');\n quantityCell.empty().text(quantityCell.attr('data-value'));\n }", "set (text, state) {\n this.element.textContent = text;\n\n this.element.classList.add('message_visible');\n this.element.classList.add('message_' + (state || 'error'));\n\n this.element.classList.remove('hidden');\n }", "setCategorySendingStatus(state, status) {\n state.categorySendingStatus = status\n }", "notificationsToggle(state) {\n // console.log(\"toggle\")\n if (state.notificationsShow == \"show\") {\n state.notificationsShow = \"\"\n } else {\n state.notificationsShow = \"show\"\n }\n }", "reset_techInfo_State(some){\r\n\t\t//this.setState(this.initialState);\r\n\t\t//alert(\"resetting\");\r\n\t\t//alert(\"this.baseState-> \" + this.baseState );\r\n\t\tthis.setState({ //sets new value to state //setState is an async function\r\n techInfoState: this.state.baseState\r\n }); \r\n\t}", "async apiEnableSTT() {\n const body = {\n enable_stt: true,\n enable_telemetry: true,\n };\n const headers = { Authorization: `Basic ${await I.getAuth()}` };\n\n const resp = await I.sendPostRequest('v1/Settings/Change', body, headers);\n\n assert.ok(\n resp.status === 200,\n `Failed to enabled STT. ${resp.data.message}`,\n );\n }", "function onStageListChecked(){\n document.getElementById(\"onstagelistMsg\").value='on';\n}", "flushChanges () {\n this._lastTransactionWasUndo = true;\n }", "reset() {\n this.reqUserAction = true;\n this.supported = true;\n }", "function toggleReceipt(){\n\tvar caller = document.getElementById(\"donation_receipt\");\n\tif (caller.value == \"on\"){\n\t\tcaller.value = \"off\";\n\t} else {\n\t\tcaller.value = \"on\";\n\t}\n}", "_updateAndEmitIceGatheringStateChange(state) {\n if (this._closed || state === this.iceGatheringState) {\n return;\n }\n\n this._iceGatheringState = state;\n\n logger.debug(\n 'emitting \"icegatheringstatechange\", iceGatheringState:',\n this.iceGatheringState);\n\n const event = new yaeti.Event('icegatheringstatechange');\n\n this.dispatchEvent(event);\n }", "function defaultActiveStateChangeHandler(state) {\n ActiveStore.updateState(state);\n}", "function setNonStatusText() {\n sendUpdate(\"setNonStatusText\", {\n trackerDescription: tr(\"tracker.know_the_status_of_your\"),\n patentText: tr(\"tracker.patent_pending\"),\n num1: tr(\"general.stage1\"),\n num2: tr(\"general.stage2\"),\n num3: tr(\"general.stage3\"),\n num4: tr(\"general.stage4\"),\n num5: tr(\"general.stage5\"),\n trackerHeader: jsDPZ.util.htmlUnEncode(tr(\"confirmation.dominos_tracker\"))\n });\n }", "function clearTippedState() {\r\n\tupdateLocalStorage(\"firstTrans\", null, true);\r\n\tupdateLocalStorage(\"firstEnglish\", null, true);\r\n\tupdateLocalStorage(\"secondTrans\", null, true);\r\n\tupdateLocalStorage(\"secondEnglish\", null, true);\r\n}", "clear() {\n this.value = this.isMultiple ? [] : null;\n this._itemsToConfirm = [];\n this.propagateOnChange(this.value);\n }", "reset() {\r\n return this.state = \"normal\";\r\n }", "setAfterChangeStatus(state, payload) {\n state.items.find(u => u.user_id === payload.user_id).status = payload.status\n }", "resetValues () {\n _this.setState({\n address: '',\n amountSat: '',\n errMsg: ''\n })\n const amountEle = document.getElementById('amountToSend')\n amountEle.value = ''\n\n const addressEle = document.getElementById('addressToSend')\n addressEle.value = ''\n }" ]
[ "0.5723365", "0.57226276", "0.5560636", "0.5528728", "0.55265176", "0.55072325", "0.5475948", "0.5462122", "0.5409186", "0.5407828", "0.52995497", "0.51989734", "0.5198372", "0.51835716", "0.5182699", "0.5182699", "0.5167269", "0.5155649", "0.5143768", "0.51327205", "0.512027", "0.51115257", "0.51023287", "0.5099876", "0.5092495", "0.5078613", "0.5076973", "0.5053862", "0.5050824", "0.5050824", "0.5050824", "0.5050824", "0.5050824", "0.5050824", "0.5050824", "0.5049411", "0.50378835", "0.50367546", "0.50266224", "0.5024622", "0.50159323", "0.4994189", "0.49779445", "0.4975623", "0.49722624", "0.49514237", "0.4948671", "0.49367377", "0.4935759", "0.49266598", "0.4921709", "0.4917284", "0.49162182", "0.49097097", "0.49094242", "0.49071652", "0.49047318", "0.4903978", "0.4896076", "0.4895589", "0.4892707", "0.4889581", "0.48818144", "0.4859177", "0.48545247", "0.48540172", "0.48509556", "0.48422405", "0.4834437", "0.4833259", "0.4831161", "0.48301834", "0.48278832", "0.4826547", "0.48160383", "0.48145843", "0.4812515", "0.48042062", "0.48002025", "0.4785031", "0.47812998", "0.47760528", "0.47734335", "0.4763642", "0.47565752", "0.4733101", "0.47313896", "0.4727348", "0.47268072", "0.4722516", "0.47209474", "0.47178447", "0.47172883", "0.4716001", "0.4714959", "0.47106203", "0.47063497", "0.46985692", "0.46951646", "0.4692861" ]
0.56878257
2
functions for local storage
function lsSet(key, val) { return window.localStorage.setItem(key, val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalSettingStorage() {\n}", "function LocalStorage() \n{\nthis.setMany = function(map, onSuccess, onError)\n{\nsetTimeout(function() {\ntry {\nfor ( var key in map )\nlocalStorage.setItem( key, map[key] );\nif (onSuccess) \nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.getMany = function(keys, onSuccess, onError)\n{\nsetTimeout(function() {\ntry {\nvar out = [];\nfor (var i = 0, l = keys.length; i < l; i++)\nout.push( localStorage.getItem( keys[i] ) );\nif (onSuccess) \nonSuccess( out );\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.unsetMany = function(keys, onSuccess, onError)\n{\nsetTimeout(function() {\ntry {\nfor (var i = 0, l = keys.length; i < l; i++)\nlocalStorage.removeItem( keys[i] );\nif (onSuccess) \nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.set = function(key, value, onSuccess, onError) \n{\nsetTimeout(function() {\ntry {\nlocalStorage.setItem( key, value );\nif (onSuccess)\nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.get = function(key, onSuccess, onError) \n{\nsetTimeout(function() {\ntry {\nif (onSuccess)\nonSuccess(localStorage.getItem( key ));\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n\nthis.unset = function(key, onSuccess, onError) \n{\nsetTimeout(function() {\ntry {\nlocalStorage.removeItem( key );\nif (onSuccess)\nonSuccess();\n} catch (ex) {\n(onError || defaultErrorHandler)(ex);\n}\n}, 0);\n};\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function LokiLocalStorageAdapter() {}", "function LokiLocalStorageAdapter() {}", "function work(){\r\n var storedValue = localStorage.getItem('wname');\r\n var storedValue = localStorage.getItem('wdescription');\r\n var storedValue = localStorage.getItem('wdateline');\r\n }", "function storeLocal(key, data) {\n window.localStorage.setItem(key, JSON.stringify(data));\n }", "static storeLocalStorage(callback) {\n DBHelper.readFile((error, result) => {\n if(error) {\n callback(error, null)\n }\n else {\n localStorage.setItem(\"games\", JSON.stringify(result));\n callback(null, 'GamesStored');\n }\n });\n\n }", "function LokiLocalStorageAdapter() { }", "function LocalStorage()\r\n{\r\n this.getItem = function(key)\r\n {\r\n return storedItems[key];\r\n }\r\n\r\n this.setItem = function(key, value)\r\n {\r\n storedItems[key] = value;\r\n }\r\n\r\n this.removeItem = function(key)\r\n {\r\n this.setItem(key, undefined);\r\n }\r\n\r\n var storedItems = {};\r\n}", "function saveToLocalStorage() { \n\t\n\t\t\t\t\tvar lscount = localStorage.length; \n\t\t\t\t\tvar Userstring=User.toJSONString();\n\t\t\t\t\t\t\tlocalStorage.setItem(\"User_\" + lscount, Userstring); \n\t\t\n}", "function store() {\n\n \n localStorage.setItem('mem', JSON.stringify(myLibrary));\n \n}", "function fillStorage() {\n var local = {\n uid : uid,\n Time : timeLocal,\n Todos : todos\n }\n localStorage.clear();\n window.localStorage.setItem(`local`,JSON.stringify(local));\n mapping();\n}", "function gravarLS(key,valor){\n localStorage.setItem(key, valor)\n}", "function fnSave(data){\n var key = Date.now();\n window.localStorage.setItem(key, data);\n }", "function getStorage()\n\t\t \t{\n\t\t \t\tvar data = localStorage.getItem('data');\n\t\t \t\tdata = JSON.parse(data);\n\t\t \t\treturn data;\n\t\t \t}", "function getLocalStorage() {\n\n\tvar data = window.localStorage; // array os keys\n\n\t$.each(data, function(key, val) {\n \tlocalStorage.setItem(key, val); // \n \tvar note = key.substring(0,4);\n \tif (note == 'note') {\n \t\t$('.notas-list').prepend('\\\n \t\t\t<article class=\"box-skin nota-thumb\" id=\"'+ key +'\">\\\n \t\t\t\t<a href=\"#\" class=\"nota-delete\">X</a>\\\n \t\t\t\t<div class=\"nota-content\">'+ val +'</div>\\\n \t\t\t</article>\\\n \t\t');\n \t}\n\t});\n}", "function guardaLocal(store) {\n // console.log(store)\n localStorage.storage = JSON.stringify(store)\n}", "function saveLocal(object) {\r\n var value = JSON.stringify(object);\r\n localStorage.setItem(1, value);\r\n //data = JSON.parse(localStorage.getItem(1));\r\n //alert(\"primeiro\" + data[0].nome);\r\n getLocal();\r\n}", "function lerStorage() {\n // Recebe dados do armazenamento local\n $(mes_analisado).val(localStorage.getItem(\"__mes_analisado__\"))\n\n pontosDia = JSON.parse(localStorage.getItem(\"__pontos_dia__\"));\n if (pontosDia == null) {\n pontosDia = [0, 0]\n }\n\n tarefas = localStorage.getItem(\"__tarefas__\");\n if (tarefas == null) {\n localStorage.setItem(\"__tarefas__\", taskDefault)\n document.location.reload(true);\n }\n\n dados = JSON.parse(tarefas)\n\n url = JSON.parse(localStorage.getItem(\"__recompensa_url__\"))\n\n}", "function sincroniozarLocalStore( ) {\n\n localStorage.setItem( 'tweets', JSON.stringify( tweets ) );\n}", "function storeLocal(obj) {\n\n Object.keys(obj).forEach((key) => {\n console.log(`Set ${key} = ${obj[key]}`);\n localStorage.setItem(key, obj[key]);\n });\n // localStorage.setItem('fullname', fullName);\n // localStorage.setItem('username', userName);\n // localStorage.setItem('image', imageName);\n console.log('Data stored');\n}", "getStorage(arg1) {\n return window.localStorage.getItem(arg1);\n\n }", "function localStorageOku(){\r\n localStorageiArrayeDonustur();\r\n}", "function localStorageEntry() {\n localStorage.setItem(\"eventOne\", timeBlock1.text());\n localStorage.setItem(\"eventTwo\", timeBlock2.text());\n localStorage.setItem(\"eventThree\", timeBlock3.text());\n localStorage.setItem(\"eventFour\", timeBlock4.text());\n localStorage.setItem(\"eventFive\", timeBlock5.text());\n localStorage.setItem(\"eventSix\", timeBlock6.text());\n localStorage.setItem(\"eventSeven\", timeBlock7.text());\n localStorage.setItem(\"eventEight\", timeBlock8.text());\n localStorage.setItem(\"eventNine\", timeBlock9.text());\n localStorage.setItem(\"eventTen\", timeBlock10.text());\n localStorage.setItem(\"eventEleven\", timeBlock11.text());\n}", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "function setStorage(key, value) \n{\n\tif(typeof(window.localStorage) != 'undefined'){ \n\t\twindow.localStorage.setItem(key,value); \n\t} \n}", "function storeLocalInfo(){\n // IE7 uses cookies\n // Check for IE7 first\n if(ieSeven){\n // Use cookies\n SetCookie('firstName', $(\"fName\").value);\n SetCookie('lastName', $('lName').value);\n SetCookie('email', $('email').value);\n }\n else if (window.localStorage){ // all other browsers\n localStorage.setItem(\"firstName\", $(\"fName\").value);\n localStorage.setItem(\"lastName\", $(\"lName\").value);\n localStorage.setItem(\"email\", $(\"email\").value);\n }\n}", "function updateLocalStorage() {\n objString = '{\"nextId\": \"' + nextId + '\"}';\n convertObjectToString(root);\n localStorage.setItem(LOCAL_STORAGE, objString);\n }", "function LocalStoragePlugin() {\n}", "function local(budgetLabel, incomelabel, expensesLabel) {\n\n // Save data to the current local store//\n if (typeof (localStorage) == 'undefined') {\n console.log('Your browser does not support HTML5 localStorage. Try upgrading.');\n } else {\n try {\n // Put the object into storage\n localStorage.setItem('event', JSON.stringify({\n budgetlabel:budgetlabel,\n incomeLabel:incomelabel,\n expenseslabel:expensesLabel\n }));\n } catch (e) {\n if (e == QUOTA_EXCEEDED_ERR) {\n console.log('Quota exceeded!'); //data wasn't successfully saved due to quota exceed so throw an error\n }\n }\n }\n}", "function saveToLocalStorage(todo)\n{\n //This is to check if local storage already has that item\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.push(todo);\n localStorage.setItem(\"todos\",JSON.stringify(todos));\n}", "function save() {\r\n localStorage.setItem('en', JSON.stringify(en));\r\n localStorage.setItem('level', JSON.stringify(level));\r\n}", "function storeLocal() {\n $.get(\"/api/commander\").then(function(results) {\n localStorage.setItem(\"mtgCommanders\", JSON.stringify(results));\n $.get(\"/api/league_data\").then(function(data) {\n localStorage.setItem(\"data\", JSON.stringify(data));\n window.location.replace(\"/setup\");\n });\n });\n }", "function saveToLocalStorage(theData) {\n\tvar recNBR = getLocalStorageRecordCount() + 1;\n\tvar storage = window.localStorage;\n\tstorage.setItem(recNBR, recNBR + \",\" + theData + \",\" + makeDateTime());\n\tconsole.log(recNBR,theData,makeDateTime());\n}", "function localStore(callObj) { \n\t\tif (!$.isPlainObject(callObj)) { return; } // Fix? Error handling?\n\t\tvar cmd = callObj.cmd,\n\t\t\tkey = callObj.key,\n\t\t\tval = callObj.val;\n\t\tif (cmd == \"get\") { return localStorage.getItem(key); }\n\t\tif (cmd == \"set\") { return localStorage.setItem(key, val); }\n\t\tif (cmd == \"add\") { return localStorage.setItem(key, val); }\n\t\tif (cmd == \"del\") { return localStorage.removeItem(key); }\n\t\tif (cmd == \"clr\") { return localStorage.clear(); } // Erases the entire db. Fix. Safety mechanisms?\n\t\tif (cmd == \"has\") { return (undefined===localStorage.getItem(key))?false:true; }\n\t\tif (cmd == \"all\") {\n\t\t\tvar tblArray = [];\n\t\t\tfor (var tblName in localStorage) { tblArray.push(tblName); }\n\t\t\treturn tblArray;\n\t\t}\n\t}//localStore()", "function data() {\n\n localStorage.setItem('name', 'vladica');\n}", "function setLocalStorageData() {\n if ($.isEmptyObject(localStorage.inUse)) {\n //Set defaults\n localStorage.inUse = 'true';\n localStorage.sounds = 'true';\n localStorage.tracking = 'true';\n localStorage.logggedWorkouts = '[]';\n }\n if ($.isEmptyObject(localStorage.logggedWorkouts)) {\n localStorage.logggedWorkouts = '[]';\n $('#previousworkout-btn').hide();\n } else if (localStorage.logggedWorkouts === '[]') {\n $('#previousworkout-btn').hide();\n }\n if (localStorage.sounds === 'true') {\n $('#flip-alert').val('on');\n } else {\n $('#flip-alert').val('off');\n }\n if (localStorage.tracking === 'true') {\n $('#flip-track').val('on');\n } else {\n $('#flip-track').val('off');\n }\n }", "function updateStorage()\r\n{\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "function addLocalStorage(){\n\tconsole.log(\"Saving to local storage...\");\n var stockTabsHolder = $('#stockTabsHolder').html();\n\tvar pageHTML = $(\"#resultsDiv0\"+cloudSaveIndex).html();\n\n\tif(window.localStorage) {\n localStorage.setItem(\"tabData\", stockTabsHolder);\n\t\tlocalStorage.setItem(\"pageData\"+cloudSaveIndex, pageHTML);\n\t\tlocalStorage.setItem(\"pageIndex\",mainIndex);\n\t} else {\n \t\tconsole.log('Local storage not supported');\n\t}\n\n\t//update Cloud Index\n cloudSaveIndex = updateIndex(cloudSaveIndex);\n\n} //end addLocalStorage", "function useStorage(){\n \t\tconsole.log('-- Use local storage');\n\n \t\tfor (var level in GameJam.levels) {\n \t\t\tGameJam.levels[level].time = localStorage.getItem(level);\n \t\t\tif (GameJam.levels[level].time >= GameJam.levels[level].stars[0]) {\n \t\t\t\tGameJam.levels[level].unlocked = true;\n \t\t\t\tvar nextLevel = 'level' + (parseInt(level.replace(/level/g, '')) + 1);\n \t\t\t\tGameJam.levels[nextLevel].unlocked = true;\n \t\t\t}\n \t\t}\n \t}", "function persistLocalStorage() {\n _localStorage.setItem(_name, this.toJSON());\n }", "function storageData(name, data) {\n \n localStorage.setItem(name, JSON.stringify(data));\n \n}", "function getLocalStorge() {\n\n // khi lấy localStorage lên để sử dụng chuyển thành JSON\n if (localStorage.getItem(\"DanhSachNhanVien\")) {\n danhSachNhanVien.mangNhanVien = JSON.parse(localStorage.getItem(\"DanhSachNhanVien\"));\n taoBang();\n }\n}", "saveToStorage() {\n try {\n localStorage.setItem(this.name, JSON.stringify(this.storage));\n } catch(e) {\n\n }\n }", "function storeQuizArrayToLocalStorage(){\n\t\t//var db = window.localStorage.getItem(localQuizArrayName);\n\t\t//if(db == null || db == \"\"){\n\t\t\t//window.localStorage.setItem(localQuizArrayName,JSON.stringify(quizArray));// quizArray naka include sa taas sa <script></script>\n\t\t\t//alert(localQuizArrayName + \" \\n store to db\");\n\t\t//}\n\t\t//else{\n\t\t\t//alert(\"db \" + localQuizArrayName + \" already exist!\");\n\t\t//}\n\t\t//window.localStorage.setItem(localQuizArrayName,JSON.stringify(quizArray));// quizArray naka include sa taas sa <script></script>\n\t\t\t\n\t\t\n\t}", "function setStorage(data)\n\t\t \t{\n\t\t \t\tvar data = JSON.stringify(data);\n\t\t \t\t//alert(\"SAVED\");\n\t\t \t\tlocalStorage.setItem('data',data);\n\t\t \t}", "function setLocalStorge() {\n\n // khi lưu xuống localStorage chuyển data thành String\n\n localStorage.setItem(\n \"DanhSachNhanVien\",\n JSON.stringify(danhSachNhanVien.mangNhanVien)\n );\n}", "function getLocalStorage() {\n if(localStorage.getItem(\"DSNV\")) {\n dsnv.arr = JSON.parse(localStorage.getItem(\"DSNV\"));\n taoBang(dsnv.arr);\n }\n}", "function addLocal(key, val) {\n\n\t\t\t$localStorage[key] = val;\n\t\t\tlocalStorageObj[key] = val;\n\n\t\t}", "function savepage(){\r\n var mylog=window.localStorage.getItem('z')\r\nreturn mylog;\r\n}", "function getLocalStorage() {\n if (localStorage.getItem(LOCAL_STORAGE)) {\n var dataArr = localStorage.getItem(LOCAL_STORAGE).split('|');\n var obj = JSON.parse(dataArr[readFileIndex]);\n\n // update next id\n nextId = obj.nextId;\n readFileIndex++;\n\n // root object\n obj = JSON.parse(dataArr[readFileIndex]);\n readFileIndex++;\n updateRoot(obj.items);\n\n for (var i = 0; i < root.childrenCount; i++) {\n obj = JSON.parse(dataArr[readFileIndex]);\n readFileIndex++;\n addGroupsAndContactsToPhoneBook(obj, dataArr);\n }\n\n currentGroup = root;\n }\n }", "function populateStorage(){\n \t\tconsole.log('-- Populate local storage');\n\n \t\tfor (var level in GameJam.levels) {\n \t\t\tlocalStorage.setItem(level, GameJam.levels[level].time);\n \t\t}\n \t}", "function valueToLStorage(pobj){ //pobj debe ser un elemento o id de elemento válido\n\tif (typeof(Storage)!== 'undefined'){\n\t\tvar aux=selectObjId(pobj);\n\t\tif ((aux!==null) && (aux.value!==undefined)){\n\t\t\tlocalStorage.setItem(aux.id, aux.value);\n\t\t}\n\t\telse {\n\t\t\tconsole.log('ERROR: Objeto o propiedad value inexistente');\n\t\t}\n\t}\telse {\n\t\talert('Su navegador no soporta HTML5 API Storage');}\n}", "function storeDataLocalStorage(a, b) {\n window.localStorage.setItem(a, b);\n console.log(a, b);\n}", "function checkLocalStorage(){ \nif (localStorage.getItem('adjektiv') && localStorage.getItem('nomen')) \n { \n localStorArrayAdj = [];\n let localStorAdj = localStorage.getItem('adjektiv');\n localStorArrayAdj.push(...localStorAdj.split(','));\n\n localStorArrayNomen = []\n let localStorNom = localStorage.getItem('nomen');\n localStorArrayNomen.push(...localStorNom.split(','));\n\n init(localStorArrayAdj, localStorArrayNomen);\n}\nelse \n { setDefaultToLocaleStorage();\n init(adjektivArray, nomenArray); } \n}", "function setLocal(number, id)\r\n{\r\n console.log(number, id)\r\n localStorage.setItem(\"number\", number)\r\n localStorage.setItem(\"id\", id);\r\n}", "setStorage (name, content) {\n if (!name) return\n if (typeof content !== 'string') {\n content = JSON.stringify(content)\n }\n window.localStorage.setItem(name, content)\n }", "setLocality(state, city){\n localStorage.setItem('state', state)\n localStorage.setItem('city', city)\n }", "function storage(getItemSetItem,variableNames,typ)\n{\n\t//console.log(\"zobbrazuji:\" + (window.localStorage.getItem(\"dataProfil\")));\n var arr = variableNames.split(\",\");\n for(var i=0;i<arr.length;i++)\n {\n console.log(\"storage: \"+ arr[i]);\n\n // pro getItem kontrola na null\n if(getItemSetItem==\"getItem\" && window.localStorage.getItem(arr[i])!=null)\n {\n //dataZbozi = JSON.parse(window.localStorage.getItem(\"dataZbozi\"));\n if(typ==\"string\")\n {\n eval(arr[i] + ' = window.localStorage.getItem(\"'+arr[i]+'\")');\n }\n if(typ==\"jSON\")\n {\n eval(arr[i] + ' = JSON.parse(window.localStorage.getItem(\"'+arr[i]+'\"))');\n }\n }\n if(getItemSetItem==\"setItem\")\n {\n //dataZbozi = JSON.parse(window.localStorage.getItem(\"dataZbozi\"));\n if(typ==\"string\")\n {\n eval(arr[i] + ' = window.localStorage.setItem(\"'+arr[i]+'\"'+arr[i]+')');\n }\n if(typ==\"jSON\")\n {\n eval('window.localStorage.setItem(\"'+arr[i]+'\",JSON.stringify('+arr[i]+'))');\n }\n }\n }\n}", "function saveToLocal( key, value ) {\n var localSavedData = JSON.stringify( value );\n localStorage.setItem( key, localSavedData );\n}", "function almacenarlocal(clave, valor)\n{\n local.setItem(clave, valor);\n console.log(\"guardo\");\n\n //borrar\n //localStorage.removeItem('nombre');\n //limpiar\n //localStorage.clear();\n\n}", "function saveLocally(key, data){\n\t//https://stackoverflow.com/questions/43116179/localstorage-detect-if-local-storage-is-already-full\n\ttry {\n\t\tlocalStorage.setItem(key, JSON.stringify(data));\n\t\tconsole.log(\"saved locally\");\n \t\t// localStorage.setItem(\"name\", \"Hello World!\"); //saves to the database, \"key\", \"value\"\n\t} catch (e) {\n \t\tif (e.name == 'QUOTA_EXCEEDED_ERR') {\n \t\talert('was unable to save, your local storage seems to be full'); //data wasn't successfully saved due to quota exceed so throw an error\n \t\t}\n\t}\n}", "function getLocalStorage() {\n\treturn chrome.storage.local;\n}", "saveLocal() {\n if (this.saveView.inputLocalStorage.value != Utilitary.currentScene.sceneName && !Scene.rename(this.saveView.inputLocalStorage, this.saveView.rulesName, this.saveView.dynamicName)) {\n }\n else {\n if (typeof sessionStorage != 'undefined') {\n var name = this.saveView.inputLocalStorage.value;\n var jsonScene = this.sceneCurrent.saveScene(true);\n if (this.isFileExisting(name)) {\n new Confirm(Utilitary.messageRessource.confirmReplace, (callback) => { this.replaceSaveLocal(name, jsonScene, callback); });\n return;\n }\n else {\n this.setStorageItemValue('FaustPlayground', name, jsonScene);\n }\n new Message(Utilitary.messageRessource.sucessSave, \"messageTransitionOutFast\", 2000, 500);\n var event = new CustomEvent(\"updatelist\");\n document.dispatchEvent(event);\n }\n else {\n new Message(Utilitary.messageRessource.errorLocalStorage);\n }\n }\n }", "saveToLocalStorage (key, value) {\n if (global.localStorage) {\n global.localStorage.setItem(\n key,\n JSON.stringify({\n value: value\n })\n );\n }\n }", "function setItemToLocalStorage(name, data) {\n localStorage.setItem(name, JSON.stringify(data));\n}", "function Storage(prefix,forceGM)\r\n{\r\n var gm = typeof(unsafeWindow) != \"undefined\" && navigator.userAgent.indexOf(\"Firefox\")>-1\r\n var win = gm ? unsafeWindow : window;\r\n var ls = false;\r\n var intGetValue;\r\n var intSetValue;\r\n var prefix = prefix;\r\n try {ls = typeof(win.localStorage) != \"undefined\";} catch(e) {}\r\n if( !ls && !gm )\r\n throw(\"Keine geeignete Speichermöglichgkeit gefunden\");\r\n if( forceGM && gm || !ls)\r\n {\r\n if( gm )\r\n {\r\n prefix = prefix + \"_\" + document.location.host.split('.')[0];\r\n intSetValue = function(key,value) \r\n {\r\n GM_setValue(prefix+\"_\"+key,value);\r\n };\r\n intGetValue = function(key,defaultValue)\r\n {\r\n return GM_getValue(prefix+\"_\" + key, defaultValue);\r\n }\r\n this.deleteValue = function(key)\r\n {\r\n GM_deleteValue(prefix+\"_\"+key);\r\n }\r\n this.listValues = function(re)\r\n {\r\n var allkeys = GM_listValues();\r\n var serverKeys = [];\r\n var rePrefix = new RegExp(\"^\"+prefix+\"_(.*)$\");\r\n if( typeof(re) != \"undefined\" )\r\n var reKey = new RegExp(re);\r\n for( var i = 0; i < allkeys.length; i++ )\r\n {\r\n var res = allkeys[i].match(rePrefix);\r\n if( res )\r\n {\r\n if( reKey ) \r\n {\r\n res = res[1].match(reKey);\r\n if( res )\r\n serverKeys.push(res);\r\n }\r\n else\r\n serverKeys.push(res[1]);\r\n }\r\n }\r\n return serverKeys;\r\n }\r\n }\r\n }\r\n else if( ls )\r\n {\r\n intSetValue = function(key,value) \r\n {\r\n localStorage.setItem(prefix+\"_\"+key, value );\r\n }; \r\n intGetValue = function(key,defaultValue)\r\n {\r\n var value = localStorage.getItem(prefix+\"_\"+key);\r\n if( value )\r\n return value;\r\n else\r\n return defaultValue;\r\n };\r\n this.deleteValue = function(key)\r\n {\r\n localStorage.removeItem(prefix+\"_\"+key);\r\n }\r\n this.listValues = function(re)\r\n {\r\n var keys = [];\r\n var rePrefix = new RegExp(\"^\"+prefix+\"_(.*)$\");\r\n if( typeof(re) != \"undefined\")\r\n var reKey = new RegExp(re);\r\n for( var i = 0; i < win.localStorage.length; i++ )\r\n {\r\n var res = localStorage.key(i).match(rePrefix);\r\n if( res )\r\n {\r\n if( reKey ) \r\n {\r\n res = res[1].match(reKey);\r\n if( res )\r\n keys.push(res);\r\n }\r\n else\r\n keys.push(res[1]);\r\n }\r\n }\r\n return keys;\r\n }\r\n }\r\n this.clear = function(re)\r\n {\r\n var keys = this.listValues(re);\r\n for( var i = 0; i < keys.length; i++ )\r\n this.deleteValue(keys[i]);\r\n }\r\n this.setValue = function(key,value)\r\n {\r\n switch( typeof(value) )\r\n {\r\n case \"object\":\r\n case \"function\":\r\n intSetValue(key,\"j\"+JSON.stringify(value));\r\n break;\r\n case \"number\":\r\n intSetValue(key,\"n\"+value);\r\n break;\r\n case \"boolean\":\r\n intSetValue(key,\"b\" + (value ? 1 : 0));\r\n break;\r\n case \"string\":\r\n intSetValue(key,\"s\" + value );\r\n break;\r\n case \"undefined\":\r\n intSetValue(key,\"u\");\r\n break;\r\n }\r\n } \r\n this.getValue = function(key,defaultValue)\r\n {\r\n var str = intGetValue(key);\r\n if( typeof(str) != \"undefined\" )\r\n {\r\n switch( str[0] )\r\n {\r\n case \"j\":\r\n return JSON.parse(str.substring(1));\r\n case \"n\":\r\n return parseFloat(str.substring(1));\r\n case \"b\":\r\n return str[1] == \"1\";\r\n case \"s\":\r\n return str.substring(1);\r\n default:\r\n this.deleteValue(key);\r\n }\r\n }\r\n return defaultValue;\r\n }\r\n this.getString = function(key)\r\n {\r\n return intGetValue(key);\r\n }\r\n this.setString = function(key,value)\r\n {\r\n intSetValue(key,value);\r\n }\r\n}", "function saveLocalTodo(todo)\n{\n\nlet todos;\nif(localStorage.getItem('todos')=== null)\n{\n todos=[];\n} \nelse\n{\ntodos=JSON.parse(localStorage.getItem('todos')); \n} \ntodos.push(todo);\nlocalStorage.setItem(\"todos\",JSON.stringify(todos)); \n}", "function initLocalStorage() {\n\t//\n\tvalue = that.get(key);\n\tif (value == null) {\n\t\tthat.set(key, JSON.stringify([]));\n\t}\n}", "function saveToLS(key, val) {\n \n if( !(\"localStorage\" in window) ) return; // jesli nie wspiera TO WYCHODZIMY Z FUNKCJI\n \n window.localStorage.setItem(key, val); // jesli w spiera to zapisujemy dane w local storage\n \n }", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function setLocalStorage() {\n if (typeof(Storage) !== \"undefined\") {\n if (localStorage.getItem(nme) === null) {\n if (sound.currentTime >= 3) {\n localStorage.setItem(nme, sound.currentTime);\n }} else {\n localStorage.removeItem(nme);\n localStorage.setItem(nme, sound.currentTime);\n }\n\n } else {\n console.log('This browser doesn\\'t support local storage.')\n }\n}", "local() {\n var datosLocal = JSON.parse(localStorage.getItem('automoviles'));\n var datosInfo = JSON.parse(localStorage.getItem('info'));\n if (datosLocal === null) {\n this.informacion_vehiculos = [];\n } else {\n this.informacion_vehiculos = datosLocal;\n }\n //llenamos la lista de publicaciones con la informacion del local storage\n //para poder recorrerla y compararla con la lista de seguimientos\n if (datosInfo === null) {\n this.lista_publicaciones = [];\n } else {\n this.lista_publicaciones = datosInfo;\n }\n }", "function save(amount, apr, years, yearlyTaxes) {\n if (window.localStorage) { // Only do this if the browser supports it\n /* localStorage.loan_amount = amount;\n localStorage.loan_apr = apr;\n localStorage.loan_years = years;\n localStorage.loan_taxes = yearlyTaxes;*/\n }\n}", "function store() {\n localStorage.setItem('name1', name1.value);\n localStorage.setItem('pw', pw.value);\n}", "function storedData() {\n localStorage.setItem(\"journalEntry\", newEvent);\n const storedInput = localStorage.getItem(\"journalEntry\");\n\n // if(storageInput) {\n\n // }\n}", "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "function getLocalstorage() {\n dark = JSON.parse(localStorage.getItem(\"dark\")) || false;\n\n setDark(dark);\n\n var secretStored = JSON.parse(localStorage.getItem(\"secret\"));\n var binStored = JSON.parse(localStorage.getItem(\"bin\"));\n\n if (secretStored == null || binStored == null || secretStored == \"\" || binStored == \"\") {\n jsonbin = false;\n return false;\n }\n\n jsonbin = true;\n secret = secretStored;\n bin = binStored;\n\n return true;\n}", "function initStorage() {\n _storage = localStorage;\n}", "function setLS(key,value){\n window.localStorage.setItem(key, JSON.stringify(value));\n\n}", "saveToLocal() {\n let alarmsJson = JSON.stringify(this.alarms);\n localStorage.setItem(\"alarmTime\", alarmsJson);\n let currentId = String(this.currentId);\n localStorage.setItem(\"currentId\", currentId);\n }", "function saveToStorage(saveID, data) {\n localStorage[saveID] = /*window.*/JSON.stringify(data); //this is the memory of the user's device\n}", "function setLocalStorage(items) {\n \n localStorage.setItem('storage-key', JSON.stringify(items));\n }", "function setLocalStorage(key, value) {\n \t return localStorageService.set(key, value);\n }", "function addToLocalStorage() {\n\t\tif (typeof (Storage) !== \"undefined\") {\n\t\t\tlocalStorage.setItem(\"todoList\", JSON.stringify(todoList));\n\t\t} else {\n\t\t\talert(\"error or browser doesn't support local storage!\");\n\t\t}\n\t}", "function save() {\n \n try {\n if (typeof (localStorage) === 'undefined') {\n alert('Your browser does not support HTML5 localStorage. Try upgrading.');\n } else {\n try {\n window.localStorage.setItem(\"currency\", totalCurrency.toString());\n window.localStorage.setItem(\"cps\", CPS.toString());\n window.localStorage.setItem(\"inventory\", ko.toJSON(appView));\n window.localStorage.setItem(\"totalClicks\", appView.player.totalClicks());\n window.localStorage.setItem(\"totalMoneySpent\", appView.player.totalMoneySpent());\n } catch (e) {\n if (e === QUOTA_EXCEEDED_ERR) {\n alert('Quota exceeded!');\n }\n }\n }\n } catch (e) {\n window.status = e.message;\n }\n\n lastSave = new Date();\n}", "function datatoLocalstorage() {\r\n localStorage.setItem('tasksData', JSON.stringify(tasksData));\r\n}", "function LocalStorageHandle(success, error, intent, operation, args) {\r\n var reference = args[0];\r\n var variable = args[1];\r\n\r\n if (operation.startsWith('put') || operation.startsWith('set')) {\r\n try {\r\n var varAsString = JSON.stringify(variable);\r\n if (reference === null) {\r\n error(new NativeStorageError(NativeStorageError.NULL_REFERENCE, \"JS\", \"\"));\r\n return;\r\n }\r\n localStorage.setItem(reference, varAsString);\r\n success(variable);\r\n } catch (err) {\r\n error(new NativeStorageError(NativeStorageError.JSON_ERROR, \"JS\", err));\r\n }\r\n } else if (operation.startsWith('get')) {\r\n var item = {};\r\n item = localStorage.getItem(reference);\r\n if (item === null) {\r\n error(new NativeStorageError(NativeStorageError.ITEM_NOT_FOUND,\"JS\",\"\"));\r\n return;\r\n }\r\n try {\r\n var obj = JSON.parse(item);\r\n //console.log(\"LocalStorage Reading: \"+obj);\r\n success(obj);\r\n } catch (err) {\r\n error(new NativeStorageError(NativeStorageError.JSON_ERROR, \"JS\", err));\r\n }\r\n } else if(operation === 'keys') {\r\n const keys = [];\r\n let key = localStorage.key(0);\r\n if(!key) {\r\n return success(keys);\r\n }\r\n let i = 0;\r\n while(key) {\r\n keys.push(key);\r\n i++;\r\n key = localStorage.key(i);\r\n }\r\n success(keys);\r\n }\r\n}", "function LocalStorageStore(element,value) {\n if (localStorage.getItem(element) == null) {\n localStorage.setItem(element,value);\n\t\t BeerName[element] = element;\n \t \t BeerImage[element] = localStorage[element];\n \t\t BeerList[element] = draw_beer(\"//overpass-api.de/api/interpreter?data=[out:json];(node(BBOX)[\\\"brewery\\\"~\\\"\"+element+\"\\\",i];way(BBOX)[\\\"brewery\\\"~\\\"\"+element+\"\\\",i]);out center;\", \"assets/img/\"+BeerImage[element]); \n }\n else {\n\t\t if (map.hasLayer(BeerList[element])) {map.removeLayer(BeerList[element]);}\n delete localStorage.removeItem(element); \n console.log('Removing '+element+' with value '+value);\n }\n \n }", "function saveListStorage(list){\n var jsonStr = JSON.stringify(list);//usando json para transfoma texto em uma string\n localStorage.setItem(\"list\",jsonStr);\n}", "function store(qu)\n{\nlocalStorage.ques= JSON.stringify(qu);\n}", "store() {\n\t\tlet storeData = this.data.map(wfItem => wfItem.storeVersion());\n\t\tlocalStorage.setItem('data', JSON.stringify(storeData));\n\t}", "function getlocalStorage(){\r\n let getlocalStorage = localStorage.getItem('todoItems');\r\n if(getlocalStorage === 'undefined' || getlocalStorage === null){\r\n todoItems = [];\r\n }\r\n else {\r\n todoItems = JSON.parse(getlocalStorage);\r\n addValue(items,todoItems);\r\n }\r\n}", "function saveSomeData() {\n localStorage.setItem(\"name\", $('#stringPlayerName').val());\n //localStorage.setItem()\n}", "function StorageManager()\n{\n var MAX_SIZE = new Number(2600000);\n\n /**\n * Returns the total number of characters currently in the local storage.\n *\n * @return number of characters.\n */\n this.totalSize = function()\n {\n var totalSize = new Number();\n\n for (var i = 0; i < localStorage.length; i++)\n {\n var value = localStorage.key(i);\n\n if (value)\n {\n totalSize += value.length;\n }\n }\n\n return totalSize;\n };\n\n /**\n * Return the remaining capacity of the local storage in characters, ie. the\n * maximum size minus the current size.\n */\n this.remainingStorage = function()\n {\n return MAX_SIZE - this.totalSize();\n };\n \n /**\n * Clears stored events. \n */\n this.clear = function ()\n {\n localStorage.removeItem(EVENT_VALUES); \n }; \n \n /**\n * Saves an event\n *\n * @param event The event in json format.\n */\n this.saveEvent = function(event)\n {\n //var newEvent = event;\n \n if( !event.hasOwnProperty('src') )\n {\n if( !event.event){\n event.event = this.generatePseudoUid();\n event.src = 'local';\n } \n } \n\n var events = {};\n\n if (localStorage[EVENT_VALUES] != null)\n {\n events = JSON.parse(localStorage[EVENT_VALUES]);\n }\n\n events[event.event] = event;\n\n try\n {\n localStorage[EVENT_VALUES] = JSON.stringify(events);\n\n log('Successfully stored event - locally');\n }\n catch (e)\n {\n log('Max local storage quota reached, not storing data value locally');\n }\n };\n \n /**\n * Gets the value for the event with the given arguments, or null if it\n * does not exist.\n *\n * @param id the event identifier.\n *\n */\n this.getEvent = function(id)\n {\n if (localStorage[EVENT_VALUES] != null)\n {\n var events = JSON.parse(localStorage[EVENT_VALUES]);\n\n return events[id];\n }\n\n return null;\n };\n\n /**\n * Removes the given event from localStorage.\n *\n * @param event and identifiers in json format.\n */\n this.clearEvent = function(event)\n {\n var events = this.getAllEvents();\n\n if (events != null && events[event.event] != null)\n {\n delete events[event.event];\n localStorage[EVENT_VALUES] = JSON.stringify(events);\n }\n };\n \n /**\n * Returns events matching the arguments provided\n * \n * @param orgUnit \n * @param programStage\n * \n * @return a JSON associative array.\n */\n this.getEvents = function(orgUnit, programStage)\n {\n var events = this.getEventsAsArray();\n var match = [];\n for( var i=0; i<events.length; i++){\n if(events[i].orgUnit == orgUnit && events[i].programStage == programStage ){\n match.push(events[i]);\n }\n }\n \n var pager = {pageSize: 50, page: 1, toolBarDisplay: 5, pageCount: 1}; \n return {events: match, pager: pager};\n };\n \n /**\n *\n * @return a JSON associative array.\n */\n this.getAllEvents = function()\n {\n return localStorage[EVENT_VALUES] != null ? JSON.parse( localStorage[EVENT_VALUES] ) : null;\n }; \n\n /**\n * Returns all event objects in an array. Returns an empty array if no\n * event exist. Items in array are guaranteed not to be undefined.\n */\n this.getEventsAsArray = function()\n {\n var values = new Array();\n var events = this.getAllEvents();\n\n if (undefined == events)\n {\n return values;\n }\n\n for (i in events)\n {\n if (events.hasOwnProperty(i) && undefined !== events[i])\n {\n values.push(events[i]);\n }\n }\n\n return values;\n };\n \n /**\n * Indicates whether there exists data values or complete data set\n * registrations in the local storage.\n *\n * @return true if local data exists, false otherwise.\n */\n this.hasLocalData = function()\n {\n var events = this.getAllEvents(); \n\n if (events == null)\n {\n return false;\n }\n if (Object.keys(events).length < 1)\n {\n return false;\n } \n\n return true;\n };\n \n this.generatePseudoUid = function () \n {\n return Math.random().toString(36).substr(2, 11);\n };\n}", "function getLocalStorage() {\n if (localStorage.myLibrary !== \"[]\" && localStorage.myLibrary) {\n bookIdCount = JSON.parse(localStorage.bookIdCount);\n myLibrary = JSON.parse(localStorage.myLibrary)\n };\n}", "function storeData(storage, data){\n //check if browser supports storage\n if (typeof(Storage) !== \"undefined\") {\n window.localStorage.setItem(storage, JSON.stringify(data));\n }\n\n}", "function setLocaleStorage(name, value){\n localStorage.setItem(name, JSON.stringify(value));\n}", "static getLocalStorage(callback) {\n\n if(localStorage.getItem(\"games\") == null) {\n DBHelper.storeLocalStorage((error, result) => {\n if(error) {\n callback(error, null);\n }\n else {\n console.log(result);\n let games = JSON.parse(localStorage.getItem(\"games\") || \"[]\");\n callback(null, games);\n }\n })\n }\n let games = JSON.parse(localStorage.getItem(\"games\") || \"[]\");\n callback(null, games);\n }", "function saveLocalStorage() {\n const userInput9 = localStorage.getItem('9');\n $('#9')\n .children('.description')\n .text(userInput9);\n\n const userInput10 = localStorage.getItem('10');\n $('#10')\n .children('.description')\n .text(userInput10);\n\n const userInput11 = localStorage.getItem('11');\n $('#11')\n .children('.description')\n .text(userInput11);\n\n const userInput12 = localStorage.getItem('12');\n $('#12')\n .children('.description')\n .text(userInput12);\n\n const userInput1 = localStorage.getItem('13');\n $('#13')\n .children('.description')\n .text(userInput1);\n\n const userInput2 = localStorage.getItem('14');\n $('#14')\n .children('.description')\n .text(userInput2);\n\n const userInput3 = localStorage.getItem('15');\n $('#15')\n .children('.description')\n .text(userInput3);\n\n const userInput4 = localStorage.getItem('16');\n $('#16')\n .children('.description')\n .text(userInput4);\n\n const userInput5 = localStorage.getItem('17');\n $('#17')\n .children('.description')\n .text(userInput5);\n }" ]
[ "0.8080844", "0.78309387", "0.73977995", "0.7341993", "0.7341993", "0.73052126", "0.72621", "0.7257707", "0.7234483", "0.7231756", "0.7191458", "0.71912944", "0.7187855", "0.7157281", "0.7155157", "0.71415", "0.7133037", "0.7052891", "0.705038", "0.7046006", "0.7044798", "0.7044469", "0.7042929", "0.7036742", "0.7026296", "0.70219177", "0.6985036", "0.6978433", "0.69611126", "0.69576055", "0.6955579", "0.6925045", "0.6923526", "0.6923358", "0.69213027", "0.69209623", "0.6920601", "0.69144416", "0.69126356", "0.69113153", "0.6906401", "0.6904392", "0.6896715", "0.68957216", "0.6890208", "0.68834287", "0.6872303", "0.6865542", "0.6859641", "0.6856619", "0.6854652", "0.6852722", "0.6850343", "0.6848088", "0.6838276", "0.6836306", "0.6833746", "0.6832849", "0.68287885", "0.68282634", "0.6825996", "0.68257606", "0.6823302", "0.6823091", "0.6823033", "0.6822534", "0.68197715", "0.6819692", "0.68135136", "0.68135107", "0.6812157", "0.68104756", "0.68081963", "0.6807462", "0.68058497", "0.68036973", "0.6802346", "0.6800326", "0.6799846", "0.6799758", "0.6789643", "0.6785112", "0.67846316", "0.6778371", "0.67700106", "0.67690915", "0.6769013", "0.6768479", "0.6767306", "0.6765767", "0.6745377", "0.67444015", "0.6744219", "0.67389375", "0.67384213", "0.67369306", "0.6735815", "0.6735389", "0.67274785", "0.672414", "0.6722918" ]
0.0
-1
get a slice / part of the nodes queued objects for proccessing
function getQueuePart(node, size) { var context = node.context(); var part = []; if (size) { if (context.object_queue.length >= size) { for (var i = 0; i < size; i++) { part.push(context.object_queue.shift()); } } else { var ql = context.object_queue.length; for (var i = 0; i < ql; i++) { part.push(context.object_queue.shift()); } } } else { if (context.object_queue.length >= node.pagesize) { for (var i = 0; i < node.pagesize; i++) { part.push(context.object_queue.shift()); } } else { var size = context.object_queue.length; for (var i = 0; i < size; i++) { part.push(context.object_queue.shift()); } } } return part; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get () {\n\t\treturn queue.slice(nowPlaying);\n\t}", "printQueue(){\n return this.queue.slice(this.front,this.rear+1);\n }", "dequeue() {\n return this.processes.shift();\n // console.log('dequeu',this.processes[0]);\n }", "function _sliceBuffer(amount) {\n var newBuffer = _itemsWaitingToBeRendered.slice(amount, _itemsWaitingToBeRendered.length);\n var returnedObjArray = _itemsWaitingToBeRendered.slice(0, amount);\n _itemsWaitingToBeRendered = newBuffer;\n return returnedObjArray;\n }", "function get_queue() {\n return [...$.jStorage.get('activeQueue'), ...$.jStorage.get('reviewQueue')];\n }", "getRestChains (identifier){\n return local_RestChains.slice(); \t\n }", "_read(){\n this.queue.readStart()\n }", "function dequeue(){\n return queue.shift();\n }", "constructor() {\n this._waiting = [];\n this._enqueued = [];\n }", "async function getJobQueue(userIdIn, startIndex, endIndex) {\n\n var db = await MongoClient.connect(process.env.PROD_MONGODB);\n var userDoc = await db.collection('users').find({_id: new ObjectID(userIdIn)}).project({jobQueue: 1}).limit(1).next();\n\n var jobDocsQuery = [];\n if(userDoc.jobQueue.length < endIndex){\n jobDocsQuery = userDoc.jobQueue.slice(startIndex, userDoc.jobQueue.length);\n }\n else{\n jobDocsQuery = userDoc.jobQueue.slice(startIndex, Number(endIndex) + 1);\n }\n \n var jobDocs = await db.collection('jobs').find({ \"_id\" : {\"$in\" : jobDocsQuery}}).toArray();\n \n sortedJobDocs = [];\n //sorts the queried jobs back in their original order\n for(var i = 0; i < jobDocs.length; i++){\n\t jobIndex = _.findIndex(jobDocs, function(job) { \n\t return job._id.toString() === jobDocsQuery[i].toString();\n\t });\n\t sortedJobDocs.push(jobDocs[jobIndex]);\n }\n\n await db.close();\n return sortedJobDocs;\n}", "dequeue() {\n return this.items.shift();\n }", "dequeue() {\n return this.collection.shift();\n }", "dequeue() {\n return this.collection.shift();\n }", "fetchQueued() {\n return fetchSoon.fetchSearchRequests(this._myStartableQueued());\n }", "function peek(){\n return queue[0];\n }", "dequeue() {\n\t\treturn this.items.shift();\n\t}", "fetchMembers() {\n return self.fetchAgentsOfQueue(queue);\n }", "dequeue() {\n const value = _(this).collection.shift();\n return value[0];\n }", "enqueue(process) {\n // console.log(\"This is the processes array\", this.processes[0]);\n this.processes.unshift(process);\n // console.log(\"This is the processes array AFTER\", this.processes[0]);\n console.log('enque', this.processes[0]);\n return this.processes[0];\n }", "dequeue() {\n return _(this).collection.shift();\n }", "dequeue() {\n return this.collection.shift()[0]\n }", "dequeue() { // removes the item from the queue FIFO\n return this.processes.shift(); // use array shift\n }", "_showAllNodes() {\n let currentNode = this.head;\n let nodeCounter = 0;\n\n if (currentNode === null) {\n console.log(`No nodes in current queue`);\n return null;\n }\n\n console.log(`\n There're currently ${this.length} nodes in queue\n `);\n\n let nodes = [];\n\n while (currentNode !== null) {\n // console.log(`\n // Node#${++nodeCounter} in queue: ${currentNode.value}`);\n nodes.push(currentNode);\n currentNode = currentNode.nextNode;\n }\n return nodes;\n }", "dequeue() {\n return this.queue.shift()\n }", "function Queue(){\n this.first = undefined;\n this.last = undefined;\n this.size = 0;\n }", "get _queueFirst() {\n return this._queue[0];\n }", "inorderNodes() {\r\n let queue = [];\r\n\r\n this.inorderNodesHelper(this.root, queue);\r\n\r\n return queue;\r\n }", "function getTaskFromBag() {\n\tif (currentlyWorking)\n\t\treturn;\n\tcountCurrentPath = 0;\n\tcurrentPathIndex = 0;\n\tcurrentPath = new Array();\n\tcurrentTaskId = \"\";\n\t// logbox.setContent(\"Checking bag \" + new Date().toString());\n\t// screen.render();\n\tpostWithCallBack('/getTask', {\n\t\tip : my_ip\n\t}, bag_ip, bag_port, function(response) {\n\n\t\tresponse = JSON.parse(response);\n\t\t// myLogs(response.gotTask);\n\t\tif (response.gotTask === true) {\n\t\t\tmyLogs(\"\\nMoving to \");\n\t\t\tcurrentlyWorking = true;\n\t\t\tmoveToTarget(response);\n\t\t}\n\t});\n\tsetTimeout(getTaskFromBag, 3000);\n\n}", "dequeue() {\n if(this.items.length > 0) {\n return this.items.shift();\n }\n }", "function Queue() {\n this.data = [];\n}", "dequeue() {\n return this._queue.shift();\n }", "function Queue(){var a=[],b=0;this.getLength=function(){return a.length-b};this.isEmpty=function(){return 0==a.length};this.enqueue=function(b){a.push(b)};this.dequeue=function(){if(0!=a.length){var c=a[b];2*++b>=a.length&&(a=a.slice(b),b=0);return c}};this.peek=function(){return 0<a.length?a[b]:void 0}}", "getActiveQueue() {\n if (!this.isActive) {\n return [];\n } else if (this.incremental && this.activeQueue.length === 0) {\n return [];\n } else if (this.incremental) {\n return [this.activeQueue[0]];\n }\n\n return this.activeQueue;\n }", "dequeue() {\n if(! this.isEmpty()) return this.items.shift()\n else return undefined\n }", "function new_queue() {\n let items = [...get_queue(), ...truncated];\n run(items);\n }", "peek(){\n return queue[queue.length -1]\n }", "dequeue () {\n\t\treturn this[DISPLAY_LIST].shift();\n\t}", "function peek(queue) {\n return queue.first.data;\n}", "function dequeue() {\n return queue[index++];\n }", "function Queues(){}", "function Queue(){\n this.queue = [];\n}", "async fetchQueue( endpoint ){\n\t\treturn await axios.get( endpoint )\n\t}", "async getChildNodes() {\n await this.ensureIndexLoaded()\n let ids = this.index.getAllVerticalPointers()\n let dbobjects = {}\n ids.forEach((id) => {\n if (!this.cachedDirectChildren[id]) {\n this.cachedDirectChildren[id] = new DBObject({\n id,\n dynamoClient: this.dynamoClient,\n tableName: this.tableName\n })\n }\n })\n ids.forEach((id) => {\n dbobjects[id] = this.cachedDirectChildren[id]\n })\n return dbobjects\n }", "enqueue(number) {\n return this.queue.push(number)\n}", "peek() {\n return this.queue[0]\n}", "getAllCurrentJobs() { \n return this.items.map(ele=>ele.element);\n }", "dequeue() {\n this.queue.shift()\n}", "function Queue(){\n this.arr = [];\n }", "dequeue() {\n\t\treturn this.shift();\n\t}", "function readQueue(queue) { }", "function get () {\n return blocks.map((bl) => bl.get())\n }", "getTimeSliceForDay() {\n if (this.classType === 'virtual')\n return\n\n let args = {\n classRoomId: this.classRoom.value,\n currentClass: ''\n }\n\n // alert('before send')\n ipcRenderer.send('getAllFreeTimeSlice', args)\n ipcRenderer.on('responseGetAllFreeTimeSlice', (e, args) => {\n this.availableTimeSlices = args\n })\n\n }", "getPlayQueue() {\n\t\treturn app.playQueue.toArray();\n\t}", "dequeue() {\n this._treatNoValues();\n return this.storage.shift();\n }", "peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }", "peek() { // must not be called on an empty queue\n const front = this._front;\n const cursor = this._cursor;\n return front._elements[cursor];\n }", "function getPgPromises(pg,groupsize){\n\tvar todownload = [];\n\n\tvar maxitems = (pg * groupsize);\n\tvar firstitem = maxitems - (groupsize - 1);\n\tconsole.log(\"woking on: \",firstitem, maxitems);\n\n\tfor(var i = firstitem; i <= maxitems; i++){\n\t\tvar downloadedPage = loadPage(i);\n\t\ttodownload.push(downloadedPage);\n\t}\n\t\n\treturn todownload;\n}", "function Queue(){var _1=[];var _2=0;this.getSize=function(){return _1.length-_2;};this.isEmpty=function(){return (_1.length==0);};this.enqueue=function(_3){_1.push(_3);};this.dequeue=function(){var _4=undefined;if(_1.length){_4=_1[_2];if(++_2*2>=_1.length){_1=_1.slice(_2);_2=0;}}return _4;};this.getOldestElement=function(){var _5=undefined;if(_1.length){_5=_1[_2];}return _5;};}", "traverseQueue() {\n if (this.queue.length > 0) {\n /* Get the next index */\n const data = this.queue[0];\n /* compare cached version to next props */\n this.interpolator = d3.interpolate(this.state, data);\n timer(this.functionToBeRunEachFrame, this.props.delay);\n } else if (this.props.onEnd) {\n this.props.onEnd();\n }\n }", "grow() {\n let length = this.parts.length;\n if (length == 0) this.future_part = this.head.copy();\n else this.future_part = this.parts[length - 1].copy();\n }", "dequeue() {\n\n }", "function Queue() {\n this._oldestIndex = 1;\n this._newestIndex = 1;\n this._storage = {};\n}", "get jobs () {\n return this._mem.jobs;\n }", "function nextJobs(start, stop, callback) {\n var slice;\n\n return client.sort('wf_queued_jobs',\n 'by', 'job:*->created_at', 'asc',\n 'get', 'job:*->uuid',\n function (err, res) {\n if (err) {\n log.error({err: err});\n return callback(new wf.BackendInternalError(err));\n }\n\n if (res.length === 0) {\n return callback(null, null);\n }\n\n slice = res.slice(start, stop + 1);\n\n if (slice.length === 0) {\n return callback(null, null);\n } else {\n return callback(null, slice);\n }\n });\n }", "poll() {\n const top = this.queue.shift(); \n return top; \n }", "dequeue() {\n\t\treturn this.items.removeHead();\n\t}", "enqueue(item) {\n // console.log(item)\n enqueueItem(item, this.collection, 0, this.collection.length)\n // console.log(this.collection)\n }", "dequeue () {\n this.head.shift()\n }", "getRearElement(){\n return this.queue[this.rear];\n }", "getCombArray() {\n var urls = [];\n\n this.queue.getWithStatus(\"redirected\", function(err, items) {\n urls.push(items.url);\n });\n\n this.queue.getWithStatus(\"downloaded\", function(err, items) {\n urls.push(items.url);\n });\n\n return urls;\n }", "function queueGetIds(callback) {\n return this.mredis.lrange(\"feed.ids:\" + this.name, 0, -1, callback);\n}", "dequeue() {\n const element = this.queue.binaryTree.shift();\n this.queue.binaryTree.unshift(this.queue.binaryTree.pop());\n this.queue.siftDown(0);\n return element;\n }", "function processQueue(cb){\n\n}", "getResult(id)\n {\n var result = this.queue.getResult(id); \n //console.log(result);\n return result;\n }", "function enqueueNodeWithStartIndex(queue, node) {\n if (typeof node !== 'object' || node === null) {\n return;\n }\n if (node.range) {\n queue.push([node, node.range[0]]);\n } else if (Array.isArray(node)) {\n for (var ii = 0; ii < node.length; ii++) {\n enqueueNodeWithStartIndex(queue, node[ii]);\n }\n }\n}", "function enqueueNodeWithStartIndex(queue, node) {\n if (typeof node !== 'object' || node === null) {\n return;\n }\n if (node.range) {\n queue.push([node, node.range[0]]);\n } else if (Array.isArray(node)) {\n for (var ii = 0; ii < node.length; ii++) {\n enqueueNodeWithStartIndex(queue, node[ii]);\n }\n }\n}", "function enqueueNodeWithStartIndex(queue, node) {\n if (typeof node !== 'object' || node === null) {\n return;\n }\n if (node.range) {\n queue.push([node, node.range[0]]);\n } else if (Array.isArray(node)) {\n for (var ii = 0; ii < node.length; ii++) {\n enqueueNodeWithStartIndex(queue, node[ii]);\n }\n }\n}", "function enqueueNodeWithStartIndex(queue, node) {\n if (typeof node !== 'object' || node === null) {\n return;\n }\n if (node.range) {\n queue.push([node, node.range[0]]);\n } else if (Array.isArray(node)) {\n for (var ii = 0; ii < node.length; ii++) {\n enqueueNodeWithStartIndex(queue, node[ii]);\n }\n }\n}", "function getNodes() {\n var allNodes = nodes.get();\n var nodeList = [];\n for(var i = 0; i < allNodes.length; i++) {\n nodeList.push(allNodes[i].id);\n }\n return nodeList;\n}", "dequeue()\r\n {\r\n if (this.isEmpty()){\r\n return null;\r\n }\r\n return this.items.shift();\r\n }", "dequeue() {\n this.size -= 1;\n return this.queue.shift();\n }", "function PQueue() {\n\n // initialise the queue and offset\n var queue = [];\n var offset = 0;\n\n // REPLACE\n this.queue = queue;\n\n // Returns the length of the queue.\n this.getLength = function(){\n return (queue.length - offset);\n };\n\n // Returns true if the queue is empty, and false otherwise.\n this.isEmpty = function(){\n return (queue.length == 0);\n };\n\n /* Enqueues the specified item. The parameter is:\n *\n * item - the item to enqueue\n */\n this.enqueue = function(item){\n queue.push(item);\n };\n\n\n this.each = function (fn) {\n var i;\n for (i = offset; i < queue.length; i++) {\n fn(queue[i]);\n }\n };\n\n /* Dequeues an item and returns it. If the queue is empty, the value\n * 'undefined' is returned.\n */\n this.dequeue = function(){\n // if the queue is empty, return immediately\n if (queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = queue[offset];\n\n // increment the offset and remove the free space if necessary\n if (++ offset * 2 >= queue.length){\n queue = queue.slice(offset);\n offset = 0;\n }\n\n // return the dequeued item\n return item;\n };\n\n this.remove = function (item) {\n var index = queue.indexOf(item, offset);\n if (index === -1) {\n console.error('could not find item in queue to remove');\n } else {\n queue = queue.slice(offset, index).concat(queue.slice(index+1));\n offset = 0;\n }\n };\n\n /* Returns the item at the front of the queue (without dequeuing it). If the\n * queue is empty then undefined is returned.\n */\n this.peek = function(){\n return (queue.length > 0 ? queue[offset] : undefined);\n };\n }", "function getSize(){\n return queue.length;\n }", "manageTimeSlice(currentProcess, time) {\n // console.log(\"This is the quantum\", this.quantum);\n // console.log(\"This is the priorityLevel\", this.priorityLevel);\n // console.log(\"Current process and time\", currentProcess, time);\n if (currentProcess.stateChanged === true) {\n // console.log(\"What is the queu of this TRUE,\",currentProcess);\n // console.log(\"state is true, don't affect this process\");\n return currentProcess;\n }\n if (currentProcess.stateChanged === false) {\n console.log(\"What is the cpuTimeNeeded of this,\", currentProcess.cpuTimeNeeded);\n console.log(\"This is the passed in time\", time);\n let timeAfterQuantime = this.doCPUWork(time);\n if (timeAfterQuantime === 0 || timeAfterQuantime < 0) {\n console.log(\"Returned after cpuWork, time\", timeAfterQuantime);\n // this.dequeue();\n };\n if (timeAfterQuantime !== 0 || timeAfterQuantime > 0) {\n console.log(\"Returned after cpuWork, not complete, time\", timeAfterQuantime);\n // this.dequeue();\n this.doBlockingWork(timeAfterQuantime);\n };\n // currentProcess.cpuTimeNeeded -= time;\n }\n\n\n }", "dequeue() {\n // Time Complexity O(n)\n return this.list.shift();\n }", "acquireTasks() {\n\t\treturn dbStatic.getTasks(this.dbRef)\n\t\t\t.then(tasks => {\n\t\t\t\tconsole.log(\"tasks received\");\n\t\t\t\tconsole.log(`length ${tasks.length}`);\n\t\t\t\ttasks.forEach(task => {\n\t\t\t\t\tconsole.log(task);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tthis.calcTime(tasks,\n\t\t\t\t\tthis.state.totTime);\n\t\t\t\treturn tasks;\n\t\t\t});\n\t}", "TotalItemsInQueue(){\n return this._length;\n }", "dequeue() {\r\n this.Array.shift();\r\n}", "peek () {\n return this.queue[this.front]\n }", "peek() { // gives the process a reference number; only dequeues the process once it's done or have to be moved to the next priority queue \n return this.processes[0]; // 0 index references/points to the process that was recently added \n }", "peek() {\n if(this.queue.length) return this.queue[0]; \n else return null; \n }", "getAll() {\n return {\n tasks: _data,\n targetIndex: _targetIndex,\n clickPrintAt:_time\n };\n }", "_getCPUQueue(priorityLevel) {\n return this.runningQueues[priorityLevel];\n }", "dequeue() {\n if(!this.isEmpty()) {\n return this.collection.shift();\n } else {\n console.log(\"Queue is already empty\");\n }\n }", "function queue(){\n this.tail = 1;//index starts at 1\n this.head = 1;\n this.itemList = {};\n //return the size of the queue\n this.size = function(){\n return this.head - this.tail;\n }\n //Check if the queue is empty\n this.empty = function(){\n return this.size() <= 0 ? 1 : 0;\n }\n //push an item into the beginning of the queue\n this.push = function(item){\n this.itemList[this.head] = item;\n this.head++;\n return;\n }\n //return the item at the end of the queue and remove it from the queue\n this.pull = function(){\n if (this.empty()){\n return null;\n }\n var result;\n result = this.itemList[this.tail];\n delete this.itemList[this.tail];\n this.tail++;\n return result\n }\n //empty the queue\n this.init = function(){\n while (!this.empty()){\n this.pull;\n }\n return;\n }\n}", "popFromQueue() {\n this.shiftNextSprites()\n\n let tetromino = this.queue.shift()\n tetromino.reset()\n\n this.fillQueueWithBag()\n return tetromino\n }", "_getPathData() \n {\n var result = [];\n for(let chan=0;chan<this.config.params.plot.channelcount;chan++)\n {\n let data = this.chanData[chan];\n let chanres = [];\n let nextSlot = this.nextSlot[chan];\n\n // oldest data is at this.nextSlot, we want to run oldest to newest\n // this is only true after we've filled our array\n if(data.length < this.plotConfig.maxlength)\n {\n for(let i=0; i<data.length; i++)\n chanres.push(data[i]);\n }\n else\n for(let i=0; i<data.length; i++)\n {\n var j = (i + nextSlot) % this.plotConfig.maxlength;\n chanres.push(data[j]);\n }\n result.push(chanres);\n }\n return result;\n }", "function Queue() {\n this.els = new Array();\n this.head = 0;\n this.size = 0;\n}", "function Queue() {\n this.elements = [];\n}", "shift() { // must not be called on an empty queue\n const oldFront = this._front;\n let newFront = oldFront;\n const oldCursor = this._cursor;\n let newCursor = oldCursor + 1;\n const elements = oldFront._elements;\n const element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n }" ]
[ "0.62579674", "0.59086746", "0.58773434", "0.58189785", "0.5642547", "0.5555309", "0.5540773", "0.5496877", "0.5440474", "0.5435695", "0.53355855", "0.5329713", "0.53250897", "0.5307996", "0.5298105", "0.5287273", "0.5269881", "0.52674496", "0.52665085", "0.5242574", "0.5240564", "0.5228205", "0.52187884", "0.52034235", "0.51933914", "0.5192322", "0.51708734", "0.5146802", "0.5134722", "0.51327926", "0.5127625", "0.5111135", "0.5103786", "0.5102036", "0.5096685", "0.5093918", "0.509092", "0.50887877", "0.508777", "0.5085263", "0.5084101", "0.50836134", "0.50818616", "0.5078286", "0.50730455", "0.50708115", "0.5057901", "0.5055687", "0.5053156", "0.5048686", "0.50454074", "0.50436264", "0.5035558", "0.5035426", "0.50352967", "0.50352967", "0.50241154", "0.50226736", "0.5007303", "0.50062567", "0.50033337", "0.49973312", "0.4994448", "0.49882996", "0.49845085", "0.49829423", "0.49809211", "0.49805987", "0.4973298", "0.49588427", "0.49384218", "0.49274507", "0.4927086", "0.49245682", "0.49236774", "0.49236774", "0.49236774", "0.49236774", "0.4919202", "0.49142745", "0.4914038", "0.49130216", "0.4909504", "0.49007466", "0.49002334", "0.48983195", "0.4897316", "0.4895126", "0.4891376", "0.48877785", "0.4878621", "0.4877686", "0.487007", "0.4868611", "0.48584265", "0.48562783", "0.48531488", "0.48512512", "0.4849065", "0.4848545" ]
0.70424706
0
No hay clases, hay prototipos que son objetos, que le vamos agregando metodos que reciben funciones, saben quien es this y sabe como ejecutarlas. Pero no existe un sistema como tal, donde yo diga este prototipo va heredar de otro. Lo que si existe es la herencia prototipal. todas las funciones tienen el atributo prototype
function heredaDe(prototipoHijo, prototipoPadre) { var fn = function() {}; fn.prototype = prototipoPadre.prototype; prototipoHijo.prototype = new fn; prototipoHijo.prototype.constructor = prototipoHijo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heredaDe(prototipoHijo, prototipoPadre) { // Esta es una funcion que recibe funciones\n var fn = function () {} // Creamos una funcion vacia\n fn.prototype = prototipoPadre.prototype // Hacemos una copia del prototipo del Padre para guardarlo en el protitipo de nuestra funcion vacia\n prototipoHijo.prototype = new fn // De esa forma evitamos acceder directamente a la funcion y no la pizamos\n prototipoHijo.prototype.constructor = prototipoHijo //Asignamos la funcion constructora\n //Si no agregamos la ultima linea se estaria llamando al constructor de prototipo padre\n}", "function heredaDe(prototipoHijo, prototipoPadre){\n var fn = function () {}\n fn.prototype = prototipoPadre.prototype\n prototipoHijo.prototype = new fn\n //asignamos la funcion constructora de la clase claseHija\n prototipoHijo.prototype.constructor = prototipoHijo\n}", "function Obj(nome){\n this.nome = nome;\n\n //Também posso colocar uma função dentro da função utilizando o This.\n this.exec = function(){\n console.log(\"Exec...\")\n }\n}", "metodoAbstrato(){\n throw new Error(\"Este é um método abstrato e portanto não pode ser instanciado pelo objeto Conta\")\n }", "function test2(){ \n var p2 = new Perro();\n /*\n Perro.prototype = new Animal(); \n Perro.prototype.constructor = Perro; \n -- con esto heredamos todos los metodos --\n */\n p2.dormir();\n p2.ladrar();\n p2.jugar();\n p2.morder();\n}", "function Apuesta(){\n\tvar valor;//declaracion variable private\n\tvar tipo;\n\tvar casillero;\n\t//declaracion variable static para contar instancias del objeto\n\tif ( typeof Apuesta.nApuestas == 'undefined' ) {\n Apuesta.nApuestas = 0;\n }\n ++Apuesta.nApuestas;\n\n\tApuesta.prototype.getNapuestas = function(){\n\t\t\treturn Apuesta.nApuestas;\n\t}\n\tApuesta.prototype.getValor = function(){\n\t\t\treturn valor;\n\t}\n\tApuesta.prototype.setValor = function(n){\n\t\t//validacion\n\t\t\tvalor = n;\n\t}\n}", "function heredaDe(protoHijo,protoPadre) {\n//3.Aqui le decimos al ptto hijo quien sera su padre :v\n\tvar fn = function () {} //4. funcion vacia\n\tfn.prototype = protoPadre.prototype //5. al prototipo de esta le asignamos el prototipo padre\n\tprotoHijo.prototype = new fn //6. Nuevo objeto de la funcion q creamos, es decir lo mismo pero pasamos a otro objeto.\n\t//7. asignamos constructor\n\tprotoHijo.prototype.constructor = protoHijo\n\t//Esto es algo complejo, pero en la clase q viene será más sencillo\n}", "function task1 () {\n \n function Animal(name) {\n this.name = name;\n }\n\n Animal.prototype.walk = function() {\n console.log( \"ходит \" + this.name );\n };\n\n function Rabbit(name) {\n this.name = name;\n }\n Rabbit.prototype = Animal.prototype;\n\n Rabbit.prototype.walk = function() {\n console.log( \"прыгает! и ходит: \" + this.name );\n };\n\n var a = new Animal('a')\n\n var r = new Rabbit('r')\n\n a.walk() // прыгает и ходит????\n r.walk()\n}", "function Pessoa(nome, sobrenome){\n\n // atributos privados\n const ID = 123123;\n const metodos = function(){\n \n }\n\n\n //atributos ou metodos publicos\n this.Pessoa = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function(){\n console.log(\"Oi sou o Metodo\");\n }\n }", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "function persona(nombre, edad) {\n //let this ={}\n //Atributos privados\n let n = nombre\n //Atributos publicos\n this.nombre = nombre\n this.edad = edad\n //metodo publico de instancia\n this.getNombre = function () {\n console.log(n)\n }\n\n //Metodo publico de clase. lo tiene toda la clase persona.\n persona.prototype.getNombreProto = function () {\n console.log(n)\n }\n //return this\n}", "function MiClaseFunction(nombre) { //la forma antigua\n this.nombre = nombre;\n}", "function task2 () {\n\n function Animal(name) {\n this.name = name;\n\n this.walk = function() {\n console.log( \"ходит \" + this.name );\n };\n }\n\n\n function Rabbit(name) {\n Animal.apply(this, arguments);\n }\n\n Rabbit.prototype = Object.create(Animal.prototype);\n\n Rabbit.prototype.walk = function() {\n console.log( \"прыгает \" + this.name );\n };\n\n var rabbit = new Rabbit(\"Кроль\");\n rabbit.walk();\n}", "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}", "constructor(raza) {\n this.raza = raza;\n\n // METODA 'MISCARE()' (IN INSTANTA OBIECTULUI)\n this.miscare = function() {\n console.log('miscare');\n }\n }", "function Alumno(nombre,apellido,edad)\n{\n this.nombre = nombre;\n this.apellido = apellido;\n this.edad = edad;\n /*this.saludar = function(){\n console.log(\"Hola! que se cuenta?\");\n }\n */\n //Puedo setear un metodo con una funcion externa\n //this.saludar = Saludar;\n}", "function Superheroe() {\n this.vuela = function() {\n console.log(this.name, 'vuela'); \n }\n this.esquivaBalas = function() {\n console.log(this.name, 'esquiva balas')\n }\n}", "function Persona(nombre) {\n this.nombre = nombre;\n //Esto crea una funcion por objeto instanciado. No es correcto este enfoque.\n /* this.saluda = function () {\n console.log('Hola, me llamo', this.nombre);\n \n } */\n}", "constructor(name, age)\n {\n this._name = name;\n this._age = age;\n\n //mojem da setnem neshto na funkciq\n this._something = function(){\n return \"I am Function\";\n }\n //tik moga da si rabota normalno\n let friend = \"Petre\"; \n let arr = [];\n let obj = {};\n\n //this sochi kum tekushtata instanciq na klasa:\n //OBACHE VUV FUNKCIQ 'this' VECHE NE RABOTI\n //OBACHE NIE UK MOJEM DA GO SEIVAME V PROMENLIVA I DA SI GO POLZVAME\n let tekushObekt = this; \n console.log(tekushObekt); //Person { _name: 'Atanas', _age: 25 }\n\n\n function printThis() {\n console.log(this); // undefined\n console.log(tekushObekt); //Person { _name: 'Atanas', _age: 25 }\n }\n printThis(); // VAJNO!!! : Sus printThis.call(this); PROMENQME THIS-a DA SI SOCHI KUM OBEKTA KAKTO PREDI\n }", "get prototype() {}", "function a(t,e){o(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){o(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){o(t,e,n)}))}", "function o(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}", "function HistoriaClinica() { //-------------------------------------------Class HistoriaClinica()\n\n this.a = [];\n\n HistoriaClinica.prototype.cargarData = function (data) {\n this.a = data;\n this.a.Adjuntos = [];\n // // this.a.II;\n // this.a.II_BD = 0;//estado inicial, se puede ir al servidor a buscar la informacion.\n }\n\n} //-------------------------------------------Class HistoriaClinica()", "function o(e,t){a(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(r){a(e.prototype,t.prototype,r)})),Object.getOwnPropertyNames(t).forEach((function(r){a(e,t,r)}))}", "function funcionario(nome, sobrenome) {\n this.nome = nome;\n this.sobrenome = sobrenome;\n}", "function PrototypeBasedClass () {\n}", "function Prototype() {\n }", "function o(e,t){a(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){a(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){a(e,t,n)}))}", "function o(e,t){a(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){a(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){a(e,t,n)}))}", "constructor(ojos, boca, extremidades, duenio) {\n super(ojos, boca, extremidades);\n this.duenio = duenio;\n this.estaDomesticado = true;\n }", "function o(e,t){a(e,t),Object.getOwnPropertyNames(t.prototype).forEach(function(n){a(e.prototype,t.prototype,n)}),Object.getOwnPropertyNames(t).forEach(function(n){a(e,t,n)})}", "function Celular(marca, modelo, tamanho, valor){\n\n this.marca = marca;\n this.modelo = modelo; \n this.tamanho = tamanho; \n this.valor = valor; \n\n this.Ligar = function(){\n console.log(\"fazendo ligação ..... \"); \n\n }\n\n}", "function Pessoa(nome, sobrenome) {\n // Atributos ou metodos publicos\n const ID;\n const metodoInterno = function () {\n \n }\n\n // Atributos ou metodos publicos\n this.nome = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function () {\n console.log(this.nome + ' Sou um metodo');\n }\n\n}", "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "function Persona(nombre) {\n this.nombre = nombre;\n // this.saluda = function() {\n // console.log('Hola me llamo', this.nombre); \n // }\n}", "function Estudante() {\n\n this.despedida = function () {\n console.log('Tchau! Sou da Classe Estudante');\n }\n}", "misDatos() { // un metodo es una funcion declarativa sin el function dentro de un objeto, puede acceder al universo del objeto\n return `${this.nombre} ${this.apellido}`; // por medio del \"this\", que es una forma de acceder a las propiedades del objeto en un metodo\n }", "constructor() {\n // class (etiqueta html) (web-component)\n // Instanciar a la clase\n // Clase esta lista\n // Clase se destruye\n this.ancho = 200;\n this.cambioSueldo = new EventEmitter(); // evento\n this.mostrarResultados = new EventEmitter();\n this.suma = 0;\n this.resta = 0;\n this.multiplicacion = 0;\n this.division = 0;\n console.log('instanciando');\n }", "function o(e,t){s(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){s(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){s(e,t,n)}))}", "function Persona(nombre, edad) {\n console.log('Se ejecutó esta línea');\n\n this.nombre = nombre;\n this.edad = edad; \n\n this.imprimir = function() {\n console.log(`Nombre: ${ this.nombre } - edad: ${ this.edad }`); \n }\n\n}", "function mokinys(vardas, pavarde, kelintokas, matemPazymiai){\n this.vardas = vardas;\n this.pavarde = pavarde;\n this.kelintokas = kelintokas;\n this.matemPazymiai = matemPazymiai;\n this.begti = function (){\n console.log(\"Begu begu vel\");\n};\n\n}", "function i(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "function i(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "function DependenciasGerais() {\n _DependenciasNivelConjurador();\n _DependenciasEquipamentos();\n _DependenciasFamiliar();\n _DependenciasDadosVida();\n _DependenciasAtributos();\n _DependenciasTalentos();\n _DependenciasPontosVida();\n _DependenciasIniciativa();\n _DependenciasTamanho();\n _DependenciasBba();\n _DependenciasProficienciaArmas();\n _DependenciasHabilidadesEspeciais();\n _DependenciasImunidades();\n _DependenciasResistenciaMagia();\n\n // So pode fazer aqui, pois os pre requisitos dependem de atributos, classes,\n // talentos, proficiencias...\n // TODO se essa funcao falhar, potencialmente o personagem tera que ser recarregado.\n _VerificaPrerequisitosTalento();\n\n _DependenciasPericias();\n _DependenciasFocoArmas();\n _DependenciasEspecializacaoArmas();\n _DependenciasClasseArmadura();\n _DependenciasArmas();\n _DependenciasEstilos();\n _DependenciasSalvacoes();\n _DependenciasFeiticos();\n}", "function i(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "function i(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "static saludar(){\n console.log(`Hola ${this.nombre} te saludo desde una función`);\n }", "function prototypeChain() {\n function Workshop(teacher) {\n this.teacher = teacher\n }\n \n Workshop.prototype.ask = function ask(question) {\n console.log(this.teacher, question)\n }\n \n const deepJS = new Workshop('Bruno')\n const react = new Workshop('Kyle')\n \n deepJS.ask('why the sky is blue')\n react.ask('whats the meaning of life?')\n console.log(deepJS.teacher)\n}", "function Copcar(){}", "constructor(nombre,saldo,telefono,tipo){\n //Va hacia elconstructor Padre\n super(nombre,saldo);//hereda el constructor\n //no existen en el constructor padre\n this.telefono = telefono;\n this.tipo = tipo;\n }", "function y(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}", "constructor() {\n console.log(\"Ini adalah class mahasiswa\");\n }", "constructor(value: any) {\n this.value = value\n // data的每个对象都实例化一个Dep\n this.dep = new Dep()\n this.vmCount = 0\n /**\n * @响应式8\n */\n // 在 value 对象上设置 __ob__ 属性,值为Observer实例,并且是不可遍历的enumerable=false\n def(value, '__ob__', this)\n /**\n * @响应式9\n */\n if (Array.isArray(value)) {\n /**\n * value 为数组\n * hasProto = '__proto__' in {}\n * 用于判断对象是否存在 __proto__ 属性,通过 obj.__proto__ 可以访问对象的原型链\n * 但由于 __proto__ 不是标准属性,所以有些浏览器不支持,比如 IE6-10,Opera10.1\n * 为什么要判断,是因为一会儿要通过 __proto__ 操作数据的原型链\n * 覆盖数组默认的七个原型方法,以实现数组响应式\n */\n if (hasProto) { //****hasProto = '__proto__' in {}\n // 有 __proto__\n // 改变obj的原型为我们重写的arrayMethods(重写的7个数组方法push,pop,shift,unshift,sort,reverse)\n protoAugment(value, arrayMethods) //value.__proto__ = arrayMethods\n } else {\n // 遍历数组原型的7个方法名字\n // 把七个重写好的数组方法设置到每个数组上\n copyAugment(value, arrayMethods, Object.getOwnPropertyNames(arrayMethods))\n }\n this.observeArray(value)\n } else {\n /**\n * @响应式14\n * 开始对象的响应式\n * value 为对象,为对象的每个属性(包括嵌套对象)设置响应式\n */\n this.walk(value)\n }\n }", "static saludar(){\r\n console.log('saludos desde método static');\r\n }", "function IA_Objetos() {\n IA.call(this);\n\n this.pared = false;\n this.serpiente = false;\n this.manzana = false;\n this.objManzana = null;\n\n this.establecerManzana = function(objeto) {\n this.objManzana = objeto;\n }\n\n this.activarPared = function() { this.pared = true;}\n this.activarSerpiente = function() { this.serpiente = true;}\n this.activarManzana = function() { this.manzana = true;}\n this.desactivarPared = function() { this.pared = false;}\n this.desactivarSerpiente = function() { this.serpiente = false;}\n this.desactivarManzana = function() { this.manzana = false;}\n\n this.obtenerPared = function() { return this.pared;}\n this.obtenerManzana = function() { return this.manzana;}\n this.obtenerSerpiente = function() { return this.serpiente;}\n this.obtenerObjManzana = function() { return this.objManzana;}\n\n this.clone = function() {\n o = new IA_Objetos();\n return o;\n }\n}", "function a(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}", "function hobbitPrototype(){}", "constructor(name,type,evolutions)\n {\n /*\n Se utiliza \"this\" para hacer referencia al propietario de la función que la está invocando o en su defecto, al objeto donde dicha función es un método.\n */\n // Se utilizan los métodos propios de la clase \n // para modificar sus atributos.\n this.#name=name;\n this.#type=type;\n this.#evolutions=evolutions;\n }", "function PlatizaJs() {\n const self = this;\n\n /**\n * Button To Top\n * @see module:totop\n */\n self.initToTop = function() {\n const Totop = require('./_totop');\n const totopFunc = new Totop();\n\n totopFunc.toggle();\n totopFunc.init();\n };\n\n /**\n * Верхнее меню на мобильных\n * @see module:topMenu\n */\n self.initTopMenu = function() {\n const TopMenu = require('./_topMenu');\n const topMenuFunc = new TopMenu();\n\n topMenuFunc.init();\n };\n\n /**\n * Валидация для инпута в поле Источниках доходов\n * @see module:inputSourceOfIncome\n */\n self.initInputSourceOfIncome = function() {\n var InputSourceOfIncome = require('./forms/_inputSourceOfIncome');\n var inputSourceOfIncomeFunc = new InputSourceOfIncome();\n\n inputSourceOfIncomeFunc.init();\n };\n\n /**\n * Помечает все обязательные поля при вводе в разделе Дополнительные данные\n * @see module:inputViewRequiredAdditional\n */\n self.initInputViewRequiredAdditional = function() {\n var InputViewRequiredAdditional = require('./forms/_inputViewRequiredAdditional');\n var inputViewRequiredAdditionalFunc = new InputViewRequiredAdditional();\n\n inputViewRequiredAdditionalFunc.init();\n };\n\n /**\n * Помечает все обязательные поля при вводе в разделе Акутализация анкетных данных\n * @see module:inputViewRequiredAktData\n */\n self.initInputViewRequiredAktData = function() {\n var InputViewRequiredAktData = require('./forms/_inputViewRequiredAktData');\n var inputViewRequiredAktDataFunc = new InputViewRequiredAktData();\n\n inputViewRequiredAktDataFunc.init();\n };\n\n /**\n * Проверка полей на наличия ошибок перед отправкой в LK-настройки\n * @see module:inputValidBeforeSubmit\n */\n self.initInputValidBeforeSubmit = function() {\n var InputValidBeforeSubmit = require('./forms/_inputValidBeforeSubmit');\n var inputValidBeforeSubmitFunc = new InputValidBeforeSubmit();\n\n inputValidBeforeSubmitFunc.init();\n };\n\n /**\n * Проверка полей на наличия ошибок перед отправкой на странице Регистрации\n * @see module:inputValidDataRegister\n */\n self.initInputValidDataRegister = function() {\n var InputValidDataRegister = require('./forms/_inputValidDataRegister');\n var inputValidDataRegisterFunc = new InputValidDataRegister();\n\n inputValidDataRegisterFunc.init();\n };\n\n /**\n * Проверка полей наличия ошибок в вводе на странице входа\n * @see module:inputValidDataLogin\n */\n self.initInputValidDataLogin = function() {\n var InputValidDataLogin = require('./forms/_inputValidDataLogin');\n var inputValidDataLoginFunc = new InputValidDataLogin();\n\n inputValidDataLoginFunc.init();\n };\n\n /**\n * Masked input for phone number\n * @see module:inputMaskedPhone\n */\n self.initInputMaskedPhone = function() {\n const InputMaskedPhone = require('./forms/_inputMaskedPhone');\n const inputMaskedPhoneFunc = new InputMaskedPhone();\n\n inputMaskedPhoneFunc.init('.js-input-phone');\n };\n\n /**\n * Masked input for bank BIK\n * @see module:inputMaskedBankBIK\n */\n self.initInputMaskedBankBIK = function() {\n const InputMaskedBankBIK = require('./forms/_inputMaskedBankBIK');\n const inputMaskedBankBIKFunc = new InputMaskedBankBIK();\n\n inputMaskedBankBIKFunc.init('.js-input-bank-bik');\n };\n\n /**\n * Masked input for bank account number\n * @see module:inputMaskedBankAccountNumber\n */\n self.initInputMaskedBankAccountNumber = function() {\n const InputMaskedBankAccountNumber = require('./forms/_inputMaskedBankAccountNumber');\n const inputMaskedBankAccountNumberFunc = new InputMaskedBankAccountNumber();\n\n inputMaskedBankAccountNumberFunc.init('.js-input-bank-account-number');\n };\n\n /**\n * Masked input for yandex wallet number\n * @see module:inputMaskedYandexNumber\n */\n self.initInputMaskedYandexNumber = function() {\n const InputMaskedYandexNumber = require('./forms/_inputMaskedYandexNumber');\n const inputMaskedYandexNumberFunc = new InputMaskedYandexNumber();\n\n inputMaskedYandexNumberFunc.init('.js-input-yandex-number');\n };\n\n /**\n * Masked input for optional phone number\n * @see module:inputMaskedPhoneOptional\n */\n self.initInputMaskedPhoneOptional = function() {\n const InputMaskedPhoneOptional = require('./forms/_inputMaskedPhoneOptional');\n const inputMaskedPhoneOptionalFunc = new InputMaskedPhoneOptional();\n\n inputMaskedPhoneOptionalFunc.init('.js-input-phone-optional');\n };\n\n /**\n * Masked input for optional phone number\n * @see module:inputMaskedPhoneOptional\n */\n self.initInputMaskedIncomeExpense = function() {\n const InputMaskedIncomeExpense = require('./forms/_inputMaskedIncomeExpense');\n const InputMaskedIncomeExpenseFunc = new InputMaskedIncomeExpense();\n\n InputMaskedIncomeExpenseFunc.init('.js-input-income-expense');\n };\n\n /**\n * Masked input for sms\n * @see module:inputMaskedSms\n */\n self.initInputMaskedSms = function() {\n const InputMaskedSms = require('./forms/_inputMaskedSms');\n const inputMaskedSmsFunc = new InputMaskedSms();\n\n inputMaskedSmsFunc.init('.js-input-sms');\n };\n\n /**\n * Masked input for passport\n * @see module:inputMaskedPassport\n */\n self.initInputMaskedPassport = function() {\n const InputMaskedPassport = require('./forms/_inputMaskedPassport');\n const inputMaskedPassportFunc = new InputMaskedPassport();\n\n inputMaskedPassportFunc.init('.js-input-passport');\n };\n\n /**\n * Masked input for passport - Podrazdeleniye\n * @see module:inputMaskedPassportPodr\n */\n self.initInputMaskedPassportPodr = function() {\n const InputMaskedPassportPodr = require('./forms/_inputMaskedPassportPodr');\n const inputMaskedPassportPodrFunc = new InputMaskedPassportPodr();\n\n inputMaskedPassportPodrFunc.init('.js-input-passport-podr');\n };\n\n /**\n * Masked input for date\n * @see module:inputMaskedDate\n */\n self.initInputMaskedDate = function() {\n const InputMaskedDate = require('./forms/_inputMaskedDate');\n const inputMaskedDateFunc = new InputMaskedDate();\n\n inputMaskedDateFunc.init('.js-input-date');\n };\n\n\n /**\n * Masked input for date\n * @see module:inputMaskedDateFuture\n */\n self.initInputMaskedDateFuture = function() {\n const InputMaskedDateFuture = require('./forms/_inputMaskedDateFuture');\n const inputMaskedDateFutureFunc = new InputMaskedDateFuture();\n\n inputMaskedDateFutureFunc.init('.js-input-date-future');\n };\n\n /**\n * Masked input for Snils\n * @see module:inputMaskedSnils\n */\n self.initInputMaskedSnils = function() {\n const InputMaskedSnils = require('./forms/_inputMaskedSnils');\n const inputMaskedSnilsFunc = new InputMaskedSnils();\n\n inputMaskedSnilsFunc.init('.js-input-snils');\n };\n\n /**\n * Masked input for Inn\n * @see module:inputMaskedInn\n */\n self.initInputMaskedInn = function() {\n const InputMaskedInn = require('./forms/_inputMaskedInn');\n const inputMaskedInnFunc = new InputMaskedInn();\n\n inputMaskedInnFunc.init('.js-input-inn');\n };\n\n /**\n * Masked input for numeric inputs\n * @see module:inputMaskedMoney\n */\n self.initInputMaskedMoney = function() {\n const InputMaskedMoney = require('./forms/_inputMaskedMoney');\n const inputMaskedMoneyFunc = new InputMaskedMoney();\n\n inputMaskedMoneyFunc.init('.js-input-money');\n };\n\n /**\n * Masked input for cyrillic inputs\n * @see module:inputMaskedCyrillic\n */\n self.initInputMaskedCyrillic = function() {\n const InputMaskedCyrillic = require('./forms/_inputMaskedCyrillic');\n const inputMaskedCyrillicFunc = new InputMaskedCyrillic();\n\n inputMaskedCyrillicFunc.init('.js-input-cyrillic');\n };\n\n /**\n * Masked input for ФИО\n * @see module:inputMaskedFio\n */\n self.initInputMaskedFioSeparately = function() {\n const InputMaskedFioSeparately = require('./forms/_inputMaskedFioSeparately');\n const inputMaskedFioSeparatelyFunc = new InputMaskedFioSeparately();\n\n inputMaskedFioSeparatelyFunc.init('.js-input-fio-separately');\n };\n\n /**\n * Masked input for Имя\n * @see module:inputMaskedName\n */\n self.initInputMaskedName = function() {\n const InputMaskedName = require('./forms/_inputMaskedName');\n const inputMaskedNameFunc = new InputMaskedName();\n\n inputMaskedNameFunc.init('.js-input-name');\n };\n\n /**\n * Masked input for ФИО\n * @see module:inputMaskedFio\n */\n self.initInputMaskedFio = function() {\n const InputMaskedFio = require('./forms/_inputMaskedFio');\n const inputMaskedFioFunc = new InputMaskedFio();\n\n inputMaskedFioFunc.init('.js-input-fio');\n };\n\n /**\n * Маска для инпута полного названия географического пункта\n * @see module:inputMaskedLocation\n */\n self.initInputMaskedLocation = function() {\n const InputMaskedLocation = require('./forms/_inputMaskedLocation');\n const inputMaskedLocationFunc = new InputMaskedLocation();\n\n inputMaskedLocationFunc.init('.js-input-location');\n };\n\n /**\n * Маска для инпута географического названия\n * @see module:inputMaskedGeo\n */\n self.initInputMaskedGeo = function() {\n const InputMaskedGeo = require('./forms/_inputMaskedGeo');\n const inputMaskedGeoFunc = new InputMaskedGeo();\n\n inputMaskedGeoFunc.init('.js-input-geo');\n };\n\n /**\n * Маска для обязательного инпута\n * @see module:InputRequired\n */\n self.initInputRequired = function() {\n const InputRequired = require('./forms/_inputRequired');\n const inputRequiredFunc = new InputRequired();\n\n inputRequiredFunc.init('.js-input-required');\n };\n\n /**\n * Маска для email\n * @see module:inputMaskedEmail\n */\n self.initInputMaskedEmail = function() {\n const InputMaskedEmail = require('./forms/_inputMaskedEmail');\n const inputMaskedEmailFunc = new InputMaskedEmail();\n\n inputMaskedEmailFunc.init('.js-input-email');\n };\n\n /**\n * Passport date verify\n * @see module:datePassportVerify\n */\n self.initDatePassportVerify = function() {\n const DatePassportVerify = require('./forms/_datePassportVerify');\n const datePassportVerifyFunc = new DatePassportVerify();\n\n datePassportVerifyFunc.init();\n };\n\n /**\n * Autocomplete Generic\n * @see module:autocompleteGeneric\n */\n self.initAutocompleteGeneric = function(control, terms) {\n const AutocompleteGeneric = require('./forms/_autocompleteGeneric');\n const autocompleteGenericFunc = new AutocompleteGeneric(control, terms);\n\n autocompleteGenericFunc.init();\n };\n\n /**\n * Add classes to c-form-group when controls are focused, active, disabled...\n * @see module:statesOfControls\n */\n self.initStatesOfControls = function() {\n const StatesOfControls = require('./forms/_statesOfControls');\n const statesOfControlsFunc = new StatesOfControls();\n\n statesOfControlsFunc.init();\n };\n\n /**\n * Resize textarea when typing\n * @see module:textareaResize\n */\n self.initTextareaResize = function() {\n const TextareaResize = require('./forms/_textareaResize');\n const textareaResizeFunc = new TextareaResize();\n\n textareaResizeFunc.init();\n };\n\n /**\n * Update Resize textarea when typing\n * @see module:textareaResize\n */\n self.initTextareaResizeUpdate = function(target) {\n const TextareaResize = require('./forms/_textareaResize');\n const textareaResizeUpdateFunc = new TextareaResize();\n\n textareaResizeUpdateFunc.update(target);\n };\n\n /**\n * Hide text inputs when corresponding checkbox is checked\n * @see module:checkboxNoomeField\n */\n self.initCheckboxNoSomeField = function() {\n const CheckboxNoSomeField = require('./forms/_checkboxNoSomeField');\n const checkboxNoSomeFieldFunc = new CheckboxNoSomeField();\n\n checkboxNoSomeFieldFunc.init('.js-no-email', '.js-email');\n checkboxNoSomeFieldFunc.init('.js-no-middle-name', '.js-middle-name');\n checkboxNoSomeFieldFunc.init('.js-no-street-reg', '.js-street-reg');\n checkboxNoSomeFieldFunc.init('.js-no-street-living', '.js-street-living');\n };\n\n /**\n * Check password strength\n * @see module:passwordStrength\n */\n self.initPasswordStrength = function() {\n const PasswordStrength = require('./forms/_passwordStrength');\n const passwordStrengthFunc = new PasswordStrength();\n\n passwordStrengthFunc.init();\n };\n\n /**\n * Check if passwordRepeat equals to passport\n * @see module:passwordRepeat\n */\n self.initPasswordRepeat = function() {\n const PasswordRepeat = require('./forms/_passwordRepeat');\n const passwordRepeatFunc = new PasswordRepeat();\n\n passwordRepeatFunc.init();\n };\n\n /**\n * Show / Hide hint in form groups\n * @see module:hints\n */\n self.initHintsInForms = function() {\n const HintsInForms = require('./forms/_hints');\n const hintsInFormsFunc = new HintsInForms();\n\n hintsInFormsFunc.init();\n };\n\n /**\n * Styled selects\n * @see module:selectStyled\n */\n self.initSelectStyled = function() {\n const SelectStyled = require('./forms/_selectStyled');\n const selectStyledFunc = new SelectStyled();\n\n selectStyledFunc.init();\n };\n\n /**\n * jCarousel\n * @see module:jcarouselSlider\n */\n self.initJCarousel = function() {\n const JcarouselSlider = require('./_jcarouselSlider');\n const jcarouselSliderFunc = new JcarouselSlider();\n\n jcarouselSliderFunc.init();\n };\n\n /**\n * Styled Input type File\n * @see module:inputFile\n */\n self.initInputFile = function() {\n const InputFile = require('./forms/_inputFile');\n const inputFileFunc = new InputFile();\n\n inputFileFunc.init('.js-upload-fake-btn', '.js-scan-upload');\n };\n\n /**\n * Address Living\n * @see module:addressLiving\n */\n self.initAddressLiving = function() {\n const AddressLiving = require('./forms/_addressLiving');\n const addressLivingFunc = new AddressLiving();\n\n addressLivingFunc.init();\n };\n /**\n * File Upload\n * @see module:fileUpload\n */\n self.initFileUpload = function() {\n const FileUpload = require('./forms/_fileUpload');\n const fileUploadFunc = new FileUpload();\n\n fileUploadFunc.init('.js-scan-upload');\n };\n\n /**\n * Choose document type for upload\n * @see module:documentType\n */\n self.initDocumentType = function() {\n const DocumentType = require('./forms/_documentType');\n const documentTypeFunc = new DocumentType();\n\n documentTypeFunc.init('.js-doc-type-choice', '.js-upload-block');\n };\n\n /**\n * Manage Phone Number\n * @see module:managePhoneNumber\n */\n self.initManagePhoneNumber = function(flag) {\n const ManagePhoneNumber = require('./forms/_managePhoneNumber');\n const managePhoneNumberFunc = new ManagePhoneNumber(flag);\n\n managePhoneNumberFunc.init();\n };\n\n /**\n * Sms Таймер\n * @see module:setTimerSms\n */\n self.initStartTimerSms = function(target, time) {\n const StartTimerSms = require('./forms/_startTimerSms');\n const startTimerSmsFunc = new StartTimerSms(target, time);\n\n startTimerSmsFunc.init();\n };\n\n /**\n * Прогрессбар заполнения полей блока формы (fieldset)\n * @see module:formProgress\n */\n self.initFormProgress = function() {\n const FormProgress = require('./forms/_formProgress');\n const formProgressFunc = new FormProgress();\n\n formProgressFunc.init();\n };\n\n /**\n * Переключить отображение ошибки в поле формы\n * @param {Node} target - jQuery-элемент, для которого нужно переключить отображение ошибки валидации\n * @param {Boolean} flag - Показать или скрыть\n * @see module:formGroupErrorManage\n */\n self.initFormGroupToggleError = function(target, flag) {\n const FormGroupErrorManage = require('./forms/helpers/_formGroupErrorManage');\n const formGroupToggleErrorFunc = new FormGroupErrorManage(target);\n\n formGroupToggleErrorFunc.toggleError(flag);\n };\n\n /**\n * Отобразить ошибку в поле формы\n * @param {Node} target - jQuery-элемент, для которого нужно вывести ошибку валидации\n * @param {String} text - Текст ошибки\n * @see module:formGroupErrorManage\n */\n self.initFormGroupShowError = function(target, text) {\n const FormGroupErrorManage = require('./forms/helpers/_formGroupErrorManage');\n const formGroupShowErrorFunc = new FormGroupErrorManage(target, text);\n\n formGroupShowErrorFunc.showError();\n };\n\n /**\n * Скрыть ошибку в поле формы\n * @param {Node} target - jQuery-элемент, для которого нужно скрыть ошибку валидации\n * @see module:formGroupErrorManage\n */\n self.initFormGroupHideError = function(target) {\n const FormGroupErrorManage = require('./forms/helpers/_formGroupErrorManage');\n const formGroupHideErrorFunc = new FormGroupErrorManage(target);\n\n formGroupHideErrorFunc.hideError();\n };\n\n /**\n * Изменить текст ошибки\n * @param {Node} target - jQuery-элемент, для которого нужно скрыть ошибку валидации\n * @param {String} text - Текст ошибки\n * @see module:formGroupErrorManage\n */\n self.initFormGroupSetError = function(target, text) {\n const FormGroupErrorManage = require('./forms/helpers/_formGroupErrorManage');\n const formGroupSetErrorFunc = new FormGroupErrorManage(target, text);\n\n formGroupSetErrorFunc.setErrorText(text);\n };\n\n /**\n * Проверка поля на ошибку\n * @param {Node} target - jQuery-элемент, для которого нужно проверить ошибку\n * @see module:formGroupErrorManage\n */\n self.initFormGroupHasError = function(target) {\n const FormGroupErrorManage = require('./forms/helpers/_formGroupErrorManage');\n const formGroupHasErrorFunc = new FormGroupErrorManage(target);\n\n return formGroupHasErrorFunc.hasError();\n };\n\n /**\n * Установить значение в поле ввода\n * @param {Node} target - jQuery-элемент, для которого нужно установить значение\n * @param {String} data - Значение для установки\n * @see module:formGroupSetValue\n */\n self.initFormGroupSetValue = function(target, data) {\n const FormGroupSetValue = require('./forms/helpers/_formGroupSetValue');\n const formGroupSetValueFunc = new FormGroupSetValue(target, data);\n\n formGroupSetValueFunc.init();\n };\n\n /**\n * Очистка поля ввода при ошибке\n * @see module:formGroupClearField\n */\n self.initFormGroupClearField = function() {\n const FormGroupClearField = require('./forms/helpers/_formGroupClearField');\n const formGroupClearFieldFunc = new FormGroupClearField();\n\n formGroupClearFieldFunc.init();\n };\n\n ///**\n // * Менеджмент полей форм\n // * @param {Node} target - jQuery-элемент (форма)\n // * @param {Function} canSubmit - Функция проверки дизабливания кнопки отправки формы\n // * @see module:manageForm\n // */\n //self.initManageForm = function(target, canSubmit) {\n // const ManageForm = require('./forms/helpers/_manageForm');\n // const manageFormFunc = new ManageForm(target);\n //\n // manageFormFunc.init(canSubmit);\n //};\n\n /**\n * Фейковый таймер для маркетинга\n * @param {Object} target - Елемент, в котором будет таймер\n * @param {Number} time - Время для старта фейкового отчета\n * @see module:timerFake\n */\n self.initTimerFake = function(target, time) {\n const TimerFake = require('./_timerFake');\n const timerFakeFunc = new TimerFake(target, time);\n\n timerFakeFunc.init();\n };\n\n /**\n * Тултипы\n * @see module:tooltips\n */\n self.initTooltips = function() {\n const Tooltips = require('./_tooltips');\n const tooltipsFunc = new Tooltips();\n\n tooltipsFunc.init();\n };\n\n /**\n * Прокрутка к элементу\n * @param {Node} target - Элемент, к которому нужно прокрутить страницу\n * @see module:scrollToElement\n */\n self.initScrollToElement = function(target) {\n const ScrollToElement = require('./_scrollToElement');\n const scrollToElementFunc = new ScrollToElement(target);\n\n scrollToElementFunc.init();\n };\n\n /**\n * Settings\n * @see module:settingsPltz\n */\n self.initSettingsPltzEmail = function() {\n const SettingsPltz = require('./settings/_settingsPltz');\n const settingsPltzFunc = new SettingsPltz();\n\n return settingsPltzFunc.emailRegex();\n };\n\n /**\n * Modals\n * @see module:modal\n */\n self.initModal = function() {\n const Modal = require('./_modal');\n const modalFunc = new Modal();\n\n return modalFunc.init();\n };\n\n }", "findMoves() {\n console.log(\"sub class must implement findMoves function\");\n }", "function Mascota(nombre, especie, raza='')//no importa el orden de los datos\n//se pone comillas en la raza para que no te salga undefined por si no lo sabemos\n\n{\n this.nombre = nombre\n this.especie = especie\n this.raza = raza//los parametros de una funcion constructora son parametros y pueden tener valores por defecto\n\n}", "constructor() {\n var prototype = Object.getPrototypeOf(this);\n }", "function Person(){\n Person.prototype.name = 'hx'\n Person.prototype.sayHi = function(){\n console.log(this.name);\n }\n}", "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "function Man() {\r\n}", "function prototypeInheritance() {\n function Workshop(teacher) {\n this.teacher = teacher\n }\n \n Workshop.prototype.ask = function ask(question) {\n console.log(this.teacher, question)\n }\n \n function AnotherWorkshop(teacher) {\n Workshop.call(this, teacher)\n }\n \n AnotherWorkshop.prototype = Object.create(Workshop.prototype)\n \n AnotherWorkshop.prototype.speakUp = function(msg) {\n this.ask(msg.toUpperCase())\n }\n \n const JSRecentParts = new AnotherWorkshop('Bruno')\n JSRecentParts.speakUp('is this inherirance?')\n}", "function ExtraMethods() {}", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "function Class(){}", "function Class(){}", "function Class(){}", "function $t(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}", "function example3 () {\n function Animal(name) {\n this.name = name;\n this.speed = 0;\n }\n\n Animal.prototype.run = function(speed) {\n this.speed += speed;\n console.log( this.name + ' бежит, скорость ' + this.speed );\n };\n\n function Rabbit(name) {\n this.name = name;\n this.speed = 0;\n }\n\n Rabbit.prototype = Object.create(Animal.prototype)\n Rabbit.prototype.constructor = Rabbit\n\n Rabbit.prototype.jump = function() {\n this.speed++;\n console.log( this.name + ' прыгает' );\n };\n\n //total overriding\n Rabbit.prototype.run = function () {\n this.speed++\n this.jump()\n }\n\n // extend parent method\n Rabbit.prototype.run = function() {\n Animal.prototype.run.apply(this, arguments) // don't forget about proper context\n this.jump()\n };\n\n var rabbit = new Rabbit('Кроль');\n}", "function carregaOpcoesUnidadeSuporte(){\n\tcarregaTipoGerencia();\t\n\tcarregaTecnicos();\n\tcarregaUnidadesSolicitantes();\t\n\tcarregaEdicaoTipos();//no arquivo tipoSubtipo.js\n\tcarregaComboTipo();//no arquivo tipoSubtipo.js\n}", "function Oo(){}", "function PenguinClass() {}", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "function CoD() {\n this.titulo = 'Call of Dutty';\n this.genero = 'FPS';\n\n /* this.jugar = function() {\n console.log(`Estoy jugando a ${this.titulo}`)\n } */\n}", "function Service() {\n}", "function runclassesAndThis() {\n console.log(\"\\n--->> runclassesAndThis\");\n console.log(\"What is this?\");\n (0, _classesAndThis.whatIsThis)(1);\n (0, _classesAndThis.testObjectCreate)();\n console.log(\"Create an animal where methods are set in the animal function body\");\n var leo1 = (0, _classesAndThis.Animal_V1)(\"Leo the Lion\", 100);\n console.log(\"leo v1:\", leo1);\n console.log(\"leo.eat(5) v1:\");\n leo1.eat(5);\n console.log(\"Create an animal where methods are picked up using Object.create()\");\n var leo2 = (0, _classesAndThis.Animal_V2)(\"Leo the Lion\", 100);\n console.log(\"leo v2:\", leo2);\n console.log(\"leo.eat(5) v2:\");\n leo2.eat(5); // Create an Animal with methods in the function's prototype object.\n\n console.log(\"Animal created with methods in the function's prototype object\");\n console.log(\"Remeber that every function automatically has a prototype object contained within it.\");\n var leo3 = (0, _classesAndThis.Animal_V3)(\"Leo V3\", 300);\n console.log(\"leo3:\", leo3);\n console.log(\"leo3.eat(5). Note: Animal_V3 has a eat method in its prototype.\");\n console.log(\"Since it was created using Object.create(Animal_V3.prototype) the eat() method will get picked up in the prototype.\");\n leo3.eat(5);\n console.log(\"Animal_V3.prototype:\", _classesAndThis.Animal_V3.prototype); // Create animals by calling the function using new.\n // new will call Object.create() automatically creating the \"this\" object which will\n // delegate to the object's prototype.\n\n console.log(\"Create Animals calling Animal function using new.\");\n console.log(\"Calling with new will invoke Object.create() automatically creating the \\\"this\\\" object.\");\n var leoNew = new _classesAndThis.AnimalWithNew(\"New Leo\", 1000); // Put \"new\" in front of function invocation.\n\n console.log(\"leoNew:\", leoNew);\n console.log(\"leoNew.eat(6)\");\n leoNew.eat(6); // Note how this iterates over the prototype chain showing all of the functions\n // associated with the prototype.\n\n for (var key in leoNew) {\n console.log(\"Key: \".concat(key, \". Value: \").concat(leoNew[key]));\n } // We will now use the class keyword to reproduce what was done above using a modern technique.\n\n\n console.log(\"We will now use the class keyword to reproduce what was done above using a modern technique.\");\n var leoObj = new _classesAndThis.AnimalAsClass(\"Leo with Class\", 2000);\n console.log(\"leoObj:\", leoObj);\n console.log(\"leoObj.eat(7):\");\n leoObj.eat(7); // When using a class the functions in the prototype are displayed when using for in.\n\n for (var _key in leoObj) {\n console.log(\"Key: \".concat(_key, \". Value: \").concat(leoObj[_key]));\n }\n\n console.log(\"anAry prototype:\", Object.getPrototypeOf(leoObj));\n\n try {\n (0, _classesAndThis.leaveOutNew)();\n } catch (err) {\n console.log(\"Got an error because we called a class as a function without using new.\\n\", err);\n }\n}", "function constroiEventos(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "constructor(nombre,urgencia){\n this.nombre = nombre //Se agrega this. para saber a que instancia pertenece\n this.urgencia = urgencia\n }", "function FunHuman() { // is will be called with NEW use capital letter\n this.name = 'Pesho';\n this.address = 'Mladost';\n this.walk = function() {};\n}", "efficacitePompes(){\n\n }", "function Persona(nombre){\n const id = 5; //variable privada\n\n this.nombre = nombre; //propiedad pública\n this.tieneDni = true; //propiedad pública\n\n this.presentar = function(){ //método público\n return \"Hola, mi nombre es \" + this.nombre\n }\n}", "function Fruta(nombre){\n//para poner cosas\n\n this.setNombre = function(valor){\n\n nombre=valor;\n };\n this.getNombre = function(){\n return nombre;\n };\n\n\n\n\n\n}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function MyClass() { // Funzione Costruttore\n\n var privateVariable = \"privateVariable\"; // variabile privata\n\n this.publicVariable = \"publicVariable\"; // variabile pubblica\n\n function privateMethod() {\n return \"privateMethod\";\n }\n\n this.privilegedMethod = function () { // metodo pubblico\n // i metodi pubblici possono ovviamente accedere a variabili e metodi\n // privati del costruttore poichè questi \"vivono\" nello scope\n // della funzione costruttore e quindi sono visibili ed accessibili\n // a questo livello\n console.log(privateVariable);\n console.log(privateMethod());\n };\n}", "function Persona() {\n\n //public porpierties\n this.nombre;\n this.edad;\n\n}", "function PratoDoDiaComponent() {\n }", "function e (e, t) { if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\") }", "initCustomFunctions() {/*To be overridden in sub class as needed*/}" ]
[ "0.6886069", "0.656885", "0.6207858", "0.6134792", "0.60250014", "0.59856355", "0.5966292", "0.59559214", "0.5944942", "0.5885831", "0.5835889", "0.5823579", "0.58022684", "0.57965916", "0.57548565", "0.568458", "0.5676391", "0.5675715", "0.5675182", "0.5656196", "0.5653499", "0.56330365", "0.5625165", "0.56244147", "0.56122667", "0.5597139", "0.55778116", "0.55734855", "0.55734855", "0.55675536", "0.5556391", "0.5540134", "0.55396956", "0.55263346", "0.55263346", "0.55263346", "0.55263346", "0.5516496", "0.5515539", "0.550251", "0.54879165", "0.548026", "0.54750764", "0.547107", "0.54490674", "0.54490674", "0.5435218", "0.5424838", "0.5424838", "0.5424684", "0.5413644", "0.5397703", "0.5393877", "0.5390398", "0.5387676", "0.5387627", "0.5379318", "0.537361", "0.53662837", "0.5366145", "0.53590274", "0.53567845", "0.5352535", "0.53519756", "0.5320721", "0.531764", "0.53152984", "0.53119457", "0.5311386", "0.5307604", "0.53034204", "0.5298598", "0.5298598", "0.5298598", "0.5295085", "0.52923423", "0.52913815", "0.529063", "0.52858907", "0.5283773", "0.5283773", "0.52707213", "0.5267485", "0.52521783", "0.52493536", "0.5248202", "0.5248202", "0.5248202", "0.52481157", "0.52255934", "0.5225587", "0.52218586", "0.5220842", "0.5220044", "0.5220044", "0.52186984", "0.521548", "0.52120674", "0.52066237", "0.5203914" ]
0.59836775
6
This file is automatically included by javascript_include_tag :defaults
function initCategories() { jQuery('.city h3').toggle( function() { jQuery(this).next("ul").show('fast'); jQuery(this).addClass('on'); return false; }, function() { jQuery(this).next("ul").hide('fast'); jQuery(this).removeClass('on'); return false; } ); jQuery('.city h3').hover( function() { jQuery(this).parent().addClass("js-hover"); return false; }, function(argument) { jQuery(this).parent().removeClass("js-hover"); return false; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsOnLoad(){\n\n}", "function setJs() {\n\t\t\tvar body = document.getElementsByTagName(\"body\")[0];\n\t\t\taddClass(body,'js');\n\t\t}", "function PaginaInicial_elementsExtraJS() {\n // screen (PaginaInicial) extra code\n\n }", "function Introducao_elementsExtraJS() {\n // screen (Introducao) extra code\n\n }", "function BaixarOrdemInternet_elementsExtraJS() {\n // screen (BaixarOrdemInternet) extra code\n\n }", "function ExternalScripts() {\r\n BaseObject.apply(this,arguments);\r\n }", "function TELUGU_elementsExtraJS() {\n // screen (TELUGU) extra code\n }", "function IntroducaoPros_elementsExtraJS() {\n // screen (IntroducaoPros) extra code\n\n }", "function attachJavaScriptFileInitial(fileURL) {\n\tif(minifiedJS) fileURL = fileURL.replace(\".js\", \".min.js\");\n\tif(cachingOnOff){\n\t\tfileURL = fileURL+\"?v=\"+appVersion;\n\t}\n\t$.cachedScript(\"javascripts/\"+ minifiedDir + fileURL).done(function(script, textStatus) { });\n}", "function IntroducaoContra_elementsExtraJS() {\n // screen (IntroducaoContra) extra code\n\n }", "function BaixarOrdemTV_elementsExtraJS() {\n // screen (BaixarOrdemTV) extra code\n\n }", "function includeJS(incFile)\n{\n document.write('<script type=\"text/javascript\" src=\"' + incFile+ '\"></scr' + 'ipt>');\n}", "function include(fileName)\n{ \n\t// On insere une balise script avec le nom du fichier a inclure.\n\tdocument.write(\"<script type='text/javascript' src='\"+fileName+\"'></script>\");\n}", "function Screen4_elementsExtraJS() {\n // screen (Screen4) extra code\n\n }", "function mxinclude(src)\n{\n var g = document.createElement('script'); g.type = 'text/javascript'; g.async = true; g.src = src;\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(g, s);\n}", "function IncludeJavaScript(jsFile)\n{\n document.write('<script type=\"text/javascript\" src=\"'+ jsFile + '\"></script>');\n}", "function JavascriptWriter() {\n}", "function prePluginInit() {\n // Default options for the plug-in \n // Those can be pre defined or overridden in any of the following:\n // query string parameters in the script reference\n // hash tag parameters in the browser URL box\n // as the options parameter in the plug-in construction call\n // as meta tags in the enhanced element\n window.MI_defaults = {\n optimizeNames: true,\n useLinkTarget: false,\n useLinkTitle: false,\n mi_style: 'default',\n abtest: 'false',\n debug: 'false',\n tabs: ['mentions', 'photos', 'stats'],\n frameElements: ['statsPreview', 'mediaPreview', 'tags', 'shareLinks'],\n ex: [],\n includedSourceIds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103],\n widgetTextPosition: 'bottom',\n hidden: 'false',\n xOffset: 0,\n yOffset: 0,\n gaugeOrientation: 'left',\n vertical: 'all',\n inqa: false,\n RTL: false,\n lang: \"EN\",\n displayText: false,\n layout: 'inlinepanel',\n columnscount:2,\n allowExternalLinks: 'true',\n displayExternalLinksInline: 'true',\n collapseLines: 'true',\n displayShowMore: 'true',\n loadWhenInvisible: 'false',\n hover: false,\n doClientSide: false,\n template: 'RASTA',\n tabsType: \"TABS\",\n starsType: \"SMALL\",\n animationStyle: \"DEFAULT\",\n logo: \"//d34p6saz4aff9q.cloudfront.net/images/feelterfooter.png\",\n buttonType: \"DEFAULT\",\n lightbox: true\n\n };\n window.tempDictionary = window.tempDictionary ? window.tempDictionary : {\n socialItem: function(data, baseid) {\n var click = data.click;\n var si = data.modsi ? data.modsi : window.tempDictionary[window.MI_defaults.template].socialItem.normalItem.replace(\"@@@metaicon\", data.metaicon).replace(\"@@@cond\", (data.sourceURL == '' || window.MI_defaults.allowExternalLinks == 'false' ? 'style=\"cursor:default;direction:ltr!important;\"' : ' style=\"direction:ltr!important;\" onclick=\"' + click + '\"'))\n var item = window.tempDictionary[window.MI_defaults.template].socialItem.nonTimelineItem.replace(/@@@itemImageURL/g, data.itemImageURL);\n si = si.replace(\"@@@item\", item)\n\n si = si.replace(/@@@itemImageURL/g, data.itemImageURL)\n si = si.replace(/@@@itempublisher/g, (data.itemPublisher.length > 18 ? data.itemPublisher.substring(0, 17) + '...' : data.itemPublisher))\n si = si.replace(/@@@timeago/g, data.timeAgo)\n si = si.replace(/@@@itemDate/g, data.itemDate)\n si = si.replace(/@@@sourceURL/g, data.sourceURL != 'undefined' ? \"\" : data.sourceURL.replace('http://www.youtube.com/', ''))\n si = si.replace(/@@@sourceAvatar/g, item).replace(/@@@itemtext/g, data.moditemText)\n si = si.replace(/@@@itemWidth/g, (typeof data.itemTimeLine != 'undefined' ? '250' : '275') + 'px')\n si = si.replace(/@@@sourceSite/g, (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim())\n if (data.regarding) si = si.replace('</th>', '<span style=\"position: inherit;margin-right: 3px;color: #ccc;\">On</span>' + data.regarding.capitalize() + '</th>');\n if (window.MI_defaults.lang != 'EN')\n si += '<div class=\"mi_translate\" onclick=\"window.MI_logUsage(\\'translate_clicked\\',\\'' + baseid + '\\',\\'' + window.MI_defaults.lang + '\\');jQuery.MidasInsight.translate(\\'' + data.ksid + '\\');event.stopPropagation();\" style=\"color: #49b7e6;font-size:12px;height:24px;float:left;\">' + window.langDictionary[window.MI_defaults.lang].translate + '</div>';\n if (data.itemContentImageURL && data.itemContentImageURL.indexOf('/') == -1) data.itemContentImageURL = '';\n if (data.itemContentImageURL && data.itemContentImageURL.indexOf('//') < 0) data.itemContentImageURL = '//' + data.itemContentImageURL;\n if (data.itemContentImageURL && data.itemContentImageURL.indexOf('.') > -1) {\n if (!jQuery.MidasInsight.ObjDictionary[baseid].gallery) jQuery.MidasInsight.ObjDictionary[baseid].gallery = [{\n href: '//d34p6saz4aff9q.cloudfront.net/img/feelter.png'\n }];\n //jQuery.MidasInsight.ObjDictionary[baseid].gallery.push({ href: data.itemContentImageURL, title: data.itemPublisher })\n //data.galleryindex = jQuery.MidasInsight.ObjDictionary[baseid].gallery.length - 1;\n //if (window.MI_defaults.lightbox == true && !(data.source.indexOf(\"facebook\") > -1)) {\n si += window.tempDictionary[window.MI_defaults.template].socialItem.lightboxContentImage.replace(/@@@itemcontentimage/g, data.itemContentImageURL).replace(/@@@ksid/g, data.ksid).replace(/@@@kfid/g, baseid);\n\n //} else {\n // si += window.tempDictionary[window.MI_defaults.template].socialItem.itemContentImage.replace(\"@@@itemcontentimage\", data.itemContentImageURL);\n\n //}\n }\n si += '</td></tr></table>'\n si += '</div>';\n si = si.replace(/@@@click/g, '');\n\n data.modsi = si;\n },\n socialItemneweggItem: function(data, baseid) {\n data.moditemText = data.moditemText.replace(/Pros:/g, '<span style=\"font-weight:bold\">Pros:</span>').replace(/Cons:/g, '<span style=\"font-weight:bold\">Cons:</span>').replace(/Other Thoughts:/g, '<span style=\"font-weight:bold\">Other Thoughts:</span>')\n window.tempDictionary.socialItem(data, baseid);\n },\n socialItemShowInPhotosTab: function(data, baseid) {\n data.click = ' ';\n window.tempDictionary.socialItem(data, baseid);\n },\n socialItemflickrItem: function(data, baseid) {\n window.tempDictionary.socialItemShowInPhotosTab(data, baseid);\n },\n socialIteminstagramItem: function(data, baseid) {\n data.click = ' ';\n data.modsi = window.tempDictionary[window.MI_defaults.template].socialItem.instagramItem.replace(\"@@@metaicon\", data.metaicon).replace(\"@@@cond\", (data.sourceURL == '' || window.MI_defaults.allowExternalLinks == 'false' ? 'style=\"cursor:default;direction:ltr!important;\"' : ' style=\"direction:ltr!important;\" onclick=\"' + data.click + '\"'))\n window.tempDictionary.socialItem(data, baseid);\n },\n socialItempinterestItem: function(data, baseid) {\n window.tempDictionary.socialItemShowInPhotosTab(data, baseid);\n },\n socialItemyoutubeItem: function(data, baseid) {\n //if (!jQuery.MidasInsight.ObjDictionary[baseid].gallery) jQuery.MidasInsight.ObjDictionary[baseid].gallery = [];\n var vurl = data.sourceURL.replace('http://www.youtube.com/', '//www.youtube.com/watch?v=');\n jQuery.MidasInsight.AddtoGallery(baseid, {\n href: vurl,\n title: data.itemPublisher\n });\n //jQuery.MidasInsight.ObjDictionary[baseid].gallery.push({ href: data.sourceURL.replace('http://www.youtube.com/', '//www.youtube.com/watch?v='), title: data.itemPublisher })\n var click = \"window.MI_logUsage('play_video','\" + baseid + \"','youtube'); jQuery.MidasInsight.ShowLightBoxURL('\" + vurl + \"','\" + baseid + \"')\";\n var item = window.tempDictionary[window.MI_defaults.template].socialItem.nonTimelineItem;\n item = item.replace(/@@@itemImageURL/g, data.itemImageURL)\n var si = window.tempDictionary[window.MI_defaults.template].socialItem.lightboxYoutubeItem\n .replace(/@@@youtubeid/g, data.sourceURL.split('/')[data.sourceURL.split('/').length - 1]);\n data.modsi = si.replace(/@@@itemDate/g, data.itemDate)\n .replace(/@@@click/g, click)\n .replace(/@@@itemImageURL/g, data.itemImageURL)\n .replace(/@@@itemPublisher/g, (data.itemPublisher.length > 18 ? data.itemPublisher.substring(0, 17) + '...' : data.itemPublisher))\n .replace(/@@@ksid/g, data.ksid)\n .replace(/@@@timeAgo/g, data.timeAgo)\n .replace(/@@@sourceURL/g, data.sourceURL.replace('http://www.youtube.com/', ''))\n .replace(/@@@sourceAvatar/g, item)\n .replace(/@@@itemText/g, data.moditemText)\n .replace(/@@@itemWidth/g, (typeof data.itemTimeLine != 'undefined' ? '250' : '275') + 'px')\n .replace(/@@@sourceSite/g, (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim())\n },\n socialItemvimeoItem: function(data, baseid) {\n //debugger;\n //if (!jQuery.MidasInsight.ObjDictionary[baseid].gallery) jQuery.MidasInsight.ObjDictionary[baseid].gallery = [];\n var vurl = data.sourceURL;\n jQuery.MidasInsight.AddtoGallery(baseid, {\n href: vurl,\n title: data.itemPublisher\n });\n\n //jQuery.MidasInsight.ObjDictionary[baseid].gallery.push({\n // href: data.sourceURL//.replace('vimeo.com/', 'player.vimeo.com/video/')\n // , title: data.itemPublisher\n //})\n var click = \"window.MI_logUsage('play_video','\" + baseid + \"','vimeo'); jQuery.MidasInsight.ShowLightBoxURL('\" + vurl + \"','\" + baseid + \"')\";\n var item = window.tempDictionary[window.MI_defaults.template].socialItem.nonTimelineItem;\n item = item.replace(/@@@itemImageURL/g, data.itemImageURL)\n var si = window.tempDictionary[window.MI_defaults.template].socialItem.lightboxVimeoItem;\n data.modsi = si.replace(/@@@itemDate/g, data.itemDate)\n .replace(/@@@click/g, click)\n .replace(/@@@itemImageURL/g, data.itemImageURL)\n .replace(/@@@itemPublisher/g, (data.itemPublisher.length > 18 ? data.itemPublisher.substring(0, 17) + '...' : data.itemPublisher))\n .replace(/@@@ksid/g, data.ksid)\n .replace(/@@@timeAgo/g, data.timeAgo)\n .replace(/@@@sourceURL/g, data.sourceURL.replace('vimeo.com/', 'player.vimeo.com/video/'))\n .replace(/@@@sourceAvatar/g, item)\n .replace(/@@@itemContentImageURL/g, data.itemContentImageURL)\n .replace(/@@@itemText/g, data.moditemText)\n .replace(/@@@itemWidth/g, (typeof data.itemTimeLine != 'undefined' ? '250' : '275') + 'px')\n .replace(/@@@sourceSite/g, (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim())\n\n },\n DEFAULT: {\n panelLayout: {\n header: [\"tabs\"],\n content: [\"stars\", \"photos\", \"tags\", \"mentions\"],\n footer: [\"share\"]\n },\n panel: {\n videoholder: '<div id=\"mi_videoholder_@@@baseid\" class=\"mi_singlevideocontainer mi_closeTopLeft\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@baseid\\',false)\"><div class=\"mi_singlevideo\"></div></div>',\n containerHtml: '<div style=\"padding:5px;\" class=\"mi_panelBackground mikfpanel\" id=\"cpcnt_@@@kfid\" style=\"direction: ltr;@@@layout\"></div>',\n tabs: '<tr><td><div class=\"MI_tabs@@@orientation\" style=\"margin-left:-3px!important;display:inline-block;width:100%;padding-top:10px;\">@@@tabs</div></td></tr>',\n gauge: '<div class=\"mi_gradeselectgradbg\"></div><div class=\"mi_gradeselectmasknerrow' + (window.MI_defaults.RTL == 'true' ? ' mi_gradeselectmasknerrow_right' : '') + '\"></div><div class=\"mi_gradeselecthandlenerrow\"></div><div class=\"mi_gradeselectdigitsnerrow\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"direction:ltr!important;\"' : 'style=\"direction:ltr;\"') + '><span style=\"font-size: 48px;z-index: 3;color: #92c83e;font-family: \\'Source Sans Pro\\', Alef!important;\"></span><span class=\"mi_gradeselectdigitsnerrow_after\">/ 100</span></div><div class=\"mi_gradeselecttext\"></div>',\n tag: '<span onclick=\"jQuery.MidasInsight.tagClicked(\\'@@@kfid\\',\\'@@@atags\\')\" class=\\'mi_tag_@@@atagsreplace mi_tag\\'>@@@atagscap <span style=\"display:;color:@@@color;-webkit-font-smoothing: antialiased;padding: 0;margin-bottom: 0;margin-left: 0;margin-top: 3px;text-shadow: @@@color 0 0 0.3px,1px 1px 1px white;background-color: transparent;line-height: 10px;nobox-shadow:inset 1px 1px 2px -1px lightslategray;padding: 0px 2px 1px 3px;border-radius: 50%;left: 4px;position: relative;\">&#9733;</span></span>',\n slidercontainer: '<div id=\"mi_previewPhotosContainer_@@@kfid\" style=\"max-width: 465px;cursor:default;-moz-user-select:none;-webkit-user-select:none; -ms-user-select:none; user-select:none;\" unselectable=\"on\" onselectstart=\"return false;\"><table class=\"mi_previewPhotosContainer\" style=\"\" cellspacing=\"0\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false)\"><tr>',\n photopreview: '<tr ><td id=\"mi_photopreview_@@@kfid\" colspan=\"2\" style=\"width:100%;overflow:hidden;background-color:white;padding:5px 0 !important;border-bottom: 1px solid #DBDBDB !important;\"><div class=\"mi_thumbscontainer\">',\n tabswrapper: {\n header: '<div style=\"width: 152px;margin: 0 auto;background: #fefefe; /* Old browsers */background: -moz-linear-gradient(top, #fefefe 0%, #eeeeee 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* IE10+ */background: linear-gradient(to bottom, #fefefe 0%,#eeeeee 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#fefefe\\', endColorstr=\\'#eeeeee\\',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 15px;-moz-border-radius: 15px;border-radius: 15px;border: 1px solid #cbcbcb;padding: 5px;\">',\n footer: '</div>'\n },\n starspanel: {\n header: '<tr><td><div class=\"mi_hover_starspanel\" style=\"border-bottom: 1px solid #dfdfdf !important;padding-bottom:5px;width:100%;overflow:hidden;border-top:1px solid #dfdfdf;padding-top:5px;background: #f7f7f7; /* Old browsers */background: -moz-linear-gradient(top, #f7f7f7 0%, #ffffff 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* IE10+ */background: linear-gradient(to bottom, #f7f7f7 0%,#ffffff 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#f7f7f7\\', endColorstr=\\'#ffffff\\',GradientType=0 ); /* IE6-9 */width: 396px;left: 0px;position: relative;\"><table style=\"position:relative\">',\n footer: '</tr></table></div></td></tr>'\n },\n footer: {\n header: '<div class=\"mi_footerwrapper\"><div class=\"mi_footerroot mi_footerroot_@@@kfid\" style=\"background-image: url(//d34p6saz4aff9q.cloudfront.net/images/footer/feelterfooternew.png);background-position: -120px 0px;background-repeat: no-repeat;\"><div class=\"mi_footercontainer\" id=\"mi_footercontainer_@@@kfid\" style=\"height:100%;position:static;\">' +\n '<div class=\"mi_footer\" style=\"height:auto;\"><div onclick=\"jQuery(\\'#cpcnt_@@@kfid\\').find(\\'.MI_tab_selected\\').removeClass(\\'MI_tab_selected\\');jQuery(\\'#mipct_scroll_@@@kfid\\').addClass(\\'mi_blured\\');jQuery(\\'#mipct_tblabout_@@@kfid\\').css(\\'max-height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'top\\',jQuery(\\'#mipct_scroll_@@@kfid\\').position().top).fadeIn();\" style=\"z-index: 1;position: absolute;right: 0px;top: 5px;height: 25px;width:57px;background-size: contain;cursor: pointer;background-image: url(\\'@@@logo\\');background-repeat: no-repeat;\"></div></div>',\n share: '<div style=\"width: 100%;float:left;\"><div class=\"mi_footer_prompt\" style=\"margin-bottom:0;\">@@@ask</div>' +\n '<ul class=\"mi_share-buttons\"><li><a onclick=\"window.MI_logUsage(\\'mail\\');\" href=\"mailto:?subject={1}&body={2}: {0}\" target=\"_blank\" title=\"Email\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Email.png\" style=\"opacity:0;\" style=\"opacity:0\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://www.facebook.com/sharer/sharer.php?u={0}\" target=\"_blank\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Facebook.png\" style=\"opacity:0;\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://twitter.com/intent/tweet?source={0}&text={1}: {0}\" target=\"_blank\" title=\"Tweet\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Twitter.png\" style=\"opacity:0\"></a></li><li style=\"display:none;\"><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"http://pinterest.com/pin/create/button/?url={0}&description={2}\" target=\"_blank\" title=\"Pin it\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Pinterest.png\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://plus.google.com/share?url={0}\" target=\"_blank\" title=\"Share on Google+\"><img onload=\"this.style.opacity=1;this.style.top=0;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Googleplus.png\" style=\"opacity:0;\"></a></li></ul></div>',\n callForActions: '<div id=\"cfa\" style=\"white-space:nowrap;padding-left:0;display:inline-block;\"><div onclick=\"alert(\\'call to add to favorites\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;MARGIN-LEFT:0;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px silver;vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: grey;\">Add to favorites</div><div onclick=\"alert(\\'call to book\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px rgb(3, 179, 12);vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: white;margin-left: 1px;background-color: rgb(161, 218, 101);\">BOOK</div></div>'\n },\n header: {\n header: '<table align=\"left\" class=\"mi_reset mi_greenredtitle\">' +\n '<div class=\"mi_green_close @@@orientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\" style=\"z-index:3;\"></div>' +\n '<tr><td class=\"mi_header_caption@@@gaugeOrientation>' +\n '<div class=\"mi_drag_area\" style=\"position: absolute;width: 100%;height: 60px;left:0;z-index: 2\"></div>' +\n '<div class=\"mi_gradselectroot @@@gaugeOrientation\" id=\"mi_gradselectroot_@@@kfid\" data-score=\"@@@grade\" style=\"z-idex:1;\"><div class=\"mi_gradeselect\" id=\"mi_gradeselect_@@@kfid\"></div></div>' +\n '<div class=\"mi_title\" style=\"@@@titleOrientation\">@@@displayText</div>' +\n '<div style=\"@@@optionsrtl\" class=\"mi_subtitle\">@@@count</div></td></tr>'\n /*if (count > 4) {\n p += '<div style=\"' + (options.RTL == 'true' ? '' : '') + '\" class=\"mi_subtitle ' + (options.RTL == 'true' ? 'mi_subtitle_rtl' : '') + '\">' + window.langDictionary[window.MI_defaults.lang].basedon.replace('%d', count);\n p += '</div>';\n */\n // tools tabs\n +\n '<div style=\"clear:both;height:0px;margin-bottom:0px;border-top:0px solid #DBDBDB!important;\"></div>',\n footer: '</table>'\n }\n\n ,\n closebutton: '<div class=\"mi_green_close@@@gaugeOrientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\"></div>'\n }\n\n ,\n scrollables: {\n header: '<div style=\"clear:both;height: px;margin-bottom:0px;border-top:1px solid #DBDBDB\"></div><div id=\"mipct_scroll_@@@kfid\" tabindex=\"-1\" style=\"heightdummy:0;outline:none;\" class=\"mi_scroll\">' +\n '<table align=\"left\" id=\"mipct_tbldefault_@@@kfid\" class=\"mi_results mi_scrolledcontent\">',\n footer: '</table></div>'\n },\n socialItem: {\n timelineItem: '<div class=\"mi_timeline\">@@@fullYear<br/>@@@month<br/>@@@date</div>',\n nonTimelineItem: '<img onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'avatar\\',this)\" src=\"@@@itemImageURL\" valign=\"top\" class=\"mi_resultimage\"/>',\n youtubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div>' +\n '</td></tr></table></div>',\n lightboxYoutubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery.MidasInsight.StopYoutubeVideo(jQuery(\\'#mi_image_lightbox_@@@ksid iframe\\')[0]);jQuery(this).fadeOut();\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/@@@youtubeid?enablejsapi=1\" frameborder=\"0\" allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n lightboxVimeoItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'data-src\\'));\"><img src=\"@@@itemContentImageURL\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" nonclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',\\'\\');jQuery(this).fadeOut();\"><iframe id=\"mi_iframe_lightbox_@@@ksid\" data-src=\"@@@sourceURL?autoplay=1&title=0&byline=0&portrait=0\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n normalItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeago' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">@@@itemtext</div>',\n instagramItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeago' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\">'\n\n ,\n itemContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><img onload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"/></div>',\n lightboxContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(this).fadeOut();\"><img src=\"@@@itemcontentimage\" style=\"box-shadow: 0px 0 10px 4px #eee;border-radius: 5px;\" onload=\"jQuery(this).css(\\'position\\', \\'relative\\').css(\\'top\\',\\'50%\\').css(\\'margin-top\\',((this.height/2)*-1)+ \\'px\\').css(\\'top\\',\\'50%\\',\\'!important\\');\"/></div></div>'\n\n }\n },\n MODERN: {\n panelLayout: {\n header: [\"tabs\", \"stars\"],\n content: [\"tags\", \"mentions\"],\n footer: [\"photos\", \"callForActions\", \"share\"]\n },\n panel: {\n videoholder: '<div id=\"mi_videoholder_@@@baseid\" class=\"mi_singlevideocontainer mi_closeTopLeft\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@baseid\\',false)\" style=\"margin-top: 74px;background-position: 10px 18px;\"><div class=\"mi_singlevideo\"></div></div>',\n containerHtml: '<div style=\"padding:5px;margin-top:25px;border: 1px solid #ccc !important;\" class=\"mi_panelBackground mikfpanel\" id=\"cpcnt_@@@kfid\" style=\"direction: ltr;margin-top: 20px;@@@layout\"></div>',\n tabs: '<tr><td><div class=\"MI_tabs@@@orientation\" style=\"margin-left:-10px !important;position:relative;z-index:30;box-shadow:none;left:0px;padding-top: 0 !important;\">@@@tabs</div></td></tr>',\n gauge: '<div class=\"mi_gradeselectgradbg\"></div><div class=\"mi_gradeselectmasknerrow' + (window.MI_defaults.RTL == 'true' ? ' mi_gradeselectmasknerrow_right' : '') + '\" style=\"background-image:url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAABQCAYAAADFuSFAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA25pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyODYzNTRkZS04NWY4LTg3NDEtYjNmOS02OGU4NGQzZjVjODkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTM0QjUyMzEwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTM0QjUyMzAwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RDVFOTA3RTFFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RDVFOTA3RTJFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5NfkuaAAAX1klEQVR42uxdCZQdVZm+99by9u7Xr1+n926ykOASgQODS5gJijIGJQxbOM4IIosKKgoHZw7icubMAcHjuI3jCHJkNI4LGcEIKuoIozKj4uAIkTBEliyd3ve313bn++tVvby8vNd53R00CXVPbqrqVdWtW/93v3+5SzWXUrIgHfuJb9u2bUk3UgMIhUIsFosx27aZoigsn8+ztrY21t7ezvbu3csikYj7e7FYdO+JRqNM13U2OzvLUqkUE0Iwx3GYqqruNpPJuFsqo1JBzt3fDMNgiUSCzc/Pu+VS+T09PfT88NDQUE9ra2tnOBweRJn9uGcFbm1HDqOeKo5t7JvIczieQN6POu+ZmZnZj3qMo05Te/bscetNdaE60jvRs6mO1e9M9bAsy30XOucTga4tFAru/ZRzuRwzTdP9vaWlhWWzWfe9qN6opys3kg29G+Xp6Wk2OTnpXr+UpI6NjS3pRno4CZQqSS9NlSchU6KKTkxMuIKnytILUiIhEPhUabqeztG9mqa55UGwFWD9RMKia6iR0D41AgiyG8c9AD4NQZ6M3AehpXC+G2V2IrdhvxW3h5AVnHewtbDNovwZlDeOMkaxP4G6TaKh7YCg96Lek7juOQjZKZVKbv0oVzcoapQEEAHoA0HnKFNDpHehhkCyoPel3+m6ubm5yrtTI6D7/Pvp/ej30dHRSlmLBtKv6KKp7FXQb5W09Y+rz/nZB6U2+/f65/2t39Jpi/KiAHc9Dl+LxnEGGtDa9evXnwChtUE4YtWqVYeUWyMQApNeNATBtSOvIQFS2dTICBwwOguARsGknbjv97j25yjnSVwz4pflM7S6/Ebnaq+r/b1aLtXyWzKQR5OepxfyWyheJo58OgC8CHlDOp0eBIApUkmkCah1L/WlqxNpDa/RxMHSNQB1DcDcDICvx/4E8mOo0w9wzU8IVLr2aPQrjhogCUAiOlrmyVBNmwDehfF4/HQSNIFH6mip2qMZ7UKJ1CJleiYBC/UaB6groSYvhSofg6r8d/z+IPKvAOZsAGQNC4mBSG+Bs/E2qLhzkdvI9r6Y4DWTiPWUyTEDqJ0A9b2w0dfB3v0c7N2GxncvLpt4SQPpMRAEFOdBWO8BcH8Bry5Knp1vK46m5IOaTCY52LkRzslGAHotWPp11PVOvMfMSwpIzwbi3flrYOs+AgA3gYkcAvqTsq/ZRE4JVL6bAegrpqamPgGWXgWG3o53uw8aZua4BbI6FgR4L+vu7r5xxYoVlwNAnQCsDjeOpUSqnzJU7xoAejdAfAfe8xNoqD/8YztEfxQJel4ox0u/H6rzxo6OjkGyOxRvLcO6MgoPORdjUvK845jcKY0rQqhPKuHO79e8m4Nrw6X8c1sY07vVUJetKOT1Ulhi9yE6WZYm9z1pvNufj4+PnwaG3osCbwGYw8cNkB6IrxwcHLwVDNwMEH2vcNFOEXhdcGxzhDvGDqnEfmUWRwt6OHU/UyLTjm0xszDCVTVSBJBmnZqwUu6Ff2Y8qjElJYWgvgKLFwoTl4RCXSkmi+uB9gZVDSepVwgNZNEql94LjTU6OTl5BfKG4eHhj+DUvccskNW9ID09PZfBntwOddpDjgy594sC0LH2AcVfAsAnpZ3dAdB+zsz5WUWNESkPfq7QkBu9EoJxJVSUTC/W0O8rdGxaBTyGeoOstbZtnYufNmpqbD3nSrpxmYcmsvOdnZ1kQ0+Exvl2Npt9NTxesp8TxxSQJBTqi8RLJMDA27q6uq6FPVQWw0KoQUMacy84kv8rVyPf49L+A3AwmYMwRQFTuHIQQLWANQKy0bXl3iNioJjDf7+Buv2NYWbaTDu7FtecpWvJ81U1erLgSnQx6pZ6nMDMG4eGhjZAHu8FmI8fE0CSQAhEbFf29/d/qa+v7xxSpeS2N2PzHLOYl1buF0wJfdopzj4GEGeZBtlJ7p5nJGxkTr0rnLrx8Cy7CFxDXveXiuMsk9Y0MIngWt2Fiq5znAx2TEZYlEEjG2t6dtYr3wO3XJYC75P/2nHsXwPUL0BUvY5T+jtVCV+kqKFWznjT7ASIrx4ZGfk+nL13Qz7bXwxHSBzJwrwO5D8D+7bDJp5DoxPNgCjNgm3O7nnAmn7mIsfIvRnS/jGEPesCV5Gv4gqdOQZz8CO35qGmE0xmfgdtOMtULQyBRZlwplEegLQLLnBkG5lTApmzwAL102z3OinnEOTvxn6CGdYwzhcAjeoBLMvthtQxNRyu5LC/y3Gsq/LF0XPmss99oWTONa0qyaRAHp1g6VZ46e/zG/1RxUjf3pA9ROs7e2BgYCtY2J1Opw8b1Eur5Nj5ifsdI/tVaRs/4lCpZOcOUn0u8+AwWTkmiFGFIfgrvYwZU0yJDjAbIgYNq+pDrFXL7KX7padS3d8Ah/S1B93joDHEWCH7NADtQ1uxXDCFsKBZ5KGKmNNAgPpYsTT1mGUXt9oh82pdS2xRlVBrM6oWskmAnf8EJ6gDzPz4kez4OCKMpPgQLW3L6tWr7zvhhBO6SZ0uWEEaebDMR6A+N8nC9F9DvA9woRvMU3menQSZSoyZc6TmGDemvcrKso2kTNe49pI3o7lrnCO6R/HsI5wkprgXUENQNJ3poTjaAFQyM8sNqUpUAo0C9pLAfHfRmH21ZRa+gvo6zfQOwdyw3t7ej4XD4c9Bg/EjxUx1uWz0QLwAhv1OVLCF+kgXMKKQvTlnZ8a+xLTY33OhFOBKukxh8oCkuevOk3ChCq0S4+F2CNUDrNJAvK1jHkBI2hqTxkrmse1gFG08wkDcaO7HwXxZhVpVZcmDnB+hqC7TbQkVjTpaMgsoFRyzKluqSORnbCnflS+MPBrVU7cgPl29UOhCLCQwIbvrx8bGVNM0byAu/MmA9EGEOj0PLNwKEGMLgkiiLWV/4uQn78DdP60A4gvGMVw2CEV3277U4KyQl0oXEPMqcvYAd8w2bFNchN8CSafxo8n19Clg78lMbQO5wxW20r5gbSwcOUnlPLQLP/436VrO1d+jjEfhxBTBqEle47i5gIKtmhJmJXuCKTzCpGu2HZQnDjhJnNlcinvyxtwvVUX/UDSUuvJwMSfkRbvXjY6OmjBLH1wuMxcNpO+Z0ig5PNM3AcSvoYXFFgovpAlbODf0HRZpoxfMsmq1S4OrYJUbhxt5nFI9Z8PL3ENQWjCWvAdt+gKwYECGUhcAi7BIntbr2j/3bZLYTdZpdQqiFp0pqtvQBpHfpKrUt9tioqzRcGjAFCLyX1Ch3+dc/lC6jK1mc9nxKdnzLKJ1sIjSwTKw1VEnDJDjFfspmf1/2L06W5zcrSmhD4e0RPhwYOJdPwBmGlCzf0type7KpYCqLhZECuipfzQSiZwCdfplBPrJBUG0rXlp5N7nZMa3KvEOvKznhBCAZpEJNY6M8EHRKPwos69aiFJ2oSWczPTkFUzRzxVaf4sbgrBYBaSluge87Fn1h/QeetYqsPIytKp9kssHHdt8yJH2DodZL1RUqVt3h4XQCKbFs+VoiPuW2/G8XE0WzKl/cBzjIU2NfRNe7+qFwCTPHsz+0Nzc3DAA/aw/k+BFB5J0PDzSPlTgqwj0B1tbGztsTnYqB3AuF5GW7QDBY1jZznFyLEyrrD7hBEhybKrjdinTQPgaxJIXAayTeaTjRe5OdG0eWbF+lanXSiV0LcDZZTvF/7ClcTfY+r8H5GC59pI83iJi1rBMMQ1xq+PaXOmGLPBuf1MycpsdWfpOLJw+qSEAYGBXVxeNd96GMGV3JpP5LkUAiwVTXQyNSZ3C84oCvLtSqdSrFgoxnKm9GXP46cuUvvXbK94oriUh8HmEiIUc4wk4MaWcx0JeBtWx07j0vTyUuJgJ/ZWMC/bHT2VQQ2p6LSq31nJyF5aY+JZpTt4Flj7N3GYoXYZKDnupcDZVepZpLM6S6uABx4YrO2fyIxcXrNnvpONr1jV6Gmk5qNkIsLgLIA7T9BLycIk0zeKjNtfrwly76HU7fRQtaBP1WDQC0Z54IWPufOQqnuoFE9UDahKaTOB1ZR7BuRat8hjJmXFiYO3l8GZv5nqs/+gZrEJkKeJdqh7/oCIi1+CHm21p/RsYOu2yD8xUuM7GzKfw4ipri6zCb+qBUEZoT41ln7oUrL6vM/HyVY2eQqMnCNs68vn8lwHeGyYnJ6eImc2O0TYNJIEGAP8KQe0NUKkHzfc8iInT+\\/PWEz++jGvqdq7pHoDCVavcQCihRplNndC+x+\\/21jhnMi18s4ilz3XDkaM0hdV2MsyfN+zMFoD0ebBy2wEbFWaWsNiY8RQL2TEW1XoqHRSqiDwxnH3yPGiX+zvjJ61tVD75HtB6r4Ine8euXbuuBZgmTS1thpUqzcVsZigKAK5G/iLUaYgKr2tDZ8cyxlM/uxye33amhbyQAWqoiHBRg0dJMXNVLwxSC+Loa0S07WbYwXZ2lE3vaJR0JXFmV+y016KFrsqZY3ccUKUaA8hs3hlGaJZnXeFXuA4QkUDl+s6x7NMX495tbZHehmqWzBVYeQUigl/Bft7tTQddvrNDdhH01trb2/+Rut4aOTeymMuZ+56+hkv7u+B52bEhVxr2kKGxiI7eKhbaFJL0iGjyDiXc8nYmjr0ZApqIK2Dk7SEluQle7tthO4fIrgIwt7/sycwDLG/Ns3Z1oNwdyEkNix2zhf2XxtTUfboWWdVI88FsKSDPbTj8z/n5+WebmUGhEp0PZxsB4NUIM95Ko/oN0rSTz7wTCH3PVaOGiZJpC5c8N44mHCrHg9xzaNTQWXB0vswUbQ1T2DGbiG0JvWejI80f4sU+5kh5v3Q7/jRydNg4HKA25QQWVtrgVUbdGFnlkScyxcnLW5WuR1RRf3CWNB5k3QFtSeHIJYZhFA7HSuX888+vrD+ozTRtHi7xIBycrwHIlnoqFXEicyaHbpWZmbulUXSHmCgm5HDNhYiXmQlbyaMJmrSK641zRKrnW6JlRR87ThKYuCKurbikYM3Bi2O/pJhy3hwFgEnWFz4VwLawCCxHRLQzjUdgquSodMQGXaPuPN6wXxasXF0oFKhL8XGSvT/vtl5WG9k7n+ZQpR9B6+imWWN1VWp29kHr+R2fYwQeqYBQsjxmWBmC8vtBHfyTrxeJ9q8zPZJmx1mKa13ihMSGT40Un2QlK/dpv5NACJ1FlRAzHaPSTxxSmGXb1j1gWgmAnVtv8IJkD3upQLXehP2HQKo9C7FS1GMiOTekUsHCNyJf3Uj9ymJ+j5ybfg+PtmR5BA6dhkaBcMON6X0Q3Q5xihPlWTyWuBcgdrDjNIWUBO+NnPpJhek3mk4BMuBljxPWlNo1dRhIZmNrUxD6TdxyHvInFxotgVlbAx/lJlrdRetUGmV1amqqrl3UdT28du3aj5MXVTdEkbJgT4x8WM5N7uehmNcfSr01BXeYqjL6YJZgE/U380Tqq1wLpdlxnjQRVQbjZ3xiqPCELDm5z/gzCfxwzakZ7cLxHWDaXyKf2igkgVa8Gp7sPXA8f9so7BP1VkhRAhO3wFM9s3qt4kEVmBx5SM5NfYOrYYQVzLONpFoR6EcSlczbe/qVvjWf46HoCvYSSWGlVT81dcmnYmrbDaZTFOXBbVZZoeYvxfOC/VnqOHcHExp04SFuD8O0fZSmlDaKKdV6MSPsZhvimOtp4Wddvew4IyjvSpFoc0OMigolF9TvibDhudpOXHQP3ArbuZa9xFJKHxSJ1IpPGoaVgyq9y++rJiBpPm/NsrpfIH8bsr6qXlk0PAhmnlMsFjfRyrBaTNwGUk+tdnV1vRW6+TTqkqvLxpnJzwDMWdg8xkNgJLEPal/OzzA5O8Xk9AQFoIzHWz7ABb+MvUSTJiJqVI/fpKiiq9rDJCD9Rb6UPb/kX4idjZxO4BEFHjQMGPZ/45xXVo6rvs6mH6nQSCQS7u3tvZ4C/3r6WGbnn7NH993LFdIY7lg+o7BDzs0QA2keBEA0mOhbdbbSlr6JvcQTGvKJGteuhJxvqx1JqlaT3lTJh2k5YV2vGFEDmLkZseXpsJWP+iD6S+XFunXrKqtpCUjo481wcE6vy0Z6+MjQN3g+t4cV4cTk8wzBJlgZYUq6iyldfdh2M5HuHlTaO79ItpoFidKtyK+rZVntMa0bYQ2mfdB5mDoN7Hs3LWOnbxLQMnxitvvdgoGBAXeH1q8DUAVq9Tp/7f8hOGbmn7czc3dy6kctj6qSTw0nRy/35HjzMZTewQt5S3JtgN8BECDbO2C2LsXhQutBHgeZvgnZv6PeSSIXzY8C4OtQ5jNULo2akDl040h4qG6fKtIZxMYGI/7Syc1t5fHEftYCorW0gu8tzAErrb0vMGtoN7P3PM/s4X2vYeHoLQF8h4B5JsB8Z3V0UGc6pASQX5Hy4JGFaqcmlUrFoEpp1ZcLrN8PKwzDINSSoG0bTrwdejhWd32GZU5zVf+S6IDqTLYz0Z52mcj1MBOtKSYSADcSZcrAyo9zXW8PoKsLxN8AuJ56H5DwvyCCfVrW/t1GZZAHi+u24JougNkCNiaxn6Rv0NxfKpUUhBscJ05t5Knae3f/j7N/zwTXveEpcoRUjVUGjmFfRTh2ttLde1YAWcP0MsibQPhstdqt+aiFgfPfwnYzOb6HeMLlOVMrcc1DOJz0Q0gOoyl9D4poSjq3TtyYs/e+sFkW8g+7A78EYi6LUGOOSd+WlkphZfWJ25SVq94a4NU4Qc7Pg0WvBXDj1Wq1JtDvA+t+hPMvr1cGmUGaPVAdVVBPwTQxthzNN0iF/ONOJrOJK8qEO1cFLHQnVjvywCRvx3olb2n7KQ+FVgRwLZwAxM3Y3H4YL/YbAPNtTRZpeHMTD9OKiqVHwLgJSZ8iQ7jhwO11xseZMzPNnOlpZo9PkLp9QwBicwmabwvYxGu7RWvYuXUxZR5+ihrNSy3mHnbXJdIDSZVqqmsTWcko52IxBZreEEDUtAc7iLzxICBqvpIFMH8Hn+UPRw5IyfYjJvwZb00yjpBDJFqYNK2ybdQ1F1Qej60X6XRvAFHzXbEAbEOto1PjzY5i+1jTLD/cBc7Y2HPO+BjnIW8eDkIchyvueCPN6ZQIRpV0+wX1PKwgLZjO9oawrKpuumpbKSnoh52UzZi/wzKSp1KPKitX5kRfHxP9A0xGEXYWCmClWc6FfCfU7RuPlRlwR1Gi8cczawP+6gxWfo8i+OUz0jTzcnx8V7VHxamDtrvLa0LSfbqS7ugPcFm0nUwCqBW1Tk71wDOONX8Mc3lAquo+3tGx3VWp7uw4gxk7d5BzU57qCEaKaPQKZUVnS8DHJcWUFyJvpyi8TixJ6WkA/gNsz18ekI5UuR4qL0GiB2k6C53xmvJybn9toOP0cEUJUFlal12nh0GpwSU55NFlq1Z7/76wMzLM3Fnj3iopu5j3VlVhY5i6duK6lOgOHNalJKjRpGVZbWBdboHLos18m0gsrMfZnUxwqzJiZRrMoQFlFCxJtdJXjTl/QwDJktMpAPGURmGIt/8ANvllMVL0Dz6LfODYsplqW+VZAMyd8mhwVTECPJaW6vXq1ElDyPRR+Ohy4siDBiaFqtBX0AMEjjCehzlPc3SUpTOSZoYXS7Kyypi2CD34MfpJzqM4Zet4swcdLm81lg0gZ2dYZaojfeUx1e5NfwzSkUq2bZ+E/HD1XxyonWbTDJCiMSFt5uQzyNlyLuSZzB3SeBx2yDcag7RIz/Vd/jINykv9TEtDetHKKRGJ2O4nxAgtw2Cl3c8wXVOY0urN5HBskwnFCeBYVir5Ix/+4L6/vxiyNNaTqsZEZ0/J7b0Jh5k9jrjUMtw5qw5iSWt+hqmxxEYRTfQF/axLTwCu0qtT7++Y4Li0bI9JWuZ11uhQD7Os8hJyeggApqXkxZ2/Wy8deYu7ejNIS04Aiv7C0MUN/jAMeazvYuUZHMvoENBCrxMtSfq+6GoocxXA6rTFqdPCq9Y9qMRbBgMolp2SAPMe5Pdjn9b1a56mpG/zfAH5ymbCD+79eYPEYS7e6cxM/tYc3hPS+lcZIpHciKbUF2Bw5JLHxl8j7waoDo7fhG2zyxCNZoH0n8YCe3hUpkUCGaQAyCAFQAYpADIAMkgBkEEKgAxSAGQAZABkAGSQAiCDFAAZpADI4xxI+qi593nHIB2jySIg6ftn9B1PEcjj2AXy/wUYACIPOMIobjzuAAAAAElFTkSuQmCC\\');width:100%;background-repeat: no-repeat;background-position: 15px 6px;\"></div><div class=\"mi_gradeselecthandlenerrow\"></div><div class=\"mi_gradeselectdigitsnerrow\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"direction:ltr!important;\"' : 'style=\"direction:ltr; LEFT: -4PX;TOP: 30PX;\"') + '><span style=\"font-size: 43px;z-index: 3;color: #92c83e;font-family: \\'Source Sans Pro\\', Alef!important;\"></span></div><div class=\"mi_gradeselecttext\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"top:77px;direction:rtl;color:#b8b8b8;\"' : 'style=\"top:77px;direction:ltr;color:#b8b8b8;\"') + '></div>',\n starspanel: {\n header: '<tr><td><div class=\"mi_hover_starspanel\" style=\"border-bottom: 1px solid #dfdfdf !important;padding-bottom:5px;width:387px;;overflow:hidden;border-top:1px solid #dfdfdf; padding-top: 20px;margin-top: -17px;background: #f7f7f7; /* Old browsers */background: -moz-linear-gradient(top, #f7f7f7 0%, #ffffff 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* IE10+ */background: linear-gradient(to bottom, #f7f7f7 0%,#ffffff 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#f7f7f7\\', endColorstr=\\'#ffffff\\',GradientType=0 ); /* IE6-9 */width: 396px;left: -5px;position: relative;\"><table style=\"position:relative\">',\n footer: '</tr></table></div></td></tr>'\n },\n tag: '<span onclick=\"jQuery.MidasInsight.tagClicked(\\'@@@kfid\\',\\'@@@atags\\')\" class=\"mi_tag_@@@atagsreplace mi_tag\">@@@atagscap</span>',\n slidercontainer: '<div id=\"mi_previewPhotosContainer_@@@kfid\" style=\"height:65px;cursor:default;-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;\" unselectable=\"on\" onselectstart=\"return false;\"><table class=\"mi_previewPhotosContainer\" style=\"\" cellspacing=\"0\"><tr>',\n photopreview: '<tr ><td id=\"mi_photopreview_@@@kfid\" onclick=\"jQuery(\\'.mi_thumbscontainer\\').hide();jQuery.MidasInsight.resize(\\'@@@kfid\\');jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\" colspan=\"2\" style=\"width: 100%;overflow: hidden;background-color:white;\"><div class=\"mi_thumbscontainer\" style=\"margin:0 auto;overflow:hidden;width:386px;padding-top: 3px;border-top: 1px solid rgba(0,0,0,0.2);\">',\n tabswrapper: {\n header: '<div style=\"width: 152px;margin: 0 auto;background: #fefefe; /* Old browsers */background: -moz-linear-gradient(top, #fefefe 0%, #eeeeee 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* IE10+ */background: linear-gradient(to bottom, #fefefe 0%,#eeeeee 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#fefefe\\', endColorstr=\\'#eeeeee\\',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 15px;-moz-border-radius: 15px;border-radius: 15px;border: 1px solid #cbcbcb;padding: 5px;\">',\n footer: '</div>'\n },\n footer: {\n header: '<div class=\"mi_footerwrapper\" style=\"background-color:#fff;\"><div class=\"mi_footerroot\" style=\"top:2px;\"><div class=\"mi_footercontainer\" id=\"mi_footercontainer_@@@kfid\" style=\"height:100%;position:static;\">' +\n '<div class=\"mi_footer\" style=\"background-image:none;height:auto;margin-top:2px;\"><div onclick=\"jQuery(\\'#cpcnt_@@@kfid\\').find(\\'.MI_tab_selected\\').removeClass(\\'MI_tab_selected\\');jQuery(\\'#mipct_scroll_@@@kfid\\').addClass(\\'mi_blured\\');jQuery(\\'#mipct_tblabout_@@@kfid\\').css(\\'max-height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'top\\',jQuery(\\'#mipct_scroll_@@@kfid\\').position().top).fadeIn();\" style=\"z-index: 1;position: absolute;right: 0px;top: 5px;height: 25px;width: 65px;cursor: pointer;\"></div>',\n share: '<div class=\"mi_footer_prompt\" style=\"color:#59a3e8;top:auto;border-top:none;position:static;float:left;margin-bottom:0;padding: 7px;\">@@@ask</div>' +\n '<div><ul class=\"mi_share-buttons\" style=\"padding:0;margin: -5px 0 0 0;\"><li><a onclick=\"window.MI_logUsage(\\'mail\\');\" href=\"mailto:?subject={1}&body={2}: {0}\" target=\"_blank\" title=\"Email\" ><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAxCAYAAAAm0WAHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQxOTgzOUY2RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQxOTgzOUY3RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDE5ODM5RjRGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDE5ODM5RjVGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5SFpoiAAAe+klEQVR42uxdeXBd1Xn/3r5ptWTJki3bsrzbeMcOm9kNCRCghKWEpFkIkFCSIaShpO1MOmkzmTZJZ2hT2gYCTKCUBEiAYQlJiMHYGLzIeMEL3hfJkmWt7+nt9/b3O+9e6erpbZKeRP7gzly9d5d3zvc73/6dc69suq7LJ9sn23htTuvB1q1bh91gs9nUJwUx/Tt3fjeE1I5Pv9Pp9GiaVm232+fgegP2MlzzYI/gei/2E7j+Ea6fSSQScVwPsUmzLeun2ddoNyuN5rFJL/ofhgv0uHE+gHM+fDZgb8K1GuwB/hx7GNfasB9OJpNHcD6Iz5jD4YhiF3wfMjbmZu0/34axKQgb6TfbtY6b0Qb54MZxJe6bjWszsFfikg97HOf7sJ8y+HAauGM43497EtYxs46XFZOF50O2VatW5Raw0WwgshSdVbnd7ktcLtfl+Gzw+Xx+bAGPx1OFcyUgzIl74gASjEQiZ/v7+0PhcDgUi8WOx+PxN/D5Du7pRHPBQphQzI0DBQy1GOhG0H416L0In9WBQMAGDCX4Xg5m+XHdhvtCwNANDB2hUKgPO5XkEATrZXwewPU+MunjsBTo2wcs5aD3PNB7JXDMBP0VwFECPkzCuVIoAZU/ST5Eo9Eu8gF7GONPIVuPzzfQRjuwdheLLptVEkdiwQiGVgrE3+H1ei+cNGlSTXl5eYNpGXIJikXT9J6enqOdnZ1nIHBvg3FP4/Qh/LZvIiwY+p+OcxeB/i9DKeYDQ3lpaWnJSDBAuPq6u7v3dHV1HQGGV4HhDfyuA8zUJsKCUbBwOB0YbgGGSysrK6dWVFQ04rqrUAz87O3tPQ0+dEDgtkL4nkS7u4Dh7Fgt2IgFDJ/U5EUAdCcEal1NTc10AAtkIz4b49M3MKevvb39CIC+ju+PY4D2WYWjmAIG+ivw/XJguB8YzgGGMiiKjBUDLNq+tra2Hfj8FQTtLTCoc7wEjG1BuGcAw19CKW6ora2dDYtVNVYMoDsOPrSAD+vx/RGcasYemxABo0/HoF1fUlLyjbq6usUA5hurlUnvJ4ittbX1g76+vv/AAL6O893FFDC0uRAYvlVWVnbzlClTKoFFiowhCav8ITC8AUEjg45QboopYLRacHlr4f6+CQxroCRVxeYDaE8Cw0cQtJ/DfT6DMWsdjYA5vv/97w8ctLS0ZO0QoKbBvz8ETblv6tSp82C1XByMYmWhJtGwJG4wn8nBCpjqSQC3ly5zLAJmYczlaP9hMOX6+vp6H7RfxgGDHWNTCwwLOGbA0A2hbgEdyUIELB8taHMS4qu7Jk+e/O1p06adxxhrnPhgBwYma6uBoRF82IPvZ3P9FmM6OgEDgFno8IcNDQ13ANgkSDPdpIxHQM522T4sSyX6XIKYoA6JwA701TMGAbOj3RsgUD8BU5ZVV1ebMdi4YYAQ+MCgucBSB5ffDwzH0Gd8LAKGdmswJn8DBb8bit7kYKA3vnwQ8MFHPgDDAgjaDmBoK6qAoSP6+X+bPn365xBAuoplivMNMgcNlsCDvhfAXE8Bg7aNVMhMAYMFUcIFDHMQAGc18eOAwQkLMwPCVg9F6TRKG4nRCBj4MBmM/h6U/CtVVVXVRllo3DFwAx8E4zcLGBaDD1uAob1QAbPnkeI6gPpHaMxnwRjbRDAm3VQjvvDA6twEOh4CPVNMocm0Z8FwMX77I2BoRFvyMWBwQzE/hZj1TsRN5+PYWYhSWHdgKIOQ3gMG3gE+VNANZ8JgU78vwp6BD7DGgjG8CGP5E9Azu9AxyGXBAjCRd8EU3w2XwqKdbaKr/hYNouWkBjFt3jmCWtNsYPgvYFgCrZ9Q4UrD4ASGabFYzA9X02zU/AoSMP4WbulahCYPINutS7dcvMdhZ9nCpoQDCMdMM9tSlRp9aEBPS4atCR7FgXPvo+/+fBYslzZdgCzxHjAmkJ5tfhxCBjoqkWDe29XVtR1Cs6GAtLscv2W2uJrCNRGuPY+79CK5uA6pfysys382Sxj5SgewFnOA4X4IV2O6cFEIYglN3j0UleYTUekMaaKNESN/7oSALZnmlsvn+yXggQXVh/CBGebnwYf3cO6plBgWOFVkAVUPaf1baD7jh4JrM+PJINBhAz1zwKAHsB+CVrfkYg7inbWIG74EzRe4pqJiSHcjYoyylbcmKeY5IzMrAYarYMk2AsNLwJDIhQE0l+M390IwVwK/3YqBVqsjmJRfbw3J+gNhOYPv0bguYw33dcPVbjkakbMQ2C9+qlQJsm4IGQN/CHsF6H8QgrYNGD4ckYChESYn1yFeWeP3+9X8WrYBVma82MJkTt+k6QXSZGY0jAXWIptZi3ueRf96lsp0DTDcj3ClJBcGu0G/lqG/jK7DZinWGsJjM4Ifm6TaG0KLan+wbWIA/SyI3goGvYNT7Xms3gpgvga724qB3cSTurywPSTPbe+TKWVOuf3cEplR5VR0jMWG8fd7W+Pywo6gvLm3X5ZMdcuqmR5JaAMzF8IxhXwsAh9uxvG/gM7wSASsnloDU+jLpr0caFhmSeJPsZ0O23Y6UnFFUhueOoOuir6+vq8jlnkL2tOaScBw36XAcMmkSZNy9kX3wnFzoz/2m0vITOE6dCYmGw9F5MOWuHT1J0GnTaZWOGXldLec1+SVUo9djnclZPPhiFT67bKm0SvlPru1bQ8swHLEk+vAoGezlS44FQcMrHdNS3ftDtC792RcNoOOxmqX3HdpuSyod4vLXoTxR9uL6hNyuCMu+07HZXdLVM5t9AwTfo4t+PA17M9hXPYUJGCsDeHmCyGhMwFuWNxlWq7jZxPyxt6wbD8Wld6INqDBY/f9CBTBrEvne+XCJp/4XDZJ6kOBwe1xEvocMGcZTrVmyNrKYb2+AK23cfonU9zFGOODk1F5ZkufnA3q8hcr/HLlAr/qP5HBk/J8BM7s1V1BefGDfmnvTSrFshtZ10kI1DaMxe8/DMu0SofsAPM7Q0l1/Uwf3Mx5JaJrKYxUEtDPuuI1wPAKmunKEos1IkxZg92ZiQ9toKEHY3/D8oAsbXAb5Ri9KC6kMmCX2TUu2XkyJn1hfRhzSY/b7SaOWijKlTg+gP7jeQUM5o6rB26B+SvJlHGRMc0nYvLohl45BAn3QWUcNsOuFgFbBPvulpjsPhWT/dCev4L/D3iZpg+9D66vFIHyTYhlNkApgmnNzEDMdQnT6kwYyBwqxfPbg7LpYFS8EOLH3ukTN7BdPM+rrGciMZiLOVQgLbg/JP/7fhDfdZlb65KL53plXo0b8V1KwDZ8FFEM2Qu6fW4b3JZDWnuSsr8tBiFOSoV/iBVzAEMTrPB8uM3NVldv0OwChhtwz+SMma9uuHVmdi6Oj54xrBhWMrCLsrgDAqPTS+hDPAUvJSCoVCoxs9Is2TfG2NHT03ML3P3/cdlPXgFDI5Oh/RdwqUom4k73poLK/W1xaLxPPrPYJ1PKnUOC2bEEzgS2A0wiM1/bHZZaxBY3nxtQA2hlAOhzQhHWxePxKq7JspKJ61eBObglkLEfFwZ456moHDyTUBnSjcsC8v7RqDz8Zq/0RjW5ArjK6NKSqcGny9gE4fltc0gF0Z9Z7Jfb15RIbaljICBeOMUl58/yyvr9ETkIxVuDmKWtNyGPbQzKYfSzCwpzyXyfam8gxS0vn9fe3n4NlKQZzIlYvQgwBIDhWk4D5YqVVPyoFTb2KUXRlVuPJwdDkQCUgUqWyaOY/WSLEWHBbKBzBZUae34Bg3AthQtymstV0v0+XeIe+OR6CNW6hT5ZMsOT0qZkMSZZsaOPGmg+0+1H3uqV5uNRuXiORyaDmUO0DDdDwLwwzyz4HbM0w4WClzAItS7ISy8tH4OL7+7XEL845dolfhVj/DsEjH0ebI/L9UsD0gBX5/c5pA+u7l3EOi3dSbkMrvtWCHxdhSNl5XQj6wLtFNZPn+MDQ3xyoisJoY1AQRyI2eJyFP2l0kpricFeBuaQfpdhvK34piJrrMjEh9FsFK6+qC6v7+qXV7C3wlD43HbEiDa5CS523UK/uJ3DY9789TI7a2M6+HAuaN4ixqR+riB/NRfZZTTLGKDWngTciy4h+Iyn3gsqjVyO4JZmN54YfYmP40jLchZa/4e9EcQ5IaVdFDS6GbqbRFpxkYsa4SZXI6Z5yyy84rsXTFuaLfYytxBcZBT0VpU41MCumOGW+68oV5je3BeW945EYaG9ctFsr7LadHulPpucN8sj06ocEosOTW5UbGUwMpFMTY+safSoOKkzZJeZyO50y4S0pXA5Gcwp4wpTy6ICMm4FrJffPM4UJw2Otm5pN4viYoA3HwrLk5uDKuFYWOdW3iIU11Q2qumGsuiD5Qizfd1oONt4AoMXhmkNXP0TOAzms2CLYBlc2dZh0bTGIVQcsAPQ9B/9rkduWxWAW/EiMMTAx0cuZE57ijH7WmPyXHM/3ExUKsDMagSaHAQKbqYNljYAOhdwKoZhg3GaaSOzL8m6lgz88rqYOUKroSwUCBK9qN4p37myTF7bE5ZNsFi/aQ7Lb3b0K4acDWoyY5JDWS7+PhtGWoBU9qvJq3Dx247H5Y41AbhMt7J4GZjDhKQJse8pi4A58H0+VwMXKyuPQiGOdSakP6aDHp98bkUA2DVV5yrxpDLoQes1Mg4y2IdCLGQhOa+A4aZZLEpmnlJRFSrFkE8j9uLl57b3yyNv9ykXcP0yv8ytcSqNKNTUup02FddsOsyMLqSElvELtX/rsZi09CQGNHRYwgE6yRyuozenLMAcLvOxZ8eQKkVUw3KVeu1ytCOhCpR15XYlAHQZn18dkAtmuWXzkZiKNZkxEnOJx64SAdGyazOVpT8m8hqyyfdhBW9Y6pdrMVZOhwyJv0wrDCHiOvkmtPeODK4Zc2Jv4pr6rLMPlqqunsWC8SsTMKfTZrhyZODgNt22B0LlQYJWXWJXcZlpwcw2rH3qup7TgnGs+eyFoeh562BVrNTmnABnDQTW6sqFXqlBbESr89LOsBKyW1b65VNwIy4giyf1nPGWB8AZ17y+h5YiDMuoyXVLfHIrtCsA5m8/HsupTEZJpRq7w1L9ruVxrtiFt/bHNDWw/RDuF0F/NWLpmlK7UaKghXapNJ1aTlynulmWsKm6VkLLPVFNHHTtTZNdKgli9phtLDDWXFlbw3leE4OBpzofHwqJu8KwWIehRPQ8XSFNYSeWw1DkCK7RelWBl1SA0SZpxlgzrHIVkkW6s64tslBgjtdl8z1K+1/6ICx/RAb18J/6YIqTcpUSPjvinMGpB7MJh+ESKUCsKW04GEUbDrlxaYnKTMuhVafOJgsF5pWhK0LKUgV1W04BO92jSU9YlwV1LhVbMbas9LvUJC9pZBhAprAAuwAZ4uJ612CIkMy9/opuPQjBpBtm0TWhYihbNoFkMdtnrI5IGud4cyDnGq8ChIG0H+qOy49/36dcIEszxMdaHecuKfSrEHt+boU/pTijFDCDTpvBi7wWTDdXR2aqvQwRNuzUgnm1Lrl7rUPqEZ88/X6\\/\\/PK9kMrSbljqk8VTXco1mN7BBatFq7D+QFTFN0chSLMnO+VrF5XIKiQLnI5IJvShZl8yL9E1HxFLx2usuc++ckIXpbkeIKfL4ACrgq6mDyvnaSpDTglWphmDTPFOBFaRicH0SqcS3lSJJesaL7al57iWsS8zGB8I+DO4SM2oj3qAzS5G/Qs301oRuypT2AdDn3QXaY2mc61CyTfHmy5g0Uzzdrkmrsx5vGAkRXwSVusP+yJyEqn6ZfM8CJ5dSkOoMSdhnpmhvXUgBvekpSrnyZSgaiMMLw1gYWiQZtGm7tSl7KAZHzZCqJlB7mtLyHEEv+fDrUcThc1H5qpLcWOdie5odaNDJRKRHOOPsSb9fB5Rs1gsUhEc6+Q8kyN6hgeuKMV3kRcRxrwJL3PFfJ9cPNej3CdrYH53brdfCB8gfFp6qSWbgJ1F0Dw1mwXTDYdnBn4UEPr0p97rV8Q3Iru8cblP1X5e2R2Vx99NyHSk9XQVtBDtfRqELCFN1S65a3lATnQl4CYj8rO3+qQDTPn0Io/YHdYAdlB70unhxDHOdZiuxdhO4RiXEp5sWsfBXoyMsRF0UQleQPxXD0aw7hVL6mOIRVIxDyeKWbicCyFOJHOvP4vH43zouAPuXrNkkUk+m2jgy27BRB9mXay3MoxhnNs02aESqXJvyv1PRgjSUO2QZCylUPQaVlnW9YEOhpRBsuEw6AwWNFXEJ5ZjsdiSfOumbEbB8gAG88nNIVilmIpnvnp+iayc7kJ84wYT3bLlWCoTY7bmQk91yGDWLSxRvn9BrVOCUU1lZ89s6Zcn3w3id0m5bZU/tdjNlnv5DuikBTjEOWvLpZPUpmg0qmb8syUpLIMwAGe8yFiQmfBnkWAsgUtn/W00QkYX1BVKygbEN9WIPxfVOYdljukY+PAxMVjdJBWE54AhHggEXGOxYsQaBdtpnc0QQK2KwHE0UZxlChxr0HwcAhYrZC5ydyQSuTbjsl5LKMH0t/lYXH6+MSh7WlKlhS+fnypTROD6/DC9a2e7laXoDSNjM6YmGOtUBexqro7BMj9vXOZV2vX45n55dms/rIDIJXPdMiBjWSwYmBODtvOJo6jFRfbgHJ+8Ls2lJJxbpCJMRdx4HFasq19TlX1+MnUXfWTuWtWRgHHnqbicgNBevcgLF2xTFizXBgwY8uQxa80O1owW+QCfuq6srKzIVM/T9KGBWK5C60DxNBWh5i07DJQp0mOyLPdjrGl19+B6uBAXuQWgdfOJkvRGecQ4i1pKd3cAMcxVC7xy+7l+aZjkUFqhG1NHtPi0FFUB54AxMk0yA+FUPKQLQgBZt8AjpRCyRzemSh5MrZkMpJYAZ9Z+AsMnH0BIWgQsAtqbgaEhG4bBbFaXOTUO+eCUDZZUpB7WlcJvzzTfkbdYbJMzQU1+i2yatTTGnvmsIOmCe+k03Et6XLODlsHE8Oe6kT5DwLZAMfozKl8a6A8Aupc/ylg9hwXyu+yy9XhcWnqScstKn9x5AYUrVbAbmJowxovBI4UuYuyxZMrvWx8w4M9soOKi2R759uUlMhtWcA9c7xFkorR43PW0tJj0gc4OfD+YRiJBvoJrejYMZo2Ifa+b75U5iFE4pfPs9rDK/sSWecVqVuFypDC+sjuirOHaOR4V32l56mWwUP2gc2P6unZDIfhiksNQlD9b4TL5gDiSL1N5L1s2nG7BOgD6j729vbcwhrH+htXsmZWs/tqktVeT21ZyysEnlbBSsYQ+ptUUKnEF05c3kByfPLIhJPtOp+Ygp1Zwykgb0j7oI7AXQd+ZdMMA4OvhdoJ9fX2l6RhMd0Y3zCyrxCPIqjzS2qOpeJFTJ5fNc8vKBrfUoV9bAcLFrJRZMS3vPMSV1yz2FrR0pgcbxvoVaH44A/P6cO03wLkUGBxZyxTGilnl8vK4SEmbu8zlIjV9cA2YnqNMgTGmom8ChmMFlSlwYwia8zyU6xYG0VyPPxi36LKswaUCdGor59nKfVz3ZBdt5FNYGQugyaRNdiGmO9mlKcE6f5YLbtY+JCCFYFH7MQb6y+lm2RiEVmB4PRQK3ZyOIbXkSIMwRGUfkg9mWcz8QrHUylYG/a8i+w3h3LUQlDKvLaOgcOxdYDtjy42HYvKLTf0yyW+XL6724dOWmt/MsYEuWtiDoPdguns0jhPA8Cos2IPAyzV6GRXFLLuYa+Y1vVjWKf9yHYMPdI/P53ri25lBe97hGiUo2HI+MDGwDBkfrJvctNyrhG0rsq+nt4SVYGWLlUa06YPpPoX22nM8EDD3gOs1Bx90kUF/wvftGaZelGKB5sdwz024127FQIFaD2vz8q6IKrFU+FMumJaSrn9erUPOQ5+z4Ta5uiOdYTbDatG2dSJ5eXM/51DDShDvutCvLFhCyz0WxNDd3c1XVz2e7QFW476DuOcl3Ht7TU3NsCC/BmNEBW8+GZfVjW6ZVZVaGZLeOcs+g0XVVIXfxvqXnrk8wGp/byQpp7oT6t4y7/CsmhjoRRAnHsfhG0YdrGABa4FU/gwN/E9JSYmd728wGcSK9pRSm9xzoU+aT7hkd2tqhr4YT64bz0go4Vo1wyVN1Y4hD2OYPh90xeECH8v1CDvu3QYMr+De60pLS8VcvmOT1FQPk4wyn8j8WlhkZJOzqp3YHcoqMXZin0kzqzPW4qeWU3PBnq5mIF7eFZUtULKZlU758nleWTrNOWTWIlfcEgwG94O+N1n/ynFvL+55FBg+y1dKDeWDLrNB7/kQrF83h+WRt0Jy1UKPGrt0Z8KMn5a2I0j8NlX7238iJuFEZstMvHtPJ2TbibjUBFLlloQ2GKJY+ED3+HNgOJLTGlpN77Zt2wYmjXH+ibKysqvr6uqGLX2xWwL58djMLNkKiv23tbVR+5/H8b043ZZlftLcLsIAvMQnoadMmTIgJKzeP9eccvEUtIUYwAua3DIPGSWX5tBKp6ZSbErAqVRh3McFe5ycf/9YXK20YN3rXM7lLfPITFiPpJ57wtjE0Nra2gfm3IvjpwoILPhik38qLy\\/\\/FjFYF1Gm5hd1eXFnRDYcjCGL1XPW3TTDhdptg+41432SUjIul6IXuRkeS2ymARjCh9249SaWVMzf5n190/bt263xzOVo8Jnq6urJfIIkW1A4Ho+tZXErcubMGVrXW+nGC2jKD0v3d3Cb36ObrKysTD1fCSFrC2qy/qOYbIewHOnkuqikWr7TVMU5VbuK+9TafE5cRzWl/UdgtViK4MDThTI+ZObrdw+fq8wmYF1dXcTwNDA8gOO2bOWLtOMFwPBCVVXVfPPpdKuiU2h2tyRUDY70JbQsPDEy43zJmGbMACyd6lQYXU7bEEU3+NCLsb0Hp56x/javgFksGDcfGvkm3MsPEAO46Gom+tF78/F5uBRqTT9ikgf5KgAZXGCYb+K1AfsTCPQvq62tVc9VcvLZbtPVkiJOc+04lZCP2hMqM+4M6WoRYiSRWtNGYfTCopVxWUuJXSUenIFYhmy30mc3VoOOCMNuxC2fhyXaOcKhuMnpdPIVCNXp7zOzyeDDHPYiajvDASYrusU7IHGS06dPM/b6CfjwA9DQk0/AnDm0J4xGfwGmzoHEfpUdmA9STISQmYwhKPSfBB2PgoZnOJUygjZO4Df347dPtbe3n8P2iIHkMzOtZTJR6YGguFWpoq1Pk+5wqhCsBAwxGWclWDDmNFdNqU0FwbECp1qsGNA/p+G+OwrhYhuvIWv7KcbhH7jExypkulFvTGj6uPKBGSMwMMHiE+kPpwtXQTFYpjccYuODnz+FJbuZrobgxtuSWbW+o6ODQeUvcfxdyfLkSq52jPeArcX+nwiUF/HdYOkYzBeIOGzD40sz/afAJfXClcuKAYJxClr/XUNBRjtwfKvO34MP94EP7onkgylcwMDnH+5Gn/sz3T+qNxyyrolGNyNgnhwOh5cYS31lvN4GbQaS9PVnz57VAeoJnPt7kjeatoyN8307YQWWA0NdJgymENEaxJODu3qCXRtZjSkNw1Fo/UMQrl+NYhZqyLQf2t0KPtiAYSVLccRQrCePsmFgWQgKQuH6Hdzifbi0L9tvRvUCOouQbeLMLKzJMq6DZwGT67GL5TJNbeEcHJhC5rDSzfce/HCkliu9TWM7Dma8DwgzwaDZXGYyXhiYxnd2dpI52yHU30G/L4xRuAbCFrT/HjCcRR9LgIGPvg0Uk4vNB2IAH5LAwJrdg7j8Ua7fZhKwQlyktXMu72Vq+hC0ZyHNNIP/sQC0/BMEVVuhSwG4D3Dqh7jG6aDoWAcr7S3PM+Euv4FzX+fbbkh/sTCwum1gYMzIV7L/GNd25coSR4mLHfKR/e+53e6LjZfCFI0PnALibhRS/xXXnkabXfleLT+qt0xnIgK/WYj9SzCZdwJUJV9MxuCZxcCRmGxmfdQUBsH082BQB7Tzv1kjwr5vrAzJ8Z58L74zLvtr0Hud8Z4FtY8GAy0W6ecOwdrEeA9tvIZ+OtNDiWJaGbTViL5uQ1/3AMP00fLBXJ1i4QPXETE0edScMSnkv68UU8BMa8bnEm8GmNshbNNprhkXcKc2cerGePonNW+WTKqdmk7B4s6VDzh3FANFoXoB+15arYn4Rwz4rMXplej7Kzj+DOj15cJgrvfPgIGzC2/jGpOR9diPpTNlnARMhTn4nIv9OtD5BT7bCgy2QvnA+Vpi4Hec6wCGZ3HL07h/t/WB4I9DwAbe3IdTdSBsOY6vBJiLcW6m8fiV3TDnqRpfatOMyVz+v5+3AeR3OOZrMVtwLTaR/6vIgmMSdi4VvxC3XY1ra3C+3KA/HYNmYOC6+R3Y1+P773HL0fTi6QQJmNkPJ2Lr6V1A0xXgwyXAMZ/JgIkjnQ9cbo6dxeuNOM\\/\\/ScAXLXPZeSgTHz4uAbMOng/HXE1ayocx+dJeptec8pDU/yGiyziN6yf50hJqCJerZPqnThMsYNY+y7EHQHsljqfzhTDY+Tic01i7dQa/Pc5/imX8Iy9OricyZdUTLGAD10C7h3zAJ/8tDstMdVQigw9cHtTNN0TyH5MZfOET2aH08S+6gH2yfbIVe7N/MgSfbOO5/b8AAwDCB5vdkkgX5QAAAABJRU5ErkJggg==\\');height:50px;width:50px;height: 30px;width: 30px;background-size: cover;\"></div></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://www.facebook.com/sharer/sharer.php?u={0}\" target=\"_blank\"><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAxCAYAAAAm0WAHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQxOTgzOUY2RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQxOTgzOUY3RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDE5ODM5RjRGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDE5ODM5RjVGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5SFpoiAAAe+klEQVR42uxdeXBd1Xn/3r5ptWTJki3bsrzbeMcOm9kNCRCghKWEpFkIkFCSIaShpO1MOmkzmTZJZ2hT2gYCTKCUBEiAYQlJiMHYGLzIeMEL3hfJkmWt7+nt9/b3O+9e6erpbZKeRP7gzly9d5d3zvc73/6dc69suq7LJ9sn23htTuvB1q1bh91gs9nUJwUx/Tt3fjeE1I5Pv9Pp9GiaVm232+fgegP2MlzzYI/gei/2E7j+Ea6fSSQScVwPsUmzLeun2ddoNyuN5rFJL/ofhgv0uHE+gHM+fDZgb8K1GuwB/hx7GNfasB9OJpNHcD6Iz5jD4YhiF3wfMjbmZu0/34axKQgb6TfbtY6b0Qb54MZxJe6bjWszsFfikg97HOf7sJ8y+HAauGM43497EtYxs46XFZOF50O2VatW5Raw0WwgshSdVbnd7ktcLtfl+Gzw+Xx+bAGPx1OFcyUgzIl74gASjEQiZ/v7+0PhcDgUi8WOx+PxN/D5Du7pRHPBQphQzI0DBQy1GOhG0H416L0In9WBQMAGDCX4Xg5m+XHdhvtCwNANDB2hUKgPO5XkEATrZXwewPU+MunjsBTo2wcs5aD3PNB7JXDMBP0VwFECPkzCuVIoAZU/ST5Eo9Eu8gF7GONPIVuPzzfQRjuwdheLLptVEkdiwQiGVgrE3+H1ei+cNGlSTXl5eYNpGXIJikXT9J6enqOdnZ1nIHBvg3FP4/Qh/LZvIiwY+p+OcxeB/i9DKeYDQ3lpaWnJSDBAuPq6u7v3dHV1HQGGV4HhDfyuA8zUJsKCUbBwOB0YbgGGSysrK6dWVFQ04rqrUAz87O3tPQ0+dEDgtkL4nkS7u4Dh7Fgt2IgFDJ/U5EUAdCcEal1NTc10AAtkIz4b49M3MKevvb39CIC+ju+PY4D2WYWjmAIG+ivw/XJguB8YzgGGMiiKjBUDLNq+tra2Hfj8FQTtLTCoc7wEjG1BuGcAw19CKW6ora2dDYtVNVYMoDsOPrSAD+vx/RGcasYemxABo0/HoF1fUlLyjbq6usUA5hurlUnvJ4ittbX1g76+vv/AAL6O893FFDC0uRAYvlVWVnbzlClTKoFFiowhCav8ITC8AUEjg45QboopYLRacHlr4f6+CQxroCRVxeYDaE8Cw0cQtJ/DfT6DMWsdjYA5vv/97w8ctLS0ZO0QoKbBvz8ETblv6tSp82C1XByMYmWhJtGwJG4wn8nBCpjqSQC3ly5zLAJmYczlaP9hMOX6+vp6H7RfxgGDHWNTCwwLOGbA0A2hbgEdyUIELB8taHMS4qu7Jk+e/O1p06adxxhrnPhgBwYma6uBoRF82IPvZ3P9FmM6OgEDgFno8IcNDQ13ANgkSDPdpIxHQM522T4sSyX6XIKYoA6JwA701TMGAbOj3RsgUD8BU5ZVV1ebMdi4YYAQ+MCgucBSB5ffDwzH0Gd8LAKGdmswJn8DBb8bit7kYKA3vnwQ8MFHPgDDAgjaDmBoK6qAoSP6+X+bPn365xBAuoplivMNMgcNlsCDvhfAXE8Bg7aNVMhMAYMFUcIFDHMQAGc18eOAwQkLMwPCVg9F6TRKG4nRCBj4MBmM/h6U/CtVVVXVRllo3DFwAx8E4zcLGBaDD1uAob1QAbPnkeI6gPpHaMxnwRjbRDAm3VQjvvDA6twEOh4CPVNMocm0Z8FwMX77I2BoRFvyMWBwQzE/hZj1TsRN5+PYWYhSWHdgKIOQ3gMG3gE+VNANZ8JgU78vwp6BD7DGgjG8CGP5E9Azu9AxyGXBAjCRd8EU3w2XwqKdbaKr/hYNouWkBjFt3jmCWtNsYPgvYFgCrZ9Q4UrD4ASGabFYzA9X02zU/AoSMP4WbulahCYPINutS7dcvMdhZ9nCpoQDCMdMM9tSlRp9aEBPS4atCR7FgXPvo+/+fBYslzZdgCzxHjAmkJ5tfhxCBjoqkWDe29XVtR1Cs6GAtLscv2W2uJrCNRGuPY+79CK5uA6pfysys382Sxj5SgewFnOA4X4IV2O6cFEIYglN3j0UleYTUekMaaKNESN/7oSALZnmlsvn+yXggQXVh/CBGebnwYf3cO6plBgWOFVkAVUPaf1baD7jh4JrM+PJINBhAz1zwKAHsB+CVrfkYg7inbWIG74EzRe4pqJiSHcjYoyylbcmKeY5IzMrAYarYMk2AsNLwJDIhQE0l+M390IwVwK/3YqBVqsjmJRfbw3J+gNhOYPv0bguYw33dcPVbjkakbMQ2C9+qlQJsm4IGQN/CHsF6H8QgrYNGD4ckYChESYn1yFeWeP3+9X8WrYBVma82MJkTt+k6QXSZGY0jAXWIptZi3ueRf96lsp0DTDcj3ClJBcGu0G/lqG/jK7DZinWGsJjM4Ifm6TaG0KLan+wbWIA/SyI3goGvYNT7Xms3gpgvga724qB3cSTurywPSTPbe+TKWVOuf3cEplR5VR0jMWG8fd7W+Pywo6gvLm3X5ZMdcuqmR5JaAMzF8IxhXwsAh9uxvG/gM7wSASsnloDU+jLpr0caFhmSeJPsZ0O23Y6UnFFUhueOoOuir6+vq8jlnkL2tOaScBw36XAcMmkSZNy9kX3wnFzoz/2m0vITOE6dCYmGw9F5MOWuHT1J0GnTaZWOGXldLec1+SVUo9djnclZPPhiFT67bKm0SvlPru1bQ8swHLEk+vAoGezlS44FQcMrHdNS3ftDtC792RcNoOOxmqX3HdpuSyod4vLXoTxR9uL6hNyuCMu+07HZXdLVM5t9AwTfo4t+PA17M9hXPYUJGCsDeHmCyGhMwFuWNxlWq7jZxPyxt6wbD8Wld6INqDBY/f9CBTBrEvne+XCJp/4XDZJ6kOBwe1xEvocMGcZTrVmyNrKYb2+AK23cfonU9zFGOODk1F5ZkufnA3q8hcr/HLlAr/qP5HBk/J8BM7s1V1BefGDfmnvTSrFshtZ10kI1DaMxe8/DMu0SofsAPM7Q0l1/Uwf3Mx5JaJrKYxUEtDPuuI1wPAKmunKEos1IkxZg92ZiQ9toKEHY3/D8oAsbXAb5Ri9KC6kMmCX2TUu2XkyJn1hfRhzSY/b7SaOWijKlTg+gP7jeQUM5o6rB26B+SvJlHGRMc0nYvLohl45BAn3QWUcNsOuFgFbBPvulpjsPhWT/dCev4L/D3iZpg+9D66vFIHyTYhlNkApgmnNzEDMdQnT6kwYyBwqxfPbg7LpYFS8EOLH3ukTN7BdPM+rrGciMZiLOVQgLbg/JP/7fhDfdZlb65KL53plXo0b8V1KwDZ8FFEM2Qu6fW4b3JZDWnuSsr8tBiFOSoV/iBVzAEMTrPB8uM3NVldv0OwChhtwz+SMma9uuHVmdi6Oj54xrBhWMrCLsrgDAqPTS+hDPAUvJSCoVCoxs9Is2TfG2NHT03ML3P3/cdlPXgFDI5Oh/RdwqUom4k73poLK/W1xaLxPPrPYJ1PKnUOC2bEEzgS2A0wiM1/bHZZaxBY3nxtQA2hlAOhzQhHWxePxKq7JspKJ61eBObglkLEfFwZ456moHDyTUBnSjcsC8v7RqDz8Zq/0RjW5ArjK6NKSqcGny9gE4fltc0gF0Z9Z7Jfb15RIbaljICBeOMUl58/yyvr9ETkIxVuDmKWtNyGPbQzKYfSzCwpzyXyfam8gxS0vn9fe3n4NlKQZzIlYvQgwBIDhWk4D5YqVVPyoFTb2KUXRlVuPJwdDkQCUgUqWyaOY/WSLEWHBbKBzBZUae34Bg3AthQtymstV0v0+XeIe+OR6CNW6hT5ZMsOT0qZkMSZZsaOPGmg+0+1H3uqV5uNRuXiORyaDmUO0DDdDwLwwzyz4HbM0w4WClzAItS7ISy8tH4OL7+7XEL845dolfhVj/DsEjH0ebI/L9UsD0gBX5/c5pA+u7l3EOi3dSbkMrvtWCHxdhSNl5XQj6wLtFNZPn+MDQ3xyoisJoY1AQRyI2eJyFP2l0kpricFeBuaQfpdhvK34piJrrMjEh9FsFK6+qC6v7+qXV7C3wlD43HbEiDa5CS523UK/uJ3DY9789TI7a2M6+HAuaN4ixqR+riB/NRfZZTTLGKDWngTciy4h+Iyn3gsqjVyO4JZmN54YfYmP40jLchZa/4e9EcQ5IaVdFDS6GbqbRFpxkYsa4SZXI6Z5yyy84rsXTFuaLfYytxBcZBT0VpU41MCumOGW+68oV5je3BeW945EYaG9ctFsr7LadHulPpucN8sj06ocEosOTW5UbGUwMpFMTY+safSoOKkzZJeZyO50y4S0pXA5Gcwp4wpTy6ICMm4FrJffPM4UJw2Otm5pN4viYoA3HwrLk5uDKuFYWOdW3iIU11Q2qumGsuiD5Qizfd1oONt4AoMXhmkNXP0TOAzms2CLYBlc2dZh0bTGIVQcsAPQ9B/9rkduWxWAW/EiMMTAx0cuZE57ijH7WmPyXHM/3ExUKsDMagSaHAQKbqYNljYAOhdwKoZhg3GaaSOzL8m6lgz88rqYOUKroSwUCBK9qN4p37myTF7bE5ZNsFi/aQ7Lb3b0K4acDWoyY5JDWS7+PhtGWoBU9qvJq3Dx247H5Y41AbhMt7J4GZjDhKQJse8pi4A58H0+VwMXKyuPQiGOdSakP6aDHp98bkUA2DVV5yrxpDLoQes1Mg4y2IdCLGQhOa+A4aZZLEpmnlJRFSrFkE8j9uLl57b3yyNv9ykXcP0yv8ytcSqNKNTUup02FddsOsyMLqSElvELtX/rsZi09CQGNHRYwgE6yRyuozenLMAcLvOxZ8eQKkVUw3KVeu1ytCOhCpR15XYlAHQZn18dkAtmuWXzkZiKNZkxEnOJx64SAdGyazOVpT8m8hqyyfdhBW9Y6pdrMVZOhwyJv0wrDCHiOvkmtPeODK4Zc2Jv4pr6rLMPlqqunsWC8SsTMKfTZrhyZODgNt22B0LlQYJWXWJXcZlpwcw2rH3qup7TgnGs+eyFoeh562BVrNTmnABnDQTW6sqFXqlBbESr89LOsBKyW1b65VNwIy4giyf1nPGWB8AZ17y+h5YiDMuoyXVLfHIrtCsA5m8/HsupTEZJpRq7w1L9ruVxrtiFt/bHNDWw/RDuF0F/NWLpmlK7UaKghXapNJ1aTlynulmWsKm6VkLLPVFNHHTtTZNdKgli9phtLDDWXFlbw3leE4OBpzofHwqJu8KwWIehRPQ8XSFNYSeWw1DkCK7RelWBl1SA0SZpxlgzrHIVkkW6s64tslBgjtdl8z1K+1/6ICx/RAb18J/6YIqTcpUSPjvinMGpB7MJh+ESKUCsKW04GEUbDrlxaYnKTMuhVafOJgsF5pWhK0LKUgV1W04BO92jSU9YlwV1LhVbMbas9LvUJC9pZBhAprAAuwAZ4uJ612CIkMy9/opuPQjBpBtm0TWhYihbNoFkMdtnrI5IGud4cyDnGq8ChIG0H+qOy49/36dcIEszxMdaHecuKfSrEHt+boU/pTijFDCDTpvBi7wWTDdXR2aqvQwRNuzUgnm1Lrl7rUPqEZ88/X6\\/\\/PK9kMrSbljqk8VTXco1mN7BBatFq7D+QFTFN0chSLMnO+VrF5XIKiQLnI5IJvShZl8yL9E1HxFLx2usuc++ckIXpbkeIKfL4ACrgq6mDyvnaSpDTglWphmDTPFOBFaRicH0SqcS3lSJJesaL7al57iWsS8zGB8I+DO4SM2oj3qAzS5G/Qs301oRuypT2AdDn3QXaY2mc61CyTfHmy5g0Uzzdrkmrsx5vGAkRXwSVusP+yJyEqn6ZfM8CJ5dSkOoMSdhnpmhvXUgBvekpSrnyZSgaiMMLw1gYWiQZtGm7tSl7KAZHzZCqJlB7mtLyHEEv+fDrUcThc1H5qpLcWOdie5odaNDJRKRHOOPsSb9fB5Rs1gsUhEc6+Q8kyN6hgeuKMV3kRcRxrwJL3PFfJ9cPNej3CdrYH53brdfCB8gfFp6qSWbgJ1F0Dw1mwXTDYdnBn4UEPr0p97rV8Q3Iru8cblP1X5e2R2Vx99NyHSk9XQVtBDtfRqELCFN1S65a3lATnQl4CYj8rO3+qQDTPn0Io/YHdYAdlB70unhxDHOdZiuxdhO4RiXEp5sWsfBXoyMsRF0UQleQPxXD0aw7hVL6mOIRVIxDyeKWbicCyFOJHOvP4vH43zouAPuXrNkkUk+m2jgy27BRB9mXay3MoxhnNs02aESqXJvyv1PRgjSUO2QZCylUPQaVlnW9YEOhpRBsuEw6AwWNFXEJ5ZjsdiSfOumbEbB8gAG88nNIVilmIpnvnp+iayc7kJ84wYT3bLlWCoTY7bmQk91yGDWLSxRvn9BrVOCUU1lZ89s6Zcn3w3id0m5bZU/tdjNlnv5DuikBTjEOWvLpZPUpmg0qmb8syUpLIMwAGe8yFiQmfBnkWAsgUtn/W00QkYX1BVKygbEN9WIPxfVOYdljukY+PAxMVjdJBWE54AhHggEXGOxYsQaBdtpnc0QQK2KwHE0UZxlChxr0HwcAhYrZC5ydyQSuTbjsl5LKMH0t/lYXH6+MSh7WlKlhS+fnypTROD6/DC9a2e7laXoDSNjM6YmGOtUBexqro7BMj9vXOZV2vX45n55dms/rIDIJXPdMiBjWSwYmBODtvOJo6jFRfbgHJ+8Ls2lJJxbpCJMRdx4HFasq19TlX1+MnUXfWTuWtWRgHHnqbicgNBevcgLF2xTFizXBgwY8uQxa80O1owW+QCfuq6srKzIVM/T9KGBWK5C60DxNBWh5i07DJQp0mOyLPdjrGl19+B6uBAXuQWgdfOJkvRGecQ4i1pKd3cAMcxVC7xy+7l+aZjkUFqhG1NHtPi0FFUB54AxMk0yA+FUPKQLQgBZt8AjpRCyRzemSh5MrZkMpJYAZ9Z+AsMnH0BIWgQsAtqbgaEhG4bBbFaXOTUO+eCUDZZUpB7WlcJvzzTfkbdYbJMzQU1+i2yatTTGnvmsIOmCe+k03Et6XLODlsHE8Oe6kT5DwLZAMfozKl8a6A8Aupc/ylg9hwXyu+yy9XhcWnqScstKn9x5AYUrVbAbmJowxovBI4UuYuyxZMrvWx8w4M9soOKi2R759uUlMhtWcA9c7xFkorR43PW0tJj0gc4OfD+YRiJBvoJrejYMZo2Ifa+b75U5iFE4pfPs9rDK/sSWecVqVuFypDC+sjuirOHaOR4V32l56mWwUP2gc2P6unZDIfhiksNQlD9b4TL5gDiSL1N5L1s2nG7BOgD6j729vbcwhrH+htXsmZWs/tqktVeT21ZyysEnlbBSsYQ+ptUUKnEF05c3kByfPLIhJPtOp+Ygp1Zwykgb0j7oI7AXQd+ZdMMA4OvhdoJ9fX2l6RhMd0Y3zCyrxCPIqjzS2qOpeJFTJ5fNc8vKBrfUoV9bAcLFrJRZMS3vPMSV1yz2FrR0pgcbxvoVaH44A/P6cO03wLkUGBxZyxTGilnl8vK4SEmbu8zlIjV9cA2YnqNMgTGmom8ChmMFlSlwYwia8zyU6xYG0VyPPxi36LKswaUCdGor59nKfVz3ZBdt5FNYGQugyaRNdiGmO9mlKcE6f5YLbtY+JCCFYFH7MQb6y+lm2RiEVmB4PRQK3ZyOIbXkSIMwRGUfkg9mWcz8QrHUylYG/a8i+w3h3LUQlDKvLaOgcOxdYDtjy42HYvKLTf0yyW+XL6724dOWmt/MsYEuWtiDoPdguns0jhPA8Cos2IPAyzV6GRXFLLuYa+Y1vVjWKf9yHYMPdI/P53ri25lBe97hGiUo2HI+MDGwDBkfrJvctNyrhG0rsq+nt4SVYGWLlUa06YPpPoX22nM8EDD3gOs1Bx90kUF/wvftGaZelGKB5sdwz024127FQIFaD2vz8q6IKrFU+FMumJaSrn9erUPOQ5+z4Ta5uiOdYTbDatG2dSJ5eXM/51DDShDvutCvLFhCyz0WxNDd3c1XVz2e7QFW476DuOcl3Ht7TU3NsCC/BmNEBW8+GZfVjW6ZVZVaGZLeOcs+g0XVVIXfxvqXnrk8wGp/byQpp7oT6t4y7/CsmhjoRRAnHsfhG0YdrGABa4FU/gwN/E9JSYmd728wGcSK9pRSm9xzoU+aT7hkd2tqhr4YT64bz0go4Vo1wyVN1Y4hD2OYPh90xeECH8v1CDvu3QYMr+De60pLS8VcvmOT1FQPk4wyn8j8WlhkZJOzqp3YHcoqMXZin0kzqzPW4qeWU3PBnq5mIF7eFZUtULKZlU758nleWTrNOWTWIlfcEgwG94O+N1n/ynFvL+55FBg+y1dKDeWDLrNB7/kQrF83h+WRt0Jy1UKPGrt0Z8KMn5a2I0j8NlX7238iJuFEZstMvHtPJ2TbibjUBFLlloQ2GKJY+ED3+HNgOJLTGlpN77Zt2wYmjXH+ibKysqvr6uqGLX2xWwL58djMLNkKiv23tbVR+5/H8b043ZZlftLcLsIAvMQnoadMmTIgJKzeP9eccvEUtIUYwAua3DIPGSWX5tBKp6ZSbErAqVRh3McFe5ycf/9YXK20YN3rXM7lLfPITFiPpJ57wtjE0Nra2gfm3IvjpwoILPhik38qLy\\/\\/FjFYF1Gm5hd1eXFnRDYcjCGL1XPW3TTDhdptg+41432SUjIul6IXuRkeS2ymARjCh9249SaWVMzf5n190/bt263xzOVo8Jnq6urJfIIkW1A4Ho+tZXErcubMGVrXW+nGC2jKD0v3d3Cb36ObrKysTD1fCSFrC2qy/qOYbIewHOnkuqikWr7TVMU5VbuK+9TafE5cRzWl/UdgtViK4MDThTI+ZObrdw+fq8wmYF1dXcTwNDA8gOO2bOWLtOMFwPBCVVXVfPPpdKuiU2h2tyRUDY70JbQsPDEy43zJmGbMACyd6lQYXU7bEEU3+NCLsb0Hp56x/javgFksGDcfGvkm3MsPEAO46Gom+tF78/F5uBRqTT9ikgf5KgAZXGCYb+K1AfsTCPQvq62tVc9VcvLZbtPVkiJOc+04lZCP2hMqM+4M6WoRYiSRWtNGYfTCopVxWUuJXSUenIFYhmy30mc3VoOOCMNuxC2fhyXaOcKhuMnpdPIVCNXp7zOzyeDDHPYiajvDASYrusU7IHGS06dPM/b6CfjwA9DQk0/AnDm0J4xGfwGmzoHEfpUdmA9STISQmYwhKPSfBB2PgoZnOJUygjZO4Df347dPtbe3n8P2iIHkMzOtZTJR6YGguFWpoq1Pk+5wqhCsBAwxGWclWDDmNFdNqU0FwbECp1qsGNA/p+G+OwrhYhuvIWv7KcbhH7jExypkulFvTGj6uPKBGSMwMMHiE+kPpwtXQTFYpjccYuODnz+FJbuZrobgxtuSWbW+o6ODQeUvcfxdyfLkSq52jPeArcX+nwiUF/HdYOkYzBeIOGzD40sz/afAJfXClcuKAYJxClr/XUNBRjtwfKvO34MP94EP7onkgylcwMDnH+5Gn/sz3T+qNxyyrolGNyNgnhwOh5cYS31lvN4GbQaS9PVnz57VAeoJnPt7kjeatoyN8307YQWWA0NdJgymENEaxJODu3qCXRtZjSkNw1Fo/UMQrl+NYhZqyLQf2t0KPtiAYSVLccRQrCePsmFgWQgKQuH6Hdzifbi0L9tvRvUCOouQbeLMLKzJMq6DZwGT67GL5TJNbeEcHJhC5rDSzfce/HCkliu9TWM7Dma8DwgzwaDZXGYyXhiYxnd2dpI52yHU30G/L4xRuAbCFrT/HjCcRR9LgIGPvg0Uk4vNB2IAH5LAwJrdg7j8Ua7fZhKwQlyktXMu72Vq+hC0ZyHNNIP/sQC0/BMEVVuhSwG4D3Dqh7jG6aDoWAcr7S3PM+Euv4FzX+fbbkh/sTCwum1gYMzIV7L/GNd25coSR4mLHfKR/e+53e6LjZfCFI0PnALibhRS/xXXnkabXfleLT+qt0xnIgK/WYj9SzCZdwJUJV9MxuCZxcCRmGxmfdQUBsH082BQB7Tzv1kjwr5vrAzJ8Z58L74zLvtr0Hud8Z4FtY8GAy0W6ecOwdrEeA9tvIZ+OtNDiWJaGbTViL5uQ1/3AMP00fLBXJ1i4QPXETE0edScMSnkv68UU8BMa8bnEm8GmNshbNNprhkXcKc2cerGePonNW+WTKqdmk7B4s6VDzh3FANFoXoB+15arYn4Rwz4rMXplej7Kzj+DOj15cJgrvfPgIGzC2/jGpOR9diPpTNlnARMhTn4nIv9OtD5BT7bCgy2QvnA+Vpi4Hec6wCGZ3HL07h/t/WB4I9DwAbe3IdTdSBsOY6vBJiLcW6m8fiV3TDnqRpfatOMyVz+v5+3AeR3OOZrMVtwLTaR/6vIgmMSdi4VvxC3XY1ra3C+3KA/HYNmYOC6+R3Y1+P773HL0fTi6QQJmNkPJ2Lr6V1A0xXgwyXAMZ/JgIkjnQ9cbo6dxeuNOM\\/\\/ScAXLXPZeSgTHz4uAbMOng/HXE1ayocx+dJeptec8pDU/yGiyziN6yf50hJqCJerZPqnThMsYNY+y7EHQHsljqfzhTDY+Tic01i7dQa/Pc5/imX8Iy9OricyZdUTLGAD10C7h3zAJ/8tDstMdVQigw9cHtTNN0TyH5MZfOET2aH08S+6gH2yfbIVe7N/MgSfbOO5/b8AAwDCB5vdkkgX5QAAAABJRU5ErkJggg==\\');height:50px;width:50px;height: 30px;width: 30px;background-size: cover;background-position-x: 32px;;background-position: 32px;\"></div></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://twitter.com/intent/tweet?source={0}&text={1}: {0}\" target=\"_blank\" title=\"Tweet\"><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAAxCAYAAAAm0WAHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQxOTgzOUY2RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQxOTgzOUY3RjMxMjExRTQ4RDc1QkNENzc1ODE3OTkzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDE5ODM5RjRGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDE5ODM5RjVGMzEyMTFFNDhENzVCQ0Q3NzU4MTc5OTMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5SFpoiAAAe+klEQVR42uxdeXBd1Xn/3r5ptWTJki3bsrzbeMcOm9kNCRCghKWEpFkIkFCSIaShpO1MOmkzmTZJZ2hT2gYCTKCUBEiAYQlJiMHYGLzIeMEL3hfJkmWt7+nt9/b3O+9e6erpbZKeRP7gzly9d5d3zvc73/6dc69suq7LJ9sn23htTuvB1q1bh91gs9nUJwUx/Tt3fjeE1I5Pv9Pp9GiaVm232+fgegP2MlzzYI/gei/2E7j+Ea6fSSQScVwPsUmzLeun2ddoNyuN5rFJL/ofhgv0uHE+gHM+fDZgb8K1GuwB/hx7GNfasB9OJpNHcD6Iz5jD4YhiF3wfMjbmZu0/34axKQgb6TfbtY6b0Qb54MZxJe6bjWszsFfikg97HOf7sJ8y+HAauGM43497EtYxs46XFZOF50O2VatW5Raw0WwgshSdVbnd7ktcLtfl+Gzw+Xx+bAGPx1OFcyUgzIl74gASjEQiZ/v7+0PhcDgUi8WOx+PxN/D5Du7pRHPBQphQzI0DBQy1GOhG0H416L0In9WBQMAGDCX4Xg5m+XHdhvtCwNANDB2hUKgPO5XkEATrZXwewPU+MunjsBTo2wcs5aD3PNB7JXDMBP0VwFECPkzCuVIoAZU/ST5Eo9Eu8gF7GONPIVuPzzfQRjuwdheLLptVEkdiwQiGVgrE3+H1ei+cNGlSTXl5eYNpGXIJikXT9J6enqOdnZ1nIHBvg3FP4/Qh/LZvIiwY+p+OcxeB/i9DKeYDQ3lpaWnJSDBAuPq6u7v3dHV1HQGGV4HhDfyuA8zUJsKCUbBwOB0YbgGGSysrK6dWVFQ04rqrUAz87O3tPQ0+dEDgtkL4nkS7u4Dh7Fgt2IgFDJ/U5EUAdCcEal1NTc10AAtkIz4b49M3MKevvb39CIC+ju+PY4D2WYWjmAIG+ivw/XJguB8YzgGGMiiKjBUDLNq+tra2Hfj8FQTtLTCoc7wEjG1BuGcAw19CKW6ora2dDYtVNVYMoDsOPrSAD+vx/RGcasYemxABo0/HoF1fUlLyjbq6usUA5hurlUnvJ4ittbX1g76+vv/AAL6O893FFDC0uRAYvlVWVnbzlClTKoFFiowhCav8ITC8AUEjg45QboopYLRacHlr4f6+CQxroCRVxeYDaE8Cw0cQtJ/DfT6DMWsdjYA5vv/97w8ctLS0ZO0QoKbBvz8ETblv6tSp82C1XByMYmWhJtGwJG4wn8nBCpjqSQC3ly5zLAJmYczlaP9hMOX6+vp6H7RfxgGDHWNTCwwLOGbA0A2hbgEdyUIELB8taHMS4qu7Jk+e/O1p06adxxhrnPhgBwYma6uBoRF82IPvZ3P9FmM6OgEDgFno8IcNDQ13ANgkSDPdpIxHQM522T4sSyX6XIKYoA6JwA701TMGAbOj3RsgUD8BU5ZVV1ebMdi4YYAQ+MCgucBSB5ffDwzH0Gd8LAKGdmswJn8DBb8bit7kYKA3vnwQ8MFHPgDDAgjaDmBoK6qAoSP6+X+bPn365xBAuoplivMNMgcNlsCDvhfAXE8Bg7aNVMhMAYMFUcIFDHMQAGc18eOAwQkLMwPCVg9F6TRKG4nRCBj4MBmM/h6U/CtVVVXVRllo3DFwAx8E4zcLGBaDD1uAob1QAbPnkeI6gPpHaMxnwRjbRDAm3VQjvvDA6twEOh4CPVNMocm0Z8FwMX77I2BoRFvyMWBwQzE/hZj1TsRN5+PYWYhSWHdgKIOQ3gMG3gE+VNANZ8JgU78vwp6BD7DGgjG8CGP5E9Azu9AxyGXBAjCRd8EU3w2XwqKdbaKr/hYNouWkBjFt3jmCWtNsYPgvYFgCrZ9Q4UrD4ASGabFYzA9X02zU/AoSMP4WbulahCYPINutS7dcvMdhZ9nCpoQDCMdMM9tSlRp9aEBPS4atCR7FgXPvo+/+fBYslzZdgCzxHjAmkJ5tfhxCBjoqkWDe29XVtR1Cs6GAtLscv2W2uJrCNRGuPY+79CK5uA6pfysys382Sxj5SgewFnOA4X4IV2O6cFEIYglN3j0UleYTUekMaaKNESN/7oSALZnmlsvn+yXggQXVh/CBGebnwYf3cO6plBgWOFVkAVUPaf1baD7jh4JrM+PJINBhAz1zwKAHsB+CVrfkYg7inbWIG74EzRe4pqJiSHcjYoyylbcmKeY5IzMrAYarYMk2AsNLwJDIhQE0l+M390IwVwK/3YqBVqsjmJRfbw3J+gNhOYPv0bguYw33dcPVbjkakbMQ2C9+qlQJsm4IGQN/CHsF6H8QgrYNGD4ckYChESYn1yFeWeP3+9X8WrYBVma82MJkTt+k6QXSZGY0jAXWIptZi3ueRf96lsp0DTDcj3ClJBcGu0G/lqG/jK7DZinWGsJjM4Ifm6TaG0KLan+wbWIA/SyI3goGvYNT7Xms3gpgvga724qB3cSTurywPSTPbe+TKWVOuf3cEplR5VR0jMWG8fd7W+Pywo6gvLm3X5ZMdcuqmR5JaAMzF8IxhXwsAh9uxvG/gM7wSASsnloDU+jLpr0caFhmSeJPsZ0O23Y6UnFFUhueOoOuir6+vq8jlnkL2tOaScBw36XAcMmkSZNy9kX3wnFzoz/2m0vITOE6dCYmGw9F5MOWuHT1J0GnTaZWOGXldLec1+SVUo9djnclZPPhiFT67bKm0SvlPru1bQ8swHLEk+vAoGezlS44FQcMrHdNS3ftDtC792RcNoOOxmqX3HdpuSyod4vLXoTxR9uL6hNyuCMu+07HZXdLVM5t9AwTfo4t+PA17M9hXPYUJGCsDeHmCyGhMwFuWNxlWq7jZxPyxt6wbD8Wld6INqDBY/f9CBTBrEvne+XCJp/4XDZJ6kOBwe1xEvocMGcZTrVmyNrKYb2+AK23cfonU9zFGOODk1F5ZkufnA3q8hcr/HLlAr/qP5HBk/J8BM7s1V1BefGDfmnvTSrFshtZ10kI1DaMxe8/DMu0SofsAPM7Q0l1/Uwf3Mx5JaJrKYxUEtDPuuI1wPAKmunKEos1IkxZg92ZiQ9toKEHY3/D8oAsbXAb5Ri9KC6kMmCX2TUu2XkyJn1hfRhzSY/b7SaOWijKlTg+gP7jeQUM5o6rB26B+SvJlHGRMc0nYvLohl45BAn3QWUcNsOuFgFbBPvulpjsPhWT/dCev4L/D3iZpg+9D66vFIHyTYhlNkApgmnNzEDMdQnT6kwYyBwqxfPbg7LpYFS8EOLH3ukTN7BdPM+rrGciMZiLOVQgLbg/JP/7fhDfdZlb65KL53plXo0b8V1KwDZ8FFEM2Qu6fW4b3JZDWnuSsr8tBiFOSoV/iBVzAEMTrPB8uM3NVldv0OwChhtwz+SMma9uuHVmdi6Oj54xrBhWMrCLsrgDAqPTS+hDPAUvJSCoVCoxs9Is2TfG2NHT03ML3P3/cdlPXgFDI5Oh/RdwqUom4k73poLK/W1xaLxPPrPYJ1PKnUOC2bEEzgS2A0wiM1/bHZZaxBY3nxtQA2hlAOhzQhHWxePxKq7JspKJ61eBObglkLEfFwZ456moHDyTUBnSjcsC8v7RqDz8Zq/0RjW5ArjK6NKSqcGny9gE4fltc0gF0Z9Z7Jfb15RIbaljICBeOMUl58/yyvr9ETkIxVuDmKWtNyGPbQzKYfSzCwpzyXyfam8gxS0vn9fe3n4NlKQZzIlYvQgwBIDhWk4D5YqVVPyoFTb2KUXRlVuPJwdDkQCUgUqWyaOY/WSLEWHBbKBzBZUae34Bg3AthQtymstV0v0+XeIe+OR6CNW6hT5ZMsOT0qZkMSZZsaOPGmg+0+1H3uqV5uNRuXiORyaDmUO0DDdDwLwwzyz4HbM0w4WClzAItS7ISy8tH4OL7+7XEL845dolfhVj/DsEjH0ebI/L9UsD0gBX5/c5pA+u7l3EOi3dSbkMrvtWCHxdhSNl5XQj6wLtFNZPn+MDQ3xyoisJoY1AQRyI2eJyFP2l0kpricFeBuaQfpdhvK34piJrrMjEh9FsFK6+qC6v7+qXV7C3wlD43HbEiDa5CS523UK/uJ3DY9789TI7a2M6+HAuaN4ixqR+riB/NRfZZTTLGKDWngTciy4h+Iyn3gsqjVyO4JZmN54YfYmP40jLchZa/4e9EcQ5IaVdFDS6GbqbRFpxkYsa4SZXI6Z5yyy84rsXTFuaLfYytxBcZBT0VpU41MCumOGW+68oV5je3BeW945EYaG9ctFsr7LadHulPpucN8sj06ocEosOTW5UbGUwMpFMTY+safSoOKkzZJeZyO50y4S0pXA5Gcwp4wpTy6ICMm4FrJffPM4UJw2Otm5pN4viYoA3HwrLk5uDKuFYWOdW3iIU11Q2qumGsuiD5Qizfd1oONt4AoMXhmkNXP0TOAzms2CLYBlc2dZh0bTGIVQcsAPQ9B/9rkduWxWAW/EiMMTAx0cuZE57ijH7WmPyXHM/3ExUKsDMagSaHAQKbqYNljYAOhdwKoZhg3GaaSOzL8m6lgz88rqYOUKroSwUCBK9qN4p37myTF7bE5ZNsFi/aQ7Lb3b0K4acDWoyY5JDWS7+PhtGWoBU9qvJq3Dx247H5Y41AbhMt7J4GZjDhKQJse8pi4A58H0+VwMXKyuPQiGOdSakP6aDHp98bkUA2DVV5yrxpDLoQes1Mg4y2IdCLGQhOa+A4aZZLEpmnlJRFSrFkE8j9uLl57b3yyNv9ykXcP0yv8ytcSqNKNTUup02FddsOsyMLqSElvELtX/rsZi09CQGNHRYwgE6yRyuozenLMAcLvOxZ8eQKkVUw3KVeu1ytCOhCpR15XYlAHQZn18dkAtmuWXzkZiKNZkxEnOJx64SAdGyazOVpT8m8hqyyfdhBW9Y6pdrMVZOhwyJv0wrDCHiOvkmtPeODK4Zc2Jv4pr6rLMPlqqunsWC8SsTMKfTZrhyZODgNt22B0LlQYJWXWJXcZlpwcw2rH3qup7TgnGs+eyFoeh562BVrNTmnABnDQTW6sqFXqlBbESr89LOsBKyW1b65VNwIy4giyf1nPGWB8AZ17y+h5YiDMuoyXVLfHIrtCsA5m8/HsupTEZJpRq7w1L9ruVxrtiFt/bHNDWw/RDuF0F/NWLpmlK7UaKghXapNJ1aTlynulmWsKm6VkLLPVFNHHTtTZNdKgli9phtLDDWXFlbw3leE4OBpzofHwqJu8KwWIehRPQ8XSFNYSeWw1DkCK7RelWBl1SA0SZpxlgzrHIVkkW6s64tslBgjtdl8z1K+1/6ICx/RAb18J/6YIqTcpUSPjvinMGpB7MJh+ESKUCsKW04GEUbDrlxaYnKTMuhVafOJgsF5pWhK0LKUgV1W04BO92jSU9YlwV1LhVbMbas9LvUJC9pZBhAprAAuwAZ4uJ612CIkMy9/opuPQjBpBtm0TWhYihbNoFkMdtnrI5IGud4cyDnGq8ChIG0H+qOy49/36dcIEszxMdaHecuKfSrEHt+boU/pTijFDCDTpvBi7wWTDdXR2aqvQwRNuzUgnm1Lrl7rUPqEZ88/X6\\/\\/PK9kMrSbljqk8VTXco1mN7BBatFq7D+QFTFN0chSLMnO+VrF5XIKiQLnI5IJvShZl8yL9E1HxFLx2usuc++ckIXpbkeIKfL4ACrgq6mDyvnaSpDTglWphmDTPFOBFaRicH0SqcS3lSJJesaL7al57iWsS8zGB8I+DO4SM2oj3qAzS5G/Qs301oRuypT2AdDn3QXaY2mc61CyTfHmy5g0Uzzdrkmrsx5vGAkRXwSVusP+yJyEqn6ZfM8CJ5dSkOoMSdhnpmhvXUgBvekpSrnyZSgaiMMLw1gYWiQZtGm7tSl7KAZHzZCqJlB7mtLyHEEv+fDrUcThc1H5qpLcWOdie5odaNDJRKRHOOPsSb9fB5Rs1gsUhEc6+Q8kyN6hgeuKMV3kRcRxrwJL3PFfJ9cPNej3CdrYH53brdfCB8gfFp6qSWbgJ1F0Dw1mwXTDYdnBn4UEPr0p97rV8Q3Iru8cblP1X5e2R2Vx99NyHSk9XQVtBDtfRqELCFN1S65a3lATnQl4CYj8rO3+qQDTPn0Io/YHdYAdlB70unhxDHOdZiuxdhO4RiXEp5sWsfBXoyMsRF0UQleQPxXD0aw7hVL6mOIRVIxDyeKWbicCyFOJHOvP4vH43zouAPuXrNkkUk+m2jgy27BRB9mXay3MoxhnNs02aESqXJvyv1PRgjSUO2QZCylUPQaVlnW9YEOhpRBsuEw6AwWNFXEJ5ZjsdiSfOumbEbB8gAG88nNIVilmIpnvnp+iayc7kJ84wYT3bLlWCoTY7bmQk91yGDWLSxRvn9BrVOCUU1lZ89s6Zcn3w3id0m5bZU/tdjNlnv5DuikBTjEOWvLpZPUpmg0qmb8syUpLIMwAGe8yFiQmfBnkWAsgUtn/W00QkYX1BVKygbEN9WIPxfVOYdljukY+PAxMVjdJBWE54AhHggEXGOxYsQaBdtpnc0QQK2KwHE0UZxlChxr0HwcAhYrZC5ydyQSuTbjsl5LKMH0t/lYXH6+MSh7WlKlhS+fnypTROD6/DC9a2e7laXoDSNjM6YmGOtUBexqro7BMj9vXOZV2vX45n55dms/rIDIJXPdMiBjWSwYmBODtvOJo6jFRfbgHJ+8Ls2lJJxbpCJMRdx4HFasq19TlX1+MnUXfWTuWtWRgHHnqbicgNBevcgLF2xTFizXBgwY8uQxa80O1owW+QCfuq6srKzIVM/T9KGBWK5C60DxNBWh5i07DJQp0mOyLPdjrGl19+B6uBAXuQWgdfOJkvRGecQ4i1pKd3cAMcxVC7xy+7l+aZjkUFqhG1NHtPi0FFUB54AxMk0yA+FUPKQLQgBZt8AjpRCyRzemSh5MrZkMpJYAZ9Z+AsMnH0BIWgQsAtqbgaEhG4bBbFaXOTUO+eCUDZZUpB7WlcJvzzTfkbdYbJMzQU1+i2yatTTGnvmsIOmCe+k03Et6XLODlsHE8Oe6kT5DwLZAMfozKl8a6A8Aupc/ylg9hwXyu+yy9XhcWnqScstKn9x5AYUrVbAbmJowxovBI4UuYuyxZMrvWx8w4M9soOKi2R759uUlMhtWcA9c7xFkorR43PW0tJj0gc4OfD+YRiJBvoJrejYMZo2Ifa+b75U5iFE4pfPs9rDK/sSWecVqVuFypDC+sjuirOHaOR4V32l56mWwUP2gc2P6unZDIfhiksNQlD9b4TL5gDiSL1N5L1s2nG7BOgD6j729vbcwhrH+htXsmZWs/tqktVeT21ZyysEnlbBSsYQ+ptUUKnEF05c3kByfPLIhJPtOp+Ygp1Zwykgb0j7oI7AXQd+ZdMMA4OvhdoJ9fX2l6RhMd0Y3zCyrxCPIqjzS2qOpeJFTJ5fNc8vKBrfUoV9bAcLFrJRZMS3vPMSV1yz2FrR0pgcbxvoVaH44A/P6cO03wLkUGBxZyxTGilnl8vK4SEmbu8zlIjV9cA2YnqNMgTGmom8ChmMFlSlwYwia8zyU6xYG0VyPPxi36LKswaUCdGor59nKfVz3ZBdt5FNYGQugyaRNdiGmO9mlKcE6f5YLbtY+JCCFYFH7MQb6y+lm2RiEVmB4PRQK3ZyOIbXkSIMwRGUfkg9mWcz8QrHUylYG/a8i+w3h3LUQlDKvLaOgcOxdYDtjy42HYvKLTf0yyW+XL6724dOWmt/MsYEuWtiDoPdguns0jhPA8Cos2IPAyzV6GRXFLLuYa+Y1vVjWKf9yHYMPdI/P53ri25lBe97hGiUo2HI+MDGwDBkfrJvctNyrhG0rsq+nt4SVYGWLlUa06YPpPoX22nM8EDD3gOs1Bx90kUF/wvftGaZelGKB5sdwz024127FQIFaD2vz8q6IKrFU+FMumJaSrn9erUPOQ5+z4Ta5uiOdYTbDatG2dSJ5eXM/51DDShDvutCvLFhCyz0WxNDd3c1XVz2e7QFW476DuOcl3Ht7TU3NsCC/BmNEBW8+GZfVjW6ZVZVaGZLeOcs+g0XVVIXfxvqXnrk8wGp/byQpp7oT6t4y7/CsmhjoRRAnHsfhG0YdrGABa4FU/gwN/E9JSYmd728wGcSK9pRSm9xzoU+aT7hkd2tqhr4YT64bz0go4Vo1wyVN1Y4hD2OYPh90xeECH8v1CDvu3QYMr+De60pLS8VcvmOT1FQPk4wyn8j8WlhkZJOzqp3YHcoqMXZin0kzqzPW4qeWU3PBnq5mIF7eFZUtULKZlU758nleWTrNOWTWIlfcEgwG94O+N1n/ynFvL+55FBg+y1dKDeWDLrNB7/kQrF83h+WRt0Jy1UKPGrt0Z8KMn5a2I0j8NlX7238iJuFEZstMvHtPJ2TbibjUBFLlloQ2GKJY+ED3+HNgOJLTGlpN77Zt2wYmjXH+ibKysqvr6uqGLX2xWwL58djMLNkKiv23tbVR+5/H8b043ZZlftLcLsIAvMQnoadMmTIgJKzeP9eccvEUtIUYwAua3DIPGSWX5tBKp6ZSbErAqVRh3McFe5ycf/9YXK20YN3rXM7lLfPITFiPpJ57wtjE0Nra2gfm3IvjpwoILPhik38qLy//FjFYF1Gm5hd1eXFnRDYcjCGL1XPW3TTDhdptg+41432SUjIul6IXuRkeS2ymARjCh9249SaWVMzf5n190/bt263xzOVo8Jnq6urJfIIkW1A4Ho+tZXErcubMGVrXW+nGC2jKD0v3d3Cb36ObrKysTD1fCSFrC2qy/qOYbIewHOnkuqikWr7TVMU5VbuK+9TafE5cRzWl/UdgtViK4MDThTI+ZObrdw+fq8wmYF1dXcTwNDA8gOO2bOWLtOMFwPBCVVXVfPPpdKuiU2h2tyRUDY70JbQsPDEy43zJmGbMACyd6lQYXU7bEEU3+NCLsb0Hp56x/javgFksGDcfGvkm3MsPEAO46Gom+tF78/F5uBRqTT9ikgf5KgAZXGCYb+K1AfsTCPQvq62tVc9VcvLZbtPVkiJOc+04lZCP2hMqM+4M6WoRYiSRWtNGYfTCopVxWUuJXSUenIFYhmy30mc3VoOOCMNuxC2fhyXaOcKhuMnpdPIVCNXp7zOzyeDDHPYiajvDASYrusU7IHGS06dPM/b6CfjwA9DQk0/AnDm0J4xGfwGmzoHEfpUdmA9STISQmYwhKPSfBB2PgoZnOJUygjZO4Df347dPtbe3n8P2iIHkMzOtZTJR6YGguFWpoq1Pk+5wqhCsBAwxGWclWDDmNFdNqU0FwbECp1qsGNA/p+G+OwrhYhuvIWv7KcbhH7jExypkulFvTGj6uPKBGSMwMMHiE+kPpwtXQTFYpjccYuODnz+FJbuZrobgxtuSWbW+o6ODQeUvcfxdyfLkSq52jPeArcX+nwiUF/HdYOkYzBeIOGzD40sz/afAJfXClcuKAYJxClr/XUNBRjtwfKvO34MP94EP7onkgylcwMDnH+5Gn/sz3T+qNxyyrolGNyNgnhwOh5cYS31lvN4GbQaS9PVnz57VAeoJnPt7kjeatoyN8307YQWWA0NdJgymENEaxJODu3qCXRtZjSkNw1Fo/UMQrl+NYhZqyLQf2t0KPtiAYSVLccRQrCePsmFgWQgKQuH6Hdzifbi0L9tvRvUCOouQbeLMLKzJMq6DZwGT67GL5TJNbeEcHJhC5rDSzfce/HCkliu9TWM7Dma8DwgzwaDZXGYyXhiYxnd2dpI52yHU30G/L4xRuAbCFrT/HjCcRR9LgIGPvg0Uk4vNB2IAH5LAwJrdg7j8Ua7fZhKwQlyktXMu72Vq+hC0ZyHNNIP/sQC0/BMEVVuhSwG4D3Dqh7jG6aDoWAcr7S3PM+Euv4FzX+fbbkh/sTCwum1gYMzIV7L/GNd25coSR4mLHfKR/e+53e6LjZfCFI0PnALibhRS/xXXnkabXfleLT+qt0xnIgK/WYj9SzCZdwJUJV9MxuCZxcCRmGxmfdQUBsH082BQB7Tzv1kjwr5vrAzJ8Z58L74zLvtr0Hud8Z4FtY8GAy0W6ecOwdrEeA9tvIZ+OtNDiWJaGbTViL5uQ1/3AMP00fLBXJ1i4QPXETE0edScMSnkv68UU8BMa8bnEm8GmNshbNNprhkXcKc2cerGePonNW+WTKqdmk7B4s6VDzh3FANFoXoB+15arYn4Rwz4rMXplej7Kzj+DOj15cJgrvfPgIGzC2/jGpOR9diPpTNlnARMhTn4nIv9OtD5BT7bCgy2QvnA+Vpi4Hec6wCGZ3HL07h/t/WB4I9DwAbe3IdTdSBsOY6vBJiLcW6m8fiV3TDnqRpfatOMyVz+v5+3AeR3OOZrMVtwLTaR/6vIgmMSdi4VvxC3XY1ra3C+3KA/HYNmYOC6+R3Y1+P773HL0fTi6QQJmNkPJ2Lr6V1A0xXgwyXAMZ/JgIkjnQ9cbo6dxeuNOM//ScAXLXPZeSgTHz4uAbMOng/HXE1ayocx+dJeptec8pDU/yGiyziN6yf50hJqCJerZPqnThMsYNY+y7EHQHsljqfzhTDY+Tic01i7dQa/Pc5/imX8Iy9OricyZdUTLGAD10C7h3zAJ/8tDstMdVQigw9cHtTNN0TyH5MZfOET2aH08S+6gH2yfbIVe7N/MgSfbOO5/b8AAwDCB5vdkkgX5QAAAABJRU5ErkJggg==\\');height:50px;width:50px;height: 30px;width: 30px;background-size: cover;background-position-x: 62px;;background-position: 62px;\"></div></a></li><li style=\"display:none;\"><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"http://pinterest.com/pin/create/button/?url={0}&description={2}\" target=\"_blank\" title=\"Pin it\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Pinterest.png\" style=\"opacity:0\"></a></li><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://plus.google.com/share?url={0}\" target=\"_blank\" title=\"Share on Google+\"><div style=\"background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAXCAYAAADgKtSgAAAD4klEQVRIDY1VzW8bVRD/7Xq9teOPtElDHdlupSIFKEqUhH5AI7WNBCeQuHAqlEPpASHgyA3hf4ALHwckGoFAHBGIA5zapoiCEUpCEiGFUlHJTkCyiePEXjter5f5rf2CWTuBkcZvPB+/eW/evFkNB9DKysrpVqt1NRgMpoWPmqYZbzQa27ZtF4Vzuq7PjY+P/3QARK9pYWHh4urq6s2trS2r2Wy6kqCHqaedfsvLyxd7UfpolpaW5jY3N7ccx3H/L5dKpS2Je0/gtD6QnkpbXFyctyzLVqDcHWWu/8XVatVmfF9wZqaDkKuYgJQVsJL3szOeJ1cJvGOwZslk8stYLDaoaRpc120fpSMXKi6+Xqnim18sWLstDEUCuDQWxotPROH3LwttbGw8OzExMa8TRW49Q2DKCljJ9wpNfPhtGU+eCuOtZ44gFtLx+MmQB6x8uJIYG4/HB4nH/zrbLZFInKOhH3/24w6OxXWMCo89YGD2oRBurdWwXXMY37MZ6ohHXF0u7KVIJBKm0k8szh9lB9v1dpmY/NSoCdtxhQFpUQ/890IDdrPlhVNHPL4P3TCMlKpbz87FcSIZxJ17dayXbC94s+rgsROHcHjgn677JFv1EhJYUSAQSBt8eQTdjy6fjcBquPjo+yoSUppyzcXLF6KsB37O28je30Wu1MT17yowDQ3XZiIeFHF1Pmm1Y2q7E1GOmBpen43itdkYbqzVpTuAqNn2G4poePiYgXBQw5isjyQML55xUpG4wVmhAP2rSrZebuFPqX3ysIHbd+vSijounxmQ/wGPF+UEMydNhCSJInkb24Y8iKJS+Ffe0adZC6zkmeMmXrkQwY1fd/HFkoUTR3TMPChHELp2fgBmgN3WPhHvkLiGdEuOF0GFnz7+wcLquo23nxvcGxpXzoZR3HGwLHoFfshoR6qTE4+40u/6XKVSqdHg55truwgEJGnHRgj6JAYDOD7Urq/SdcfKGKgRV+c8LhaLWeWkVjq/8VQUf1UcvHPLwt2C43XF7d8aqNstzI4F6er1uid0/RQKhSxxvecvQBnZfdnv/OhoAJmnY9ipO3jzqx28P1+FIRHPnw4jJKVQfc1VMXGk3hli7RWa0yyVSl2R/uxUkOZ/E0+jHhwtSlb3JaDNfD7/weTk5KuevTtcvkDz6XT6vPS+l8AP1u3rlwmcy+XuTE9PXxKb9yr3dt5x5gfj3ZGRkRdkPuyNX7Wz/ZLJBZalzp9PTU1d7U7qB/dsnW9iZnh4+FwoFArLzXfHeDITyVerJp9ENkOG89vv1BdcOXFscmrKEEoJH+WT5ssTXVE4L7rrB339/wYDDxkPEF5efgAAAABJRU5ErkJggg==\\'); background-size: 29px;width:30px;height:30px;background-repeat: no-repeat;\"></div></a></li></ul></div>',\n callForActions: '<tr><td><div id=\"cfa\" style=\"white-space:nowrap;border-top: solid 1px #c5c5c5 !important;padding-left:0;\"><div onclick=\"alert(\\'call to add to favorites\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;MARGIN-LEFT:0;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px silver;vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: grey;\">Add to favorites</div><div onclick=\"alert(\\'call to book\\')\" style=\"cursor:pointer;border-radius: 7px;height: 27px;width: 187px;margin:5px;display: inline-block;text-align: center;box-shadow: inset 0 -9px 37px -10px rgb(3, 179, 12);vertical-align: middle;padding-top: 8px;border: 1px solid rgba(0,0,0,0.2);color: white;margin-left: 1px;background-color: rgb(161, 218, 101);\">BOOK</div></div></td></tr>'\n },\n header: {\n header: '<table align=\"left\" class=\"mi_reset mi_greenredtitle\"><tr><td class=\"mi_header_caption@@@gaugeOrientation\" style=\"padding:0 !important;\">' +\n '<div class=\"mi_drag_area\" style=\"position: absolute;width: 100%;height:125px;left:0;z-index: 2\"></div>' +\n '<div class=\"mi_green_close@@@gaugeOrientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\" style=\"z-index:3;\"></div>'\n // score gauge\n +\n '<div class=\"mi_gradselectroot @@@gaugeOrientation\" id=\"mi_gradselectroot_@@@kfid\" data-score=\"@@@grade\" style=\"left:123px;top:-48px;\"><div class=\"mi_gradeselect\" id=\"mi_gradeselect_@@@kfid\"></div></div>' +\n '<div class=\"mi_title\" style=\"@@@titleOrientation;margin-top:40px;width:240px;float: left;height:38px\" >@@@displayText</div>' +\n '<div style=\"float:left !important;\" class=\"mi_subtitle\" >@@@count</div>' +\n '<div class=\"mi_preview_images\" style=\"z-index:3;width: 100px;height: 75px;border: 1px solid #ababab;position: absolute;right: 18px;top: 33px;padding: 1px 3px 3px 1px;cursor: pointer; cursor: hand;\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\"><div style=\"border: 1px solid #ababab;width:100%;height:100%;background-image:url(@@@previewimgsrc); background-size: cover;\"></div></div>'\n\n // tools tabs\n +\n '<div style=\"clear:both;height:0px;margin-bottom:0px;border-top:0px solid #DBDBDB!important;\"></div>' +\n '</td></tr>',\n footer: '</table>'\n }\n },\n scrollables: {\n header: '<div style=\"clear:both;height: px;margin-bottom:0px;border-top:1px solid #DBDBDB\"></div><div id=\"mipct_scroll_@@@kfid\" tabindex=\"-1\" style=\"heightdummy:0;outline:none;max-height:auto;\" class=\"mi_scroll\">' +\n '<table align=\"left\" id=\"mipct_tbldefault_@@@kfid\" class=\"mi_results mi_scrolledcontent\">',\n footer: '</table></div>'\n },\n socialItem: {\n timelineItem: '<div class=\"mi_timeline\">@@@fullYear<br/>@@@month<br/>@@@date</div>',\n nonTimelineItem: '<img onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'avatar\\',this)\" src=\"@@@itemImageURL\" valign=\"top\" class=\"mi_resultimage\">',\n youtubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itemPublisher<span class=\"mi_resulttimeago\">@@@timeAgo' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\">' +\n '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div>' +\n '</div></td></tr></table></div>',\n lightboxYoutubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery.MidasInsight.StopYoutubeVideo(jQuery(\\'#mi_image_lightbox_@@@ksid iframe\\')[0]);jQuery(this).fadeOut();\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/@@@youtubeid?enablejsapi=1\" frameborder=\"0\" allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n lightboxVimeoItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'data-src\\'));\"><img src=\"@@@itemContentImageURL\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" nonclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',\\'\\');jQuery(this).fadeOut();\"><iframe id=\"mi_iframe_lightbox_@@@ksid\" data-src=\"@@@sourceURL?autoplay=1&title=0&byline=0&portrait=0\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></a></div>' +\n '</td></tr></table></div>',\n normalItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itempublisher<span class=\"mi_resulttimeago\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">@@@itemtext',\n instagramItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">',\n itemContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><img onload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"/></div>',\n lightboxContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><div id=\"#mi_image_lightbox_@@@ksid\" onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();\"><img src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"></div><div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(this).fadeOut();\"><img src=\"@@@itemcontentimage\" style=\"nbox-shadow: 0px 0 10px 4px #eee;border-radius: 5px;\" onload=\"jQuery(this).css(\\'position\\', \\'relative\\').css(\\'top\\',\\'50%\\').css(\\'margin-top\\',((this.height/2)*-1)+ \\'px\\').css(\\'top\\',\\'50%\\',\\'!important\\');\"/></div></div>'\n }\n },\n RASTA: {\n panelLayout: {\n header: [\"tabs\", \"stars\"],\n content: [\"photos\", \"tags\", \"mentions\"],\n footer: [\"share\"]\n },\n panel: {\n videoholder: '<div id=\"mi_videoholder_@@@baseid\" class=\"mi_singlevideocontainer mi_closeTopLeft\" onclick=\"jQuery.MidasInsight.MI_GetPhotos(\\'@@@baseid\\',false)\" style=\"margin-top: 74px;background-position: 10px 18px;\"><div class=\"mi_singlevideo\"></div></div>',\n containerHtml: '<div style=\"padding:0px;margin-top:25px;border: 1px solid #ccc;\" class=\"mi_panelBackground mikfpanel mi_rasta\" id=\"cpcnt_@@@kfid\" style=\"direction: ltr;margin-top: 20px;@@@layout\"></div>',\n tabs: '<tr><td><div class=\"MI_tabs@@@orientation\" style=\"margin-left:0px !important;position:relative;z-index:30;box-shadow:none;left:0px;padding-top: 0 !important;\">@@@tabs</div></td></tr>',\n gauge: '<div class=\"mi_gradeselectgradbg\"></div><div class=\"mi_gradeselectmasknerrow' + (window.MI_defaults.RTL == 'true' ? ' mi_gradeselectmasknerrow_right' : '') + '\" style=\"background-image:url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAABQCAYAAADFuSFAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA25pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyODYzNTRkZS04NWY4LTg3NDEtYjNmOS02OGU4NGQzZjVjODkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTM0QjUyMzEwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTM0QjUyMzAwQ0ZBMTFFNTlCQjg4NzExODFEM0Q0M0QiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RDVFOTA3RTFFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RDVFOTA3RTJFN0Y4MTFFNDkzNjJGQzdDNUEyRDA1MTYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5NfkuaAAAX1klEQVR42uxdCZQdVZm+99by9u7Xr1+n926ykOASgQODS5gJijIGJQxbOM4IIosKKgoHZw7icubMAcHjuI3jCHJkNI4LGcEIKuoIozKj4uAIkTBEliyd3ve313bn++tVvby8vNd53R00CXVPbqrqVdWtW/93v3+5SzWXUrIgHfuJb9u2bUk3UgMIhUIsFosx27aZoigsn8+ztrY21t7ezvbu3csikYj7e7FYdO+JRqNM13U2OzvLUqkUE0Iwx3GYqqruNpPJuFsqo1JBzt3fDMNgiUSCzc/Pu+VS+T09PfT88NDQUE9ra2tnOBweRJn9uGcFbm1HDqOeKo5t7JvIczieQN6POu+ZmZnZj3qMo05Te/bscetNdaE60jvRs6mO1e9M9bAsy30XOucTga4tFAru/ZRzuRwzTdP9vaWlhWWzWfe9qN6opys3kg29G+Xp6Wk2OTnpXr+UpI6NjS3pRno4CZQqSS9NlSchU6KKTkxMuIKnytILUiIhEPhUabqeztG9mqa55UGwFWD9RMKia6iR0D41AgiyG8c9AD4NQZ6M3AehpXC+G2V2IrdhvxW3h5AVnHewtbDNovwZlDeOMkaxP4G6TaKh7YCg96Lek7juOQjZKZVKbv0oVzcoapQEEAHoA0HnKFNDpHehhkCyoPel3+m6ubm5yrtTI6D7/Pvp/ej30dHRSlmLBtKv6KKp7FXQb5W09Y+rz/nZB6U2+/f65/2t39Jpi/KiAHc9Dl+LxnEGGtDa9evXnwChtUE4YtWqVYeUWyMQApNeNATBtSOvIQFS2dTICBwwOguARsGknbjv97j25yjnSVwz4pflM7S6/Ebnaq+r/b1aLtXyWzKQR5OepxfyWyheJo58OgC8CHlDOp0eBIApUkmkCah1L/WlqxNpDa/RxMHSNQB1DcDcDICvx/4E8mOo0w9wzU8IVLr2aPQrjhogCUAiOlrmyVBNmwDehfF4/HQSNIFH6mip2qMZ7UKJ1CJleiYBC/UaB6groSYvhSofg6r8d/z+IPKvAOZsAGQNC4mBSG+Bs/E2qLhzkdvI9r6Y4DWTiPWUyTEDqJ0A9b2w0dfB3v0c7N2GxncvLpt4SQPpMRAEFOdBWO8BcH8Bry5Knp1vK46m5IOaTCY52LkRzslGAHotWPp11PVOvMfMSwpIzwbi3flrYOs+AgA3gYkcAvqTsq/ZRE4JVL6bAegrpqamPgGWXgWG3o53uw8aZua4BbI6FgR4L+vu7r5xxYoVlwNAnQCsDjeOpUSqnzJU7xoAejdAfAfe8xNoqD/8YztEfxQJel4ox0u/H6rzxo6OjkGyOxRvLcO6MgoPORdjUvK845jcKY0rQqhPKuHO79e8m4Nrw6X8c1sY07vVUJetKOT1Ulhi9yE6WZYm9z1pvNufj4+PnwaG3osCbwGYw8cNkB6IrxwcHLwVDNwMEH2vcNFOEXhdcGxzhDvGDqnEfmUWRwt6OHU/UyLTjm0xszDCVTVSBJBmnZqwUu6Ff2Y8qjElJYWgvgKLFwoTl4RCXSkmi+uB9gZVDSepVwgNZNEql94LjTU6OTl5BfKG4eHhj+DUvccskNW9ID09PZfBntwOddpDjgy594sC0LH2AcVfAsAnpZ3dAdB+zsz5WUWNESkPfq7QkBu9EoJxJVSUTC/W0O8rdGxaBTyGeoOstbZtnYufNmpqbD3nSrpxmYcmsvOdnZ1kQ0+Exvl2Npt9NTxesp8TxxSQJBTqi8RLJMDA27q6uq6FPVQWw0KoQUMacy84kv8rVyPf49L+A3AwmYMwRQFTuHIQQLWANQKy0bXl3iNioJjDf7+Buv2NYWbaTDu7FtecpWvJ81U1erLgSnQx6pZ6nMDMG4eGhjZAHu8FmI8fE0CSQAhEbFf29/d/qa+v7xxSpeS2N2PzHLOYl1buF0wJfdopzj4GEGeZBtlJ7p5nJGxkTr0rnLrx8Cy7CFxDXveXiuMsk9Y0MIngWt2Fiq5znAx2TEZYlEEjG2t6dtYr3wO3XJYC75P/2nHsXwPUL0BUvY5T+jtVCV+kqKFWznjT7ASIrx4ZGfk+nL13Qz7bXwxHSBzJwrwO5D8D+7bDJp5DoxPNgCjNgm3O7nnAmn7mIsfIvRnS/jGEPesCV5Gv4gqdOQZz8CO35qGmE0xmfgdtOMtULQyBRZlwplEegLQLLnBkG5lTApmzwAL102z3OinnEOTvxn6CGdYwzhcAjeoBLMvthtQxNRyu5LC/y3Gsq/LF0XPmss99oWTONa0qyaRAHp1g6VZ46e/zG/1RxUjf3pA9ROs7e2BgYCtY2J1Opw8b1Eur5Nj5ifsdI/tVaRs/4lCpZOcOUn0u8+AwWTkmiFGFIfgrvYwZU0yJDjAbIgYNq+pDrFXL7KX7padS3d8Ah/S1B93joDHEWCH7NADtQ1uxXDCFsKBZ5KGKmNNAgPpYsTT1mGUXt9oh82pdS2xRlVBrM6oWskmAnf8EJ6gDzPz4kez4OCKMpPgQLW3L6tWr7zvhhBO6SZ0uWEEaebDMR6A+N8nC9F9DvA9woRvMU3menQSZSoyZc6TmGDemvcrKso2kTNe49pI3o7lrnCO6R/HsI5wkprgXUENQNJ3poTjaAFQyM8sNqUpUAo0C9pLAfHfRmH21ZRa+gvo6zfQOwdyw3t7ej4XD4c9Bg/EjxUx1uWz0QLwAhv1OVLCF+kgXMKKQvTlnZ8a+xLTY33OhFOBKukxh8oCkuevOk3ChCq0S4+F2CNUDrNJAvK1jHkBI2hqTxkrmse1gFG08wkDcaO7HwXxZhVpVZcmDnB+hqC7TbQkVjTpaMgsoFRyzKluqSORnbCnflS+MPBrVU7cgPl29UOhCLCQwIbvrx8bGVNM0byAu/MmA9EGEOj0PLNwKEGMLgkiiLWV/4uQn78DdP60A4gvGMVw2CEV3277U4KyQl0oXEPMqcvYAd8w2bFNchN8CSafxo8n19Clg78lMbQO5wxW20r5gbSwcOUnlPLQLP/436VrO1d+jjEfhxBTBqEle47i5gIKtmhJmJXuCKTzCpGu2HZQnDjhJnNlcinvyxtwvVUX/UDSUuvJwMSfkRbvXjY6OmjBLH1wuMxcNpO+Z0ig5PNM3AcSvoYXFFgovpAlbODf0HRZpoxfMsmq1S4OrYJUbhxt5nFI9Z8PL3ENQWjCWvAdt+gKwYECGUhcAi7BIntbr2j/3bZLYTdZpdQqiFp0pqtvQBpHfpKrUt9tioqzRcGjAFCLyX1Ch3+dc/lC6jK1mc9nxKdnzLKJ1sIjSwTKw1VEnDJDjFfspmf1/2L06W5zcrSmhD4e0RPhwYOJdPwBmGlCzf0type7KpYCqLhZECuipfzQSiZwCdfplBPrJBUG0rXlp5N7nZMa3KvEOvKznhBCAZpEJNY6M8EHRKPwos69aiFJ2oSWczPTkFUzRzxVaf4sbgrBYBaSluge87Fn1h/QeetYqsPIytKp9kssHHdt8yJH2DodZL1RUqVt3h4XQCKbFs+VoiPuW2/G8XE0WzKl/cBzjIU2NfRNe7+qFwCTPHsz+0Nzc3DAA/aw/k+BFB5J0PDzSPlTgqwj0B1tbGztsTnYqB3AuF5GW7QDBY1jZznFyLEyrrD7hBEhybKrjdinTQPgaxJIXAayTeaTjRe5OdG0eWbF+lanXSiV0LcDZZTvF/7ClcTfY+r8H5GC59pI83iJi1rBMMQ1xq+PaXOmGLPBuf1MycpsdWfpOLJw+qSEAYGBXVxeNd96GMGV3JpP5LkUAiwVTXQyNSZ3C84oCvLtSqdSrFgoxnKm9GXP46cuUvvXbK94oriUh8HmEiIUc4wk4MaWcx0JeBtWx07j0vTyUuJgJ/ZWMC/bHT2VQQ2p6LSq31nJyF5aY+JZpTt4Flj7N3GYoXYZKDnupcDZVepZpLM6S6uABx4YrO2fyIxcXrNnvpONr1jV6Gmk5qNkIsLgLIA7T9BLycIk0zeKjNtfrwly76HU7fRQtaBP1WDQC0Z54IWPufOQqnuoFE9UDahKaTOB1ZR7BuRat8hjJmXFiYO3l8GZv5nqs/+gZrEJkKeJdqh7/oCIi1+CHm21p/RsYOu2yD8xUuM7GzKfw4ipri6zCb+qBUEZoT41ln7oUrL6vM/HyVY2eQqMnCNs68vn8lwHeGyYnJ6eImc2O0TYNJIEGAP8KQe0NUKkHzfc8iInT+\\/PWEz++jGvqdq7pHoDCVavcQCihRplNndC+x+\\/21jhnMi18s4ilz3XDkaM0hdV2MsyfN+zMFoD0ebBy2wEbFWaWsNiY8RQL2TEW1XoqHRSqiDwxnH3yPGiX+zvjJ61tVD75HtB6r4Ine8euXbuuBZgmTS1thpUqzcVsZigKAK5G/iLUaYgKr2tDZ8cyxlM/uxye33amhbyQAWqoiHBRg0dJMXNVLwxSC+Loa0S07WbYwXZ2lE3vaJR0JXFmV+y016KFrsqZY3ccUKUaA8hs3hlGaJZnXeFXuA4QkUDl+s6x7NMX495tbZHehmqWzBVYeQUigl/Bft7tTQddvrNDdhH01trb2/+Rut4aOTeymMuZ+56+hkv7u+B52bEhVxr2kKGxiI7eKhbaFJL0iGjyDiXc8nYmjr0ZApqIK2Dk7SEluQle7tthO4fIrgIwt7/sycwDLG/Ns3Z1oNwdyEkNix2zhf2XxtTUfboWWdVI88FsKSDPbTj8z/n5+WebmUGhEp0PZxsB4NUIM95Ko/oN0rSTz7wTCH3PVaOGiZJpC5c8N44mHCrHg9xzaNTQWXB0vswUbQ1T2DGbiG0JvWejI80f4sU+5kh5v3Q7/jRydNg4HKA25QQWVtrgVUbdGFnlkScyxcnLW5WuR1RRf3CWNB5k3QFtSeHIJYZhFA7HSuX888+vrD+ozTRtHi7xIBycrwHIlnoqFXEicyaHbpWZmbulUXSHmCgm5HDNhYiXmQlbyaMJmrSK641zRKrnW6JlRR87ThKYuCKurbikYM3Bi2O/pJhy3hwFgEnWFz4VwLawCCxHRLQzjUdgquSodMQGXaPuPN6wXxasXF0oFKhL8XGSvT/vtl5WG9k7n+ZQpR9B6+imWWN1VWp29kHr+R2fYwQeqYBQsjxmWBmC8vtBHfyTrxeJ9q8zPZJmx1mKa13ihMSGT40Un2QlK/dpv5NACJ1FlRAzHaPSTxxSmGXb1j1gWgmAnVtv8IJkD3upQLXehP2HQKo9C7FS1GMiOTekUsHCNyJf3Uj9ymJ+j5ybfg+PtmR5BA6dhkaBcMON6X0Q3Q5xihPlWTyWuBcgdrDjNIWUBO+NnPpJhek3mk4BMuBljxPWlNo1dRhIZmNrUxD6TdxyHvInFxotgVlbAx/lJlrdRetUGmV1amqqrl3UdT28du3aj5MXVTdEkbJgT4x8WM5N7uehmNcfSr01BXeYqjL6YJZgE/U380Tqq1wLpdlxnjQRVQbjZ3xiqPCELDm5z/gzCfxwzakZ7cLxHWDaXyKf2igkgVa8Gp7sPXA8f9so7BP1VkhRAhO3wFM9s3qt4kEVmBx5SM5NfYOrYYQVzLONpFoR6EcSlczbe/qVvjWf46HoCvYSSWGlVT81dcmnYmrbDaZTFOXBbVZZoeYvxfOC/VnqOHcHExp04SFuD8O0fZSmlDaKKdV6MSPsZhvimOtp4Wddvew4IyjvSpFoc0OMigolF9TvibDhudpOXHQP3ArbuZa9xFJKHxSJ1IpPGoaVgyq9y++rJiBpPm/NsrpfIH8bsr6qXlk0PAhmnlMsFjfRyrBaTNwGUk+tdnV1vRW6+TTqkqvLxpnJzwDMWdg8xkNgJLEPal/OzzA5O8Xk9AQFoIzHWz7ABb+MvUSTJiJqVI/fpKiiq9rDJCD9Rb6UPb/kX4idjZxO4BEFHjQMGPZ/45xXVo6rvs6mH6nQSCQS7u3tvZ4C/3r6WGbnn7NH993LFdIY7lg+o7BDzs0QA2keBEA0mOhbdbbSlr6JvcQTGvKJGteuhJxvqx1JqlaT3lTJh2k5YV2vGFEDmLkZseXpsJWP+iD6S+XFunXrKqtpCUjo481wcE6vy0Z6+MjQN3g+t4cV4cTk8wzBJlgZYUq6iyldfdh2M5HuHlTaO79ItpoFidKtyK+rZVntMa0bYQ2mfdB5mDoN7Hs3LWOnbxLQMnxitvvdgoGBAXeH1q8DUAVq9Tp/7f8hOGbmn7czc3dy6kctj6qSTw0nRy/35HjzMZTewQt5S3JtgN8BECDbO2C2LsXhQutBHgeZvgnZv6PeSSIXzY8C4OtQ5jNULo2akDl040h4qG6fKtIZxMYGI/7Syc1t5fHEftYCorW0gu8tzAErrb0vMGtoN7P3PM/s4X2vYeHoLQF8h4B5JsB8Z3V0UGc6pASQX5Hy4JGFaqcmlUrFoEpp1ZcLrN8PKwzDINSSoG0bTrwdejhWd32GZU5zVf+S6IDqTLYz0Z52mcj1MBOtKSYSADcSZcrAyo9zXW8PoKsLxN8AuJ56H5DwvyCCfVrW/t1GZZAHi+u24JougNkCNiaxn6Rv0NxfKpUUhBscJ05t5Knae3f/j7N/zwTXveEpcoRUjVUGjmFfRTh2ttLde1YAWcP0MsibQPhstdqt+aiFgfPfwnYzOb6HeMLlOVMrcc1DOJz0Q0gOoyl9D4poSjq3TtyYs/e+sFkW8g+7A78EYi6LUGOOSd+WlkphZfWJ25SVq94a4NU4Qc7Pg0WvBXDj1Wq1JtDvA+t+hPMvr1cGmUGaPVAdVVBPwTQxthzNN0iF/ONOJrOJK8qEO1cFLHQnVjvywCRvx3olb2n7KQ+FVgRwLZwAxM3Y3H4YL/YbAPNtTRZpeHMTD9OKiqVHwLgJSZ8iQ7jhwO11xseZMzPNnOlpZo9PkLp9QwBicwmabwvYxGu7RWvYuXUxZR5+ihrNSy3mHnbXJdIDSZVqqmsTWcko52IxBZreEEDUtAc7iLzxICBqvpIFMH8Hn+UPRw5IyfYjJvwZb00yjpBDJFqYNK2ybdQ1F1Qej60X6XRvAFHzXbEAbEOto1PjzY5i+1jTLD/cBc7Y2HPO+BjnIW8eDkIchyvueCPN6ZQIRpV0+wX1PKwgLZjO9oawrKpuumpbKSnoh52UzZi/wzKSp1KPKitX5kRfHxP9A0xGEXYWCmClWc6FfCfU7RuPlRlwR1Gi8cczawP+6gxWfo8i+OUz0jTzcnx8V7VHxamDtrvLa0LSfbqS7ugPcFm0nUwCqBW1Tk71wDOONX8Mc3lAquo+3tGx3VWp7uw4gxk7d5BzU57qCEaKaPQKZUVnS8DHJcWUFyJvpyi8TixJ6WkA/gNsz18ekI5UuR4qL0GiB2k6C53xmvJybn9toOP0cEUJUFlal12nh0GpwSU55NFlq1Z7/76wMzLM3Fnj3iopu5j3VlVhY5i6duK6lOgOHNalJKjRpGVZbWBdboHLos18m0gsrMfZnUxwqzJiZRrMoQFlFCxJtdJXjTl/QwDJktMpAPGURmGIt/8ANvllMVL0Dz6LfODYsplqW+VZAMyd8mhwVTECPJaW6vXq1ElDyPRR+Ohy4siDBiaFqtBX0AMEjjCehzlPc3SUpTOSZoYXS7Kyypi2CD34MfpJzqM4Zet4swcdLm81lg0gZ2dYZaojfeUx1e5NfwzSkUq2bZ+E/HD1XxyonWbTDJCiMSFt5uQzyNlyLuSZzB3SeBx2yDcag7RIz/Vd/jINykv9TEtDetHKKRGJ2O4nxAgtw2Cl3c8wXVOY0urN5HBskwnFCeBYVir5Ix/+4L6/vxiyNNaTqsZEZ0/J7b0Jh5k9jrjUMtw5qw5iSWt+hqmxxEYRTfQF/axLTwCu0qtT7++Y4Li0bI9JWuZ11uhQD7Os8hJyeggApqXkxZ2/Wy8deYu7ejNIS04Aiv7C0MUN/jAMeazvYuUZHMvoENBCrxMtSfq+6GoocxXA6rTFqdPCq9Y9qMRbBgMolp2SAPMe5Pdjn9b1a56mpG/zfAH5ymbCD+79eYPEYS7e6cxM/tYc3hPS+lcZIpHciKbUF2Bw5JLHxl8j7waoDo7fhG2zyxCNZoH0n8YCe3hUpkUCGaQAyCAFQAYpADIAMkgBkEEKgAxSAGQAZABkAGSQAiCDFAAZpADI4xxI+qi593nHIB2jySIg6ftn9B1PEcjj2AXy/wUYACIPOMIobjzuAAAAAElFTkSuQmCC\\');width:100%;background-repeat: no-repeat;background-position: 15px 6px;\"></div><div class=\"mi_gradeselecthandlenerrow\"></div><div class=\"mi_gradeselectdigitsnerrow\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"direction:ltr!important;\"' : 'style=\"direction:ltr; LEFT: -4PX;TOP: 30PX;\"') + '><span style=\"font-size: 43px;z-index: 3;color: #92c83e;font-family: \\'Source Sans Pro\\', Alef!important;\"></span></div><div class=\"mi_gradeselecttext\" ' + (window.MI_defaults.RTL == 'true' ? 'style=\"top:77px;direction:rtl;color:#b8b8b8;\"' : 'style=\"top:77px;direction:ltr;color:#b8b8b8;\"') + '></div>',\n starspanel: {\n header: '<tr><td style=\" border-top: 1px solid #DFDFDF;\"><div class=\"mi_hover_starspanel\" style=\"border-bottom: 1px solid #dfdfdf !important;padding-bottom:5px;;overflow:hidden;border-top:1px solid transparent; padding-top: 20px;margin-top: -17px;background: #f7f7f7; /* Old browsers */background: -moz-linear-gradient(top, #f7f7f7 0%, #ffffff 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #f7f7f7 0%,#ffffff 100%); /* IE10+ */background: linear-gradient(to bottom, #f7f7f7 0%,#ffffff 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#f7f7f7\\', endColorstr=\\'#ffffff\\',GradientType=0 ); /* IE6-9 */width: @@@widthpx;left: -0px;position: relative; height: 30px;\"><table style=\"position:relative\">',\n footer: '</tr></table></div></td></tr>'\n },\n tag: '<span onclick=\"jQuery.MidasInsight.tagClicked(\\'@@@kfid\\',\\'@@@atags\\')\" class=\"mi_tag_@@@atagsreplace mi_tag\">@@@atagscap<span style=\"display:inline-block;background-color:@@@color;-webkit-font-smoothing: antialiased;padding: 0;margin-bottom: 0;margin-left: 0;margin-top: 5px;left: 4px;position: relative;width:6px;height:6px;border-radius:50%; box-shadow: inset 0 0 10px 10px rgba(0,0,0,0.2);\"></span></span>',\n slidercontainer: '<div id=\"mi_previewPhotosContainer_@@@kfid\" style=\"height:65px;cursor:default;-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;\" unselectable=\"on\" onselectstart=\"return false;\"><table class=\"mi_previewPhotosContainer\" style=\"\" cellspacing=\"0\"><tr>',\n photopreview: '<tr ><td id=\"mi_photopreview_@@@kfid\" onclick=\"window.MI_logUsage(\\'photo_preview_clicked\\',\\'@@@kfid\\');if(jQuery.inArray(\\'photos\\', jQuery.MidasInsight.ObjDictionary[\\'@@@kfid\\'].options.tabs) ==-1) return;jQuery(this).find(\\'.mi_thumbscontainer\\').hide();jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\" colspan=\"2\" style=\"width: 100%;overflow: hidden;background-color:white;\"><div class=\"mi_thumbscontainer\" style=\"margin:0 auto;overflow:hidden;width:@@@widthpx;padding-top: 3px;border-top: 0px solid rgba(0,0,0,0.2);\">',\n tabswrapper: {\n header: '<div style=\"width: 152px;margin: 0 auto;background: #fefefe; /* Old browsers */background: -moz-linear-gradient(top, #fefefe 0%, #eeeeee 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #fefefe 0%,#eeeeee 100%); /* IE10+ */background: linear-gradient(to bottom, #fefefe 0%,#eeeeee 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\\'#fefefe\\', endColorstr=\\'#eeeeee\\',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 15px;-moz-border-radius: 15px;border-radius: 15px;border: 1px solid #cbcbcb;padding: 5px;\">',\n footer: '</div>'\n },\n footer: {\n header: '<div class=\"mi_footerwrapper\" style=\"background-color:#fff;\"><div class=\"mi_footerroot\" style=\"top:2px;\"><div class=\"mi_footercontainer\" id=\"mi_footercontainer_@@@kfid\" nstyle=\"height:100%;position:static;\">' +\n '<div class=\"mi_footer\" style=\"background-image:none;height:auto;margin-top:2px;\"><div onclick=\"jQuery(\\'#cpcnt_@@@kfid\\').find(\\'.MI_tab_selected\\').removeClass(\\'MI_tab_selected\\');jQuery(\\'#mipct_scroll_@@@kfid\\').addClass(\\'mi_blured\\');jQuery(\\'#mipct_tblabout_@@@kfid\\').css(\\'max-height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'height\\',jQuery(\\'#mipct_scroll_@@@kfid\\').height()+1).css(\\'top\\',jQuery(\\'#mipct_scroll_@@@kfid\\').position().top).fadeIn();\" style=\"z-index: 1;position: absolute;right: 0px;top: 5px;height: 25px;width: 65px;cursor: pointer;display:none;\"></div>',\n share: '<div><ul class=\"mi_share-buttons\" style=\"padding:0; margin: 0 10px 5px;;\"><li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://www.facebook.com/sharer/sharer.php?u={0}\" target=\"_blank\"><div style=\"margin-right: -6px;background-image: url(//d34p6saz4aff9q.cloudfront.net/img/f.png);height: 30px;width: 30px;\"></div></a></li>' +\n ' <li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://twitter.com/intent/tweet?url={0}&text={1}:\" target=\"_blank\" title=\"Tweet\"><div style=\"background-image:url(//d34p6saz4aff9q.cloudfront.net/img/t.png);height: 30px;width: 30px;\"></div></a></li><li style=\"display:none;\"><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"http://pinterest.com/pin/create/button/?url={0}&description={2}\" target=\"_blank\" title=\"Pin it\"><img onload=\"this.style.opacity=1;this.style.top=0;\" src=\"//d34p6saz4aff9q.cloudfront.net/images/footer/Pinterest.png\" style=\"opacity:0\"></a></li>' +\n '<li><a onclick=\"window.MI_logUsage(\\'share\\');\" href=\"https://plus.google.com/share?url={0}\" target=\"_blank\" title=\"Share on Google+\"><div style=\"background-image: url(//d34p6saz4aff9q.cloudfront.net/img/g.png); ;width:30px;height:30px;background-repeat: no-repeat;\"></div></a></li></ul></div>' +\n '<div class=\"mi_footer_prompt\" style=\"color:#59a3e8;top:auto;border-top:none;position:static;float:left;margin-bottom:0;padding: 7px;\">@@@ask</div>',\n callForActions: '<tr><td><div id=\"cfa\" style=\"white-space:nowrap;padding: 0;margin-top: -2px;\"><div onclick=\"alert(\\'call to add to favorites\\')\" style=\"cursor:pointer;height: 21px;width: 50%;margin: 0;display: inline-block;text-align: center;vertical-align: middle;padding-top: 7px;border: 1px solid rgb(239, 239, 239);border-left: none;font-size: 12px;color: #111;border-top: none;\">+Add to Favorites</div><div onclick=\"alert(\\'call to book\\')\" style=\"cursor: pointer;height: 21px;width: 50%;margin: 0;display: inline-block;text-align: center;vertical-align: middle;padding-top: 7px;border: 1px solid rgb(239, 239, 239);border-left: none;font-size: 12px;color: #111;border-top: none;background-color: #31b444;color: white;\">Book</div></div></td></tr>'\n },\n header: {\n header: '<div class=\"mi_panelheader\" style=\" max-width: @@@widthpx;overflow: hidden;display: block;\"><table class=\"mi_rasta\" align=\"left\" class=\"mi_reset mi_greenredtitle\" style=\" max-width: @@@widthpx;overflow: hidden;display: block;\"><tr><td class=\"mi_header_caption@@@gaugeOrientation\" style=\"padding:0 !important;@@@exttrastyle\">' +\n '<div class=\"mi_drag_area\" style=\"position: absolute;width: 100%;height:125px;left:0;z-index: 2\"></div>' +\n '<div class=\"mi_green_close@@@gaugeOrientation\" onclick=\"jQuery.MidasInsight.hidePanel(\\'@@@kfid\\');\" style=\"z-index:3;cursor:pointer;display:none;\">✕</div>'\n // score gauge\n +\n '<div class=\"oi_gauge oi_gauge_@@@clsgrade mi_gradselectroot @@@gaugeOrientation\" id=\"mi_gradselectroot_@@@kfid\" data-score=\"@@@decgrade\" ></div>' +\n '<div class=\"mi_titlescore oi_color_@@@clsgrade\" style=\"@@@titleOrientation;text-align: left;margin-top: 16px;width: 240px;font-size: 25px;height: 0px;margin-left: 105px;\" >@@@textgrade</div>' +\n '<div class=\"mi_title\" style=\"@@@titleOrientation;margin-top: 22px;width: 240px;float: left;height: 41px;margin-left: 102px;color: #030303;\" >@@@displayText</div>' +\n '<div style=\"float:left !important;margin-left:102px;color: #A0A0A0; margin-top: -5px; nmargin-left: 0!important;npadding-left: 0!important;\" class=\"mi_subtitle\" >@@@count</div>' +\n '<div class=\"mi_preview_images\" style=\"z-index: 3;width: 100px;height: 60px;border: 0px solid #ababab;position: absolute;right: 18px;top: 33px;padding: 0px 0px 0px 0px;cursor: pointer;\" onclick=\"if(jQuery.inArray(\\'photos\\', jQuery.MidasInsight.ObjDictionary[\\'@@@kfid\\'].options.tabs) ==-1) return; jQuery.MidasInsight.MI_GetPhotos(\\'@@@kfid\\',false);\"><div style=\"border: 0px solid #ababab;width:100%;height:100%;background-image:url(@@@previewimgsrc); background-size: contain;background-repeat: no-repeat;background-position: center top;\"></div></div>'\n\n // tools tabs\n +\n '<div style=\"clear:both;height:0px;margin-bottom:0px;border-top:0px solid #DBDBDB!important;\"></div>' +\n '</td></tr>',\n footer: '</table></div>'\n }\n },\n scrollables: {\n header: '<div style=\"clear:both;height: px;margin-bottom:0px;border-top:0px solid #DBDBDB\"></div><div id=\"mipct_scroll_@@@kfid\" tabindex=\"-1\" style=\"heightdummy:0;outline:none;max-height:none;\" class=\"mi_scroll\">' +\n '<table align=\"left\" id=\"mipct_tbldefault_@@@kfid\" class=\"mi_results mi_scrolledcontent\">',\n footer: '</table></div>'\n },\n socialItem: {\n timelineItem: '<div class=\"mi_timeline\">@@@fullYear<br/>@@@month<br/>@@@date</div>',\n metaIcon: function(data, baseid) {\n return \"<div style=\\\"left:auto;position: absolute;right: 24px;-moz-transform:none;-moz-filter:grayscale(100%);filter: grayscale(100%);zoom: 1;-webkit-filter: grayscale(1);top: 5px;\\\" class=\\\"mi_widget_social_icon_small mi_widget_social_icon_small_\" + (data.source.replace('.com', '').replace('www.', '').replace('.', '').replace('.', '')).trim().capitalize() + \"\\\" mi_data-tooltip=\\\"\" + (data.source.replace('.com', '').replace('www.', '').replace('mi.google.reviews', 'Google Reviews').replace('plus.google', 'Google+')) + \"\\\"></div>\";\n },\n nonTimelineItem: '<img data-source=\"@@@sourceSite\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'avatar\\',this)\" src=\"@@@itemImageURL\" valign=\"top\" class=\"mi_resultimage\">',\n youtubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itemPublisher<span class=\"mi_resulttimeago\">@@@timeAgo' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\">' +\n '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\" class=\"mi_imgcontainer\"><img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;box-shadow: 0px 0 10px 4px #eee;border-radius: 5px;display:inline;\"/><img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"/></div>' +\n '</div></td></tr></table></div>',\n lightboxYoutubeItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\" class=\"mi_imgcontainer\">' +\n '<div id=\"#mi_image_lightbox_@@@ksid\" >' +\n '<img src=\"https://i.ytimg.com/vi/@@@sourceURL/mqdefault.jpg\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/>' +\n '<img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" '\n //+'onclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" '\n +\n 'onerror=\"this.style.display=\\'none\\';\"/></div>'\n //+'<div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery.MidasInsight.StopYoutubeVideo(jQuery(\\'#mi_image_lightbox_@@@ksid iframe\\')[0]);jQuery(this).fadeOut();\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/@@@youtubeid?enablejsapi=1\" frameborder=\"0\" allowfullscreen></iframe></a></div>'\n +\n '</td></tr></table></div>',\n lightboxVimeoItem: '<div style=\"position:relative;\"><div class=\\\"MI_SourceIcon MI_@@@sourceSite\\\" mi_data-tooltip=\\\"@@@sourceSite\\\"></div><table align=\"left\" class=\"mi_resultcontainer\" style=\"direction:ltr!important;cursor:default;\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display: block;\">' +\n '@@@sourceAvatar' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itemPublisher<span class=\"mi_resulttimeago\" itemDate=\"@@@itemDate\">@@@timeAgo' +\n '</span></div></th></tr><tr><td style=\"padding-right:30px;\"></td></tr>' +\n '<tr><td colspan=\"2\" onclick=\"@@@click\" style=\"cursor: pointer; cursor: hand;\"><div style=\"padding-right:10px;overflow:hidden;position:relative;max-width: 275px;\" class=\"mi_imgcontainer\">' +\n '<div id=\"#mi_image_lightbox_@@@ksid\" '\n //+'onclick=\" jQuery(mi_image_lightbox_@@@ksid).fadeIn();jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'data-src\\'));\"'\n +\n '><img src=\"@@@itemContentImageURL\" style=\"max-width: @@@itemWidth ;min-width:185px;margin-top: 15px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right!important;border-radius: 2px;display:inline;\"/>' +\n '<img src=\"//d34p6saz4aff9q.cloudfront.net/images/playvideow.png\" style=\"position:absolute;cursor: pointer;left: 50%!important;margin-top: 20%;display:inline;margin-left: -30px;\" '\n //+'nonclick=\"window.MI_logUsage(\\'play_video\\',\\'@@@baseid\\');@@@click\" onerror=\"this.style.display=\\'none\\';\"\n +\n '/></div>'\n //+'<div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(\\'#mi_iframe_lightbox_@@@ksid\\').attr(\\'src\\',\\'\\');jQuery(this).fadeOut();\"><iframe id=\"mi_iframe_lightbox_@@@ksid\" data-src=\"@@@sourceURL?autoplay=1&title=0&byline=0&portrait=0\" width=\"500\" height=\"281\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'\n //+'</a></div>'\n +\n '</td></tr></table></div>',\n normalItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\">@@@itempublisher<span class=\"mi_resulttimeago\" style=\"\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">@@@itemtext',\n instagramItem: '<div style=\"position:relative;\">@@@metaicon<table align=\"left\" class=\"mi_resultcontainer\" @@@cond onclick=\"@@@click\"><tr><td rowspan=\"4\" valign=\"top\" style=\"padding-right:15px;padding-left:3px;width: 65px;\"><div style=\"position:relative;height: 100%;display:block;\">' +\n '@@@item' +\n '</div></td><th style=\"vertical-align: middle;\" align=\"left\"><div class=\"mi_resultpublisher\" style=\"color:#838383;\">@@@itempublisher<span class=\"mi_resulttimeago\"> @@@timeago' +\n '</div></span></th></tr><tr><td style=\"padding-right:30px;\"><div class=\"mi_resulttext\">',\n itemContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><img nonload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" onerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee;float: right;border-radius: 5px;\"/></div>',\n lightboxContentImage: '</td></tr><tr><td colspan=\"2\"><div style=\"padding-right:10px;overflow:hidden;\"><div id=\"#mi_image_lightbox_@@@ksid\" ><img src=\"@@@itemcontentimage\" style=\"max-width: 275px;margin-top: 0px;margin-bottom: 15px;nbox-shadow: 0px 0 10px 4px #eee; border-radius: 2px;float: left!important;cursor:pointer;\" nonerror=\"jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this);\" nonload=\"if (!jQuery.MidasInsight.imageIsGood(this)) jQuery.MidasInsight.HandleMissingImage(\\'preview\\',this); else ' +\n '{jQuery.MidasInsight.AddtoGallery(\\'@@@kfid\\', { href: \\'@@@itemcontentimage\\', title:\\'\\' });' +\n ' jQuery(this).parent().attr(\\'onclick\\',\\'jQuery.MidasInsight.ShowLightBoxURL(\\\\\\'@@@itemcontentimage\\\\\\',\\\\\\'@@@kfid\\\\\\')\\');}\"></div></div>'\n //<div class=\"mi_lightbox\" id=\"mi_image_lightbox_@@@ksid\" onclick=\"jQuery(this).fadeOut();\"><img src=\"@@@itemcontentimage\" style=\"nbox-shadow: 0px 0 10px 4px #eee;border-radius: 5px;\" onload=\"jQuery(this).css(\\'position\\', \\'relative\\').css(\\'top\\',\\'50%\\').css(\\'margin-top\\',((this.height/2)*-1)+ \\'px\\').css(\\'top\\',\\'50%\\',\\'!important\\');\"/></div></div>'\n }\n }\n }\n\n var langDictionary = {\n EN: {\n scores: ['Lame', 'Fair', 'Okay', 'Good', 'Great!'],\n basedon: 'Based on %d Reviews & Mentions ',\n ask: 'Ask friends for their opinion',\n mentions: 'Mentions <br/>&&nbsp;Reviews',\n media: 'Photos <br/>&&nbsp;Videos',\n facebook: 'Facebook',\n feelter: 'Social <br/>Insights',\n comment: 'Comment',\n back: 'Back',\n insights: 'Insights',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating <span style=\"font-family: \\'Source Sans Pro\\'\">%d</span> Reviews & Mentions',\n translate: 'Translate'\n },\n FR: {\n scores: ['Boiteux', 'Juste', 'Bien', 'Bon', 'Grand!'],\n basedon: 'Basé sur %d Critiques et Mentions ',\n ask: 'Demandez à vos amis pour leur opinion',\n mentions: 'Mentions & Commentaires',\n media: 'Photos & Vidéos',\n facebook: 'Facebook',\n feelter: 'Insights sociaux',\n comment: 'Commentaire',\n back: 'Arrière',\n insights: 'Insights',\n clickhere: \"CLIQUEZ ICI\",\n hoverbuttontext: 'CRITIQUES, MENTIONS ET PHOTOS',\n rating: ' Rating %d Critiques & Commentaires'\n },\n IT: {\n scores: ['Zoppo', 'Fiera', 'Bene', 'Buono', 'Grande!'],\n basedon: 'Sulla base %d Recensioni e Menzioni',\n ask: 'Chiedi amici per il loro parere',\n mentions: 'Menzioni & Recensioni',\n media: 'Foto & Video',\n facebook: 'Facebook',\n feelter: 'Insights Sociali',\n comment: 'Commento',\n back: 'Indietro',\n insights: 'Insights',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating %d Reviews & Mentions'\n },\n DE: {\n scores: ['lahm', 'Messe', 'Okay', 'gut', 'Na Toll!'],\n basedon: 'Basierend auf %d Bewertungen & Mentions ',\n ask: 'Fragen Sie Freunde nach ihrer Meinung',\n mentions: 'Erwähnungen & Reviews',\n media: 'Fotos & Videos',\n facebook: 'Facebook',\n feelter: 'Social Insights',\n comment: 'Kommentar',\n back: 'Der Rücken',\n insights: 'Insights',\n clickhere: \"HIER KLICKEN\",\n hoverbuttontext: 'REZENSIONEN, ERWÄHNUNGEN UND FOTOS',\n rating: 'Bewertung %d Rezensionen und Erwähnungen'\n },\n ES: {\n scores: ['Cojos', 'Justo', 'Bien', 'Bueno', 'Excelente!'],\n basedon: 'Basado en %d Comentarios y Menciones ',\n ask: 'Pregunte a sus amigos para su opinión ',\n mentions: 'Menciones',\n media: 'Medios',\n facebook: 'Facebook',\n feelter: 'Feelter',\n comment: 'comentario',\n back: 'Back',\n clickhere: \"CLIC AQUÍ\",\n hoverbuttontext: ' COMENTARIOS, MENCIONCES Y FOTOS',\n rating: 'Puntuación %d Comentarios Y Menciones'\n },\n HE: {\n scores: ['גרוע', 'סביר', 'טוב', 'טוב מאוד', '!מעולה'],\n basedon: 'מבוסס על %d חוות דעת ',\n ask: 'שתף את החברים ',\n mentions: 'חוות&nbsp;דעת',\n media: '×ª×ž×•× ×•×ª ווידאו',\n facebook: 'פייסבוק',\n feelter: 'Feelter',\n comment: 'תגובה',\n moreInfo: 'מידע × ×•×¡×£',\n back: 'סגור',\n insights: '×ª×•×‘× ×•×ª',\n clickhere: \"לחץ כאן\",\n hoverbuttontext: 'ביקורות, איזכורים ×•×ª×ž×•× ×•×ª',\n rating: 'הדירוג מבוסס על <span style=\"font-family: \\'Source Sans Pro\\'\"> %d </span>ביקורות ואיזכורים',\n translate: 'תרגם'\n },\n CN: {\n scores: ['拉梅', '公平', '好吧', '好', '太好了!'],\n basedon: '基于%d个评论与说起 ',\n ask: '问朋友他们的意见 ',\n mentions: '说起 ',\n media: '媒体 ',\n facebook: 'Facebookçš„ ',\n feelter: 'Feelter',\n comment: '评论}',\n back: 'Back',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating %d Reviews & Mentions'\n },\n AR: {\n scores: ['عرجاء', 'معرض', 'حسنا،', 'جيدة', 'عظيم!'],\n basedon: 'استنادا %d الآراء Ùˆ التنويهات ',\n ask: ' نسأل الاصدقاء عن رأيهم ',\n mentions: ' يذكر ',\n media: ' الصور ',\n facebook: ' الفيسبوك ',\n feelter: ' Feelter ',\n comment: ' تعليق',\n back: 'Back',\n clickhere: \"CLICK HERE\",\n hoverbuttontext: 'REVIEWS, MENTIONS & PHOTOS',\n rating: 'Rating %d Reviews & Mentions'\n },\n CS: {\n scores: ['Příšerné', 'Uspokojivé', 'PrůmÄ›rné', 'Dobré', 'Vynikající'],\n basedon: 'Na základÄ› %d hodnocení a zmínek',\n ask: 'Zeptej se přítele na jeho názor',\n mentions: 'Hodnocení a zmínky',\n media: 'Fotky a videa ',\n facebook: 'Facebook',\n feelter: ' Feelter ',\n comment: 'Komentář',\n back: 'ZpÄ›t',\n clickhere: \"Klikni zde\",\n hoverbuttontext: 'Názory, zmínky a fotky',\n rating: 'Hodnocení %d názory a zmínky',\n translate: 'pÅ™eložit'\n },\n PL: {\n scores: ['Okropnie', 'Źle', 'Åšredni', 'Bardzo Dobrze', 'Doskonale'],\n basedon: 'Bazowane na %d Opiniach',\n ask: 'Zapytaj znajomych o opiniÄ™',\n mentions: 'Wzmianki i Opinie',\n media: 'Filmy i ZdjÄ™cia',\n facebook: 'Facebook',\n feelter: ' Feelter',\n comment: 'komentarz',\n back: 'z powrotem',\n clickhere: \"kliknij tutaj\",\n hoverbuttontext: 'Opinie, Wzmianki i ZdjÄ™cia',\n rating: 'Ranking %d Wzmianek i Opini',\n translate: 'tÅ‚umaczyć'\n },\n SK: {\n scores: ['Hrozné', 'Uspokojivé', 'Priemerné', 'Dobré', 'Výborné'],\n basedon: 'Na základe %d hodnotení a zmienok',\n ask: 'Spýtaj sa priateľa na jeho názor',\n mentions: 'Zmienky a hodnotenia',\n media: 'Fotky a videá',\n facebook: 'Facebook',\n feelter: ' Feelter',\n comment: 'Komentár',\n back: 'Späť',\n clickhere: \"Klikni tu\",\n hoverbuttontext: 'Opinie, Wzmianki i ZdjÄ™cia',\n rating: 'Hodnotenie %d názory a zmienky',\n translate: 'PreložiÅ¥'\n }\n };\n\n window.langDictionary = langDictionary;\n\n\n // Constructs an object from a query string\n // in the format of key=value&key2=value2\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = unescape(query).split('&');\n for (var i = 0; i < Pairs.length; i++) {\n if (Pairs[i].indexOf('=') == -1) continue;\n var key = Pairs[i].substr(0, Pairs[i].indexOf('='));\n var val = Pairs[i].substr(Pairs[i].indexOf('=') + 1);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n // parse parameters from script source\n var myScript = req.url;\n var queryString = req.query;//(typeof myScript == 'undefined' || typeof myScript.src == 'undefined') ? '' : myScript.src.replace(/^[^\\?]+\\??/, '');\n\n var params = parseQuery(queryString);\n //res.write('zzzz'+queryString+' '+ JSON.stringify(queryString));\n \n window.MI_defaults = extend({}, window.MI_defaults, queryString)\n if (typeof window.MI_defaults.feedback != 'undefined') window.MI_defaults.inqa = window.MI_defaults.feedback;\n\n //get template from html if availasble\n if (!(typeof mi_template === \"undefined\")) {\n window.tempDictionary[window.MI_defaults.template].panelLayout = mi_template.panelLayout;\n }\n if (typeof window.MI_defaults.panelLayout == \"string\") try {\n window.MI_defaults.panelLayout = JSON.parse(window.MI_defaults.panelLayout.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (!(typeof window.MI_defaults.panelLayout === \"undefined\")) {\n window.tempDictionary[window.MI_defaults.template].panelLayout = window.MI_defaults.panelLayout;\n }\n if (typeof window.MI_defaults.frameElements == \"string\") try {\n window.MI_defaults.frameElements = JSON.parse(window.MI_defaults.frameElements.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.MI_defaults.tabs == \"string\") try {\n window.MI_defaults.tabs = JSON.parse(window.MI_defaults.tabs.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.MI_defaults.ex == \"string\") try {\n window.MI_defaults.ex = JSON.parse(window.MI_defaults.ex.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.MI_defaults.panelLayout == 'undefined') window.MI_defaults.panelLayout = {};\n if (typeof window.MI_defaults.panelLayout.flags == 'undefined') window.MI_defaults.panelLayout.flags = [];\n if (typeof window.MI_defaults.panelLayout.flags == \"string\") try {\n window.MI_defaults.panelLayout.flags = JSON.parse(window.MI_defaults.panelLayout.flags.replace(/'/g, '\"'));\n }\n catch (e) {}\n if (typeof window.langDictionary[window.MI_defaults.lang] == 'undefined') window.MI_defaults.lang = 'EN';\n\n if (typeof window.langDictionary[window.MI_defaults.lang] == 'undefined')\n window.langDictionary[window.MI_defaults.lang] = extend({}, langDictionary['EN'], window.langDictionary[window.MI_defaults.lang]);\n\n //exclude tripadvisor\n if (typeof window.MI_defaults.ex == 'undefined') {\n window.MI_defaults.ex = [];\n }\n window.MI_defaults.ex.push(3);\n window.MI_defaults.ex.push(24);\n switch (window.MI_defaults.lang) {\n case 'AR':\n window.MI_defaults.RTL = 'true';\n window.MI_defaults.gaugeOrientation = 'right';\n break;\n }\n window.MI_defaults.minPanelWidth = window.MI_defaults.layout == \"inlinepanel\" ? 750 : 485;\n window.MI_defaults.panelWidth = window.MI_defaults.template == 'RASTA' ? window.MI_defaults.minPanelWidth : 386;\n\n if (typeof String.prototype.camelCase !== 'function') {\n String.prototype.camelCase = function() {\n return this.toLowerCase().replace(/-(.)/g, function(match, group1) {\n return group1.toUpperCase();\n });\n }\n }\n if (typeof String.prototype.trim !== 'function') {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }\n }\n\n if (typeof String.prototype.trim !== 'function') {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }\n }\n String.prototype.capitalize = function() {\n return this.replace(/((?:^|\\s(?!and)(?!or)(?!of)(?!the)(?!\\bat\\b))\\S)/g, function(a) {\n return a.toUpperCase();\n }).replace(/\\b\\S\\S$/g, function(a) {\n return a.toUpperCase();\n });\n };\n\n if (!Object.keys) {\n Object.keys = function(obj) {\n var keys = [];\n\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n keys.push(i);\n }\n }\n return keys;\n };\n }\n if (typeof console == \"undefined\") {\n this.console = {\n log: function() {}\n };\n }\n\n if (!Array.prototype.map) {\n Array.prototype.map = function(fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n var res = new Array(len);\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++) {\n if (i in t)\n res[i] = fun.call(thisArg, t[i], i, t);\n }\n return res;\n };\n }\n\n Array.maxProp = function(array, prop) {\n var values = array.map(function(el) {\n return el[prop];\n });\n return Math.max.apply(Math, values);\n };\n Array.minProp = function(array, prop) {\n var values = array.map(function(el) {\n return el[prop];\n });\n return Math.min.apply(Math, values);\n };\n String.prototype.format = function() {\n var formatted = this;\n for (var i = 0; i < arguments.length; i++) {\n var regexp = new RegExp('\\\\{' + i + '\\\\}', 'gi');\n formatted = formatted.replace(regexp, arguments[i]);\n }\n return formatted;\n };\n\n\n // initiate logging parameters and create \n // on-screen log if in debug mode\n window.MI_logState = '';\n window.MI_logDetails = '';\n window.MI_logKey = '';\n window.MI_logLast = new Date();\n window.MI_scrollLast = new Date(1970, 1, 1);\n window.MI_queuedLoggingEvents = '';\n if (typeof(window.MI_defaults.debug) != 'undefined' && window.MI_defaults.debug == 'true') {\n jQuery('<div id=\"MI_onScreenLog\" style=\"padding:5px;overflow:hidden;z-index:999;position:fixed;right:10px;top:10px;width:200px;bottom:10px;border-radius:5px;border:1px solid #333;background:#aaa;background:rgba(0,0,0,0.5);color:white;\"><div class=\"mi-logCaption\" style=\"background:#aaa;margin:-10px -10px 10px -10px;padding:10px;color:#333;\" ><strong style=\"color: white;\">Debug-Mode Log</strong><br><div style=\"box-shadow: 0px 0px 5px gray;background-color: white;border: 1px solid #7D7D7D;border-radius: 4px;padding: 5px;margin-top: 5px;font-size: 11px;color: #999;\">This log is only displayed on debug mode.To stop showing It, Remove the \"debug=true\" parameter from your script reference or hash tag.</div></div>').appendTo(\"body\");\n }\n else if (typeof(window.MI_defaults.hidden) != 'undefined' && window.MI_defaults.hidden == 'true') {\n return;\n }\n\n window.misstimer = 0;\n }", "configure() {\n //if (typeof $.fn.SageMedia == 'undefined') {\n // this.js = '/js/SageMediaManagement.js';\n //}\n //this.css = '//';\n }", "function Main() {\n window.$ = jQuery.noConflict();\n this.languagesLoaded = false;\n this.frameCallback = null;\n }", "function dealers_page_elementsExtraJS() {\n // screen (dealers_page) extra code\n\n }", "function BaixarOrdemInternet_TV_elementsExtraJS() {\n // screen (BaixarOrdemInternet_TV) extra code\n\n }", "function include_js(js_file) {\n\tvar doc_head = document.getElementsByTagName('head').item(0);\n\tvar jsNode = document.createElement('script');\n\tjsNode.setAttribute('language', 'javascript');\n\tjsNode.setAttribute('type', 'text/javascript');\n\tjsNode.setAttribute('src', js_file);\n\tdoc_head.appendChild(jsNode);\n\treturn false;\n}", "function applyMultiJs () {\n /* Main script loaded on base.html. Here only function is\n called */\n $('#id_client_id').multi({\n \"search_placeholder\":\n \"Search... (if there are no clients, hit CTRL+R to manually refresh the page)\",\n });\n}", "function scriptLoader()\n{\n addJavascript(\"phoneticMapper.js\", \"head\");\n addJavascript(\"vedatype.js\", \"head\");\n addJavascript(\"slp01.js\", \"head\"); \n}", "function ConfirmacaoCliente_elementsExtraJS() {\n // screen (ConfirmacaoCliente) extra code\n\n }", "function IncludeJavaScript(jsFile)\n{\n document.write('<script type=\"text/javascript\" src=\"/'\n + jsFile + '\"></scr' + 'ipt>'); \n}", "function scriptLoadHandler()\n {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n\n // Call widgets init function\n init(); \n }", "init() {\n this.addAdditionnalScripts();\n }", "function HeaderDocumentReadyScripts() {\n\n\tif ($.trim(SearchPageUrl).length > 0) {\n\t\tsessionStorage.setItem('SearchPageUrl', SearchPageUrl);\n\t}\n\n\t$(\"body\").find(\"div\").click(function () {\n\t\tif ($(this).hasClass(\"village-cinema-bg\") == false && $(this).hasClass(\"wrapper\") == false) { //#5322 - To Allow click on main div or body.\n\t\t\tisBodyClicked = false;\n\t\t}\n\t});\n\n\tif ($('#LoginTexthWidget').length > 0) {\n\t\t$('#LoginTexthWidget').hover(function () {\n\t\t\treturn false;\n\t\t});\n\n\t\t$('#LoginTexthWidget').click(function () {\n\t\t\treturn false;\n\t\t});\n\n\t}\n\n\tSetPasswordDefaultText();\n\tWidgetStateChange();\n\tWidgetByMovieFilterChange('All');\n\tWidgetByCinemaFilterChange('All');\n\n\tstyleFormElements();\n\n\tEnableDisableControl('ddlByMovieCinemas', true);\n\tEnableDisableControl('ddlByMovieSessions', true);\n\tEnableDisableControl('ddlByCinemaMovies', true);\n\tEnableDisableControl('ddlByCinemaSessions', true);\n\n\t$('#ddlByMovieCinemas').parent().find('span').html('Select cinema');\n\t$('#ddlByMovieSessions').parent().find('span').html('Select session');\n\t$('#ddlByCinemaMovies').parent().find('span').html('Select movie');\n\t$('#ddlByCinemaSessions').parent().find('span').html('Select session');\n\n\t//code for call cinema page on enter press in CinemaMegaMenu \n\t/* fix for defect #643 */\n\t$('#Cinema-Search').bind('keypress', function (e) {\n\t\tvar code = (e.keyCode ? e.keyCode : e.which);\n\t\tif (code == 13) {\n\t\t\t$('#imgCinemaNavFindCinema').trigger('click');\n\t\t\treturn false;\n\t\t}\n\t});\n\n\t$('#QuickTicketsMenu ul.tabs a').click(function () {\n\n\t\tif ($(this).attr('href') == '#CinemaTab') {\n\t\t\tWidgetTab('bycinema');\n\t\t}\n\t\telse {\n\t\t\tWidgetTab('bymovie');\n\t\t}\n\n\t\t$('#txtCurrentWidgetTab').val($(this).attr('href'));\n\n\t});\n\n\t$('#divHeaderForgotPwdContent').html($('#hidForgotPasswordText').val());\n\t$('#divHeaderMailSentContent').html($('#hidMailSentText').val());\n\n}", "function DEFAULT$static_(){ToolbarSkin.DEFAULT=( new ToolbarSkin(\"default\"));}", "cleanScript(jsfile) {// N/A in web\n }", "function CalendarPlugin() {\n}", "function initThemeJs() {\n\t\t(function($) {\n\n\t\t\t\"use strict\";\n\n\t\t\tskel.breakpoints({\n\t\t\t\txlarge: '(max-width: 1680px)',\n\t\t\t\tlarge: '(max-width: 1280px)',\n\t\t\t\tmedium: '(max-width: 980px)',\n\t\t\t\tsmall: '(max-width: 736px)',\n\t\t\t\txsmall: '(max-width: 480px)'\n\t\t\t});\n\n\t\t\t$(function() {\n\n\t\t\t\tvar $window = $(window),\n\t\t\t\t\t$body = $('body'),\n\t\t\t\t\t$header = $('#header'),\n\t\t\t\t\t$banner = $('#banner');\n\n\t\t\t\t// Disable animations/transitions until the page has loaded.\n\t\t\t\t$body.addClass('is-loading');\n\n\t\t\t\t$window.on('load', function() {\n\t\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\t\t$body.removeClass('is-loading');\n\t\t\t\t\t}, 100);\n\t\t\t\t});\n\n\t\t\t\t// Fix: Placeholder polyfill.\n\t\t\t\t$('form').placeholder();\n\n\t\t\t\t// Prioritize \"important\" elements on medium.\n\t\t\t\tskel.on('+medium -medium', function() {\n\t\t\t\t\t$.prioritize(\n\t\t\t\t\t\t'.important\\\\28 medium\\\\29',\n\t\t\t\t\t\tskel.breakpoint('medium').active\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\t// Header.\n\t\t\t\tif (skel.vars.IEVersion < 9)\n\t\t\t\t\t$header.removeClass('alt');\n\n\t\t\t\tif ($banner.length > 0 &&\n\t\t\t\t\t$header.hasClass('alt')) {\n\n\t\t\t\t\t$window.on('resize', function() {\n\t\t\t\t\t\t$window.trigger('scroll');\n\t\t\t\t\t});\n\n\t\t\t\t\t$banner.scrollex({\n\t\t\t\t\t\tbottom: $header.outerHeight(),\n\t\t\t\t\t\tterminate: function() {\n\t\t\t\t\t\t\t$header.removeClass('alt');\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenter: function() {\n\t\t\t\t\t\t\t$header.addClass('alt');\n\t\t\t\t\t\t},\n\t\t\t\t\t\tleave: function() {\n\t\t\t\t\t\t\t$header.removeClass('alt');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t}\n\n\t\t\t\t// Menu.\n\t\t\t\tvar $menu = $('#menu');\n\n\t\t\t\t$menu._locked = false;\n\n\t\t\t\t$menu._lock = function() {\n\n\t\t\t\t\tif ($menu._locked)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t$menu._locked = true;\n\n\t\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\t\t$menu._locked = false;\n\t\t\t\t\t}, 350);\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t};\n\n\t\t\t\t$menu._show = function() {\n\n\t\t\t\t\tif ($menu._lock())\n\t\t\t\t\t\t$body.addClass('is-menu-visible');\n\n\t\t\t\t};\n\n\t\t\t\t$menu._hide = function() {\n\n\t\t\t\t\tif ($menu._lock())\n\t\t\t\t\t\t$body.removeClass('is-menu-visible');\n\n\t\t\t\t};\n\n\t\t\t\t$menu._toggle = function() {\n\n\t\t\t\t\tif ($menu._lock())\n\t\t\t\t\t\t$body.toggleClass('is-menu-visible');\n\n\t\t\t\t};\n\n\t\t\t\t$menu\n\t\t\t\t\t.appendTo($body)\n\t\t\t\t\t.on('click', function(event) {\n\n\t\t\t\t\t\tevent.stopPropagation();\n\n\t\t\t\t\t\t// Hide.\n\t\t\t\t\t\t$menu._hide();\n\n\t\t\t\t\t})\n\t\t\t\t\t.find('.inner')\n\t\t\t\t\t.on('click', '.close', function(event) {\n\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\n\t\t\t\t\t\t// Hide.\n\t\t\t\t\t\t$menu._hide();\n\n\t\t\t\t\t})\n\t\t\t\t\t.on('click', function(event) {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t})\n\t\t\t\t\t.on('click', 'a', function(event) {\n\n\t\t\t\t\t\tvar href = $(this).attr('href');\n\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tevent.stopPropagation();\n\n\t\t\t\t\t\t// Hide.\n\t\t\t\t\t\t$menu._hide();\n\n\t\t\t\t\t\t// Redirect.\n\t\t\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\t\t\twindow.location.href = href;\n\t\t\t\t\t\t}, 350);\n\n\t\t\t\t\t});\n\n\t\t\t\t$body\n\t\t\t\t\t.on('click', 'a[href=\"#menu\"]', function(event) {\n\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Toggle.\n\t\t\t\t\t\t$menu._toggle();\n\n\t\t\t\t\t})\n\t\t\t\t\t.on('keydown', function(event) {\n\n\t\t\t\t\t\t// Hide on escape.\n\t\t\t\t\t\tif (event.keyCode == 27)\n\t\t\t\t\t\t\t$menu._hide();\n\n\t\t\t\t\t});\n\t\t\t});\n\t\t})(jQuery);\n\t}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n wjQuery = window.jQuery.noConflict(false); \n }", "function scriptLoadHandler() {\n\t\tjQuery = window.jQuery.noConflict(true);\n\t\tmain();\n\t}", "function scriptLoadHandler() {\n\t\tjQuery = window.jQuery.noConflict(true);\n\t\tmain();\n\t}", "function Stimulus() {\n //var evt = window.event || arguments[1] || arguments.callee.caller.arguments[0];\n //var target = evt.target || evt.srcElement;\n var options = {};\n if (arguments[0]) options = arguments[0];\n var default_args = {\n 'id' : '',\n 'image' : '',\n 'text' : '',\n 'audio' : '',\n 'seq' : [],\n 'priority' : 2\n }\n for (var index in default_args) {\n if (typeof options[index] == \"undefined\") options[index] = default_args[index];\n }\n}", "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "function BaixarOrdemTelefone_elementsExtraJS() {\n // screen (BaixarOrdemTelefone) extra code\n\n }", "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n }", "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n }", "onReady() {\n\n }", "function TermsServices_elementsExtraJS() {\n // screen (TermsServices) extra code\n\n }", "function HTML5_SolutionStorage() {\n}", "function detailedReviewPage_elementsExtraJS() {\n // screen (detailedReviewPage) extra code\n }", "function defaultsClick() {\n Common.defaultSettings();\n setControlValues();\n Common.setTheme(document.getElementById('theme').value);\n}", "function BootstrapOptions() { }", "function BootstrapOptions() { }", "function userscripts()\n{\n //insert code here:\n}", "function defineAppCode() {\r\n var strCode=\"\";\r\n if (document.location.hostname.length === 0) {\r\n strCode += '<link rel=\"stylesheet\" href=\"datepicker/datepicker.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"static_files/assets/css/bootstrap-multiselect.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"tablesorter/css/theme.blue.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"static_files/assets/validator/bootstrapValidator.min.css\">'; \r\n strCode += '<link rel=\"stylesheet\" href=\"css/safe.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"css/beaches.css\">';\r\n strCode += '<script type=\"text/javascript\" src=\"static_files/assets/validator/bootstrapValidator.min.js\"></script>'; \r\n strCode += '<script type=\"text/javascript\" src=\"static_files/assets/multiselect/bootstrap-multiselect.js\"></script>'; \r\n strCode += '<script type=\"text/javascript\" src=\"static_files/assets/datepicker/bootstrap-datepicker.js\"></script>';\r\n strCode += '<script type=\"text/javascript\" src=\"static_files/assets/datepicker/moment-with-locales.js\"></script>';\r\n strCode += '<script type=\"text/javascript\" src=\"/placeholders/placeholders.min.js\"></script>';\r\n\r\n } else { \r\n strCode += '<link rel=\"stylesheet\" href=\"/datepicker/datepicker.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"/static_files/assets/multiselect/bootstrap-multiselect.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"/tablesorter/css/theme.blue.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"/static_files/assets/validator/bootstrapValidator.min.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"/static_files/WebApps/Health/safe/css/safe.css\">';\r\n strCode += '<link rel=\"stylesheet\" href=\"/static_files/WebApps/Health/SwimSafe/css/beaches.css\">';\r\n strCode += '<script type=\"text/javascript\" src=\"/static_files/assets/validator/bootstrapValidator.min.js\"></script>';\r\n strCode += '<script type=\"text/javascript\" src=\"/static_files/assets/multiselect/bootstrap-multiselect.js\"></script>';\r\n strCode += '<script type=\"text/javascript\" src=\"/datepicker/bootstrap-datepicker.js\"></script>';\r\n strCode += '<script type=\"text/javascript\" src=\"/static_files/assets/datepicker/moment-with-locales.js\"></script>';\r\n strCode += '<script type=\"text/javascript\" src=\"/placeholders/placeholders.min.js\"></script>';\r\n }\r\n return strCode;\r\n\r\n}", "function _init(){\n if(mergedConfig.content && mergedConfig.button && mergedConfig.cookie_name && _util.validate.settingsConfig(mergedConfig)){\n //Add cookieValue globally if it exists.\n cookieValue = _util.validate.ifCookieNameSet(mergedConfig.cookie_name.name) ? JSON.parse(_util.getCookieValueByName(mergedConfig.cookie_name.name)) : undefined;\n // Build DOM\n _build.bannerLayout(mergedConfig);\n _build.modalLayout(mergedConfig);\n _util.toggleBanner(mergedConfig);\n };\n }", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function LiveReloadJsHandler() {\n}", "static get defaultOptions() {\n // @ts-ignore\n const options = super.defaultOptions\n options.id = \"pf2e-monster-import-ui\"\n options.template = \"modules/pf2e_monsterimportui/templates/monster-import-ui.html\"\n options.width = 1024\n options.height = 800\n options.resizable = true\n options.classes = [\"pf2e-monster-import-ui\"]\n options.popOut = true\n\n return options\n }", "function loadScripts() {\r\n\t\t\t\twindow._sf_endpt = (new Date()).getTime();\r\n\t\t\t\tvar cbDomain = ((\"https:\"==document.location.protocol)?\"https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/\":\"http://static.chartbeat.com/\");\r\n\t\t\t\tif(loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat_pub.js\");\r\n\t\t\t\t}\r\n\t\t\t\tif((loadVidJS) || (typeof StrategyInterface !== 'undefined' && (espn && espn.video))) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat_video.js\");\r\n\t\t\t\t}\r\n\t\t\t\t// load default chartbeat js others are disabled\r\n\t\t\t\tif(!loadVidJS && !loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat.js\");\r\n\t\t\t\t}\r\n\t\t\t}", "function getDefaultJsConfig() {\n return {\n compilerOptions: {\n maxNodeModuleJsDepth: 2,\n allowSyntheticDefaultImports: true\n },\n // Necessary to not flood the initial files\n // with potentially completely unrelated .ts/.js files:\n include: []\n };\n }", "function letsJQuery() {\n get_layout();\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "onLoad() { }", "function InitValues_Framework_L1(){\n // You must make textarea, slidbar and more.\n}", "function InitValues_Framework_L1(){\n // You must make textarea, slidbar and more.\n}", "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n\n }", "function startScreen_elementsExtraJS() {\n // screen (startScreen) extra code\n\n }", "static get defaultOptions() {\n return mergeObject(super.defaultOptions, {\n id: 'turnmarker-settings-form',\n title: 'Turn Marker - Global Settings',\n template: './modules/turnmarker/templates/settings.html',\n classes: ['sheet', 'tm-settings'],\n width: 500,\n closeOnSubmit: true\n });\n }", "function include(url){ \n document.write('<script type=\"text/javascript\" src=\"'+ url +'\" ></script>'); \n}", "function removeOriginalJsLocations() {\n $('a[href*=\"user-registration.html?register\"], ' +\n 'a[href*=\"user-login.html?login\"], ' +\n '.customer-account-login .new-users button')\n .attr('onclick', 'return false;');\n }", "function onReady() {\r\n alert( 'Кофе готов!' );\r\n }", "function includeJS(s) {\n\tfor (i = 0; i < s.length; i++) {\n\t\tvar script = document.createElement(\"script\");\n\t\tscript.type = \"text/javascript\";\n\t\tscript.src = base + s[i];\n\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(script);\n\t}\n}", "function scriptLoadHandler() {\n\t\t // Restore $ and window.jQuery to their previous values and store the\n\t\t // new jQuery in our local jQuery variable\n\t\t jQuery = window.jQuery.noConflict(true);\n\t\t // Call our main function\n\t\t main(); \n\t\t}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function Javascript(file) {\n \n this.file = file;\n}", "function qodefOnDocumentReady() {\n qodefThemeRegistration.init();\n\t qodefInitDemosMasonry.init();\n\t qodefInitDemoImportPopup.init();\n }", "function DatePickerPlugin() {\n\n }", "function scriptLoadHandler() {\n\t\t// Restore jQuery and window.jQuery to their previous values and store the\n\t\t// new jQuery in our local jQuery variable\n\t\tjQuery = window.jQuery.noConflict(true);\n\t\t$ = window.jQuery;\n\t\t// Call our main function\n\t\tmain(); \n\t}", "function wsLib_defaultOnload() {\n ///// jQuery Selector Variables\n var $selectsRing = $('.js-default-onload-select');\n var $selects = $selectsRing.find('select');\n var $checkboxesRing = $('.js-default-onload-checkbox');\n var $checkboxes = $checkboxesRing.find('input[type=\"checkbox\"]');\n var $radiobuttons = $('.js-default-onload-radio');\n\n // Unchecks checkboxes and defaults radio buttons and selects\n $(document).ready(function() {\n $checkboxes.prop('checked', false);\n $radiobuttons.prop('checked', true);\n\n $selects.each(function() {\n $(this).find('option').first().prop('selected', true);\n });\n });\n}", "function initOnDomReady() {}", "function loadJQ() {\r\n\t var script = document.createElement(\"script\");\r\n\t script.setAttribute(\"src\", \"http://plaku.com/bytui/jquery.min.js\");\r\n\t script.addEventListener('load', function() {\r\n\t\tvar script = document.createElement(\"script\");\r\n\t\tloadJQCookie();\r\n\t\tdocument.body.appendChild(script);\r\n\t }, false);\r\n\t document.body.appendChild(script);\r\n\t}", "static viewJs(formfactor) {\n let src;\n switch(formfactor) {\n case 'phone':\n case 'table':\n src = window.rootpath + 'sample/sample-view-phone.js';\n //src = window.rootpath + 'sample-view-desktop.js';\n break;\n case 'desktop':\n default:\n src = window.rootpath + 'sample/sample-view-desktop.js';\n break;\n }\n return src;\n }", "function mobileinit(){\n\t\t//init(document.body);\n\t\tJQM_VER = ($.mobile.version==null) ? \"1.0\" : $.mobile.version;\n\t}", "function init() {\n var js = document.createElement('script');\n js.setAttribute('type', 'text/javascript');\n js.setAttribute('src', url);\n document.getElementsByTagName('head').item(0).appendChild(js);\n}", "function theme_script(){\n\n}", "function include(file)\n\t{\n\t\tif (window.document.getElementsByTagName)\n\t\t{\n\t\t\tscript = window.document.createElement(\"script\");\n\t\t\tscript.type = \"text/javascript\";\n\t\t\tscript.src = file;\n\t\t\tdocument.documentElement.firstChild.appendChild(script);\n\t\t}\n\t}", "function init()\n{\n}", "function init()\n{\n}", "function init()\n{\n}", "defaults () {\n }", "function noJSLinks()\n {\n this.ruleID = 'noJSLinks';\n }", "function onScriptStart() {\n setYTStyleSheet(bodyStyleLoading);\n // Early configuration for settings that cannot wait until configuration is loaded.\n config.timeToMarkAsSeen = localStorage.getItem(\"YTBSP_timeToMarkAsSeen\");\n config.autoPauseVideo = \"0\" !== localStorage.getItem(\"YTBSP_autoPauseVideo\");\n}", "function Scan_elementsExtraJS() {\n // screen (Scan) extra code\n\n }", "function autoInit () {\n\t\tvar ddPageinfo = IBMCore.common.meta.page.pageInfo,\n\t\t\tncForm = \"\";\n\n\t\t// Check if they have the proper settings before we .getscript the NC JS file.\n\t\t// First they need the proper NC and ID object that tells us where the form and the placeholder div is.\n\t\tif (ddPageinfo.nc && ddPageinfo.nc.id) {\n\t\t\t// Onload, check if the form and placeholder exists, then include extra JS if so.\n\t\t\t$(function(){\n\t\t\t\tncForm = ddPageinfo.nc.id.form ? $(\"#\" + ddPageinfo.nc.id.form) : ($(\".nc_register_form\")[0] || $(\"#registerform\"));\n\n\t\t\t\t// Validate that the form and the placeholder div exist on the page\n\t\t\t\tif (ncForm.length === 0 || $(\"#\" + ddPageinfo.nc.id.privacyDiv).length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"//1.www.s81c.com/common/v18/js/notice-choice.js\",\n\t\t\t\t\t//url: \"/v18/js/notice-choice.js\",\n\t\t\t\t\tdataType: \"script\",\n\t\t\t\t\tcache: true\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "function include (file) {\r\n\tvar script = document.createElement('script');\r\nscript.src = file;\r\nscript.type = 'text/javascript';\r\nscript.defer = true;\r\n\r\ndocument.getElementsByTagName('head').item(0).appendChild(script);\r\n}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function LocalStoragePlugin() {\n}", "onLoad () {}", "function downloadJSAtOnload(){var e=document.createElement(\"script\");e.src=\"https://cdn.rawgit.com/Arlina-Design/quasar/23207858/arlinablock.js\",document.body.appendChild(e)}", "function drupalgap_add_js() {\n try {\n var data;\n if (arguments[0]) { data = arguments[0]; }\n jQuery.ajax({\n async: false,\n type: 'GET',\n url: data,\n data: null,\n success: function() {\n if (drupalgap.settings.debug) {\n // Print the js path to the console.\n console.log(data);\n }\n },\n dataType: 'script',\n error: function(xhr, textStatus, errorThrown) {\n console.log(\n 'drupalgap_add_js - error - (' +\n data + ' : ' + textStatus +\n ') ' + errorThrown\n );\n }\n });\n }\n catch (error) {\n console.log('drupalgap_add_js - ' + error);\n }\n}", "function letsJQuery() {\r\n\tcreateOptionsMenu();\r\n\tpressthatButton();\r\n }", "onLoad() {}", "function nojs(){\n\t$(\".nojs\").addClass(\"invisible\");\n}" ]
[ "0.5867077", "0.5810372", "0.56908464", "0.55790746", "0.548318", "0.5442478", "0.54247946", "0.53652877", "0.53514975", "0.53482634", "0.5323611", "0.53070503", "0.5300482", "0.5285206", "0.5273341", "0.5245496", "0.5241201", "0.52106607", "0.520653", "0.5202457", "0.5199078", "0.51862234", "0.5180594", "0.517532", "0.514164", "0.51357687", "0.5113652", "0.5109814", "0.510826", "0.50863916", "0.5051086", "0.50413704", "0.5035267", "0.5031045", "0.501672", "0.50136405", "0.50136405", "0.5003151", "0.49924716", "0.49878833", "0.49760023", "0.49760023", "0.49745372", "0.49736333", "0.49721545", "0.49707705", "0.49696234", "0.49569887", "0.49569887", "0.4956692", "0.49554583", "0.49422118", "0.49404174", "0.49390614", "0.49346483", "0.49333867", "0.49281073", "0.49212092", "0.49206117", "0.49188414", "0.4904061", "0.4904061", "0.48960522", "0.48960522", "0.4890988", "0.48862553", "0.4883157", "0.48794553", "0.4877712", "0.4874117", "0.48712143", "0.48712143", "0.48662558", "0.4859948", "0.48540655", "0.48532623", "0.4853085", "0.48518866", "0.48422116", "0.48388094", "0.48245257", "0.48067114", "0.48042068", "0.48036548", "0.47911918", "0.47911918", "0.47911918", "0.47907248", "0.47871196", "0.47861698", "0.47843316", "0.4771599", "0.47690102", "0.4768713", "0.4767951", "0.47649303", "0.47506225", "0.4750391", "0.47463572", "0.47416076", "0.47397506" ]
0.0
-1
Decoding base64 image Source:
function decodeBase64Image(dataString) { var matches = dataString.match(/^data:([A-Za-z-+\/]+);base64,(.+)$/); var response = {}; if (matches.length !== 3) { return new Error('Invalid input string'); } response.type = matches[1]; response.data = Buffer.from(matches[2], 'base64'); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeBase64Image(dataString) {\n\n \tconsole.log(\"Decoding base 64 image\");\n\n\t\tvar matches = dataString.match(/^data:([A-Za-z-+\\/]+);base64,(.+)$/),\n\t\tresponse = {};\n\n\t\tif (matches.length !== 3) {\n\t\t\treturn new Error('Invalid input string');\n\t\t}\n\n\t\tresponse.type = matches[1];\n\t\tresponse.data = new Buffer(matches[2], 'base64');\n\n\t\treturn response;\n\t}", "function decodeBase64Image(s, w, h) {\n var imgdata = new ImageData(w, h);\n for (var i = 0; i < s.length; i+=4) {\n imgdata.data[i / 4] = atob(s.substring(i, i + 4));\n }\n return imgdata;\n}", "function decodeBase64Image(dataString) {\n\t \tvar matches = dataString.match(/^data:([A-Za-z-+\\/]+);base64,(.+)$/),\n\t response = {};\n\n\t \tif (matches.length !== 3) {\n\t \treturn new Error('Invalid input string');\n\t \t}\n\n\t \tresponse.type = matches[1].split('/')[1];\n\t \tresponse.data = new Buffer(matches[2], 'base64');\n\n\t \treturn response;\n\t}", "getBase64(img, callback) {\n const reader = new FileReader();\n reader.addEventListener('load', () => callback(reader.result));\n reader.readAsDataURL(img);\n }", "function base64_decode(base64Image, file) {\n base64Image = base64Image.substring(2, base64Image.length - 1)\n base64Image += \"data:image/jpeg;base64,\"\n fs.writeFile(file, Buffer.from(base64Image, 'base64'), function (err) {\n if (err) {\n console.log(\"image write error\")\n }\n else {\n document.getElementById(\"spotimage\").src = file + '?' + new Date().getTime(); // the le epic cache breaker\n }\n });\n}", "static base64Decode(base64Str) {\n return Buffer.from(base64Str, \"base64\").toString(\"utf8\");\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "base64Decode(input) {\n return EncodingUtils.base64Decode(input);\n }", "function imageToBase64(string, callback, blur, width, height){ \n\t\tdecodeImage(string, callback, width, height); \n\t}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function decode(input) {\n return JSON.parse(base64.decode(input));\n}", "function base64_decode(base64str, fileName) {\n var bitmap = new Buffer.from(base64str, 'base64');\n fs.writeFileSync('./imagem/' + fileName + '', bitmap, 'binary', function(err) {\n if (err) {\n console.log('Conversao com erro');\n }\n });\n}", "function get_base64_img(){\n\tvar file \t = man_settings.inputField.files[0],\n\t\timage_src = '',\n\t\tfile_reader = new FileReader();\n\n\tif(file){\n\t\tfile_reader.readAsDataURL(file);\n\t}\n\n\tfile_reader.addEventListener('load', function(){\n\t\timage_src = file_reader.result;\n\n\t\t/*push the image base64 code man_settings start*/\n\t\tman_settings.src = image_src;\n\t\t/*push the image base64 code man_settings end*/\n\n\n\t\t/*generate man_cropper start--------*/\n\t\tman_cropper_container();\n\t\t/*generate man_cropper end----------*/\n\n\t});\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n if (typeof base64 !== 'undefined') return base64.decode(str); //react native\n throw new Error('No Base64 Decode');\n }", "function getImageBase64(file, callback) {\n var reader = new FileReader();\n reader.onload = function gotImage(event) {\n var image = event.target.result;\n callback(image)\n };\n reader.readAsDataURL(file);\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n throw new Error('No Base64 Decode');\n }", "function base64_decode(base64str, file) {\n var bitmap = new Buffer(base64str, 'base64');\n fs.writeFileSync(file, bitmap);\n }", "function base64_decode(base64str, file) {\n var bitmap = new Buffer(base64str, 'base64');\n fs.writeFileSync(file, bitmap);\n }", "function decode(base64url, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n return new Buffer(toBase64(base64url), \"base64\").toString(encoding);\n}", "function base64Image(src) {\n var data = fs.readFileSync(src).toString('base64');\n return util.format('data:%s;base64,%s', mime.lookup(src), data);\n}", "async function imgTob64 (image_source){\n\n}", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buffer(encodedString, 'base64');\n}", "function base64Decode(data) {\n data = data.replace(/[^a-z0-9\\+\\/=]/gi, \"\"); // strip none base64 characters\n if (typeof atob == \"function\") return atob(data); //use internal base64 functions if available (gecko only)\n var b64_map =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var byte1, byte2, byte3;\n var ch1, ch2, ch3, ch4;\n var result = new Array(); //array is used instead of string because in most of browsers working with large arrays is faster than working with large strings\n var j = 0;\n while (data.length % 4 != 0) {\n data += \"=\";\n }\n\n for (var i = 0; i < data.length; i += 4) {\n ch1 = b64_map.indexOf(data.charAt(i));\n ch2 = b64_map.indexOf(data.charAt(i + 1));\n ch3 = b64_map.indexOf(data.charAt(i + 2));\n ch4 = b64_map.indexOf(data.charAt(i + 3));\n\n byte1 = (ch1 << 2) | (ch2 >> 4);\n byte2 = ((ch2 & 15) << 4) | (ch3 >> 2);\n byte3 = ((ch3 & 3) << 6) | ch4;\n\n result[j++] = String.fromCharCode(byte1);\n if (ch3 != 64) result[j++] = String.fromCharCode(byte2);\n if (ch4 != 64) result[j++] = String.fromCharCode(byte3);\n }\n\n return result.join(\"\");\n}", "function processBase64Image(dataString) {\n var matches = dataString.match(/^data:([A-Za-z-+\\/]+);base64,(.+)$/),response = {};\n\n if (matches.length !== 3) {\n return new Error('Invalid input string');\n }\n\n response.type = matches[1];\n response.data = new Buffer(matches[2], 'base64');\n\n return response;\n}", "base64(pathFile) {\n const fs = require('fs');\n let base64data = null;\n try {\n let buff = fs.readFileSync(pathFile);\n base64data = buff.toString('base64');\n } catch (error) {\n console.log('Image not converted to base 64 :\\n\\n' + error);\n }\n //console.log('Image converted to base 64 is:\\n\\n' + base64data);\n return base64data;\n }", "decode(str){\n this.init()\n var end = str.length\n while(end>=0 && str.charAt(end-1)=='=') end--\n if(end<2) throw '·Invalid Base64 string at· ' + end\n var m = (end%4)\n if(m==1) throw '·Invalid Base64 string at· ' + (end-1)\n if(m>1) m--\n var n = 3*Math.floor(end/4) + m\n var blob = new Uint8Array(n)\n var control =[[2,4,1],[4,2,1],[6,0,2]]\n var left, right\n var k=0\n var c=0\n for(var i=0; i<n; i++){\n left = this.a2i[str.charAt(k)]\n right = this.a2i[str.charAt(k+1)]\n if(left===undefined || right===undefined) throw '·Invalid Base64 string at· ' + k\n blob[i] = (left << control[c][0]) |( right >> control[c][1])\n k+=control[c][2]\n c = (c+1)%3\n } \n return blob\n }", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "function base64Decode(base64str, file) {\n // create buffer object from base64 encoded string\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n }", "function base64_decode(data) {\n var dst = \"\"\n var i, a, b, c, d, z\n\n for (i = 0; i < data.length - 3; i += 4) {\n a = base64_charIndex(data.charAt(i+0))\n b = base64_charIndex(data.charAt(i+1))\n c = base64_charIndex(data.charAt(i+2))\n d = base64_charIndex(data.charAt(i+3))\n\n dst += String.fromCharCode((a << 2) | (b >>> 4))\n if (data.charAt(i+2) != b64pad)\n dst += String.fromCharCode(((b << 4) & 0xF0) | ((c >>> 2) & 0x0F))\n if (data.charAt(i+3) != b64pad)\n dst += String.fromCharCode(((c << 6) & 0xC0) | d)\n }\n\n dst = decodeURIComponent(escape(dst))\n return dst\n }", "function base64urldecode(data) {\n data += '=='.substr((2 - data.length * 3) & 3)\n if (typeof atob === 'function') {\n data = data.replace(/\\-/g, '+').replace(/_/g, '/').replace(/,/g, '');\n try {\n return atob(data);\n } catch (e) {\n return '';\n }\n }\n // http://kevin.vanzonneveld.net\n // + original by: Tyler Akins (http://rumkin.com)\n // + improved by: Thunder.m\n // + input by: Aman Gupta\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + bugfixed by: Onno Marsman\n // + bugfixed by: Pellentesque Malesuada\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + input by: Brett Zamir (http://brett-zamir.me)\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');\n // * returns 1: 'Kevin van Zonneveld'\n // mozilla has this native\n // - but breaks in 2.0.0.12!\n //if (typeof this.window['atob'] == 'function') {\n // return atob(data);\n //}\n\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 255;\n o2 = bits >> 8 & 255;\n o3 = bits & 255;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec;\n}", "raw_blob(txt) { return Base64.decode(txt) }", "function base64_decode(base64str, file) {\n// create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function decodeBase64(input = \"\") {\n if (!input) return;\n\n return base64.toByteArray(\n input.padEnd(input.length + 4 - (input.length % 4), \"=\")\n );\n}", "function base64_covert_to_img(_base64_string, _path){\nvar filepath = base64Img.imgSync(_base64_string, _path,uuidv1());\nreturn filepath;\n}", "function base64_decode (base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "function base64_decode(base64str, file) {\n var bitmap = new Buffer(base64str, 'base64');\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function decode_base64(base64) {\n let b64 = base64.split(\";base64\")[1];\n \n // b64 = b64.replace(/\\s/g, '');\n // var filepath = pathUpload + Date.now() + \".jpg\";\n // console.log(filepath);\n\n\n // var base64Data =base64.replace(/^data:image\\/jpg;base64,/, \"\");\n \n// fs.writeFile(\"out.png\", base64Data, 'base64', function(err) {\n// console.log(err);\n// });\n let filepath = \"./public/\"+Date.now() + \".jpg\"\n var newFile = __dirname +filepath\n\n fs.writeFile(filepath, new Buffer.from(b64, \"base64\"), function(err) {\n console.log(\"Create file success\");\n\n });\n newFile = newFile.replace(/\\\\/g, \"/\");\n newFile = newFile.replace(/\\./, \"\");\n return newFile\n\n}", "function getBase64(f){\r\n var reader = new FileReader();\r\n reader.readAsDataURL(f);\r\n reader.onload = function () {\r\n console.log(reader.result);\r\n };\r\n }", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(data) {\n // console.log(\"data\"+data);\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 0xff;\n o2 = bits >> 8 & 0xff;\n o3 = bits & 0xff;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec.replace(/\\0+$/, '');\n }", "function base64_decode(data) {\n // console.log(\"data\"+data);\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 0xff;\n o2 = bits >> 8 & 0xff;\n o3 = bits & 0xff;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec.replace(/\\0+$/, '');\n }", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function getImageAsBase64FromCanvas(canvas) {\n\t\t// return only the base64 image not the header as reported in issue #2\n\t\t// return canvas.toDataURL('image/jpeg', 1.0).split(',')[1];\n\t\treturn canvas.toDataURL('image/jpeg', 1.0);\n\t}", "function getBase64(file) {\n var reader = new FileReader();\n var algo = '';\n reader.readAsDataURL(file);\n reader.onloadend = function () {\n algo = reader.result;\n };\n}", "function _decodeBase64(k, d) {\n if (d === null) {\n return null;\n }\n if (typeof d == 'object' && 'clazz' in d) {\n let clazz = d.clazz;\n if (clazz.startsWith('[') && clazz.length == 2 && 'data' in d) {\n let x = _b64toArray(d.data, d.clazz);\n if (x) d = x;\n }\n }\n return d;\n }", "function decodeMessage(message) {\n const raw = message.raw;\n return base64_decode(raw);\n}", "async getBase64Data(url) {\n \n // Awaiting for fetch response\n const response = await fetch(url,{\n method:\"GET\",\n headers: {\n 'If-None-Match': ''\n }\n });\n \n // Awaiting for response.json()\n const data = await response.json();\n \n // Getting content\n const base64Data = data.content;\n\n //Decoding Data\n const resData = window.atob(base64Data);\n\n // Returning result data\n return resData;\n }", "function imgToBase64(url, callback, imgVariable) {\n \n if (!window.FileReader) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n imgVariable = reader.result.replace('text/xml', 'image/jpeg');\n callback(imgVariable);\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n }", "getBase64(file, cb) {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = function () {\n cb(reader.result)\n };\n reader.onerror = function (error) {\n console.log('Error: ', error);\n };\n }", "function base64decode(input) {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n \n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (i < input.length) {\n\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n\n }\n\n output = _utf8_decode(output);\n \n return output;\n\n }", "function decodeImage(input, callback, width, height, element){\n\t\t\n\t\t// If a base64-encoded image is passed at this stage its expected to be optimised so it\n\t\t// won’t affect its quality or resolution.\n\t\tif (isBase64(input)) return encodeImage(input, function(source){\n\t\t\tdecodeImage(source, callback, element, width, height);\n\t\t}, false);\n\t\t\t\n\t\t// else...\n\t\t// Extract image data from the string parameter.\n\t\tvar source = input.split(separateData);\n\t\tvar data = source[1].match(/.{1,2}/g);\n\t\t\n\t\t// Extact meta data from the source prefix.\n\t\tvar meta = getImageMeta(source[0]);\n\t\tif (!isNaN(width)){\n\t\t\tif (!isNaN(height)) meta.height = height;\n\t\t\telse meta.height = Math.round(meta.height * width / meta.width);\n\t\t\tmeta.width = width;\n\t\t}\n\t\t\n\t\tvar previewWidth = keyIndex.indexOf(data.shift());\n\t\tvar previewHeight = data.length / previewWidth; // calculate the preview’s height\n\t\tif (meta.monochrome) previewHeight = 0|previewHeight * 3; // compensate for the smaller data.length \n\t\t\n\t\t// Prepare a html canvas.\n\t\tvar canvas = createImage(tagCanvas, previewWidth, previewHeight);\n\t\tvar imageData = createData(canvas, previewWidth, previewHeight);\n\t\tvar length = imageData.data.length;\n\t\tvar i = 0;\n\t\t\n\t\t// Set the canvas image data.\n\t\tvar index = 0, current = 0;\n\t\tif (meta.monochrome) for (i = 0; i < length; i += 12){\n\t\t\t\n\t\t\tcurrent = keyToChannel(data[index++]);\n\t\t\tvar a = current[0], b = current[1], c = current[2];\n\t\t\t\n\t\t\timageData.data[i ] = a;\n\t\t\timageData.data[i+1] = a;\n\t\t\timageData.data[i+2] = a;\n\t\t\timageData.data[i+3] = 255;\n\t\t\t\n\t\t\timageData.data[i+4] = b; \n\t\t\timageData.data[i+5] = b;\n\t\t\timageData.data[i+6] = b;\n\t\t\timageData.data[i+7] = 255;\n\t\t\t\n\t\t\timageData.data[i+8] = c; \n\t\t\timageData.data[i+9] = c\n\t\t\timageData.data[i+10] = c;\n\t\t\timageData.data[i+11] = 255;\n\t\t\t\n\t\t}\n\t\telse for (i = 0; i < length; i += 4){\n\t\t\t\n\t\t\tcurrent = keyToChannel(data[index++]);\n\t\t\timageData.data[i ] = current[0];\n\t\t\timageData.data[i+1] = current[1];\n\t\t\timageData.data[i+2] = current[2];\n\t\t\timageData.data[i+3] = 255;\n\t\t\t\n\t\t}\n\t\tsetData(canvas, imageData);\n\t\t\n\t\t// Load and redraw the canvas image to its given dimensions, \n\t\t// then pass it to the callback as a base64 encoded jpeg-image.\n\t\tvar image = createImage(tagImg);\n\t\timage.onload = function(){\n\t\t\t\n\t\t\tvar result = drawImage(image, meta.width, meta.height);\n\t\t\t\n\t\t\t// Blur using glimpse.blur if its is available\n\t\t\tif (typeof glimpse.blur === \"function\"){\n\t\t\t\tvar imageData = getData(result, meta.width, meta.height);\n\t\t\t\tvar stackBlur = glimpse.blur(imageData, meta.width, meta.height);\n\t\t\t\tsetData(result, stackBlur);\n\t\t\t}\n\t\t\t\n\t\t\tif (element !== tagCanvas) result = result.toDataURL(type);\n\t\t\tif (element){\n\t\t\t\t\n\t\t\t\tif (element === tagImg){\n\t\t\t\t\telement = createImage(element, meta.width, meta.height);\n\t\t\t\t\telement.src = result;\n\t\t\t\t\tresult = element;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar className = classNames.base;\n\t\t\t\tif (meta.monochrome) className += \" \" + classNames.monochrome;\n\t\t\t\tresult.className = className;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcallback(result, meta);\n\t\t\t\n\t\t}\n\t\timage.src = canvas.toDataURL(type);\n\n\t}", "static base64(file, callback){\n const reader = new FileReader();\n reader.onload = function(event){\n callback(event.target.result, file);\n }\n reader.readAsDataURL(file);\n }", "function getImageAsBase64FromCanvas(canvas) {\n // return only the base64 image not the header as reported in issue #2\n return canvas.toDataURL('image/jpeg', 1.0).split(',')[1];\n\n }", "function getBase64Image(img) {\n // Create an empty canvas element\n var canvas = document.createElement(\"canvas\");\n\n var newImg = new Image();\n newImg.src = img.src;\n canvas.width = newImg.width;\n canvas.height = newImg.height;\n\n // Copy the image contents to the canvas\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(newImg, 0, 0);\n\n // Get the data-URL formatted image\n var dataURL = canvas.toDataURL(\"image/png\");\n\n return dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n}", "function base64decode(b64string) {\n var byteCharacters = atob(b64string);\n var byteNumbers = new Array(byteCharacters.length);\n for (var i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n return new Uint8Array(byteNumbers);\n }", "function Base64Decode(encoded) {\n var keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n\n do {\n enc1 = keyStr.indexOf(encoded.charAt(i++));\n enc2 = keyStr.indexOf(encoded.charAt(i++));\n enc3 = keyStr.indexOf(encoded.charAt(i++));\n enc4 = keyStr.indexOf(encoded.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n } while (i < encoded.length);\n\n return output;\n }", "function toBase64() {\n var canvas = document.createElement(\"canvas\");\n var ctx = canvas.getContext(\"2d\");\n var img = document.getElementById(\"preview\");\n ctx.drawImage(img, 10, 10);\n var data = canvas.toDataURL();\n var string = data.replace('data:image/png;base64,', '');\n return string;\n }", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "getBase64Url() {\n return new Promise(resolve => {\n const reader = new FileReader();\n reader.onload = e => {\n resolve(\n `data:${this.state.fileSelected.type};base64, ${btoa(\n e.target.result\n )}`\n );\n };\n reader.readAsBinaryString(this.state.fileSelected);\n });\n }", "function decodeB64 (str) {\n if (typeof btoa !== 'undefined') {\n return btoa(str)\n }\n return 'base64:' + str\n}", "function base64_decode(data) {\r\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\r\n ac = 0,\r\n dec = '',\r\n tmp_arr = [];\r\n\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n data += '';\r\n\r\n do { // unpack four hexets into three octets using index points in b64\r\n h1 = b64.indexOf(data.charAt(i++));\r\n h2 = b64.indexOf(data.charAt(i++));\r\n h3 = b64.indexOf(data.charAt(i++));\r\n h4 = b64.indexOf(data.charAt(i++));\r\n\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n\r\n o1 = bits >> 16 & 0xff;\r\n o2 = bits >> 8 & 0xff;\r\n o3 = bits & 0xff;\r\n\r\n if (h3 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1);\r\n } else if (h4 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\r\n } else {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\r\n }\r\n } while (i < data.length);\r\n\r\n dec = tmp_arr.join('');\r\n\r\n return dec.replace(/\\0+$/, '');\r\n}", "function fromBase64(text){\n if(CryptoJS && CryptoJS.enc.Base64) \n return CryptoJS.enc.Base64.parse(text).toString(CryptoJS.enc.Latin1);\n else\n return Base64.decode(text);\n }", "function intArrayFromBase64(s){try{var decoded=decodeBase64(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i);}return bytes;}catch(_){throw new Error('Converting base64 string to bytes failed.');}}// If filename is a base64 data URI, parses and returns data (Buffer on node,", "function fromBase64(base64) {\n return base64\n .replace(/=/g, \"\")\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function getBase64(file){return new Promise(function(resolve,reject){var reader=new FileReader();reader.readAsDataURL(file);reader.onload=function(){return resolve(reader.result);};reader.onerror=function(error){return reject(error);};});}", "function base64_decode(base64str, file,callback) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n callback(true)\n}", "function base64UrlDecode(input) {\n var str = (String (input)).replace (/[=]+$/, ''); // #31: ExtendScript bad parse of /=\n if (str.length % 4 === 1) {\n throw new InvalidCharacterError (\"'atob' failed: The string to be decoded is not correctly encoded.\");\n }\n for (\n // initialize result and counters\n var bc = 0, bs, buffer, idx = 0, output = '';\n // get next character\n buffer = str.charAt (idx++); // eslint-disable-line no-cond-assign\n // character found in table? initialize bit storage and add its ascii value;\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n // and if not first of each 4 characters,\n // convert the first 8 bits to one ascii character\n bc++ % 4) ? output += String.fromCharCode (255 & bs >> (-2 * bc & 6)) : 0\n ) {\n // try to find character in table (0-63, not found => -1)\n buffer = chars.indexOf (buffer);\n }\n return output;\n }", "function imgToBase64(url, callback) {\n if (!window.FileReader) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n callback(reader.result.replace('text/xml', 'image/jpeg'));\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function getBase64Image(img) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n\n var dataURL = canvas.toDataURL();\n\n return dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n}", "function decodeDataString(str)\n {\n\n if (str.length < 1) return \"\";\n\n var retStr = Base64.decode(str);\n retStr = retStr.substring(1, (retStr.length -1));\n retStr = retStr.split(\"\").reverse().join(\"\");\n\n return retStr;\n }", "async function decodeBase64Image(dataString) {\r\n\r\n cloudinary.config({\r\n cloud_name: process.env.CLOUD_NAME,\r\n api_key: process.env.API_KEY,\r\n api_secret: process.env.API_SECRET\r\n });\r\n\r\n const valid_extensions = ['png', 'jpg', 'jpeg'];\r\n var matches = dataString.match(/^data:([A-Za-z-+\\/]+);base64,(.+)$/)\r\n response = {};\r\n // console.log(matches);\r\n if (matches.length !== 3) {\r\n return new Error('Invalid input string');\r\n }\r\n\r\n extension = matches[1].split(\"/\")[1].toLowerCase().trim();\r\n data = Buffer.from(matches[2], 'base64');\r\n let imageName = `${Date.now()}-image.${extension}`\r\n if (valid_extensions.indexOf(extension) !== -1) {\r\n\r\n var dir = './images/'\r\n if (!fs.existsSync(dir)) {\r\n fs.mkdirSync(dir);\r\n }\r\n\r\n console.log('full dir: ', dir, 'existed: ', fs.existsSync(dir));\r\n\r\n fs.writeFile(`./images/${imageName}`, data, function(err) {\r\n if (err) {\r\n console.log('error when save image: ', err)\r\n response.status = 500;\r\n response.error = err.toString();\r\n }\r\n });\r\n\r\n // upload image to cloudinary\r\n result = await cloudinary.uploader.upload(`./images/${imageName}`);\r\n\r\n console.log(result);\r\n console.log(result.url);\r\n response.name = result.url\r\n response.status = 200;\r\n response.path = dir;\r\n response.type = matches[1];\r\n // response.name = imageName;\r\n response.extension = extension;\r\n } else {\r\n response.status = 404\r\n response.error = 'extension not supported'\r\n\r\n }\r\n\r\n return response;\r\n}", "function imgToBase64(){\r\n $('img').each(function(){\r\n var src = $(this).attr('src');\r\n var img = $(this);\r\n if (src.includes(\"latex.codecogs.com\")) {\r\n toDataURL(\r\n 'https://cors-anywhere.herokuapp.com/' + src,\r\n function (dataUrl) {\r\n img.attr('src', dataUrl);\r\n });\r\n }\r\n });\r\n}", "function getBase64(file) {\n var nameFile = file.name;\n var reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = function (result) {\n getFile(result.target.result, nameFile);\n };\n reader.onerror = function (error) {\n console.log('Error: ', error);\n };\n}", "function base64_encode(img) {\n // read binary data\n let png = fs.readFileSync(img);\n // convert binary data to base64 encoded string\n return new Buffer.from(png).toString('base64');\n}", "function imgToBase64(url, callback, imgVariable) {\n\n if (!window.FileReader) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n imgVariable = reader.result.replace('text/xml', 'image/jpeg');\n callback(imgVariable);\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function base64_encode(img) {\n // read binary data\n let png = fs.readFileSync(img);\n // convert binary data to base64 encoded string\n return new Buffer.from(png).toString('base64');\n}", "function decode64(input) {\n\tvar output = \"\";\n\tvar chr1, chr2, chr3 = \"\";\n\tvar enc1, enc2, enc3, enc4 = \"\";\n\tvar i = 0;\n\n\t// remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n\tvar base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n\tif (base64test.exec(input)) {\n\t\talert(\"There were invalid base64 characters in the input text.\\n\"\n\t\t\t\t+ \"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\\n\"\n\t\t\t\t+ \"Expect errors in decoding.\");\n\t}\n\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n\tdo {\n\t\tenc1 = keyStr.indexOf(input.charAt(i++));\n\t\tenc2 = keyStr.indexOf(input.charAt(i++));\n\t\tenc3 = keyStr.indexOf(input.charAt(i++));\n\t\tenc4 = keyStr.indexOf(input.charAt(i++));\n\n\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\n\t\toutput = output + String.fromCharCode(chr1);\n\n\t\tif (enc3 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t}\n\t\tif (enc4 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t}\n\n\t\tchr1 = chr2 = chr3 = \"\";\n\t\tenc1 = enc2 = enc3 = enc4 = \"\";\n\n\t} while (i < input.length);\n\n\treturn unescape(output);\n}", "function imgToBase64(url, callback, imgVariable) {\n if (!window.FileReade) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n imgVariable = reader.result.replace('text/xml', 'image/jpeg');\n callback(imgVariable);\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function Base64() { \r\n // private property \r\n var _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"; \r\n \r\n // public method for encoding \r\n this.encode = function (input) { \r\n \tif(Ext.isEmpty(input)){\r\n \t\treturn '';\r\n \t}\r\n var output = \"\"; \r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4; \r\n var i = 0; \r\n input = _utf8_encode(input); \r\n while (i < input.length) { \r\n chr1 = input.charCodeAt(i++); \r\n chr2 = input.charCodeAt(i++); \r\n chr3 = input.charCodeAt(i++); \r\n enc1 = chr1 >> 2; \r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); \r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); \r\n enc4 = chr3 & 63; \r\n if (isNaN(chr2)) { \r\n enc3 = enc4 = 64; \r\n } else if (isNaN(chr3)) { \r\n enc4 = 64; \r\n } \r\n output = output + \r\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + \r\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4); \r\n } \r\n return output; \r\n } \r\n \r\n // public method for decoding \r\n this.decode = function (input) {\r\n \tif(Ext.isEmpty(input)){\r\n \t\treturn '';\r\n \t}\r\n var output = \"\"; \r\n var chr1, chr2, chr3; \r\n var enc1, enc2, enc3, enc4; \r\n var i = 0; \r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\"); \r\n while (i < input.length) { \r\n enc1 = _keyStr.indexOf(input.charAt(i++)); \r\n enc2 = _keyStr.indexOf(input.charAt(i++)); \r\n enc3 = _keyStr.indexOf(input.charAt(i++)); \r\n enc4 = _keyStr.indexOf(input.charAt(i++)); \r\n chr1 = (enc1 << 2) | (enc2 >> 4); \r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); \r\n chr3 = ((enc3 & 3) << 6) | enc4; \r\n output = output + String.fromCharCode(chr1); \r\n if (enc3 != 64) { \r\n output = output + String.fromCharCode(chr2); \r\n } \r\n if (enc4 != 64) { \r\n output = output + String.fromCharCode(chr3); \r\n } \r\n } \r\n output = _utf8_decode(output); \r\n return output; \r\n } \r\n \r\n // private method for UTF-8 encoding \r\n var _utf8_encode = function (str) { \r\n str = str.replace(/\\r\\n/g,\"\\n\");\r\n var utftext = \"\"; \r\n for (var n = 0; n < str.length; n++) { \r\n var c = str.charCodeAt(n); \r\n if (c < 128) { \r\n utftext += String.fromCharCode(c); \r\n } else if((c > 127) && (c < 2048)) { \r\n utftext += String.fromCharCode((c >> 6) | 192); \r\n utftext += String.fromCharCode((c & 63) | 128); \r\n } else { \r\n utftext += String.fromCharCode((c >> 12) | 224); \r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128); \r\n utftext += String.fromCharCode((c & 63) | 128); \r\n } \r\n \r\n } \r\n return utftext; \r\n } \r\n \r\n // private method for UTF-8 decoding \r\n var _utf8_decode = function (utftext) { \r\n var str = \"\"; \r\n var i = 0, c = 0,c1 = 0,c2 = 0 ,c3; \r\n var c = c1 = c2 = 0; \r\n while ( i < utftext.length ) { \r\n c = utftext.charCodeAt(i); \r\n if (c < 128) { \r\n str += String.fromCharCode(c); \r\n i++; \r\n } else if((c > 191) && (c < 224)) { \r\n c2 = utftext.charCodeAt(i+1); \r\n str += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); \r\n i += 2; \r\n } else { \r\n c2 = utftext.charCodeAt(i+1); \r\n c3 = utftext.charCodeAt(i+2); \r\n str += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); \r\n i += 3; \r\n } \r\n } \r\n return str; \r\n } \r\n}", "function decodeBase64(encodedValue) {\n return CryptoJS.enc.Base64.stringify(encodedValue);\n}" ]
[ "0.7564775", "0.7341758", "0.7307353", "0.70639443", "0.7063326", "0.70070595", "0.6984309", "0.6944486", "0.69243026", "0.6923552", "0.6879048", "0.68724144", "0.6872352", "0.68554837", "0.68493557", "0.681064", "0.6801049", "0.67886406", "0.677794", "0.67547584", "0.66925013", "0.66923237", "0.66902584", "0.66340274", "0.66340274", "0.6627372", "0.66175497", "0.6598891", "0.6597611", "0.6582755", "0.6578012", "0.65760165", "0.6562283", "0.656074", "0.65594053", "0.65477544", "0.6477427", "0.646082", "0.6448542", "0.64441454", "0.6437748", "0.64129376", "0.64041984", "0.6394566", "0.6392877", "0.63872415", "0.63859344", "0.63800496", "0.63800496", "0.63800496", "0.63800496", "0.63800496", "0.63800496", "0.63800496", "0.63597745", "0.63597745", "0.6355266", "0.63496006", "0.63271415", "0.62678915", "0.6254217", "0.62466836", "0.6233834", "0.62095827", "0.62060213", "0.62057096", "0.6204068", "0.6203426", "0.6199384", "0.61920166", "0.61853427", "0.6181937", "0.6168639", "0.61637145", "0.61637145", "0.61491686", "0.6139058", "0.6119379", "0.6097462", "0.60930437", "0.60923165", "0.6090651", "0.6090651", "0.6090651", "0.608721", "0.60858196", "0.60772395", "0.60652804", "0.6040806", "0.60008425", "0.60007614", "0.5982619", "0.5976969", "0.59750324", "0.594939", "0.59438217", "0.5942137", "0.5941978", "0.59340066", "0.5933096" ]
0.7215253
3
Fetch an image (html img snippet with inline base64 src attribute) snippet and save the image as file
function fetchImage2base64 (path, dest, key) { return limitedFetch(`${domain}${path}`) .then(r=>r.buffer()) .then(buf=>{ const imgdom = new JSDOM(buf); const src = imgdom.window.document.querySelector('img').getAttribute('src'); const imageBuffer = decodeBase64Image(src); const imageType = imageBuffer.type.match(/\/(.*?)$/)[1]; const imagePath = `${assets}${path}.${imageType}`; dest[key] = imagePath; return fs.mkdir( imagePath.replace(/(.*)\/.*/, '$1'), {recursive:true} ).then( ()=>{ return fs.writeFile(imagePath, imageBuffer.data); } ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchImage() {\n // TODO\n fetch('examples/fetching.jpg')\n\t.then(validateResponse)\n\t.then(readResponseAsBlob)\n\t.then(showImage)\n\t.catch(logError);\n}", "function base64Image(src) {\n var data = fs.readFileSync(src).toString('base64');\n return util.format('data:%s;base64,%s', mime.lookup(src), data);\n}", "function imgToBase64(){\r\n $('img').each(function(){\r\n var src = $(this).attr('src');\r\n var img = $(this);\r\n if (src.includes(\"latex.codecogs.com\")) {\r\n toDataURL(\r\n 'https://cors-anywhere.herokuapp.com/' + src,\r\n function (dataUrl) {\r\n img.attr('src', dataUrl);\r\n });\r\n }\r\n });\r\n}", "function fetchImg() {\n fetch(\"https://xkcd.now.sh/?comic=latest\")\n .then((response) => response.json())\n .then((data) => {\n console.log(data);\n img.src = data.img;\n })\n //logs if an error occurs\n .catch((err) => console.log(err));\n}", "function imgToBase64(url, callback, imgVariable) {\n if (!window.FileReade) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n imgVariable = reader.result.replace('text/xml', 'image/jpeg');\n callback(imgVariable);\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function autoGetImage(image)\n{\n\tvar xhr = new XMLHttpRequest();\n\tvar img = image\n\turl = img.data('imagesrc');\n\t//console.log(\"get >> \" +url);\n\txhr.open('GET', url.trim(), true);\n\txhr.responseType = 'blob';\n\txhr.onload = function(e) \n\t{\n\t\timg.attr('src',window.URL.createObjectURL(this.response));\n\t};\n\txhr.send();\n\treturn true;\n}", "function imgToBase64(url, callback, imgVariable) {\n \n if (!window.FileReader) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n imgVariable = reader.result.replace('text/xml', 'image/jpeg');\n callback(imgVariable);\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n }", "function getBase64Image(img) {\n // Create an empty canvas element\n var canvas = document.createElement(\"canvas\");\n\n var newImg = new Image();\n newImg.src = img.src;\n canvas.width = newImg.width;\n canvas.height = newImg.height;\n\n // Copy the image contents to the canvas\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(newImg, 0, 0);\n\n // Get the data-URL formatted image\n var dataURL = canvas.toDataURL(\"image/png\");\n\n return dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n}", "function imgToBase64(url, callback) {\n if (!window.FileReader) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n callback(reader.result.replace('text/xml', 'image/jpeg'));\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function createImage(blob)\n {\n var pastedImage = new Image();\n pastedImage.src = blob;\n\n // Send the image content to the form variable\n pastedImage.onload = function() {\n var sourceSplit = blob.split(\"base64,\");\n var sourceString = sourceSplit[1];\n $(\"input[name=screenshot]\").val(sourceString);\n };\n\n document.getElementById(\"screenshot-inner\").style.display = \"none\";\n document.getElementById(\"screenshot-zone\").className = \"screenshot-pasted\";\n document.getElementById(\"screenshot-zone\").appendChild(pastedImage);\n }", "function saveAsImg(isJpg) {\n let myImg = cy.jpg();\n if (!isJpg) myImg = cy.png()\n console.log(\"myImg :\", myImg);\n var a = document.createElement(\"a\"); //Create <a>\n a.href = myImg; //Image Base64 Goes here\n a.download = document.getElementById(\"FileName\").value;\n a.click();\n // window.location.href = myimg;\n}", "async getRedditPic(url) {\n let downloadedImg = document.createElement('img')\n downloadedImg.src = url\n return console.log(downloadedImg)\n }", "function imgToBase64(url, callback, imgVariable) {\n\n if (!window.FileReader) {\n callback(null);\n return;\n }\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function() {\n var reader = new FileReader();\n reader.onloadend = function() {\n imgVariable = reader.result.replace('text/xml', 'image/jpeg');\n callback(imgVariable);\n };\n reader.readAsDataURL(xhr.response);\n };\n xhr.open('GET', url);\n xhr.send();\n}", "function savePic(event) {\n const reader = new FileReader();\n reader.onload = function () {\n imgTag = `<img src=\"${reader.result}\" style=\"max-width:100px;width:100%\">`\n }\n reader.readAsDataURL(event.target.files[0]);\n}", "function getBase64Image(img) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n\n var dataURL = canvas.toDataURL();\n\n return dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n}", "function setSpeakerImage(img, id) {\n let url = location.origin + \"/api/speakers/\" + id + \"/image\";\n fetch(url)\n .then(function (response) {\n if (response.ok) {\n return response.blob();\n }\n })\n .then(function (blob) {\n const objUrl = URL.createObjectURL(blob);\n img.src = objUrl;\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "getBase64(img, callback) {\n const reader = new FileReader();\n reader.addEventListener('load', () => callback(reader.result));\n reader.readAsDataURL(img);\n }", "function fetchImg(){\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(json => json.message.forEach(element => \n addImgToDom(element)\n ));\n}", "function getImage() {\n fetch(\"https://unsplash.it/900/600\").then(response => {\n // Fetching the Unsplash link\n imageDiv.innerHTML = `<img src=\"${response.url}\">`; // Embedding the photo url inside the div\n imageLink = `${response.url}`; // Setting the url as a variable so it can be stored\n });\n}", "function getBase64FromImageUrl(url, cb) {\n \n var image = new Image();\n\n image.onload = function () {\n \n var canvas = document.createElement(\"canvas\");\n canvas.width =this.width;\n canvas.height =this.height;\n imgWidth = Math.floor(canvas.width * 0.6); // resize for adding image to PDF\n imgHeight = Math.floor(canvas.height * 0.6);\n\n canvas.getContext(\"2d\").drawImage(this, 0, 0)\n\n cb(canvas.toDataURL(\"image/png\"));\n };\n\n image.src = url;\n}", "async function imgTob64 (image_source){\n\n}", "function encodeImageFileAsURL(element, onLoaded) {\n\tvar file = element.files[0];\n\tvar reader = new FileReader();\n\treader.onloadend = function () {\n\t\tconst base64Img = reader.result.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n\t\tonLoaded(base64Img);\n\t}\n\treader.readAsDataURL(file);\n}", "function base64_decode(base64Image, file) {\n base64Image = base64Image.substring(2, base64Image.length - 1)\n base64Image += \"data:image/jpeg;base64,\"\n fs.writeFile(file, Buffer.from(base64Image, 'base64'), function (err) {\n if (err) {\n console.log(\"image write error\")\n }\n else {\n document.getElementById(\"spotimage\").src = file + '?' + new Date().getTime(); // the le epic cache breaker\n }\n });\n}", "function pasteImage(base64Data) {\n\tvar blob = b64toBlob(base64Data, 'image/png');\n\tvar uploader = getValueForFirstObjectKey(getValueForFirstObjectKey(__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers).ComponentTree.getClosestInstanceFromNode(document.querySelector('._4rv4 form').parentElement)._renderedChildren);\n\tuploader._instance.uploadFiles([blob]);\n}", "async getBase64Data(url) {\n \n // Awaiting for fetch response\n const response = await fetch(url,{\n method:\"GET\",\n headers: {\n 'If-None-Match': ''\n }\n });\n \n // Awaiting for response.json()\n const data = await response.json();\n \n // Getting content\n const base64Data = data.content;\n\n //Decoding Data\n const resData = window.atob(base64Data);\n\n // Returning result data\n return resData;\n }", "function downloadImage(url) {}", "function getBase64Image(img, hFlip, doubleSizeImage) {\n // Create an empty canvas element. This is a virtual element and does\n // not exist in the DOM yet, so no cleanup on it needs to be done.\n var canvas = document.createElement(\"canvas\");\n canvas.width = img.width;\n canvas.height = img.height;\n\n if ( doubleSizeImage ) {\n canvas.width *= 2;\n canvas.height *= 2;\n }\n\n // Copy the image contents to the canvas\n var ctx = canvas.getContext(\"2d\");\n\n if ( hFlip ) {\n ctx.translate(canvas.width,0);\n ctx.scale(-1,1);\n }\n\n if ( doubleSizeImage ) {\n ctx.scale(2,2);\n }\n\n ctx.drawImage(img, 0, 0);\n\n // Get the data-URL formatted image. Firefox supports PNG and JPEG. You\n // could check img.src to guess the original format, but be aware the\n // using \"image/jpg\" will re-encode the image.\n var dataURL = canvas.toDataURL(\"image/png\");\n return dataURL;\n // return dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n }", "async function fetchCommentImage(blobKey) {\n if (blobKey == null) {\n return null;\n }\n const response = await fetch(`/serve-images?blob-key=${blobKey}`);\n // check that response was successful\n if (response.ok) {\n // parse the body of the response as a Blob.\n const blob = await response.blob();\n // create a URL for accessing the Blob.\n const imageURL = window.URL.createObjectURL(blob);\n return imageURL; \n }\n else {\n console.log(\"Error fetching image: \" + response.status + \" \" + response.statusText);\n return undefined;\n }\n}", "function viewFullImg(uri){\n\tconst html = `<img src=\"${uri}\">`\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function getDataUrl(img, type) {\n let canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n let context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n return canvas.toDataURL('image/' + type);\n }", "processImageDownload(imageSave, componentObject) {\n const a_href = document.getElementById(componentObject.title + componentObject.packageName);\n a_href.href = \"data:application/octet-stream;charset=utf-8;base64,\" + this.getBase64Image(imageSave);;\n }", "function saveImage() {\n\n var blobToBase64 = function (blob, callback) {\n var reader = new FileReader();\n reader.onload = function () {\n var dataUrl = reader.result;\n var base64 = dataUrl.split(',')[1];\n callback(base64);\n };\n reader.readAsDataURL(blob);\n };\n\n const img = new Image();\n img.src = imgblob;\n img.onload = function (ev) {\n\n URL.revokeObjectURL(imgblob); //release memory\n //Do whatever I need here:\n const newWidth = 200, newHeight = 200;\n const canvas = document.createElement('canvas');\n canvas.width = newWidth;\n canvas.height = newHeight;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, newWidth, newHeight);\n\n canvas.toBlob(function (blob) {\n blobToBase64(blob, function (base64) {\n //console.log(base64);\n saveUserPhoto(base64);\n });\n }, 'image/'+imgext, 1);\n } \n}", "getTopicDistributionFn () {\n fetch(test_url + '/TM/topicdistribution', {\n mode: 'cors',\n method: 'GET'\n })\n .then((resp) => resp.text())\n .then(function (data) {\n var wcImage = document.getElementById('topicDistributionImg');\n wcImage.src = \"data:image/png;charset=utf-8;base64,\" + data;\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n });\n }", "function get_base64_img(){\n\tvar file \t = man_settings.inputField.files[0],\n\t\timage_src = '',\n\t\tfile_reader = new FileReader();\n\n\tif(file){\n\t\tfile_reader.readAsDataURL(file);\n\t}\n\n\tfile_reader.addEventListener('load', function(){\n\t\timage_src = file_reader.result;\n\n\t\t/*push the image base64 code man_settings start*/\n\t\tman_settings.src = image_src;\n\t\t/*push the image base64 code man_settings end*/\n\n\n\t\t/*generate man_cropper start--------*/\n\t\tman_cropper_container();\n\t\t/*generate man_cropper end----------*/\n\n\t});\n}", "function getDisplayImage(){\n //html2canvas実行\n html2canvas(document.getElementById(\"target\")).then(function(canvas) {\n downloadImage(canvas.toDataURL());\n });\n}", "function getBase64FromImageUrl(URL, callback) {\n var img = new Image();\n img.src = URL;\n img.onload = function () {\n\n\t\t\t\tvar canvas = document.createElement(\"canvas\");\n\t\t\t\tcanvas.width =this.width;\n\t\t\t\tcanvas.height =this.height;\n\n\t\t\t\tvar ctx = canvas.getContext(\"2d\");\n\t\t\t\tctx.drawImage(this, 0, 0);\n\n\t\t\t\tvar dataURL = canvas.toDataURL(\"image/png\");\n\t\t\t\tcallback(dataURL);\n }\n}", "function getPictureString(base64picture) {\n return '<img src=\"data:image/png;base64, ' + base64picture + '\" alt=\"ProfilePicture\" />'\n}", "function handleImg(imgData) {\n //console.log(imgData);\n const imgContainer = document.getElementById(\"response-imgContainer\");\n const img = document.createElement('img');\n img.height=315;\n img.width=420;\n img.src=imgData.url\n\n imgContainer.appendChild(img);\n}", "async function getImage(url){\n const link = new URL(url)\n\n // local filesystem\n if (link.protocol === 'file:'){\n const filepath = path.resolve(path.normalize(url.replace('file://','')))\n return new Promise(function(resolve, reject){\n fs.readFile(filepath, (err, localImage)=>{\n if (err) reject(err)\n resolve(localImage)\n })\n })\n }\n\n // download from web\n const response = await fetch(link.href)\n const type = response.headers.get('Content-Type')\n if (type.includes('image/') || !type.includes('text/html'))\n return Buffer.from(await response.arrayBuffer())\n\n // parse html\n const { image } = scraper( link.href, await response.text() )\n if (!image)\n return null\n\n return Buffer.from( await (await fetch(image)).arrayBuffer() )\n}", "function imageToPngBase64(imgsrc) {\n var img = document.createElement(\"IMG\");\n img.src = imgsrc;\n var c = document.createElement(\"CANVAS\");\n c.id = \"myCanvas\";\n c.width = img.width;\n c.height = img.height;\n var ctx = c.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n return c.toDataURL();\n}", "function getImageBase64(file, callback) {\n var reader = new FileReader();\n reader.onload = function gotImage(event) {\n var image = event.target.result;\n callback(image)\n };\n reader.readAsDataURL(file);\n}", "get_image(img_tag){\n let fake_canvas = document.createElement('canvas'),\n fake_context = fake_canvas.getContext('2d');\n fake_canvas.width = img_tag.width;\n fake_canvas.height = img_tag.height;\n fake_context.drawImage(img_tag, 0, 0);\n return fake_context.getImageData(0, 0, img_tag.width, img_tag.height);\n }", "function callImage(element) {\n\tvar myNode = document.getElementById(\"certImg\");\n\twhile (myNode.firstChild) { myNode.removeChild(myNode.firstChild); } // we do this to remove the previously stored image and then append the new image that we got from the api call down below\n\t$.ajax({\n\t\turl: baseUrl+\"/downloadCert/\"+element.id,\n\t\theaders:{'Authorization':localStorage.token},\n\t\tsuccess: function(result){\n\t\t\tconsole.log(result);\n\t\t\tdata = result;\n\t\t\tvar image = new Image(); // in the following three lines we create a new image object and add it inside the #certImage id in the dom\n\t\t\timage.src = result.badge.image;\n\t\t\t$(\"#certImg\").append(\"<img src=\" + image.src + \" height='500px' width='868px'>\");\t\t\t\t\t\n\t\t}\n\t});\n}", "async setImage() {\n try {\n if (this.hasProperty(this.parsedMessage, \"metadata\")) {\n const metadata = this.parsedMessage.metadata;\n const injectedObject = metadata[\"@injected\"];\n if (\n injectedObject &&\n this.hasProperty(injectedObject, \"extensions\")\n ) {\n const extensionsObject = injectedObject[\"extensions\"];\n if (\n extensionsObject &&\n this.hasProperty(extensionsObject, \"thumbnail-generation\")\n ) {\n const thumbnailGenerationObject =\n extensionsObject[\"thumbnail-generation\"];\n\n const imageToDownload = this.chooseImage(\n thumbnailGenerationObject\n );\n\n try {\n const response = await this.downloadImage(imageToDownload);\n const url = URL.createObjectURL(response);\n let img = new Image();\n img.src = url;\n img.onload = () => (this.imageUrl = img.src);\n } catch (error) {\n logger(\"error\", error);\n }\n }\n }\n } else {\n let img = new Image();\n img.src = this.parsedMessage.data.url;\n img.onload = () => (this.imageUrl = img.src);\n }\n } catch (error) {\n logger(\"error\", error);\n }\n }", "function i(e,i,h){const s=e.thumbnail&&e.thumbnail.url;return s?(0,_request_js__WEBPACK_IMPORTED_MODULE_0__.default)(s,{responseType:\"image\"}).then((t=>{const e=n(t.data,h);return h&&h.node?(h.node.appendChild(e),h.node):e})):e.fetchSymbol().then((t=>i(t,h)))}", "function uploadImg(e) {\n var reader = new FileReader();\n reader.onload = function (event) {\n var img = new Image();\n img.onload = function () {\n const resultImage = document.querySelector('#result-image');\n resultImage.setAttribute('src', event.target.result);\n };\n img.src = event.target.result;\n };\n reader.readAsDataURL(e.target.files[0]);\n}", "function renderImage(options) {\n // Unpack the options.\n var host = options.host, mimeType = options.mimeType, source = options.source, width = options.width, height = options.height, unconfined = options.unconfined;\n // Clear the content in the host.\n host.textContent = '';\n // Create the image element.\n var img = document.createElement('img');\n // Set the source of the image.\n img.src = \"data:\" + mimeType + \";base64,\" + source;\n // Set the size of the image if provided.\n if (typeof height === 'number') {\n img.height = height;\n }\n if (typeof width === 'number') {\n img.width = width;\n }\n if (unconfined === true) {\n img.classList.add('jp-mod-unconfined');\n }\n // Add the image to the host.\n host.appendChild(img);\n // Return the rendered promise.\n return Promise.resolve(undefined);\n}", "function base64Image(canvas){\n $(\"#picture\").attr(\"src\", canvas.toDataURL());\n\n detectImages();\n}", "function getImage64withId(id,srcId){\n \n var imgId = id ;\n var currDate = new Date();\n var currTime = currDate.getTime();\n console.log(\"finding image for - \"+imgId);\n \n if(id!=null){\n config.db.get(imgId, function(err, view){\n \n \n if(err){\n console.log(\"err - \"+ JSON.stringify(err));\n }\n else{\n document.getElementById(srcId).setAttribute( 'src', 'data:image/jpg;base64,'+view.image_data);\n }\n });\n }\n \n \n \n \n \n}", "function saveUserPhoto(base64) {\n var urlvariable = \"/rest/update/picture\";\n var URL = \"https://voluntier-317915.appspot.com\" + urlvariable; //LookUp REST URL\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\", URL, false);\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n var userId = localStorage.getItem(\"email\"), token = localStorage.getItem(\"jwt\");\n var ItemJSON = '{\"email\": \"' + userId +\n '\", \"token\": \"' + token +\n '\", \"data\": \"' + 'data:image/'+imgext+';base64,' + base64 + '\"}';\n xmlhttp.send(ItemJSON);\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n document.getElementById(\"user64img\").src = ('data:image/' + imgext + ';base64,' + base64);\n const obj = JSON.parse(xmlhttp.responseText);\n let cloudURL = obj.url;\n sendFile(cloudURL, fileData);\n return false;\n }\n console.log(\"update request: \" + xmlhttp.status);\n}", "function base64_covert_to_img(_base64_string, _path){\nvar filepath = base64Img.imgSync(_base64_string, _path,uuidv1());\nreturn filepath;\n}", "async function getBase64FromUrl(url) {\n const response = await fetch(url);\n const blob = await response.blob();\n return await new Promise(resolve => {\n let reader = new FileReader();\n reader.readAsDataURL(blob);\n reader.onloadend = () => { resolve(reader.result); };\n });\n }", "function static_image(req, res) {\n \n // this === framework\n var self = this;\n\n var db = self.database('images');\n var id = req.uri.pathname.replace('/', '').replace('.png', '');\n\n // check client cache via etag\n // if not modified - framework send automatically 304\n // id === etag\n if (self.notModified(req, res, id))\n return;\n\n db.binary.read(id, function(err, stream, header) {\n\n if (err) {\n self.response404(req, res);\n return;\n }\n\n // set client cache via etag\n self.setModified(req, res, id);\n\n // req, res, filename, stream, [downloadname], [headers]\n self.responseStream(req, res, 'image/png', stream);\n });\n}", "function downloadImage() {\n var data = canvas.toDataURL('image/png');\n download.href = data;\n }", "load_from_url() {\n this.download_btn.prop(\"disabled\", 1);\n\n const url = this.url_input.val();\n\n let xhr = new XMLHttpRequest();\n\n console.info(\"Loading remote image from\", url)\n\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"blob\";\n\n xhr.onload = (e) => {\n this.fname = e.target.responseURL.replace(/\\\\/g,'/').replace(/.*\\//, '').split('.')[0];\n\n let file_reader = new FileReader();\n file_reader.onload = (e) => { this.load_image(e, this); };\n file_reader.readAsArrayBuffer(e.target.response);\n };\n\n xhr.send();\n }", "function saveItAsImage()\n {\n let image = $cvs.get(0).toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n //locally save\n window.location.href=image;\n }", "function visualizarImg() {\n\tvar preview = document.querySelectorAll('img').item(2);\n\tvar file = document.querySelector('input[type=file]').files[0];\n\tvar reader = new FileReader();\n\t\n\treader.onloadend = function() {\n\t\t// carrega em base64 a img\n\t\tpreview.src = reader.result;\n\t};\n\t\n\tif (file) {\n\t\treader.readAsDataURL(file);\n\t} else {\n\t\tpreview.src = \"\";\n\t}\n}", "function set_image_src(image_ref, image_element) {\n image_ref.getDownloadURL()\n .then( function(url) {\n image_element.src = url;\n })\n .catch( function (error) {\n console.log(error.message);\n })\n}", "function getDataURI()\n {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext( '2d' );\n Object.keys( imagesRack.loadedImages ).forEach( function( key ) {\n var rack = imagesRack.loadedImages[ key ];\n var bImg = rack.img;\n canvas.width = bImg.naturalWidth;\n canvas.height = bImg.naturalHeight;\n ctx.drawImage( bImg, 0, 0, canvas.width, canvas.height );\n rack.dataURI = canvas.toDataURL();\n });\n }", "function prepHref(linkElement) {\n var myImage = document.getElementById(\"rawimg\");\n var url = myImage.src.replace(/^data:image\\/bmp;base64[^;]/, 'data:application/octet-stream');\n window.open(url);\n // linkElement.href = myImage;\n// var byteArray = new Uint8Array(rawData);\n// var b64img = Base64.encode(rawData);\n// // linkElement.href = window.URL.createObjectURL(b64img,{type:'application/octet-stream'});\n// // linkElement.href = window.URL.createObjectURL(new Blob([byteArray],{type:'data:image/bmp;base64'}));\n// linkElement.href = window.URL.createObjectURL(new Blob([b64img],{type:'data:image/bmp;base64'}));\n// var img = document.images[0];\n// img.onclick = function() {\n// // atob to base64_decode the data-URI\n// var image_data = atob(img.src.split(',')[1]);\n// // Use typed arrays to convert the binary data to a Blob\n// var arraybuffer = new ArrayBuffer(image_data.length);\n// var view = new Uint8Array(arraybuffer);\n// for (var i=0; i<image_data.length; i++) {\n// view[i] = image_data.charCodeAt(i) & 0xff;\n// }\n// // var blob = new Blob([arraybuffer], {type: 'application/octet-stream'});\n// var blob = new Blob([arraybuffer], {type: 'data:image/bmp;base64'});\n// linkElement.href = blob;\n// }\n}", "async UploadImage(url) {\n const ClientId = 'Client-ID '+'546c25a59c58ad7'\n const reqOpts = {\n headers: {\n Accept: \"application/json\",\n Authorization: ClientId,\n \"Content-Type\": \"application/json\"\n },\n method: \"POST\",\n body: JSON.stringify({\n image : url,\n type:'base64'\n })\n };\n let resp = await fetch('https://api.imgur.com/3/image', reqOpts); //Envío de formulario de actividad\n let response = await resp.json();\n return response;\n }", "asImageAsync() {\n return new Promise((resolve, reject) => {\n // According to this answer:\n // https://stackoverflow.com/a/59025746/211234\n // the toBlob() method still has to copy the image synchronously, so this whole method still\n // takes about 13ms. It's better than toDataUrl() because it doesn't have to make an actual\n // base64 string. The Object URL is just a reference to the blob.\n this.canvas.toBlob(blob => {\n if (blob === null) {\n reject(\"Cannot make image from screen\");\n }\n else {\n const image = document.createElement(\"img\");\n const url = URL.createObjectURL(blob);\n image.addEventListener(\"load\", () => {\n URL.revokeObjectURL(url);\n // Resolve when the image is fully loaded so that there's no UI glitching.\n resolve(image);\n });\n image.src = url;\n }\n });\n });\n }", "function retrieveImageUrl(memoizeRef, filename){\n /*\n var storageRef = firebase.storage().ref();\n var spaceRef = storageRef.child('images/photo_1.png');\n var path = spaceRef.fullPath;\n var gsReference = storage.refFromURL('gs://test.appspot.com')\n */\n memoizeRef.child(filename).getDownloadURL().then(function(url) {\n var test = url;\n console.log(test)\n var imageLoaded = document.createElement(\"img\");\n imageLoaded.src = test;\n imageLoaded.className = \"w3-image w3-padding-large w3-hover-opacity\";\n document.getElementById(\"chatDisplay\").prepend(imageLoaded);\n\n imageLoaded.setAttribute(\"onclick\", \"onClick(this)\");\n }).catch(function(error) {\n\n });\n}", "function imgToDataUrl(img) {\n var $img = artoo.$(img);\n\n // Do we know the mime type of the image?\n var mime = imageMimes[getExtension($img.attr('src')) || 'png'];\n\n // Creating dummy canvas\n var canvas = document.createElement('canvas');\n canvas.width = $img[0].naturalWidth;\n canvas.height = $img[0].naturalHeight;\n\n // Copy the desired image to a canvas\n var ctx = canvas.getContext('2d');\n ctx.drawImage($img[0], 0, 0);\n var dataUrl = canvas.toDataURL(mime);\n\n // Clean up\n canvas = null;\n\n // Returning the url\n return dataUrl;\n }", "function downloadImage(imageURL, fileExtension) {\n let a = document.createElement('a');\n let originalFileName = loadImage.files[0].name.replace(/\\.[^/.]+$/, \"\");\n a.href = imageURL;\n a.download = originalFileName + \"_jsphotoeditor.\" + fileExtension;\n document.body.appendChild(a);\n a.click();\n}", "function handleDownloadImage(ev) {\n\tev.preventDefault();\n\tdocument.getElementById('cvBase').getContext('2d').drawImage(document.getElementById('cvTop'),0,0);\n\timagejs.canvas2Image('cvBase', function (blob) {\n\t\tsaveAs(blob, 'image.png');\n\t});\n}", "saveAsjpg() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n // base64 image\n var img = this.canvas.toDataURL(\"image/jpg\");\n var base64data = img.split(\",\")[1];\n img = \"\";\n var newbase64Img = base64data.replace(/\\//g, \"SLASH\");\n this.apiresult = yield this.apiService.getApiResult(newbase64Img).toPromise();\n console.log(\"flask response \" + this.apiresult);\n // Emmiting response to parent component\n this.childevent.emit(this.apiresult);\n });\n }", "getImageURL(img) {\n return img.src;\n }", "function save() {\r\n bannerImage = document.getElementById('uploadedImage');\r\n imgData = getBase64Image(bannerImage);\r\n localStorage.setItem(\"imgData\", imgData); \r\n}", "getInlineAttachment() {\n const imageData = fs.readFileSync(path.join(__dirname, '../resources/architecture-resize.png'));\n const base64Image = Buffer.from(imageData).toString('base64');\n\n return {\n name: 'architecture-resize.png',\n contentType: 'image/png',\n contentUrl: `data:image/png;base64,${ base64Image }`\n };\n }", "image(node, context) {\n const { origin, entering } = context;\n const result = origin();\n const httpRE = /^https?:\\/\\/|^data:/;\n if (httpRE.test(node.destination)){\n return result;\n }\n if (entering) {\n result.attributes.src = img_root + node.destination;\n }\n return result;\n }", "async function encodeImage(url) {\n\treturn new Promise((resolve, reject) => {\n\t\trequest.get(url, function (error, response, body) {\n\t\t\tif (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t\treturn resolve(null);\n\t\t\t}\n\t\t\tif (response.statusCode != 200) {\n\t\t\t\tconsole.log(\"Images not found, is the image folder route correct?\");\n\t\t\t\treturn resolve(null);\n\t\t\t}\n\t\t\tlet data = \"data:\" + response.headers[\"content-type\"].replace(\" \", \"\") + \";base64,\" + new Buffer.from(body).toString('base64');\n\t\t\treturn resolve(data);\n\t\t})\n\t});\n}", "asImage() {\n const image = document.createElement(\"img\");\n image.src = this.canvas.toDataURL();\n return image;\n }", "function download() {\n var stegimgbytes = putDataBlock(rawData, document.getElementById('editor').value);\n var stegDiv = document.getElementById('stegimgdiv');\n stegDiv.style.visibility=\"visible\";\n var stegImage = document.getElementById(\"stegimg\");\n stegImage.src = bmphdr + \",\" + btoa(stegimgbytes);\n}", "function img() {\n return src(source + 'img/*.*')\n .pipe(dest(destination + 'img'));\n}", "function encodeIMG() {\n if ($('#fileIMG').prop('files')[0]) {\n var imgFile = $('#fileIMG').prop('files')[0];\n if (imgFile.size >= 2000000) {\n $('.error').text(\n 'Your image is larger than 2mb! Please upload a smaller image.'\n );\n }\n var reader = new FileReader();\n reader.onloadend = function () {\n $('.file1').remove();\n $('<img>')\n .attr('src', reader.result)\n .attr('alt', 'User Image')\n .attr('id', 'preview1')\n .attr('class', 'file1')\n .appendTo($('.imgdisplay')); // displays image on site\n imgResult = reader.result; // base64 conversion result\n return imgResult;\n };\n reader.readAsDataURL(imgFile); // Takes the file and converts the data to base64\n }\n}", "function toBase64() {\n var canvas = document.createElement(\"canvas\");\n var ctx = canvas.getContext(\"2d\");\n var img = document.getElementById(\"preview\");\n ctx.drawImage(img, 10, 10);\n var data = canvas.toDataURL();\n var string = data.replace('data:image/png;base64,', '');\n return string;\n }", "function fetchVirtualTour() {\n let image = `<img class=\"rounded mx-auto d-block\" src=\"./image/panoramic.png\" width=\"1000\" height=\"450\" alt=\"library virtual tour\" \">`\n fetch('./text/VirtualTour.txt')\n .then(res => res.text())\n .then(data => {\n\n outlet.innerHTML = `${image}${data}`;\n\n\n })\n}", "function renderCanvasToImg(canvas, container) {\n canvas.toBlob((blob)=>{\n var image = document.createElement('img');\n image.src = window.URL.createObjectURL(blob);\n\n var anchor = document.createElement('a');\n anchor.innerHTML = '↓';\n anchor.target = '_blank';\n anchor.onclick = function() {\n return doDownload(anchor, image);\n };\n\n var wrapper = document.createElement('div');\n wrapper.className = 'downloader';\n\n wrapper.appendChild(image);\n wrapper.appendChild(anchor);\n\n container.appendChild(wrapper);\n },'image/png');\n}", "function displayImage(user , srcData ) {\r\n var newImage = document.createElement('img');\r\n newImage.src = srcData;\r\n \r\n // document.getElementById(\"historyMsg\").innerHTML = user + newImage.outerHTML;\r\n \r\n messageArea.append(newImage);\r\n appendMessage(`${user} send image...`);\r\n autoScrollDown();\r\n // alert(\"Converted Base64 version is \" + document.getElementById(\"historyMsg\").innerHTML);\r\n\r\n}", "function onPhotoDataSuccess2(imageData) {\n ImageSrc = \"data:image/jpeg;base64,\" + imageData;\n\t document.getElementById(\"container2\").innerHTML = \"<img src = '\" + ImageSrc + \"' width = '100%'/>\"\n\t }", "async function sendimg(){\n img = document.getElementById('file').files[0]\n let response = await fetch('/imageprocessing', {\n method: \"POST\",\n header:{\n 'content-type': 'image/png'\n },\n body: img\n });\n if (response.status == 200) {\n let result = await response.text()\n window.location.hash = '#home'\n window.location.reload()\n}\n}", "async function choosingPicture() {\n const fileName = document.getElementById('profile-image-upload-field').files[0];\n const fileReader = new FileReader();\n\n fileReader.addEventListener('loadend', async function () {\n const res = fileReader.result;\n const base64 = arrayBufferToBase64(res);\n const imgSrc = 'data:image/png;base64,' + base64;\n\n document.getElementById('header-profile-inner-img').src = imgSrc;\n document.getElementById('profile-image-field').src = imgSrc;\n\n // res ist Array-Buffer -> Server speichert es in DB -> beim Auslesen später wird der Byte-String noch mit Base64 encodiert, da readAsArrayBuffer im Ggs. zu readAsDataURL nicht vorkodiert\n await sendByteData(HOST + ':' + PORT + '/addImageToUser', window.localStorage.getItem('DatingApp-accessToken'), res);\n });\n\n // readAsDataURL bringt bereits Base64-encodeten String (also inklusive: data:image/png;base64)\n // readAsArrayBuffer bringt Array-Buffer\n // ArrayBuffer sind reine Binärdaten (mithilfe von Uint8Array können sie in Bytes zusammengefasst werden)\n fileReader.readAsArrayBuffer(fileName);\n}", "function renderImage(file){\n var reader = new FileReader();\n reader.onload = function(event){\n the_url = event.target.result\n //of course using a template library like handlebars.js is a better solution than just inserting a string\n preview = document.getElementById(\"blog_body_preview\")\n var oImg=document.createElement(\"img\");\n oImg.setAttribute('src', the_url);\n oImg.setAttribute('height', '300px');\n oImg.setAttribute('width', '450px');\n preview.appendChild(oImg);\n }\n \n //when the file is read it triggers the onload event above.\n reader.readAsDataURL(file);\n }", "async function getOverlayImage(promoId) {\n\t\tif (promoId === null) {\n\t\t\tsetOverlayImage(null);\n\t\t\treturn;\n\t\t}\n\t\tconst response = await fetch(API_URL + PROMO_IMAGE + promoId, {\n\t\t\tmethod: \"GET\",\n\t\t});\n\t\tconst blob = await response.blob();\n\t\tconst loadedImage = URL.createObjectURL(blob);\n\t\tsetOverlayImage(loadedImage);\n\t}", "async componentDidMount () {\n const response = await fetch(\"https://avatars2.githubusercontent.com/u/22461722?s=400&u=404c9d39b94f9a3c69af974eff7db43b932c39ad&v=4\");\n const imageBlob=await response.blob();\n const imageSrc=window.URL.createObjectURL(imageBlob);\n this.setState({\n imageSrc: imageSrc,\n })\n }", "function createImage(blob) {\n\n var content = null;\n\n var reader = new parentwin.FileReader();\n reader.addEventListener('loadend', function() {\n content = reader.result;\n });\n reader.readAsDataURL(blob);\n\n thread = Services.tm.currentThread;\n while (content === null) {\n thread.processNextEvent(true);\n }\n\n var image = parentwin.document.createElementNS(\n \"http://www.w3.org/1999/xhtml\", \"img\");\n\n var imageLoaded = false;\n image.addEventListener('load', function() {\n imageLoaded = true;\n });\n image.src = content;\n\n thread = Services.tm.currentThread;\n while (!imageLoaded) {\n thread.processNextEvent(true);\n }\n\n // create the canvas\n var canvas = parentwin.document.createElementNS(\n \"http://www.w3.org/1999/xhtml\", \"canvas\");\n canvas.width = image.width;\n canvas.height = image.height;\n\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(image, 0, 0);\n ctx.restore();\n\n var content = null;\n canvas.toBlob(function(blob) {\n let reader = new parentwin.FileReader();\n reader.onloadend = function() {\n content = reader.result;\n };\n reader.readAsBinaryString(blob);\n });\n\n var thread = Services.tm.currentThread;\n while (content === null) {\n thread.processNextEvent(true);\n }\n\n return canvas;\n}", "function App() {\n const imageUrl = \"https://picsum.photos/200/300\";\n\n return (\n <div>\n <h1>Image As URL</h1>\n {/** IMAGE AS URL */}\n <img src=\"https://picsum.photos/200/300\" alt=\"\" />\n <img src={imageUrl} alt=\"\" />\n\n {/** Image as file */}\n <h1>Image As Downloaded File</h1>\n <img src={imgMountain} alt=\"\" />\n </div>\n );\n}", "function buildImage(src) {\n var image = loadImage(\n src,\n function (img) {\n // add styles to img\n img.className = \"file-image\";\n // empty all children in fileImage\n fileImage.empty();\n // append new img \n fileImage.append(img);\n },\n {\n orientation: true,\n canvas: true,\n cover: true\n }\n );\n return image;\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function (e) {\n //id <img scr=\"#\"\n $('#imagePreview').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }", "function serveBlob(blobKey, imageId) {\n const image = document.getElementById(imageId);\n image.src = \"/serve?blob-key=\" + blobKey;\n}", "async function saveImageToDisk(url, filename) {\n await fetch(url)\n .then((res) => {\n const dest = fs.createWriteStream(filename)\n res.body.pipe(dest)\n })\n .catch((err) => {\n console.log(err)\n })\n}", "function createImage ( src, panelHtml, name ) {\n\n var img = document.createElement( 'img' );\n img.setAttribute( \"src\", src + name );\n\n img.className = \"mediaImg\";\n\n panelHtml.getElementsByClassName( \"mediaTarget\" )[0].innerHTML = img.outerHTML;\n\n // fitPanelOfElement( panelHtml );\n\n var panel = panels.getByProp( \"uuid\", panelHtml.id );\n\n panel.setPlaneSizeToHTML();\n\n // Add name of file to list of files.\n panel.o.files.push( name );\n\n // panel.saveToNode();\n}", "function fetchImages(){\n const dogImageContainer = document.querySelector(\"#dog-image-container\")\n fetch(imgUrl, { method: 'GET' })\n .then((response) => {\n console.log(response)\n if (response.ok) {\n return response.json() \n \n }\n })\n .then((dogJsonData) => {\n dogJsonData.message.forEach(function(imgUrl) {\n console.log(dogImageContainer)\n dogImageContainer.innerHTML += `<img src=\"${imgUrl}\">`\n })\n const imageString = dogJsonData.message.map((imgUrl) => {\n return `<img src=\"${imgUrl}\">`\n })\n })\n}", "async function getFile(url){\n const response = await fetch(url);\n // blobs are usuually any files, like images or other files.\n const data = await response.blob();\n return new File([data], 'test.jpg', {type: 'image/jpeg'});\n }", "function readMiddleImage(){\n //alert(\"readMiddleimg\");\n\n var fpToSend = localStorageService.get('segmented_img');\n\n var email = localStorageService.get('email');\n $http.get('dyn_img/fp=' + '/' + fpToSend, {\n params: {email: email}\n }\n ).then(function(response) {\n var r_code = response.status;\n if (r_code != 200){\n localStorageService.set('error_status', r_code);\n $state.go('error_status');\n }\n\n myImageMiddle.src = \"data:image/png;base64,\" + response.data;\n });\n\n\n //var tstimg = document.getElementById('test_img');\n //tstimg.src = localStorageService.get('segmented_img');\n\n }", "function convertImage(type, data) {\n return \"\\\"data:image/\" + type + \";base64,\" + (new Buffer(data).toString('base64')) + \"\\\"\";\n }", "function RenderedImage(options) {\n var _this = _super.call(this) || this;\n var img = document.createElement('img');\n var source = Private.getSource(options);\n img.src = \"data:\" + options.mimeType + \";base64,\" + source;\n var metadata = options.model.metadata.get(options.mimeType);\n if (metadata) {\n var metaJSON = metadata;\n if (typeof metaJSON['height'] === 'number') {\n img.height = metaJSON['height'];\n }\n if (typeof metaJSON['width'] === 'number') {\n img.width = metaJSON['width'];\n }\n }\n _this.node.appendChild(img);\n _this.addClass(IMAGE_CLASS);\n return _this;\n }", "getImage() {\n return this.canvas.toDataURL('image/png', 1.0);\n }", "function setImage()\n {\n var img = getId(\"captured_image\");\n \n var path = \"file:\" + Native.getImagePath();\n \n img.setAttribute(\"src\", path);\n }" ]
[ "0.7028462", "0.68948", "0.6827957", "0.6745683", "0.6540309", "0.6535558", "0.6532054", "0.6527274", "0.6468653", "0.6466614", "0.6413476", "0.6390011", "0.63822335", "0.6380454", "0.62634426", "0.6251078", "0.62499696", "0.6226959", "0.61669594", "0.61470807", "0.6144563", "0.61280674", "0.6125347", "0.61243784", "0.6120816", "0.61185324", "0.611674", "0.6115102", "0.6107252", "0.6085407", "0.6085194", "0.6052271", "0.6051417", "0.60348195", "0.6024731", "0.6022724", "0.6003209", "0.600227", "0.60022265", "0.5993525", "0.5989038", "0.5987715", "0.5974812", "0.5969427", "0.59610164", "0.5957956", "0.5950547", "0.59488946", "0.5937301", "0.593103", "0.5921898", "0.5876666", "0.58759385", "0.58684355", "0.5868277", "0.5850901", "0.5848551", "0.5842685", "0.5841844", "0.5839734", "0.58317554", "0.58272064", "0.58252573", "0.5819474", "0.5818098", "0.57954186", "0.5794734", "0.578751", "0.57852733", "0.57835686", "0.57794553", "0.57574576", "0.57567745", "0.5753493", "0.5743616", "0.57304287", "0.5726684", "0.57259536", "0.5721649", "0.57192856", "0.5716641", "0.5715879", "0.5711866", "0.5703994", "0.5697155", "0.56924045", "0.5691998", "0.5685539", "0.56818855", "0.56637704", "0.56633407", "0.56554407", "0.564546", "0.56440085", "0.5641248", "0.5638933", "0.56362015", "0.5632079", "0.5612858", "0.56038815" ]
0.6233172
17
Scrape the panels at the top of the detail page for meta
function scrapePrimaryPanel (id, node) { if (!package[id].headerMeta) package[id].headerMeta = {}; node.querySelectorAll('.panel-body .row').forEach(row=>{ const cells = row.querySelectorAll('div'); if (cells && cells.length>=2 ) { package[id].headerMeta[cells[0].textContent.trim()] = cells[1].textContent.trim(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function panelMetaData(url){\n\tpanelView = 'metadata';\n\tpanelShow(220, 'meta');\n\t$('panelFrame').src = myPath+'ressource/lib/media.metadata.php?url='+url;\n}", "function detail_result(json_parse) {\n\n document.getElementsByClassName('panel')[0].className = \"panel panel-default show\"\n document.getElementsByClassName('panel-heading')[0].innerHTML = '<strong>' + json_parse.Title + '</strong><br/>(' + json_parse.Released + ')'\n document.getElementsByClassName('panel-body')[0].innerHTML = '<div class=\"detail_holder\">' +\n '<div><strong>Genre:</strong>&nbsp;&nbsp;' + json_parse.Genre + '</div>' +\n '<div><strong>Starring:</strong>&nbsp;&nbsp;' + json_parse.Actors + '</div>' +\n '<div>' + json_parse.Plot + '</div>' +\n '</div>'\n \n \n \n}", "function loadPanels() {\n\t\t\tloadMonthlyCelebrants();\n\t\t\t//loadNewlyBaptized();\n\t\t}", "function investigatePage() {\r\n var rows = document.evaluate(\"//div[@class='objectinfo']\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageIDs[i] = /immo(\\d+)/.exec(rows.snapshotItem(i).id)[1];\r\n lastSeenIDs[pageIDs[i]] = new Date().getTime();\r\n }\r\n rows = document.evaluate(\"//div[@class='titel']/a\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageTitles[i] = rows.snapshotItem(i).textContent.toString();\r\n }\r\n rows = document.evaluate(\"//div[@class='adresse']\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageLocations[i] = rows.snapshotItem(i).textContent.toString();\r\n }\r\n if (lastSeenIDs) GM_setValue('lastSeenIDs',lastSeenIDs.toSource());\r\n}", "function fetchDetails (id) {\n return limitedFetch(`${domain}/item/Details/${id}`)\n .then(res => res.text())\n .then(body => {\n var promises = [];\n const detailDom = new JSDOM(body);\n\n // Get the primary image\n const pImg = detailDom.window.document.querySelector('#PrimaryImage');\n if (pImg) {\n promises.push( fetchImage2base64(pImg.getAttribute('data-url'), package[id], 'primaryImage') )\n }\n\n // scrape the panels at the top\n detailDom.window.document.querySelectorAll('.panel-primary')\n .forEach( node=>scrapePrimaryPanel(id,node) );\n\n // Fetch the detail tabs for this resource\n [\"/Item/_Details/\",\"/Item/_LocationDisplay/\",\"/Item/_Donor/\",\"/Item/_Appraisal_Deed/\",\"/Item/_Purchases/\",\"/Item/_Condition/\",\"/Item/_MaintenanceDisplay/\"]\n .forEach( tabpath=>{\n promises.push( getTabDetail(tabpath,id) );\n });\n\n return Promise.all(promises);\n })\n}", "function parse_hpsm_fields() {\n var arr = document.querySelectorAll(\".x-tab-panel-body .x-panel.x-panel-noborder\");\n for (var i=0; i < arr.length; i++) {\n if(arr[i].id.substring(0, 3) == \"ext\") {\n if(arr[i].className.indexOf('x-hide-nosize') == -1){\n var arr2 = arr[i].querySelectorAll(\"iframe.ux-mif\");\n if(arr2.length === 1) {\n var doc = arr2[0].contentWindow.document;\n console.log(doc);\n var fields = {}, listButtons = {}, unknownButtons = {}, findButtons = {}, fillButtons = {}, actionButtons = {}, labels = {};\n\n labels[\"interactionId\"] = $('label:contains(\"Interaction ID\")', doc).first();\n labels[\"status\"] = $('label:contains(\"Status\")', doc).first();\n labels[\"helpdesk\"] = $('label:contains(\"Helpdesk\")', doc).first();\n labels[\"contact\"] = $('label:contains(\"Contact\")', doc).first();\n labels[\"contactEmail\"] = $('label:contains(\"Contact email\")', doc).first();\n labels[\"title\"] = $('label:contains(\"Title\")', doc).first();\n labels[\"endUser\"] = $('label:contains(\"End user\")', doc).first();\n labels[\"endUserDept\"] = $('label:contains(\"End user dept.\")', doc).first();\n labels[\"description\"] = $('label:contains(\"Description\")', doc).first();\n labels[\"category\"] = $('label:contains(\"Category\")', doc).first();\n labels[\"subcategory\"] = $('label:contains(\"Subcategory\")', doc).first();\n labels[\"service\"] = $('label:contains(\"Service\")', doc).first();\n labels[\"impact\"] = $('label:contains(\"Impact\")', doc).first();\n labels[\"urgency\"] = $('label:contains(\"Urgency\")', doc).first();\n labels[\"priority\"] = $('label:contains(\"Priority\")', doc).first();\n labels[\"assignmentGroup\"] = $('label:contains(\"Assignment group\")', doc).first();\n labels[\"assignee\"] = $('label:contains(\"Assignee\")', doc).first();\n labels[\"targetDate\"] = $('label:contains(\"SLA target date\")', doc).first();\n labels[\"newUpdate\"] = $('label:contains(\"New update\")', doc).first();\n labels[\"closureCode\"] = $('label:contains(\"Closure code\")', doc).first();\n labels[\"solution\"] = $('label:contains(\"Solution\")', doc).first();\n\n fields[\"interactionId\"] = $(\"#\"+labels[\"interactionId\"].attr(\"for\"), doc);\n fields[\"status\"] = $(\"#\"+labels[\"status\"].attr(\"for\"), doc);\n fields[\"helpdesk\"] = $(\"#\"+labels[\"helpdesk\"].attr(\"for\"), doc);\n fields[\"contact\"] = $(\"#\"+labels[\"contact\"].attr(\"for\"), doc);\n fields[\"contactEmail\"] = $(\"#\"+labels[\"contactEmail\"].attr(\"for\"), doc);\n fields[\"title\"] = $(\"#\"+labels[\"title\"].attr(\"for\"), doc);\n fields[\"endUser\"] = $(\"#\"+labels[\"endUser\"].attr(\"for\"), doc);\n fields[\"endUserDept\"] = $(\"#\"+labels[\"endUserDept\"].attr(\"for\"), doc);\n fields[\"description\"] = $(\"#\"+labels[\"description\"].attr(\"for\"), doc);\n fields[\"category\"] = $(\"#\"+labels[\"category\"].attr(\"for\"), doc);\n fields[\"subcategory\"] = $(\"#\"+labels[\"subcategory\"].attr(\"for\"), doc);\n fields[\"service\"] = $(\"#\"+labels[\"service\"].attr(\"for\"), doc);\n fields[\"impact\"] = $(\"#\"+labels[\"impact\"].attr(\"for\"), doc);\n fields[\"urgency\"] = $(\"#\"+labels[\"urgency\"].attr(\"for\"), doc);\n fields[\"priority\"] = $(\"#\"+labels[\"priority\"].attr(\"for\"), doc);\n fields[\"assignmentGroup\"] = $(\"#\"+labels[\"assignmentGroup\"].attr(\"for\"), doc);\n fields[\"assignee\"] = $(\"#\"+labels[\"assignee\"].attr(\"for\"), doc);\n // fields[\"assigneeFull\"] = $( \"#X\" + (parseInt(labels[\"assignee\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n fields[\"targetDate\"] = $(\"#\"+labels[\"targetDate\"].attr(\"for\"), doc);\n fields[\"newUpdate\"] = $(\"#\"+labels[\"newUpdate\"].attr(\"for\"), doc);\n fields[\"closureCode\"] = $(\"#\"+labels[\"closureCode\"].attr(\"for\"), doc);\n fields[\"solution\"] = $(\"#\"+labels[\"solution\"].attr(\"for\"), doc);\n\n listButtons[\"status\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"Button\", doc);\n listButtons[\"helpdesk\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"Button\", doc);\n listButtons[\"impact\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"Button\", doc);\n\n unknownButtons[\"contact\"] = $( \"#X\" + (parseInt(labels[\"contact\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n unknownButtons[\"endUser\"] = $( \"#X\" + (parseInt(labels[\"endUser\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n unknownButtons[\"service\"] = $( \"#X\" + (parseInt(labels[\"service\"].attr(\"for\").replace(\"X\", \"\")) + 1), doc );\n\n findButtons[\"service\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FindButton\", doc);\n\n fillButtons[\"contact\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"endUser\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"category\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"subcategory\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"service\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"assignmentGroup\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"assignee\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n fillButtons[\"closureCode\"] = $(\"#\"+labels[\"status\"].attr(\"for\") + \"FillButton\", doc);\n\n actionButtons[\"markAsSpam\"] = $('button:contains(\"Mark as SPAM\")', doc);\n actionButtons[\"newEmail\"] = $('button:contains(\"New Email\")', doc);\n actionButtons[\"fullCaseflow\"] = $('button:contains(Full Case Flow)', doc);\n actionButtons[\"refreshHistory\"] = $('button:contains(Refresh History)', doc);\n\n var parsed = {}\n parsed[\"fields\"] = fields;\n parsed[\"listButtons\"] = listButtons;\n parsed[\"unknownButtons\"] = unknownButtons;\n parsed[\"findButtons\"] = findButtons;\n parsed[\"fillButtons\"] = fillButtons;\n parsed[\"actionButtons\"] = actionButtons;\n //console.log(parsed);\n return parsed;\n }\n }\n }\n }\n}", "function moreInfo() {\n return new Promise(function (resolve, reject) {\n fetch_data(whoisURL)\n .then(function(data) {\n display_whois(ID_whois,data.responseText)\n fetch_data(vtURL)\n .then(function(data) {\n display_vt(ID_vt,data.responseText);\n var elmnt = document.getElementById(ID_scroll);\n elmnt.scrollIntoView();\n resolve();\n }).catch(function(data) {\n console.warn (\"Error showing VirusTotal info\");\n });\n }).catch(function(data) {\n console.warn (\"Error showing Whois info\");\n });\n });\n}", "function searchPromoDetail(linkToDetailPage) {\n return nf(`${linkToDetailPage}`)\n .then(response => response.text())\n .then(body => {\n const details = {};\n const $ = cheerio.load(body);\n $('#contentpromolain2').each(function(i, element) {\n var $element = $(element);\n var $area = $element.find('.area b').text();\n var $periode = $element.find('.periode b').text();\n var $fullPoster = $element.find('.keteranganinside img').attr('src');\n details.area = $area;\n details.periode = $periode;\n details.fullPoster = BASEURL + $fullPoster;\n });\n return details;\n });\n}", "function emblContentMetaProperties_Read() {\n var metaProperties = {};\n // <!-- Content descriptors -->\n // <meta name=\"embl:who\" content=\"{{ meta-who }}\"> <!-- the people, groups and teams involved -->\n // <meta name=\"embl:what\" content=\"{{ meta-what }}\"> <!-- the activities covered -->\n // <meta name=\"embl:where\" content=\"{{ meta-where }}\"> <!-- at which EMBL sites the content applies -->\n // <meta name=\"embl:active\" content=\"{{ meta-active }}\"> <!-- which of the who/what/where is active -->\n metaProperties.who = metaProperties.who || document.querySelector(\"meta[name='embl:who']\");\n metaProperties.what = metaProperties.what || document.querySelector(\"meta[name='embl:what']\");\n metaProperties.where = metaProperties.where || document.querySelector(\"meta[name='embl:where']\");\n metaProperties.active = metaProperties.active || document.querySelector(\"meta[name='embl:active']\");\n\n // <!-- Content role -->\n // <meta name=\"embl:utility\" content=\"-8\"> <!-- if content is task and work based or if is meant to inspire -->\n // <meta name=\"embl:reach\" content=\"-5\"> <!-- if content is externally (public) or internally focused (those that work at EMBL) -->\n metaProperties.utility = metaProperties.utility || document.querySelector(\"meta[name='embl:utility']\");\n metaProperties.reach = metaProperties.reach || document.querySelector(\"meta[name='embl:reach']\");\n\n // <!-- Page infromation -->\n // <meta name=\"embl:maintainer\" content=\"{{ meta-maintainer }}\"> <!-- the contact person or group responsible for the page -->\n // <meta name=\"embl:last-review\" content=\"{{ meta-last-review }}\"> <!-- the last time the page was reviewed or updated -->\n // <meta name=\"embl:review-cycle\" content=\"{{ meta-review-cycle }}\"> <!-- how long in days before the page should be checked -->\n // <meta name=\"embl:expiry\" content=\"{{ meta-expiry }}\"> <!-- if there is a fixed point in time when the page is no longer relevant -->\n metaProperties.maintainer = metaProperties.maintainer || document.querySelector(\"meta[name='embl:maintainer']\");\n metaProperties.lastReview = metaProperties.lastReview || document.querySelector(\"meta[name='embl:last-review']\");\n metaProperties.reviewCycle = metaProperties.reviewCycle || document.querySelector(\"meta[name='embl:review-cycle']\");\n metaProperties.expiry = metaProperties.expiry || document.querySelector(\"meta[name='embl:expiry']\");\n for (var key in metaProperties) {\n if (metaProperties[key] != null && metaProperties[key].getAttribute(\"content\").length != 0) {\n metaProperties[key] = metaProperties[key].getAttribute(\"content\");\n } else {\n metaProperties[key] = 'notSet';\n }\n }\n return metaProperties;\n}", "function loadOttorInformation() {\n console.log ('Checking if this is a property page');\n if ($('.propertyDetails').length == 0) {\n console.log('...its not so do nothing');\n } else { \n removeJunk();\n stripOutDetails(); \n loadPropertyDetails();\n } \n}", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }", "function zoto_detail_meta_info(options) {\n\tthis.options = options || {};\n\tthis.options.mode = this.options.mode || 'page'; // 'page' or 'modal'\n\n\t/*\n\t * Create our page elements\n\t */\n\tvar desc_epaper_options = {'attribute': \"description\", 'multi_line': 1, 'starting_text': _(\"click here to add a photo description.\")};\n\tvar tag_cloud_options = {'can_delete': true, 'weighted': false};\n\tif(this.options.mode == 'modal') {\n\t\tdesc_epaper_options['maxchar'] = 300;\n\t\ttag_cloud_options['tag_count'] = 15;\n\t} else {\n\t\tthis.modal_licensing = new zoto_modal_licensing(this.options.mode);\n\t\tthis.a_edit_license = A({'href':\"javascript:void(0)\"}, \"edit\");\n\t\tthis.edit_license = SPAN({'style':\"font-size: 9px;\"}, \" (\", this.a_edit_license, \")\");\n\t}\n\tthis.title_epaper = new zoto_e_paper_lite({'id': \"title_epaper\", 'blur_update': true, 'attribute': \"title\", 'starting_text': _(\"click here to add a title\")});\n\tthis.description_epaper = new zoto_e_paper_image_attributes(desc_epaper_options);\n\tthis.tags_header = DIV({'style': \"margin-bottom: 3px\"}, H3({}, _('tags')));\n\tthis.look_ahead = new zoto_tag_lookahead({min_length: 3, allow_spaces: true});\n\tthis.tag_cloud = new zoto_image_tag_cloud(tag_cloud_options);\n\n\t//replaceChildNodes(this.albums_header, H3({'style': \"margin-top: 10px;\"}, _(\"albums\")));\n\t//this.albums_header = DIV({'syle': \"margin-bottom: 10px; margin-top: 10px;\"});\n\tthis.albums_header = H3({'style': \"margin-top: 10px;\"}, _(\"albums\"));\n\tthis.album_list = SPAN({}, \"\");\n\n\t//\n\t// Advanced info\n\t//\n\tthis.perms = SPAN({});\n\tthis.license_text = SPAN({}, \"\");\n\n\tthis.date_taken_link = A({'href': \"javascript: void(0);\"}, \"\");\n\tthis.date_taken = SPAN({});\n\tthis.date_taken_holder = SPAN({}, _('taken: '), this.date_taken);\n\n\tthis.date_uploaded = SPAN({});\n\tthis.date_uploaded_holder = SPAN({}, _(\"uploaded: \"), this.date_uploaded);\n\t\t\n\t/* Advanced info */\n\tvar advanced = DIV({'style': \"margin-top: 5px\"},\n\t\tH3({}, _('advanced info')),\n\t\tthis.perms,\n\t\tthis.license_text, BR({'clear':\"ALL\"}),\n\t\tthis.date_taken_holder, BR({'clear':\"ALL\"}),\n\t\tthis.date_uploaded_holder, BR()\n\t);\n\n\tif (this.options.mode == \"page\") {\n\t\n\t\tthis.filename = SPAN({});\n\t\tthis.filename_holder = SPAN({}, _(\"filename\"), ': ', this.filename, BR());\n\t\n\t\tthis.source_name = SPAN({});\n\t\tthis.source_name_holder = SPAN({}, _(\"uploaded via\"), \": \", this.source_name, BR());\n\t\n\t\tthis.camera_make = SPAN({});\n\t\tthis.camera_make_holder = SPAN({}, _(\"make\"), \": \", this.camera_make, BR());\n\t\n\t\tthis.camera_model = SPAN({});\n\t\tthis.camera_model_holder = SPAN({}, _(\"model\"), \": \", this.camera_model, BR());\n\t\n\t\tthis.iso_speed = SPAN({});\n\t\tthis.iso_speed_holder = SPAN({}, _(\"iso speed\"), \": \", this.iso_speed, BR());\n\t\n\t\tthis.focal_length = SPAN({});\n\t\tthis.focal_length_holder = SPAN({}, _(\"focal length\"), \": \", this.focal_length, BR());\n\t\n\t\tthis.fstop = SPAN({});\n\t\tthis.fstop_holder = SPAN({}, _(\"f-stop\"), \": \", this.fstop, BR());\n\t\n\t\tthis.exposure_time = SPAN({});\n\t\tthis.exposure_time_holder = SPAN({}, _(\"exposure time\"), \": \", this.exposure_time, BR());\n\t\n\t\tvar extra_advanced = DIV({id: 'extra_advanced'}, \n\t\t\tthis.filename_holder,\n\t\t\tthis.source_name_holder,\n\t\t\tthis.camera_make_holder,\n\t\t\tthis.camera_model_holder,\n\t\t\tthis.iso_speed_holder,\n\t\t\tthis.focal_length_holder,\n\t\t\tthis.fstop_holder,\n\t\t\tthis.exposure_time_holder\n\t\t);\n\t\tappendChildNodes(advanced, extra_advanced);\n\t\tthis.advanced_link = element_opener(extra_advanced, _(\"view all advanced info\"), _(\"hide advanced info\"));\n\t} else {\n\t\tthis.advanced_link = A({'href': \"javascript: void(0);\"}, _(\"more\"));\n\t}\n\tappendChildNodes(advanced, this.advanced_link);\n\n\tthis.el = DIV({id: 'meta_holder'},\n\t\tthis.title_epaper.el,\n\t\tthis.description_epaper.el,\n\t\tthis.tags_header,\n\t\tthis.look_ahead.el,\n\t\tthis.tag_cloud.el,\n\t\tthis.albums_header,\n\t\tthis.album_list,\n\t\tadvanced\n\t);\n\t\n\tconnect(this.title_epaper, 'EPAPER_EDITED', this, 'handle_edit');\n\tconnect(this.title_epaper, 'IMAGE_ATTRIBUTE_CHANGED', this, function(new_value) {\n\t\tthis.info.title = new_value;\n\t});\n\tconnect(this.tag_cloud, 'TAG_CLICKED', this, function(tag_name) {\n\t\tsignal(this, 'TAG_CLICKED', tag_name);\n\t});\n\tconnect(this.description_epaper, 'IMAGE_ATTRIBUTE_CHANGED', this, function(new_value) {\n\t\tthis.info.description = new_value;\n\t});\n\tconnect(this.look_ahead, 'NEW_TAG_ADDED', this.tag_cloud, 'refresh');\n\tconnect(this.look_ahead, 'NEW_TAG_ADDED', this, function(){\n\t\tsignal(this, 'NEW_TAG_ADDED');\n\t});\n\tconnect(authinator, 'USER_LOGGED_IN', this, 'update');\n\tconnect(this.date_taken_link, 'onclick', this, function(e) {\n\t\tsignal(this, 'DATE_CLICKED', this.info.date);\n\t});\n\n\tif (this.options.mode == \"page\") {\n\t\tconnect(this.a_edit_license, 'onclick', this, function(e){\n\t\t\tthis.modal_licensing.handle_image_detail_click(this.media_id)\n\t\t});\n\t\tconnect(this.modal_licensing, \"LICENSE_UPDATED\", this, function(result){\n\t\t\tthis.info.license = Number(result);\n\t\t\tthis.update();\n\t\t});\n\t} else {\n\t\tconnect(this.advanced_link, 'onclick', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t\tconnect(this.description_epaper, 'MORE_CLICKED', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t\tconnect(this.tag_cloud, 'MORE_CLICKED', this, function(e) {\n\t\t\tcurrentDocument().modal_manager.move_zig();\n\t\t\tcurrentWindow().site_manager.update(this.info.owner_username, 'detail', this.media_id);\n\t\t});\n\t}\n\n\tthis.a_cc_icon_attribution = this.create_license_icon(\n\t\t['attribution'], \"by\");\n\tthis.a_cc_icon_noderivs = this.create_license_icon(\n\t\t['attribution', 'noderivs'], \"by-nd\");\n\tthis.a_cc_icon_noncomm_noderivs = this.create_license_icon(\n\t\t['attribution', 'noderivs', 'noncomm'], \"by-nc-nd\");\n\tthis.a_cc_icon_noncomm = this.create_license_icon(\n\t\t['attribution', 'noncomm'], \"by-nc\");\n\tthis.a_cc_icon_noncomm_sharealike = this.create_license_icon(\n\t\t['attribution', 'noncomm', 'sharealike'], \"by-nc-sa\");\n\tthis.a_cc_icon_sharealike = this.create_license_icon(\n\t\t['attribution', 'sharealike'], 'by-sa');\n}", "async getStoryMeta(pageHTML) {\n this.meta.title = $(\".preface h2.title\", pageHTML)\n .text()\n .trim();\n\n this.meta.authors = [$(\".preface a[rel='author']\", pageHTML).text()];\n\n this.meta.comments = [];\n $(\".preface > .summary p\", pageHTML).each((i, elem) =>\n this.meta.comments.push(\n $(elem)\n .text()\n .trim()\n )\n );\n this.meta.comments = this.meta.comments\n .join(\"\\n\\n\")\n .replace(/[\\\\$'\"]/g, \"\\\\$&\");\n }", "function scrape(){\n\t\n\t//Title name\n\tscraperjs.StaticScraper.create('http://localhost/x_out.html')\n\t \t\t.scrape(function($) {\n\t \t\t return $(\"#nav a[class!='chosen']\").map(function() {\n \t\t \treturn $(this).text();\n \t\t \t}).get();\n \t\t\t}, function(text) {\n\n\t\t\tconsole.log(text);\n\t\t\tjson.topMemu = text;\n\n\t\twriteToJson(json);\n\t\t\n \t})\n\t\t.scrape(function($) {\n\t \t\t return $(\".nav_chosen div\").map(function() {\n \t\t \treturn $(this).text();\n \t\t \t}).get();\n \t\t\t}, function(text) {\n\n\t\t\tsubMemuIndex = text.length\n\t\t\tconsole.log(subMemuIndex);\n\n\t\t\tfor(var i = 0; i < subMemuIndex; i++)\n\t\t\t{\n\t\t\t\t//console.log(i);\n\t\t\t\tscraperjs.StaticScraper.create('http://localhost/x_out.html')\n\t \t\t\t\t.scrape(function($) { console.log(i);\n\t \t\t\t\t return $(\".nav_chosen div\").eq(i).find('li').map(function() {\n \t\t\t\t \treturn $(this).text();\n \t\t\t \t \t}).get();\n \t\t\t\t\t}, function(text) {\n\n\t\t\t\t\tconsole.log('index:'+ i +' ..' + text);\n\t\t\t\t})\n\t\t\t\t\t\n\t\t\t}\n\n\t})\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(6).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tconsole.log( text);\n\t})\n\n\t\n\n\n}", "function show_next_form() {\n var header = $('#sample_meta_header');\n header.show();\n $('#sample_meta_common').show();\n scroll_to_ele(header);\n }", "function getTabDetail (path,id) {\n return limitedFetch(`${domain}${path}${id}`)\n .then(res => res.text())\n .then(body => {\n var promises = []\n const tabDom = new JSDOM(body);\n tabDom.window.document.querySelectorAll('.panel.panel-default.collapsible')\n .forEach( node=>scrapeTabDefaultPanel(id,node,promises) );\n return Promise.all(promises);\n });\n}", "function displayDetails(item) {\n\n $(\"#addressdiv\").empty();\n $(\"#addressdiv\").html(\"<h3>\" + item.name + \"</h3>\" + item.street + \" \" + item.city + \", NY \" + item.zip + \"<br>\" + item.phone);\n $(\"#inspectiondiv\").empty();\n if (item.inspections !== undefined && item.inspections.length > 0) {\n var content = '<div class=\"panel-group\" id=\"accordion\">';\n $.each(item.inspections, function (index, value) {\n var color = \"#49F043\";\n if (value[\"critical-violations\"] > 0) {\n color = \"#f04d49\";\n } else if (value[\"non-critical-violations\"] > 0) {\n color = \"#EEF015\";\n }\n content += '<div class=\"panel panel-default\"><div class=\"panel-heading\" style=\"background-color:' + color + '\"><h4 class=\"panel-title\"><a data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapse' + index + '\">';\n var date = new Date(value.date);\n content += value.type + ' (' + date.toDateString() + ')</a></h4></div>';\n content += ' <div id=\"collapse' + index + '\" class=\"panel-collapse collapse\"><div class=\"panel-body\" id=\"' + value.id + '\">';\n //content inserted here after api call\n content += '</div></div></div>';\n });\n content += '</div>';\n $('#inspectiondiv').append(content);\n $('#accordion').on('show.bs.collapse', function (evt) {\n var contentDiv = $(evt.target.children[0]);\n\n $.get(\"/healthinspections/inspection/\" + contentDiv[0].id, function (data) {\n if (data.violations !== undefined && data.violations.length > 0) {\n var inspContent = \"\";\n $.each(data.violations, function (index, value) {\n inspContent += \"<p><b>\" + value.code + \"-\" + value.text + \"</b><br>\";\n inspContent += value.note + \"</p>\";\n });\n contentDiv.html(inspContent);\n\n } else {\n contentDiv.html(\"No Violations\");\n }\n });\n })\n } else {\n $(\"#inspectiondiv\").html(\"<h4>No Inspections</h4>\");\n }\n\n $(\"#detailsdiv\").show();\n\n\n}", "function show_next_form() {\n var meta = $('#sample_meta')\n meta.show();\n $('#meta_footer').show();\n scroll_to_ele(meta);\n }", "function fill_data(ele) {\n var p_tag = ele.children('p.tab_type');\n var meta_title = ele.children('h3').text();\n var meta_desc = ele.children('p.meta_desc').text();\n var meta_date = p_tag.children('span.type_latest').text();\n var meta_download = p_tag.children('span.type_hot').text();\n var meta_likes = p_tag.children('span.type_favorite').text();\n\n $('#theme_detail_panel h3').text(meta_title);\n $('#theme_detail_panel p').text(meta_desc);\n $('#theme_detail_panel ul li.info_date').text(meta_date);\n $('#theme_detail_panel ul li.info_download').text(meta_download);\n $('#theme_detail_panel ul li.info_fb').text(meta_likes);\n\n }", "function DetailPanel(title, popularity, preview, spotifyUrl) {\n Panel.call(this, title, 'section');\n\n var p = document.createElement('p');\n p.innerText = popularity;\n this.element.appendChild(p);\n\n var iframe = document.createElement('iframe');\n iframe.src = preview;\n this.element.appendChild(iframe);\n\n var a1 = document.createElement('a');\n a1.href = spotifyUrl;\n a1.setAttribute('target', '_blank');\n a1.innerHTML = 'Complete song on Spotify';\n this.element.appendChild(a1);\n}", "render() {\n const {data, loaded, params} = this.props;\n let meta = '';\n if (data && data.result && data.result.raw) {\n const title = `${data.result.raw.name} | Kwhen.com`;\n meta = <Meta title={title} />;\n }\n return (\n <div className={classnames('mdl-layout', 'mdl-layout--fixed-header')}>\n {meta}\n <Header params={params}/>\n {loaded && (\n <DetailsContent params={params} answer={data}/>\n ) || (\n <h3></h3>\n )}\n </div>\n );\n }", "function makeDetailHtml(data){\r\n var count = 0;\r\n var i = 0;\r\n var html = '<div style=\"display: none; \" class=\"detail_info\" id=\"detail_info_' + data.index + '\">'\r\n // id\r\n html += '<p class=\"detail_id\">id: DOID:' + data.info.id + '</p>';\r\n // name\r\n html += '<p class=\"detail_name\">name: ' + data.info.name + '</p>';\r\n //def\r\n if (data.info.definition != null){\r\n // html += '<p class=\"detail_def\">def: ' + data.info.definition + '</p>';\r\n var s=data.info.definition;\r\n if(s.match('url')){\r\n var t1=s.substring(s.lastIndexOf('[')+1,s.lastIndexOf(']'));\r\n var t2=s.substring(0,s.lastIndexOf('['));\r\n var txt=t2.substring(1,t2.length-2);\r\n html += '<p class=\"detail_def\">def: '+ txt+'url:';\r\n if(t1.match(',')){\r\n var t=t1.split(',');\r\n count=t.length;\r\n for(i=0;i < count;i++){\r\n if(t[i].match('http')){\r\n html+='<a href=\"'+makeUrl(t[i])+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t[i])+'</a>'+(i==(count-1)? '&nbsp;':'&nbsp;|&nbsp;'); \r\n }\r\n } \r\n }else{\r\n html +='<a href=\"'+makeUrl(t1)+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t1)+'</a>';\r\n }\r\n html+='</p>';\r\n }\r\n } \r\n // alt_id\r\n if (data.info.alt_ids != null){\r\n count = data.info.alt_ids.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_alt_id\">alt_id: DOID:' + data.info.alt_ids[i].alt_id + '</p>';\r\n }\r\n } \r\n // subset\r\n if (data.info.subsets != null){\r\n count = data.info.subsets.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_subset\">subset: ' + data.info.subsets[i].subset + '</p>';\r\n }\r\n }\r\n // synonym\r\n if (data.info.synonyms != null){\r\n count = data.info.synonyms.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_synonym\">synonym: ' + data.info.synonyms[i].synonym + '</p>';\r\n }\r\n } \r\n // xref\r\n if (data.info.xrefs != null){\r\n count = data.info.xrefs.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_xref\">xref: ' + data.info.xrefs[i].xref_name + ':' + data.info.xrefs[i].xref_value + '</p>';\r\n }\r\n } \r\n // relations\r\n if (data.info.relations != null){\r\n count = data.info.relations.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_relation\">' + data.info.relations[i].relation + ': ' + data.info.relations[i].term2_id + '</p>';\r\n }\r\n }\r\n html += '</div>';\r\n return html;\r\n}", "async function loadDetails() {\r\n try {\r\n setShow(true);\r\n\r\n const response = await api.get(`/etapas/${project._id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n const { data } = response;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err ', err);\r\n setErr(true);\r\n }\r\n }", "function hideMetaSeps() {\n\n\t\t$('.likes-and-comments, .post-meta-info').each(function() {\n\t\t\t$(this).children().not(':hidden').last().find('.meta-sep').hide();\n\t\t});\n\n\t}", "function showDetails() {\n $(this).closest('.panel-body').find('.projInfo').slideDown();\n }", "function more(){\n if (currentGenre == \"\" && value == \"\"){\n pageNo += 1\n if (contentType == \"anime\"){\n fetchData('top', 'anime', 'tv')\n }\n else{\n fetchData('top', 'manga', 'manga')\n }\n }\n else if (value == \"\"){\n pageNo ++ \n fetch('https://api.jikan.moe/v3/genre/'+contentType+'/'+ currentGenre.toString() +'/'+pageNo.toString()+'')\n .then(response => response.json()) \n .then(function(data){\n console.log(data)\n let i = 0\n if (contentType == \"anime\"){\n while (i < (data.anime).length){\n container.innerHTML += (\"<div class='items' id='\"+ data.anime[i].mal_id +\"' title='\"+ data.anime[i].title +\"'><img src='\" + data.anime[i].image_url + \"' id='aContent\"+i+\"'></div>\");\n i ++\n }\n }\n else{\n while (i < (data.manga).length){\n container.innerHTML += (\"<div class='items' id='\"+ data.manga[i].mal_id +\"' title='\"+ data.manga[i].title +\"'><img src='\" + data.manga[i].image_url + \"' id='aContent\"+i+\"'></div>\");\n i ++\n }\n } \n });\n }\n }", "async getInfoProfile() {\n\t\tthis.spinner.info('Get profile info!');\n\t\tthis.spinner.info('here');\n\t\tawait this.page.waitForSelector(element.numberPosts, {timeout: 5000});\n\t\tlet area_count_post = await this.page.$(element.numberPosts)\n\t\tlet numberPosts = await (await area_count_post.getProperty(\"innerText\")).jsonValue();\n\n\t\tthis.page.evaluate(async element => {\n\t\t\treturn {\n\t\t\talias: document.querySelector(element.alias).innerText,\n\t\t\tusername: document.querySelector(element.username).innerText,\n\t\t\tdescriptionProfile: document.querySelector(element.descriptionProfile)\n\t\t\t\t? document.querySelector(element.descriptionProfile).innerText\n\t\t\t\t: '',\n\t\t\turlImgProfile: document\n\t\t\t\t.querySelector(element.urlImgProfile)\n\t\t\t\t.getAttribute('src'),\n\t\t\twebsite: document.querySelector(element.website)\n\t\t\t\t? document.querySelector(element.website).innerText\n\t\t\t\t: null,\n\t\t\tnumberFollowers: document.querySelector(element.numberFollowers)\n\t\t\t\t.innerText,\n\t\t\tnumberFollowing: document.querySelector(element.numberFollowing)\n\t\t\t\t.innerText,\n\t\t\tprivate: !!document.querySelector(element.isPrivate),\n\t\t\tisOfficial: !!document.querySelector(element.isOfficial),\n\t\t\tnumberPosts: numberPosts\n\t\t};\n\t}, element);\n\t}", "function loadInfoModal(tree) { \n var results = '';\n \n //Loops through each node in the tree\n tree.visit(function(node){\n if(node.isSelected() ) {\n results += '<div class=\"panel panel-default\"><div class=\"panel-heading\" id=\"ph' + node.key +'\"><h4 class=\"panel-title\"><a data-toggle=\"collapse\" data-parent=\"#infoAccordion\" href=\"#collapse' + node.key + '\">' + node.title + '</a></h4></div>'; \n \n $.get(\"/node/\" + node.key, function( data ) {\n var mainDiv = $(\"div.node div.content\", data); \n $('<div id=\"collapse' + node.key + '\" class=\"panel-collapse collapse\"><div class=\"panel-body\">' + mainDiv[0].innerHTML + '</div></div></div>').appendTo('#ph'+node.key);\n });\n }\n });\n\n $(\"#infoAccordion\").html(results);\n}", "function getEventDetails(html) {\n\n const $ = cheerio.load(html);\n\n const artist = $('.event-information h1').text();\n\n const city = $('table.venue-details > tbody > tr:first-child > td:nth-child(2) a:first-child')\n .text()\n .split(':')[0]\n .trim();\n\n const venue = $('table.venue-details > tbody > tr:first-child > td:nth-child(2) a:first-child')\n .text()\n .split(':')[1]\n .trim();\n\n const date = $('table.venue-details > tbody > tr:nth-child(2) > td:nth-child(2)')\n .text();\n\n const price = $('.BuyBox.block:first-child .price strong')\n .text();\n\n return {\n artist,\n city,\n venue,\n date,\n price\n };\n\n}", "function extractData(html){\n let searchtool=cheerio.load(html);\n\n let part = searchtool('a[data-hover=\"View All Results\"]');\n let SourceLink=part.attr(\"href\");\n let FullLink=`https://www.espncricinfo.com${SourceLink}`;\n console.log(FullLink);\n\n //Now requesting on FullLink to obtain scorecard link array\n request(FullLink,AllScoreCardcb);\n}", "function buildInfoPanel(info) {\n var html = \"<div class='panel panel-default minimal'>\";\n html += \"<a data-toggle='collapse' data-parent='#accordion' href='#colps\" + info.id + \"'>\";\n html += \"<div class='tab-panel-heading' style='padding-top: 10px;'><span class='panel-title'>\";\n html += \"<small class='col-sm-3' style='color: #000;'>\" + info.PostedDate + \"</small> &emsp;\";\n html += \"<span class='col-sm-push-1'><strong>\" + info.Title + \"</strong></span>\";\n html += \"</span><i class='icon-down-open' style='float: right;'></i></div></a>\";\n html += \"<div id='colps\" + info.id + \"' class='panel-collapse collapse'>\" + info.Content + \"</div></div>\";\n $(\"#otherinfopanel\").append(html);\n}", "function getMoreInfoSaPi()\n{\n\tsetTimeout(function() {\n\t\t$('#pInfo_full').text('');\n\t\tvar rows =[\n\t\t\t[chrome.i18n.getMessage('injInfModal_SteamLink'),\t_URL],\n\t\t\t[chrome.i18n.getMessage('injInfModal_SteamID'),\t\t_STEAMID],\n\t\t\t[chrome.i18n.getMessage('injInfModal_SteamName'),\t_PERSONALNAME],\n\t\t\t[chrome.i18n.getMessage('injInfModal_TruckersMPID'),\tJSON.id],\n\t\t\t[chrome.i18n.getMessage('injInfModal_ForumName'),\tJSON.name],\n\t\t\t[chrome.i18n.getMessage('injInfModal_JoinDate'),\tJSON.joinDate],\n\t\t\t[chrome.i18n.getMessage('injInfModal_ForumGroup'),\tJSON.groupName],\n\t\t\t[chrome.i18n.getMessage('injInfModal_GameGroup'),\tJSON.permissions.isGameAdmin ? 'Admin' : 'Player']\n\t\t];\n\n\t\t(function table(){\n\t\t\tvar table = $('<table/>', {\"id\": 'SaPi_fInfo'});\n\t\t\t$.each(rows, function (row, value) {\n\t\t\t\tvar newRow = $('<tr/>');\n\t\t\t\tnewRow.append($('<td/>').append($('<strong/>').text(value[0] + ': ')));\n\t\t\t\tnewRow.append($('<td/>').text(value[1]));\n\t\t\t\ttable.append(newRow);\n\t\t\t})\n\t\t\t$('#pInfo_full').append(table);\n\t\t})();\n\t}, 750);\n}", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = content.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n description = content.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('contentDisplay').innerHTML =description;\r\n //console.log(content); \r\n // access summary brute force \r\n //let summary = page[pageID].revisions[0][\"*\"][10];\r\n //console.log('SUMMARY' + summary);\r\n }", "function parseDetails(data, releaseName) {\n var output = {};\n if ('detailsSelectors' in config) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(data.data, \"text/html\");\n var selectors = config.detailsSelectors;\n var container = doc.querySelector(selectors.detailsContainer);\n //console.debug('detailscontainer',container)\n var magnet = getPropertyForSelector(container, selectors.magnetUrl);\n var magnetHash = null;\n if (magnet) {\n output.magnetUrl = magnet;\n magnetHash = output.magnetUrl.match(/([0-9ABCDEFabcdef]{40})/);\n }\n var torrent = getPropertyForSelector(container, selectors.torrentUrl);\n if (torrent) {\n output.torrentUrl = (torrent.startsWith('http')) ? torrent : config.mirror + torrent;\n } else if (magnetHash && magnetHash.length) {\n output.torrentUrl = 'http://itorrents.org/torrent/' + magnetHash[0].toUpperCase() + '.torrent?title=' + encodeURIComponent(releaseName.trim());\n }\n }\n //console.debug('parseDetails', config.mirror, output);\n return output;\n }", "function loadDetails() {\n var xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n \"https://www.ots.at/api/aussendung?app=6b572c35908e4a5c4f3b8a7ee3ea9c6d&schluessel=OTS_20190425_OTS0059&format=json\",\n true\n );\n\n xhr.onload = function() {\n if (this.status == 200) {\n var details = JSON.parse(this.responseText);\n\n // console.log(details);\n\n var output = \"\";\n for (var i in details) {\n output +=\n '<div class = \"detail\">' +\n \"<ul>\" +\n \"<li>TITEL: \" +\n details[i].TITEL +\n \"</li>\" +\n \"<li>UTL: \" +\n details[i].UTL +\n \"</li>\" +\n \"<li>INHALT: \" +\n details[i].INHALT +\n \"</li>\" +\n \"<li>RUECKFRAGEHINWEIS: \" +\n details[i].RUECKFRAGEHINWEIS +\n \"</li>\" +\n \"<li>EMITTENT : \" +\n details[i].EMITTENT +\n \"</li>\" +\n \"</ul>\" +\n \"</div>\";\n }\n\n document.getElementById(\"modal-content-result\").innerHTML = output;\n }\n };\n\n xhr.send();\n }", "function show_all() {\n $(\"#meta-info\").show()\n $(\"#progress_bar\").show()\n $(\"#arrived-late\").show()\n $(\"#punctual\").show()\n $(\"#left-early\").show()\n $(\"#punctual-day-chart\").show()\n $(\"#breakdown p\").show()\n $(\"#punctual-table-wrapper\").show()\n $('#punctual-table-wrapper').collapse(\"show\")\n}", "function showMeta(strElement){\r\n\tvar objElement = document.getElementById(strElement + \"_Meta\");\r\n\tvar string;\r\n\tif(objElement != undefined){\r\n\t\tvar arrChilds = objElement.childNodes;\r\n\t\tvar boolRow = false;\r\n\t\tvar j = 0;\r\n\t\tstring = \"<table>\";\r\n\t\t\r\n\t\tfor(var i = 0; i < arrChilds.length; i++){\r\n\t\t\t//alert(arrChilds[i]);\r\n\t\t\tif(arrChilds[i].innerHTML != undefined){\r\n\t\t\t\tj++;\r\n\t\t\t\tif((j-1)%3==0){\r\n\t\t\t\t\tstring = string + \"<tr>\";\r\n\t\t\t\t}\r\n\t\t\t\tif(boolRow == false){\r\n\t\t\t\t\tstring = string + \"<th>\" + arrChilds[i].name + \":</th>\";\r\n\t\t\t\t\tstring = string + \"<td>\" + arrChilds[i].innerHTML + \"</td>\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tstring = string + \"<th class='modulo'>\" + arrChilds[i].name + \":</th>\";\r\n\t\t\t\t\tstring = string + \"<td class='modulo'>\" + arrChilds[i].innerHTML + \"</td>\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(j%3==0){\r\n\t\t\t\t\tstring = string + \"</tr>\";\r\n\t\t\t\t\tif(boolRow == false){\r\n\t\t\t\t\t\tboolRow = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tboolRow = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(j%3!=0){\r\n\t\t\tstring = string + \"</tr>\";\r\n\t\t}\r\n\t\tstring = string + \"</table>\";\r\n\t}\r\n\telse{\r\n\t\tconsole.log(strElement);\r\n\t\tstring = \"There is no information about the Object '\" + document.getElementById(strElement).getAttribute(\"name\") + \"'.\";\r\n\t}\r\n\tconsole.log(string);\r\n\tdocument.getElementById(\"InfoContent\").innerHTML = string;\r\n}", "function getLandingPageMeta(hostname,lpi,handleBarMeta,config){\n\tvar lpiDoc=DefinitionStore.get(lpi);\n\tvar meta=\"\";\n\tvar image_src=\"\";\n\tif(config && config.cloudPointHostId && config.cloudPointHostId==\"schemaengine\"){\n\t\timage_src=\"https://res.cloudinary.com/dzd0mlvkl/image/upload/v1623462816/wk_icon.jpg\"\n\t}\n\tvar mtitle=(config.htmlMeta && config.htmlMeta.title)?config.htmlMeta.title:handleBarMeta.title;\n\tvar desc=(config.htmlMeta && config.htmlMeta.description)?config.htmlMeta.description:\"\";\n\tvar metaKeywords=(config.htmlMeta && config.htmlMeta.keywords)?config.htmlMeta.keywords:\"\";\n\tvar ogTitle=mtitle;\n\tvar ogDescription=desc;\n\tif(lpiDoc && lpiDoc.htmlMeta){\n\t\tmtitle=lpiDoc.htmlMeta.title;\n\t\tdesc=lpiDoc.htmlMeta.description;\n\t\tmetaKeywords=lpiDoc.htmlMeta.keywords;\n\t\tif(lpiDoc.htmlMeta.image_src){\n\t\t\timage_src=lpiDoc.htmlMeta.image_src;\n\t\t}\n\t\togTitle=mtitle;\n\t\togDescription=desc;\n\t\tif(lpiDoc.htmlMeta.ogTitle && lpiDoc.htmlMeta.ogTitle!=\"\"){\n\t\t\togTitle=lpiDoc.htmlMeta.ogTitle;\n\t\t}\n\t\tif(lpiDoc.htmlMeta.ogDescription && lpiDoc.htmlMeta.ogDescription!=\"\"){\n\t\t\togDescription=lpiDoc.htmlMeta.ogDescription;\n\t\t}\n\t}\n\tmtitle=mtitle.replace(metaCleanRegEx,' ');\n\tdesc=desc.replace(metaCleanRegEx,' ');\n\togTitle=ogTitle.replace(metaCleanRegEx,' ');\n\togDescription=ogDescription.replace(metaCleanRegEx,' ');\n\tmetaKeywords=metaKeywords.toString().replace(metaCleanRegEx,' ');\n\ttry{\n\t\tmeta = \"<title>\"+mtitle+\"</title>\\n\" +\n\t\t\t\t\"<meta name='author' content='\"+ (config.title?config.title:\"schemaengine\") +\"'/>\\n\" +\n\t\t\t\t\"<meta name='description' content='\"+ desc +\"'/>\\n\" +\n\t\t\t\t\"<meta name='keywords' content='\"+ metaKeywords +\"'/>\\n\"+\n\t\t\t\t\"<link href='\"+ image_src +\"' rel='image_src'/>\\n\"+\n\n\t\t\t\t\"<meta property='og:image' content='\"+ image_src +\"' xmlns:og='http://opengraphprotocol.org/schema/'/>\\n\"+\n\t\t\t\t\"<meta property='og:title' content='\"+ogTitle+\"' />\\n\"+\n\t\t\t\t\"<meta property='og:description' content='\"+ ogDescription +\"' />\\n\"+\n\t\t\t\t\"<meta property='og:type' content='website' />\\n\"+\n\n\t\t\t\t\"<meta name='twitter:card' content='summary'/>\\n\" +\n\t\t\t\t\"<meta name='twitter:title' content='\"+ogTitle+\"'/>\\n\" +\n\t\t\t\t\"<meta name='twitter:description' content='\"+ogDescription+\"'/>\\n\" +\n\t\t\t\t\"<meta name='twitter:image' content='\"+image_src+\"'/>\\n\";\n\t\tif(lpiDoc && !lpiDoc.webCrawlerIndex){\n\t\t\tmeta+=\"\\n<meta name='robots' content='noindex' />\";\n\t\t\tmeta+=\"<meta name='robots' content='nofollow' />\\n\";\n\t\t}\n\n\t}catch(err){\n\t\tlogger.error({type:\"landingPageMetaConstruction\",error:err.message});\n\t}\n\treturn meta;\n}", "function init_details_panel() {\n\tvar panel_y = null;\n\tvar content_y = null;\n\tvar window_scroll_top = $(window).scrollTop();\n\t// Hide the panel initially and set its position\n\t$('.details-panel').hide().css('left', 20);\n\t$('.streams.current').delegate('.stream:not(.active)', 'click', function() {\n\t\t// Make the current item the only active item\n\t\t$('.details-panel-item').html('');\n\t\t//clear previous content\n\t\tgetEventDetails($('.hover input[name=event_id]').val());\n\t\t$('.stream-shell .active').removeClass('active');\n\t\t$(this).addClass('active');\n\t\t// Add some content to the reading panel\n\t\t// $('.details-panel-item').html($('.stream.active .stream-content').html());\n\n\t\t// Calculate panel and panel content height then show it\n\t\tpanel_y = $(window).height() - 100;\n\t\tcontent_y = panel_y - /*parseInt($('.details-panel-close').height())*/14 - 12;\n\t\tshowPanel();\n\t});\n\t$('.streams.current').delegate('.stream.active', 'click', function() {\n\t\t$(this).removeClass('active');\n\t\t// hide the details panel\n\t\thidePanel();\n\t});\n\n\t// Mouse hover over above & leaves the stream entries\n\t$('.streams').delegate('.stream', 'hover', function() {\n\t\t$(this).toggleClass('hover');\n\t});\n\n\t// Mouse press down on the stream entries\n\t$('.streams').delegate('.stream', 'mousedown', function() {\n\t\t$(this).addClass('mouse-down');\n\t});\n\t// Mouse release up on the stream entries, mouseout also triggers this event\n\t$('.streams').delegate('.stream', 'mouseup', function() {\n\t\t$(this).removeClass('mouse-down');\n\t});\n\t$('.streams').delegate('.stream', 'mouseout', function() {\n\t\t$(this).removeClass('mouse-down');\n\t});\n\n\t// Details panel close btn actions\n\t$('.details-panel-close').delegate('.close', 'click', function() {\n\t\t$('.stream-shell .active').removeClass('active');\n\t\thidePanel();\n\t});\n\n\t// Stream delete btn actions\n\t$(\".streams\").delegate('.stream-del', 'click', function(e) {\n\t\te.preventDefault();\n\t\t// prevent default <a> tag from firing\n\t\te.stopPropagation();\n\t\t// prevent other events from firing, in this case the details panel animation\n\t\thidePanel();\n\t\treview_id = $(this).find('.stream-del-identity').val();\n\t\t$(this).append('<input type=\\\"hidden\\\" />').load(\"reviews/delete\", \"review_id=\" + review_id, function() {\n\t\t\t$(this).closest(\".stream-shell\").animate({\n\t\t\t\theight : 'toggle',\n\t\t\t\topacity : 'toggle',\n\t\t\t}, 800, function() {\n\t\t\t\t$(this).closest(\".stream-shell\").remove();\n\t\t\t});\n\t\t});\n\t});\n\n\t// Window scrolling actions\n\t$(window).scroll(function() {\n\t\tif (window_scroll_top == $(window).scrollTop()) {\n\t\t\tif ($('.details-panel').hasClass('active')) {\n\t\t\t\t$('.details-panel').css('left', 580 - $(window).scrollLeft());\n\t\t\t} else {\n\t\t\t\t$('.details-panel').css('left', 20 - $(window).scrollLeft());\n\t\t\t}\n\n\t\t}\n\t\twindow_scroll_top = $(window).scrollTop();\n\t});\n\t// Window resizing actions\n\t$(window).resize(function() {\n\t\t// Calculate panel and its content height\n\t\tpanel_y = $(window).height() - 100;\n\t\tcontent_y = panel_y - parseInt($('.details-panel-close').height()) - 12;\n\t\t// Resize the details panel\n\t\tsetTimeout(browserResizeDetailsPanel, 200);\n\t});\n\n\tfunction showPanel() {\n\t\t// Set panel and its content height\n\t\t$('.details-panel').css('height', panel_y);\n\t\t$('.details-panel-content').css('height', content_y);\n\t\t// Show the panel and animate it into view\n\t\t$('.details-panel').stop().show().animate({\n\t\t\tleft : 580 - $(window).scrollLeft()\n\t\t}, function() {\n\t\t\t$('.details-panel').addClass('active');\n\t\t});\n\t\t// Hide the dashboard\n\t\t$('.dashboard').css('display', 'none');\n\t}\n\n\tfunction hidePanel() {\n\t\t// Move the panel off the screen and hide it when done\n\t\t$('.details-panel').stop().animate({\n\t\t\tleft : 20 - $(window).scrollLeft()\n\t\t}, function() {\n\t\t\t$(this).hide();\n\t\t\t$('.details-panel').removeClass('active');\n\t\t});\n\t\t// Show the dashboard\n\t\t$('.dashboard').css('display', 'block');\n\t}\n\n\tfunction browserResizeDetailsPanel() {\n\t\t// Set panel and its content height\n\t\t$('.details-panel').css('height', panel_y);\n\t\t$('.details-panel-content').css('height', content_y);\n\t\tif ($('.details-panel').hasClass('active')) {\n\t\t\t$('.details-panel').css('left', 580 - $(window).scrollLeft());\n\t\t} else {\n\t\t\t$('.details-panel').css('left', 20 - $(window).scrollLeft());\n\t\t}\n\t}\n\n\tfunction getEventDetails(eid) {\n\t\t// Ajax get the clicked event details\n\t\t$('.details-panel-item').html(\"loading\").load(\"/users/event_details\", {\n\t\t\teid : eid\n\t\t});\n\t}\n\n}", "function showDetails(){\n 'use strict';\n var frame = document.querySelector(DETAIL_FRAME_SELECTOR);\n document.body.classList.remove(HIDDEN_DETAIL_CLASS);\n frame.body.classList.add(IS_TINY_CLASS);\n setTimeout(function(){\n // setTimeout method: adds delay time since js doesnot have its own sleep function or built-in delay\n frame.classList.remove(IS_TINY_CLASS);\n },50);\n}", "function bloggerDescriptionShow(innerHTML) {\n /*var openBlogger = innerHTML;\n //var headings = document.evaluate(\"//table[@id='blogger']/tbody/tr[td/div[@class='imageR']/div/p[@class='desc_r']='\" + openBlogger + \"']/td/div[@class='imageR']/div/div/ul/li[@class='description'] \", document, null, XPathResult.ANY_TYPE, null );\n var headings = document.evaluate(\"//table[@id='blogger']/tbody/tr[td/div[@class='imageR lazy-image']/div/p[@class='desc_r']='\" + openBlogger + \"']/td/div[@class='description']\", document, null, XPathResult.ANY_TYPE, null );\n var thisHeading = headings.iterateNext();\n //var oldHeadings = document.evaluate(\"//table[@id='blogger']/tbody/tr/td/div[@class='imageR']/div/div/ul/li[@class='description openBlogger']\", document, null, XPathResult.ANY_TYPE, null );\n var oldHeadings = document.evaluate(\"//table[@id='blogger']/tbody/tr/td/div[@class='description openBlogger']\", document, null, XPathResult.ANY_TYPE, null );\n var oldHeading = oldHeadings.iterateNext();\n var imageHeadings = document.evaluate(\"//table[@id='blogger']/tbody/tr[td/div[@class='imageR lazy-image']/div/p[@class='desc_r']='\" + openBlogger + \"']/td/div[@class='imageR lazy-image']\", document, null, XPathResult.ANY_TYPE, null );\n var imageHeading = imageHeadings.iterateNext();\n var oldImageHeadings = document.evaluate(\"//table[@id='blogger']/tbody/tr[td/div[@class='description openBlogger']]/td/div[@class='imageR lazy-image']\", document, null, XPathResult.ANY_TYPE, null );\n var oldImageHeading = oldImageHeadings.iterateNext();\n var titleHeadings = document.evaluate(\"//table[@id='blogger']/tbody/tr[td/div[@class='imageR lazy-image']/div/p[@class='desc_r']='\" + openBlogger + \"']/td/div[@class='imageR lazy-image']/div[@class='titler']\", document, null, XPathResult.ANY_TYPE, null );\n var titleHeading = titleHeadings.iterateNext();\n var oldTitleHeadings = document.evaluate(\"//table[@id='blogger']/tbody/tr[td/div[@class='description openBlogger']]/td/div[@class='imageR lazy-image']/div[@class='titler']\", document, null, XPathResult.ANY_TYPE, null );\n var oldTitleHeading = oldTitleHeadings.iterateNext();\n if (thisHeading === null){\n }\n else{\n //$(thisHeading).css('display','block');\n $(thisHeading).slideDown(200);\n thisHeading.classList.add('openBlogger');\n $(imageHeading).css('border-bottom-left-radius','0px');\n $(imageHeading).css('border-bottom-right-radius','0px');\n $(titleHeading).css('border-bottom-left-radius','0px');\n $(titleHeading).css('border-bottom-right-radius','0px');\n setTimeout(bloggerFilterPos, 100);\n }\n\n if (oldHeading === null){}\n else{\n $(oldHeading).slideUp(100);\n oldHeading.classList.remove('openBlogger');\n $(oldImageHeading).animate({\"border-bottom-left-radius\":\"4px\",\"border-bottom-right-radius\":\"4px\"},300);\n $(oldTitleHeading).animate({\"border-bottom-left-radius\":\"4px\",\"border-bottom-right-radius\":\"4px\"},300);\n }*/\n }", "function initiatePanels() {\r\n 'use strict';\r\n \r\n\t//show default panel state on page load\r\n\tfor(var i = 1; i <= group_cnt; i++) {\r\n\t\tshowPanel('dyn_pnl_' + i, '1');\r\n\t}\r\n\t\r\n\t//position panel state selectors next to their respective panels\r\n\tpositionAllSelectors();\r\n}", "expandDetailsWhenPrinting() {\n const details = Array.from(document.querySelectorAll('details'));\n details.map(detail => detail.open = true);\n }", "function get_single_tag_information(selector) {\n\n selector = get_foundable_query(selector, true, true, true);\n\n if (iframe.find(selector).length <= 0) {\n return;\n }\n\n var PPname, Pname;\n\n // tagName\n var a = iframe.find(selector)[0].nodeName;\n\n // length\n var length = get_selector_array(selector).length - 1;\n\n // Names\n var n = get_selector_array(selector)[length].toUpperCase();\n if (n.indexOf(\".\") != -1) {\n n = n.split(\".\")[1].replace(/[^\\w\\s]/gi, '');\n }\n\n // Class Names\n var className = $.trim(get_selector_array(selector)[length]);\n if (className.indexOf(\".\") != -1) {\n className = className.split(\".\")[1];\n }\n\n // ID\n var id = get_selected_element().attr(\"id\");\n\n if (isDefined(id)) {\n id = id.toUpperCase().replace(/[^\\w\\s]/gi, '');\n }\n\n // Parents 1\n if (length > 1) {\n Pname = get_selector_array(selector)[length - 1].toUpperCase();\n if (Pname.indexOf(\".\") != -1) {\n Pname = Pname.split(\".\")[1].replace(/[^\\w\\s]/gi, '');\n }\n } else {\n Pname = '';\n }\n\n // Parents 2\n if (length > 2) {\n PPname = get_selector_array(selector)[length - 2].toUpperCase();\n if (PPname.indexOf(\".\") != -1) {\n PPname = PPname.split(\".\")[1].replace(/[^\\w\\s]/gi, '');\n }\n } else {\n PPname = '';\n }\n\n // ID\n if (id == 'TOPBAR') {\n return l18_topbar;\n } else if (id == 'HEADER') {\n return l18_header;\n } else if (id == 'FOOTER') {\n return l18_footer;\n } else if (id == 'CONTENT') {\n return l18_content;\n }\n\n // Parrents Class\n if (PPname == 'LOGO' || PPname == 'SITETITLE' || Pname == 'LOGO' || Pname == 'SITETITLE') {\n return l18_logo;\n } else if (n == 'MAPCANVAS') {\n return l18_google_map;\n } else if (Pname == 'ENTRYTITLE' && a == 'A') {\n return l18_entry_title_link;\n } else if (Pname == 'CATLINKS' && a == 'A') {\n return l18_category_link;\n } else if (Pname == 'TAGSLINKS' && a == 'A') {\n return l18_tag_link;\n }\n\n // Current Classes\n if (n == 'WIDGET') {\n return l18_widget;\n } else if (n == 'FA' || get_selector_array(selector)[length].toUpperCase().indexOf(\"FA-\") >= 0) {\n return l18_font_awesome_icon;\n } else if (n == 'SUBMIT' && a == 'INPUT') {\n return l18_submit_button;\n } else if (n == 'MENUITEM') {\n return l18_menu_item;\n } else if (n == 'ENTRYMETA' || n == 'ENTRYMETABOX' || n == 'POSTMETABOX') {\n return l18_post_meta_division;\n } else if (n == 'COMMENTREPLYTITLE') {\n return l18_comment_reply_title;\n } else if (n == 'LOGGEDINAS') {\n return l18_login_info;\n } else if (n == 'FORMALLOWEDTAGS') {\n return l18_allowed_tags;\n } else if (n == 'LOGO') {\n return l18_logo;\n } else if (n == 'ENTRYTITLE' || n == 'POSTTITLE') {\n return l18_post_title;\n } else if (n == 'COMMENTFORM') {\n return l18_comment_form;\n } else if (n == 'WIDGETTITLE') {\n return l18_widget_title;\n } else if (n == 'TAGCLOUD') {\n return l18_tag_cloud;\n } else if (n == 'ROW' || n == 'VCROW') {\n return l18_row;\n } else if (n == 'BUTTON') {\n return l18_button;\n } else if (n == 'BTN') {\n return l18_button;\n } else if (n == 'LEAD') {\n return l18_lead;\n } else if (n == 'WELL') {\n return l18_well;\n } else if (n == 'ACCORDIONTOGGLE') {\n return l18_accordion_toggle;\n } else if (n == 'PANELBODY') {\n return l18_accordion_content;\n } else if (n == 'ALERT') {\n return l18_alert_division;\n } else if (n == 'FOOTERCONTENT') {\n return l18_footer_content;\n } else if (n == 'GLOBALSECTION' || n == 'VCSSECTION') {\n return l18_global_section;\n } else if (n == 'MORELINK') {\n return l18_show_more_link;\n } else if (n == 'CONTAINER' || n == 'WRAPPER') {\n return l18_wrapper;\n } else if (n == 'DEFAULTTITLE') {\n return l18_article_title;\n } else if (n == 'MENULINK' || n == 'MENUICON' || n == 'MENUBTN' || n == 'MENUBUTTON') {\n return l18_menu_link;\n } else if (n == 'SUBMENU') {\n return l18_submenu;\n\n // Bootstrap Columns\n } else if (n.indexOf('COLMD1') != -1 || n == 'MEDIUM1' || n == 'LARGE1' || n == 'SMALL1') {\n return l18_column + ' 1/12';\n } else if (n.indexOf('COLMD2') != -1 || n == 'MEDIUM2' || n == 'LARGE2' || n == 'SMALL2') {\n return l18_column + ' 2/12';\n } else if (n.indexOf('COLMD3') != -1 || n == 'MEDIUM3' || n == 'LARGE3' || n == 'SMALL3') {\n return l18_column + ' 3/12';\n } else if (n.indexOf('COLMD4') != -1 || n == 'MEDIUM4' || n == 'LARGE4' || n == 'SMALL4') {\n return l18_column + ' 4/12';\n } else if (n.indexOf('COLMD5') != -1 || n == 'MEDIUM5' || n == 'LARGE5' || n == 'SMALL5') {\n return l18_column + ' 5/12';\n } else if (n.indexOf('COLMD6') != -1 || n == 'MEDIUM6' || n == 'LARGE6' || n == 'SMALL6') {\n return l18_column + ' 6/12';\n } else if (n.indexOf('COLMD7') != -1 || n == 'MEDIUM7' || n == 'LARGE7' || n == 'SMALL7') {\n return l18_column + ' 7/12';\n } else if (n.indexOf('COLMD8') != -1 || n == 'MEDIUM8' || n == 'LARGE8' || n == 'SMALL8') {\n return l18_column + ' 8/12';\n } else if (n.indexOf('COLMD9') != -1 || n == 'MEDIUM9' || n == 'LARGE9' || n == 'SMALL9') {\n return l18_column + ' 9/12';\n } else if (n.indexOf('COLMD10') != -1 || n == 'MEDIUM10' || n == 'LARGE10' || n == 'SMALL10') {\n return l18_column + ' 10/12';\n } else if (n.indexOf('COLMD11') != -1 || n == 'MEDIUM11' || n == 'LARGE11' || n == 'SMALL11') {\n return l18_column + ' 11/12';\n } else if (n.indexOf('COLMD12') != -1 || n == 'MEDIUM12' || n == 'LARGE12' || n == 'SMALL12') {\n return l18_column + ' 12/12';\n } else if (n.indexOf('COLXS1') != -1) {\n return l18_column + ' 1/12';\n } else if (n.indexOf('COLXS2') != -1) {\n return l18_column + ' 2/12';\n } else if (n.indexOf('COLXS3') != -1) {\n return l18_column + ' 3/12';\n } else if (n.indexOf('COLXS4') != -1) {\n return l18_column + ' 4/12';\n } else if (n.indexOf('COLXS5') != -1) {\n return l18_column + ' 5/12';\n } else if (n.indexOf('COLXS6') != -1) {\n return l18_column + ' 6/12';\n } else if (n.indexOf('COLXS7') != -1) {\n return l18_column + ' 7/12';\n } else if (n.indexOf('COLXS8') != -1) {\n return l18_column + ' 8/12';\n } else if (n.indexOf('COLXS9') != -1) {\n return l18_column + ' 9/12';\n } else if (n.indexOf('COLXS10') != -1) {\n return l18_column + ' 10/12';\n } else if (n.indexOf('COLXS11') != -1) {\n return l18_column + ' 11/12';\n } else if (n.indexOf('COLXS12') != -1) {\n return l18_column + ' 12/12';\n } else if (n.indexOf('COLSM1') != -1) {\n return l18_column + ' 1/12';\n } else if (n.indexOf('COLSM2') != -1) {\n return l18_column + ' 2/12';\n } else if (n.indexOf('COLSM3') != -1) {\n return l18_column + ' 3/12';\n } else if (n.indexOf('COLSM4') != -1) {\n return l18_column + ' 4/12';\n } else if (n.indexOf('COLSM5') != -1) {\n return l18_column + ' 5/12';\n } else if (n.indexOf('COLSM6') != -1) {\n return l18_column + ' 6/12';\n } else if (n.indexOf('COLSM7') != -1) {\n return l18_column + ' 7/12';\n } else if (n.indexOf('COLSM8') != -1) {\n return l18_column + ' 8/12';\n } else if (n.indexOf('COLSM9') != -1) {\n return l18_column + ' 9/12';\n } else if (n.indexOf('COLSM10') != -1) {\n return l18_column + ' 10/12';\n } else if (n.indexOf('COLSM11') != -1) {\n return l18_column + ' 11/12';\n } else if (n.indexOf('COLSM12') != -1) {\n return l18_column + ' 12/12';\n } else if (n.indexOf('COLLG1') != -1) {\n return l18_column + ' 1/12';\n } else if (n.indexOf('COLLG2') != -1) {\n return l18_column + ' 2/12';\n } else if (n.indexOf('COLLG3') != -1) {\n return l18_column + ' 3/12';\n } else if (n.indexOf('COLLG4') != -1) {\n return l18_column + ' 4/12';\n } else if (n.indexOf('COLLG5') != -1) {\n return l18_column + ' 5/12';\n } else if (n.indexOf('COLLG6') != -1) {\n return l18_column + ' 6/12';\n } else if (n.indexOf('COLLG7') != -1) {\n return l18_column + ' 7/12';\n } else if (n.indexOf('COLLG8') != -1) {\n return l18_column + ' 8/12';\n } else if (n.indexOf('COLLG9') != -1) {\n return l18_column + ' 9/12';\n } else if (n.indexOf('COLLG10') != -1) {\n return l18_column + ' 10/12';\n } else if (n.indexOf('COLLG11') != -1) {\n return l18_column + ' 11/12';\n } else if (n.indexOf('COLLG12') != -1) {\n return l18_column + ' 12/12';\n } else if (n == 'POSTBODY') {\n return l18_post_division;\n } else if (n == 'POST') {\n return l18_post_division;\n } else if (n == 'CONTENT' || n == 'DEFAULTCONTENT') {\n return l18_content_division;\n } else if (n == 'ENTRYTITLE') {\n return l18_entry_title;\n } else if (n == 'ENTRYCONTENT') {\n return l18_entry_content;\n } else if (n == 'ENTRYFOOTER') {\n return l18_entry_footer;\n } else if (n == 'ENTRYHEADER') {\n return l18_entry_header;\n } else if (n == 'ENTRYTIME') {\n return l18_entry_time;\n } else if (n == 'POSTEDITLINK') {\n return l18_post_edit_link;\n } else if (n == 'POSTTHUMBNAIL') {\n return l18_post_thumbnail;\n } else if (n == 'THUMBNAIL') {\n return l18_thumbnail;\n } else if (n.indexOf(\"ATTACHMENT\") >= 0) {\n return l18_thumbnail_image;\n } else if (n == 'EDITLINK') {\n return l18_edit_link;\n } else if (n == 'COMMENTSLINK') {\n return l18_comments_link_division;\n } else if (n == 'SITEDESCRIPTION') {\n return l18_site_description;\n } else if (n == 'POSTCLEAR' || n == 'POSTBREAK') {\n return l18_post_break;\n }\n\n // Smart For ID\n if (get_name_by_classes(id) !== false) {\n return get_name_by_classes(id);\n }\n\n // Smart For Class\n if (get_name_by_classes(className) !== false) {\n return get_name_by_classes(className);\n }\n\n // If not have name found, use clear.\n if (n.indexOf(\"CLEARFIX\") != -1 || n.indexOf(\"CLEARBOTH\") != -1 || n == \"CLEAR\") {\n return l18_clear;\n }\n\n // TAG NAME START\n if (a == 'P') {\n return l18_paragraph;\n } else if (a == 'BR') {\n return l18_line_break;\n } else if (a == 'HR') {\n return l18_horizontal_rule;\n } else if (a == 'A') {\n return l18_link;\n } else if (a == 'LI') {\n return l18_list_item;\n } else if (a == 'UL') {\n return l18_unorganized_list;\n } else if (a == 'OL') {\n return l18_unorganized_list;\n } else if (a == 'IMG') {\n return l18_image;\n } else if (a == 'B') {\n return l18_bold_tag;\n } else if (a == 'I') {\n return l18_italic_tag;\n } else if (a == 'STRONG') {\n return l18_strong_tag;\n } else if (a == 'Em') {\n return l18_italic_tag;\n } else if (a == 'BLOCKQUOTE') {\n return l18_blockquote;\n } else if (a == 'PRE') {\n return l18_preformatted;\n } else if (a == 'TABLE') {\n return l18_table;\n } else if (a == 'TR') {\n return l18_table_row;\n } else if (a == 'TD') {\n return l18_table_data;\n } else if (a == 'HEADER' || n == 'HEADER') {\n return l18_header_division;\n } else if (a == 'FOOTER' || n == 'FOOTER') {\n return l18_footer_division;\n } else if (a == 'SECTION' || n == 'SECTION') {\n return l18_section;\n } else if (a == 'FORM') {\n return l18_form_division;\n } else if (a == 'BUTTON') {\n return l18_button;\n } else if (a == 'CENTER') {\n return l18_centred_block;\n } else if (a == 'DL') {\n return l18_definition_list;\n } else if (a == 'DT') {\n return l18_definition_term;\n } else if (a == 'DD') {\n return l18_definition_description;\n } else if (a == 'H1') {\n return l18_header + ' (' + l18_level + ' 1)';\n } else if (a == 'H2') {\n return l18_header + ' (' + l18_level + ' 2)';\n } else if (a == 'H3') {\n return l18_header + ' (' + l18_level + ' 3)';\n } else if (a == 'H4') {\n return l18_header + ' (' + l18_level + ' 4)';\n } else if (a == 'H5') {\n return l18_header + ' (' + l18_level + ' 5)';\n } else if (a == 'H6') {\n return l18_header + ' (' + l18_level + ' 6)';\n } else if (a == 'SMALL') {\n return l18_smaller_text;\n } else if (a == 'TEXTAREA') {\n return l18_text_area;\n } else if (a == 'TBODY') {\n return l18_body_of_table;\n } else if (a == 'THEAD') {\n return l18_head_of_table;\n } else if (a == 'TFOOT') {\n return l18_foot_of_table;\n } else if (a == 'U') {\n return l18_underline_text;\n } else if (a == 'SPAN') {\n return l18_span;\n } else if (a == 'Q') {\n return l18_quotation;\n } else if (a == 'CITE') {\n return l18_citation;\n } else if (a == 'CODE') {\n return l18_expract_of_code;\n } else if (a == 'NAV' || n == 'NAVIGATION' || n == 'NAVIGATIONCONTENT') {\n return l18_navigation;\n } else if (a == 'LABEL') {\n return l18_label;\n } else if (a == 'TIME') {\n return l18_time;\n } else if (a == 'DIV') {\n return l18_division;\n } else if (a == 'CAPTION') {\n return l18_caption_of_table;\n } else if (a == 'INPUT') {\n return l18_input;\n } else {\n return a.toLowerCase();\n }\n\n }", "function setMetaInformation(results) {\n var i;\n for (i = 0; i < results.length; i += 1) {\n results[i].url = getLink(results[i].$el);\n results[i].title = getTitle(results[i].$el);\n results[i].date = results[i].value;\n }\n }", "function gatherInfo() {\n const pageContent = dom.$('#pageContent');\n const name = dom.$('.contest-name', pageContent).innerText;\n const id = +/\\/contest\\/(\\d+)\\//.exec(location.href)[1]; // just finds the /contest/{ID} and converts to a number\n const div = +(/Div\\. (\\d)/i.exec(name) || [])[1];\n const twinID = div == 1 ? (id + 1) : (id - 1);\n return { pageContent, name, id, div, twinID };\n}", "function parseDetailContent(html) {\n var {\n JSDOM\n } = jsdom;\n var dom = new JSDOM(html);\n var $ = (require('jquery'))(dom.window);\n\n // Handling text formatting and filtering: regex, trim, etc.\n var id, title, verses;\n var content = [];\n\n // Assign variables\n verses = $('section#content .lyrics .verse');\n for (var i = 0; i < verses.length; i++) {\n\n // Get verse lines\n var lines = $(verses[i]).children('.indent0');\n\n var verse = '';\n for (j = 0; j < lines.length; j++) {\n // Append lines\n verse = verse + $(lines[j]).text() + \"\\n\";\n }\n\n // Add row to array\n content.push((i + 1) + \". \" + verse);\n }\n\n // Build Song object\n var song = {\n id: $('section#content h1 strong').text().replace(/\\./, '').trim(),\n title: $('section#content h1').text().replace(/[0-9]{0,4}\\./, '').trim(),\n content: content,\n }\n return new Promise((resolve, reject) => resolve(song));\n}", "eachPageCheerio(data) {\n return new Promise((resolve, reject) => {\n const $ = cheerio.load(data);\n const imgUrl = $('img', '.airlineBannerLargeLeft').attr('src');\n const airlineCode = $('.ai-info', '.airlineBannerLargeRight').html();\n const airlineName = $('h1', '.title').text().split('(')[0].trim();\n resolve({ imgUrl, airlineCode, airlineName });\n });\n }", "function ciniki_web_info() {\n \n this.activeToggles = {'no':'No', 'yes':'Yes'};\n this.subpages = {\n '2':{'name':'Artist Statement', 'ui':'artiststatement', 'permalink':'artiststatement', 'flags':0x02},\n '3':{'name':'CV', 'ui':'cv', 'permalink':'cv', 'flags':0x04},\n '4':{'name':'Awards', 'ui':'awards', 'permalink':'awards', 'flags':0x08},\n '5':{'name':'History', 'ui':'history', 'permalink':'history', 'flags':0x10},\n '6':{'name':'Donations', 'ui':'donations', 'permalink':'donations', 'flags':0x20},\n '9':{'name':'Facilities', 'ui':'facilities', 'permalink':'facilities', 'flags':0x100},\n '8':{'name':'Board of Directors', 'ui':'boardofdirectors', 'permalink':'boardofdirectors', 'flags':0x80},\n '7':{'name':'Membership', 'ui':'membership', 'permalink':'membership', 'flags':0x40},\n '11':{'name':'Warranty', 'ui':'warranty', 'permalink':'warranty', 'flags':0x0400},\n '12':{'name':'Testimonials', 'ui':'testimonials', 'permalink':'testimonials', 'flags':0x0800},\n '13':{'name':'Reviews', 'ui':'reviews', 'permalink':'reviews', 'flags':0x1000},\n '14':{'name':'Green Policy', 'ui':'greenpolicy', 'permalink':'greenpolicy', 'flags':0x2000},\n '15':{'name':'Why us', 'ui':'whyus', 'permalink':'whyus', 'flags':0x4000},\n '16':{'name':'Privacy Policy', 'ui':'privacypolicy', 'permalink':'privacypolicy', 'flags':0x8000},\n '17':{'name':'Volunteer', 'ui':'volunteer', 'permalink':'volunteer', 'flags':0x010000},\n '18':{'name':'Rental', 'ui':'rental', 'permalink':'rental', 'flags':0x020000},\n '19':{'name':'Financial Assistance', 'ui':'financialassistance', 'permalink':'financialassistance', 'flags':0x040000},\n '20':{'name':'Artists', 'ui':'artists', 'permalink':'artists', 'flags':0x080000},\n '21':{'name':'Employment', 'ui':'employment', 'permalink':'employment', 'flags':0x100000},\n '22':{'name':'Staff', 'ui':'staff', 'permalink':'staff', 'flags':0x200000},\n '23':{'name':'Sponsorship', 'ui':'sponsorship', 'permalink':'sponsorship', 'flags':0x400000},\n '24':{'name':'Jobs', 'ui':'jobs', 'permalink':'jobs', 'flags':0x800000},\n };\n \n this.init = function() {\n //\n // The options and information for the info page\n //\n this.page = new M.panel('Information',\n 'ciniki_web_info', 'page',\n 'mc', 'medium', 'sectioned', 'ciniki.web.info.page');\n this.page.data = {};\n this.page.sections = {\n 'options':{'label':'', 'fields':{\n 'page-info-active':{'label':'Display Info Page', 'type':'multitoggle', 'default':'no', 'toggles':this.activeToggles},\n 'page-info-title':{'label':'Title', 'type':'text', 'hint':'Info'},\n 'page-info-defaultcontenttype':{'label':'Start Page', 'type':'select', 'options':{}},\n }},\n 'subpages':{'label':'', 'fields':{}},\n '_save':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_web_info.savePage();'},\n }},\n };\n this.page.fieldValue = function(s, i, d) { \n if( this.data[i] == null ) { return ''; }\n return this.data[i]; \n };\n this.page.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.web.pageSettingsHistory', 'args':{'tnid':M.curTenantID, 'field':i}};\n }\n this.page.addButton('save', 'Save', 'M.ciniki_web_info.savePage();');\n this.page.addClose('Cancel');\n }\n\n this.start = function(cb, ap, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(ap, 'ciniki_web_info', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n this.showPage(cb);\n }\n\n this.showPage = function(cb) {\n this.page.reset();\n M.api.getJSONCb('ciniki.web.pageSettingsGet', {'tnid':M.curTenantID, \n 'page':'info', 'content':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var flags = M.curTenant.modules['ciniki.info'].flags;\n var p = M.ciniki_web_info.page;\n p.data = rsp.settings;\n p.sections.subpages.fields = {};\n var options = {};\n var spgs = M.ciniki_web_info.subpages;\n for(i in spgs) {\n if( (spgs[i].flags&flags) > 0 ) { \n options[i] = spgs[i].name;\n p.sections.subpages.fields['page-info-' + spgs[i].permalink + '-active'] = {'label':spgs[i].name,\n 'editFn':'M.ciniki_web_info.editInfo(\\'' + i + '\\');',\n 'type':'toggle', 'default':'no', 'toggles':M.ciniki_web_info.activeToggles};\n }\n }\n p.sections.options.fields['page-info-defaultcontenttype'].options = options;\n p.refresh();\n p.show(cb);\n });\n }\n\n this.editInfo = function(ct) {\n if( this.subpages[ct] != null ) {\n M.startApp('ciniki.info.' + this.subpages[ct].ui,null,'M.ciniki_web_info.page.show();');\n }\n }\n\n this.savePage = function() {\n var c = this.page.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.web.siteSettingsUpdate', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_web_info.page.close();\n });\n } else {\n this.page.close();\n }\n };\n}", "function getSuplData(obj){\n var infoBlock = document.querySelector('.infoBlock');\n var linksArray=[];\n var articleTitle;\n for (var key in obj) {\n if (obj[key]==='homeworld') {\n linksArray.push(obj.homeworld);\n articleTitle = key.charAt(0).toUpperCase() + key.slice(1);;\n loadSupplementaryData(linksArray,articleTitle,infoBlock);\n } else if (Array.isArray(obj[key]) &&\n obj[key].length !== 0) {\n linksArray = obj[key];\n articleTitle = key;\n loadSupplementaryData(linksArray,articleTitle,infoBlock);\n };\n };\n}", "function getPageInfos(){\n browser.tabs.query({active: true, currentWindow: true}, function(tabs) {\n browser.tabs.sendMessage(tabs[0].id, {infoCode: \"pageInfo\"}, function(response) {\n writeToPopup(response);\n });\n });\n}", "function getSectionDetails() {\n sections = document.querySelectorAll('section');\n for (let i = 0; i < sections.length; i ++){\n sectionHeadings.push(sections[i].dataset.navTitle);\n navIds.push(sections[i].dataset.navId);\n sectionIds.push(sections[i].id);\n }\n console.log(sectionHeadings);\n}", "function detailedReviewPage_elementsExtraJS() {\n // screen (detailedReviewPage) extra code\n }", "async readOverviewTiles() {\n const tiles = await this.page.evaluate(() =>\n Array.from(document.querySelectorAll('div[id$=ITtile]')).map(t => {\n const [title, badge] = t.querySelectorAll('span');\n return {\n isSelected: t.classList.contains('p_AFSelected'),\n title: title.textContent,\n badge: badge.textContent,\n selectId: t.querySelector('a[title^=\"Select:\"]').id,\n };\n }));\n\n tiles.forEach(t => t.click =\n this.page.click.bind(this.page, '#'+t.selectId.replace(/:/g,'\\\\:')));\n return tiles;\n }", "async function loadDetail(aWindow, id) {\n let loaded = wait_for_view_load(aWindow, undefined, true);\n // Check the detail view.\n if (aWindow.useHtmlViews) {\n let browser = await aWindow.getHtmlBrowser();\n let card = browser.contentDocument.querySelector(\n `addon-card[addon-id=\"${id}\"]`\n );\n EventUtils.synthesizeMouseAtCenter(card, {}, browser.contentWindow);\n } else {\n let card = aWindow.document.querySelector(`.addon.card[value=\"${id}\"]`);\n EventUtils.synthesizeMouseAtCenter(card, {}, aWindow);\n }\n await loaded;\n}", "function getHeadlines () {\n const cheerio = require('cheerio');\n const request = require('request');\n \n const url = 'https://www.kompas.com';\n \n request(url, (error, response, body) => {\n if (!error && response.statusCode === 200) {\n let $ = cheerio.load(body);\n $('h2.headline__thumb__title').each(function(i, element){\n var a = $(this).prev();\n console.log(a.text());\n let title = $(this).text();\n let URL = $(this).parents().attr('href');\n console.log(`TITLE: ${title}`);\n console.log(`URL: ${URL}`);\n });\n \n } else {\n console.error(error.message);\n }\n });\n\n}", "get overviewTab() {return browser.element(\"~Overview\");}", "function downloadCardInfo() {\n var tablePages = document.getElementsByClassName(PAGE_LIST_ELEMENT_ID)[0];\n var numPages = tablePages.childNodes.length;\n\n var url = window.location.href\n var cubeId = CUBE_ID_REGEX.exec(url)[1]; // The first matched group is at index 1.\n\n downloadCardPage('', 1, numPages, cubeId);\n}", "function initialiseDynamicSummary(){\n if(window.guideBridge.isConnected()){\n //\tevent listeners to check if page is valid before setting current page and checking which button was clicked\n window.guideBridge.on(\"validationComplete\", function (event,data){\n isPageValid = data._property;\n });\n\n window.guideBridge.on(\"elementButtonClicked\", function(evnt, data) {\n if(pageManager.nextPage() == pageManager.lastPage || isPageValid){\n\t\t\t\tdynamicSummary();\n }\n });\n }\n\n}", "async function webScraper (page) {\n await page.goto(url); \n const html = await page.content(); \n const $ = cheerio.load(html); \n\n // mapping through data - ON FRONT PAGE\n data = $('.result-info').map((index, element) => {\n // title \n const titleElement = $(element).find('.result-title');\n const title = $(titleElement).text(); \n const url = $(titleElement).attr('href'); \n\n // date \n const dateElement = $(element).find('.result-date'); \n const datePosted = $(dateElement).attr(\"datetime\"); \n\n // hood \n const hoodElement = $(element).find('.result-hood');\n const hood = $(hoodElement).text().trim().replace('(', '').replace(')', '');\n\n return { title, url, datePosted, hood };\n }).get();\n return data; \n}", "function getArtifactDetails() {\n const params = new URL(location.href).searchParams;\n const selectedWorkspace = params.get('workspace');\n const selectedArtifact = params.get('artifact');\n\n get(\"./workspaces/\" + selectedWorkspace + \"/\" + selectedArtifact).then(function(artstr) {\n art = JSON.parse(artstr);\n if (Object.keys(art).length > 0) {\n var table = createTable(\"artsection\");\n Object.keys(art).forEach(function(p) {\n if (typeof(art[p]) === \"string\") {\n addTwoCellsInARow(table, p, art[p]);\n } else {\n let content = \"\";\n Object.keys(art[p]).forEach(function(a) {\n if (p === \"properties\") {\n let subcontent = \"\";\n Object.keys(art[p][a]).forEach(function(b) {\n subcontent += b + \"(\" + art[p][a][b] + \")<br />\";\n });\n addTwoCellsInARow(table, p, subcontent);\n } else {\n content += art[p][a] + \"<br />\"\n }\n });\n addTwoCellsInARow(table, p, content);\n }\n });\n } else {\n p = document.createElement('p');\n p.innerText = \"nothing to show\";\n let s = document.getElementById(\"artsection\");\n s.appendChild(p);\n }\n });\n}", "function showIndividualData() {\n $(\"#individualContentBloc\").show();\n $(\"#pageContent\").hide();\n $('.closeIndividualData').show();\n $('#permalink').show();\n }", "function preparePage() {\n offsets = [];\n links = [];\n\n $('.js-scroll-indicator').find('a').each((index, el) => {\n const $link = $(el);\n\n // Calculate the element's offset from the top of the page while anchored\n const $linkTarget = $($link.attr('href'));\n if ($linkTarget.length) {\n // Add jQuery object and offset value to link map\n offsets.push($linkTarget.offset().top);\n links.push($link);\n }\n });\n}", "function getHead() {\n let metaData = {};\n metaData.title = this.pageTitle || this.title || this.site.title;\n metaData.headline = this.title;\n metaData.description = this.description;\n if(!metaData.description){\n if(defaultOptions.preferSiteDesc && this.site.description){\n metaData.description = this.site.description;\n }else {\n metaData.description = this.contents ? utils.getDescription(this.contents) : this.site.description;\n }\n \n }\n \n metaData.image = this.image || defaultOptions.image;\n metaData.author = this.author || defaultOptions.defaultAuthor || this.site.author;\n metaData.keywords = this.keywords || this.tags || this.site.keywords;\n metaData.siteURL = defaultOptions.siteURL;\n metaData.path = \"/\" + this.path;\n metaData.url = this.url;\n metaData.type = this.type || \"website\";\n metaData.logo = this.logo || this.site.logo;\n metaData.logoWidth = this.logoWidth || this.site.logoWidth;\n metaData.logoHeight = this.logoHeight || this.site.logoHeight;\n metaData.organization = this.organization || this.site.organization || defaultOptions.organization;\n if(this.imglist && this.imglist.length > 2){\n metaData.imglist = this.imglist;\n img = this.imglist;\n q = '\"';\n url = this.site.url;\n fullurl = utils.tryFullURL;\n metaData.imgliststr = q+fullurl(url,img[0][0])+q+\",\\n\\t\\t\"+q+fullurl(url,img[1][0])+q+\",\\n\\t\\t\"+q+fullurl(url,img[2][0])+q;\n }\n\n if(this.price){\n metaData.price = this.price;\n metaData.currency = this.currency || this.site.currency;\n }\n metaData.themeColor = this.themeColor || defaultOptions.themeColor || \"#fff\";\n metaData.gaID = defaultOptions.disableAnalytics ? \"\" : (this.gaID || this.site.gaID || this.gaId || this.site.gaId || \"\");\n metaData.styles = getStyles(this);\n metaData.criticalCSS = defaultOptions.criticalCSS;\n if (defaultOptions.cookieConsent) {\n metaData.cookieConsent = cookieConsentTpl;\n }\n metaData.structuredData = this.structuredData;\n\n const headBuilder = new HeadBuilder(headTpl);\n\n return headBuilder.getHead(metaData);\n}", "function ContemporaryMeta({ metadata }) {\n return (\n <>\n <CollectionDescription about={metadata.description} />\n {metadata.category && metadata.category.split(\",\").includes(\"Lidar\") && (\n <AboutLidar />\n )}\n <Collapse>\n <Collapse.Panel\n header={\n <h3\n style={{\n fontVariant: \"small-caps\",\n fontWeight: \"800\",\n margin: 0,\n }}\n >\n metadata\n </h3>\n }\n >\n {metadata &&\n fields[\"contemporary\"].map((k, i) => (\n <div key={metadata.collection_id + \"_\" + k.key}>\n <h4 style={{ fontVariant: \"small-caps\", fontWeight: \"800\" }}>\n {metadata[k.key] ? k.label : null}\n </h4>\n {emailRegex.test(metadata[k.key]) && (\n <a href={`mailto:${metadata[k.key]}`}>{metadata[k.key]}</a>\n )}\n {urlRegex.test(metadata[k.key]) && (\n <a\n target=\"_blank\"\n rel=\"noreferrer\"\n href={`${metadata[k.key]}`}\n >\n {metadata[k.key]}\n </a>\n )}\n {!emailRegex.test(metadata[k.key]) &&\n !urlRegex.test(metadata[k.key]) && (\n <p>{metadata[k.key] ? String(metadata[k.key]) : null}</p>\n )}\n </div>\n ))}\n </Collapse.Panel>\n </Collapse>\n\n {metadata.s_three_key && metadata.s_three_key.length &&\n <Collapse>\n <Collapse.Panel\n header={\n <h3\n style={{\n fontVariant: \"small-caps\",\n fontWeight: \"800\",\n margin: 0,\n }}\n >\n additional collection download links\n </h3>\n }\n >\n <h4 style={{fontVariant: \"small-caps\", fontWeight: \"800\"}}>downloadable data store for this collection</h4>\n <a href={\"https://tnris-data-warehouse.s3.us-east-1.amazonaws.com/index.html?prefix=LCD/collection/\" + metadata.s_three_key}>Link to our data store for this collection</a>\n <br /><br />\n <h4 style={{fontVariant: \"small-caps\", fontWeight: \"800\"}}>aws cli uri for this collection (will require aws account)</h4>\n {\"s3://tnris-data-warehouse/LCD/collection/\" + metadata.s_three_key}\n </Collapse.Panel>\n </Collapse>\n }\n <CollectionMapService metadata={metadata} />\n <CollectionSupplementalDownloads metadata={metadata} />\n <div style={{ borderBottom: \"1 px solid grey\", padding: \".25rem\" }}>\n <HyperLink\n url={metadata.license_url}\n text={metadata.license_name}\n label=\"license\"\n />\n </div>\n <CollectionCitation metadata={metadata} />\n <CollectionSocialShare />\n </>\n );\n}", "function dynamicSummary(){\n fieldArray = [];\t//\tclear array so everytime this is called we update the data\n window.guideBridge.visit(function(cmp){\n var name = cmp.name;\n if(name && isVisible(cmp)){\n var grouped = isGrouped(cmp);\n var hideLabel = isHideLabel(cmp);\n var hideLink = isHideLink(cmp);\n\n if(name.indexOf(\"block_heading_\") == 0){//\tcheck if block heading (like for the address block fields)\n fieldArray.push({\"type\":\"block_heading\",\"size\":size(cmp),\"name\":cmp.name,\"value\":$(cmp.value).html(),\"grouped\":grouped, \"hideLink\":hideLink, \"className\":cmp.className, \"cssClassName\":cmp.cssClassName,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else if(name.indexOf(\"block_\") == 0) {//\tcheck if object is a group panel\n fieldArray.push({\"type\":\"block\",\"size\":size(cmp),\"name\":cmp.name,\"title\":cmp.title, \"grouped\":grouped, \"className\":cmp.className, \"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else if(name.indexOf(\"heading_\") == 0){//\tcheck if heading\n fieldArray.push({\"type\":\"heading\",\"size\":size(cmp),\"name\":cmp.name,\"value\":$(cmp.value).html(),\"grouped\":grouped, \"hideLink\":hideLink, \"className\":cmp.className, \"cssClassName\":cmp.cssClassName,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else{\n //if(cmp.value != null){\n if(cmp.className == \"guideTextBox\"){\n fieldArray.push({\"type\":\"field\",\"name\":cmp.name,\"title\":cmp.title,\"grouped\":grouped,\"hideLabel\":hideLabel, \"hideLink\":hideLink, \"value\":((cmp.value)?cmp.value:\"Not provided\"),\"className\":cmp.className,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n if(cmp.className == \"guideRadioButton\" ||\n cmp.className == \"guideCheckBox\" ){\n fieldArray.push({\"type\":\"option\",\"name\":cmp.name,\"title\":cmp.title,\"grouped\":grouped,\"hideLabel\":hideLabel,\"hideLink\":hideLink, \"value\":((cmp.value)?cmp.value:\"Not provided\"), \"obj\":cmp,\"className\":cmp.className,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n //}\n }\n }\n });\n\n renderHTML();\t//\tthis generates the html inside the summary component\n}", "function detailPage(ind){\n displayDetails(formatDetails('detail', json.list[ind]));\n // console.log(json.list[ind]);\n document.getElementById(\"homepage\").style.display = \"none\";\n document.getElementById(\"detailpage\").style.display = \"block\";\n }", "function changeMetaData(data) {\n let $panelBody = document.getElementById(\"metadata-sample\");\n // clear any existing metadata\n $panelBody.innerHTML = \"\";\n // Loop through keys in json response and create new tags for metadata\n for (let key in data) {\n h5Tag = document.createElement(\"h5\");\n metadataText = document.createTextNode(`${key}: ${data[key]}`);\n h5Tag.append(metadataText);\n $panelBody.appendChild(h5Tag);\n }\n}", "async function loadParts() {\n //load header\n if (document.getElementById(\"headerLoad\")) {\n response = await fetch(\"/header.html\");\n html = await response.text();\n document.getElementById(\"headerLoad\").innerHTML = html;\n }\n\n //load footer\n if (document.getElementById(\"footerLoad\")) {\n response = await fetch(\"/footer.html\");\n html = await response.text();\n document.getElementById(\"footerLoad\").innerHTML = html;\n document.getElementById(\"fcYear\").innerHTML = new Date().getFullYear();\n }\n\n //load left pane with desciption\n if (document.getElementById(\"left\")) {\n response = await fetch(\"/description.html\");\n html = await response.text();\n document.getElementById(\"left\").innerHTML = html;\n }\n\n //load right pane with archive\n if (document.getElementById(\"right\")) {\n response = await fetch(\"/archive.html\");\n html = await response.text();\n document.getElementById(\"right\").innerHTML = html;\n }\n\n if (document.getElementById(\"archiveList\")) {\n loadArchive();\n }\n\n setipsum();\n}", "function gotTopicDetailHTML(err, resp, html) {\n if (err) return console.error(err)\n var parser = cheerio.load(html)\n var realTag = parser('.display-post-tag-wrapper').text().split('\\n').toString().split('\\t').toString().split(',,,,,,,,,,,,,,,,,,,').toString().split(',,,,,,,,,,,,,,,,,').toString().split(',,,,,,,,,,,,,,,,').toString()\n topics.push({ title: parser('h2').text(), detail: parser('.display-post-story', '.main-post').text(), tags: realTag })\n if (count == maxTopic) {\n createCSV(topics)\n } else {\n console.log('Processing topic ' + count + '...')\n }\n count += 1\n}", "function examinePage() {\n\n var pd = {};\n\n {\n // search for text that might indicate an article requires sourcing...\n var indicators = [\"scientists have\", \"scientists say\", \"paper published\", \"research suggests\", \"latest research\", \"researchers\", \"the study\"]\n /* other possibilities:\n \"according to a new study\"\n \"the study\"\n \"findings\"\n */\n\n /* TODO: could check for obvious containers, to exclude menus, sidebars and other cruft */\n var hits = searchHTML(document.body, indicators);\n if(hits.length>0) {\n // looks like sourcing is needed...\n pd.indicatorsFound = true;\n } else {\n pd.indicatorsFound = false;\n }\n }\n\n\n // is an og:type metatag present?\n {\n pd.ogType = null;\n var meta_ogtype = document.querySelector('meta[property=\"og:type\"]');\n if( meta_ogtype != null ) {\n if(meta_ogtype.content !== undefined) {\n pd.ogType = meta_ogtype.content;\n }\n }\n }\n\n // how about a schema.org type?\n {\n var container = document.querySelector('[itemscope][itemtype]')\n if( container != null ) {\n pd.schemaType = container.getAttribute('itemtype');\n } else {\n pd.schemaType = null;\n }\n }\n\n // hNews?\n {\n hnews = document.querySelector('.hnews')\n if( hnews != null ) {\n pd.hnews = true;\n } else {\n pd.hnews = false;\n }\n }\n\n\n var schemaorg_art_types = [\n \"http://schema.org/Article\",\n \"http://schema.org/NewsArticle\",\n \"http://schema.org/BlogPosting\",\n \"http://schema.org/ScholarlyArticle\",\n \"http://schema.org/MedicalScholarlyArticle\" ];\n\n /* now make a call - are we confident it is or isn't an article? */\n pd.isDefinitelyArticle = false;\n pd.isDefinitelyNotArticle = false;\n\n if(pd.schemaType !== null ) {\n if(schemaorg_art_types.indexOf(pd.schemaType) > -1 ) {\n pd.isDefinitelyArticle = true;\n } else {\n pd.isDefinitelyNotArticle = true;\n }\n }\n\n if( pd.ogType !== null ) {\n if( pd.ogType=='article' || pd.ogType=='tumblr-feed:entry') {\n pd.isDefinitelyArticle = true;\n }\n\n if( pd.ogType=='website') {\n pd.isDefinitelyNotArticle = true;\n }\n }\n\n if( pd.hnews==true ) {\n pd.isDefinitelyArticle = true;\n }\n\n // could have conflicting info...\n if( pd.isDefinitelyArticle && pd.isDefinitelyNotArticle ) {\n // ignore all!\n pd.isDefinitelyArticle = false;\n pd.isDefinitelyNotArticle = false;\n }\n\n return pd;\n}", "async function handleDetailPage(request, page, pageData, label) {\n if (label === LABEL.NEW) {\n log.info('New Selectors Detected');\n }\n\n await puppeteer.injectJQuery(page);\n\n // Scrape page 1\n const firstPageResults = await getItems(request, page, pageData, label);\n await Apify.pushData(injectItemPositions(firstPageResults));\n\n // Go to page 2 and scrape\n let nextPage;\n try {\n nextPage = await page.waitForSelector('li.a-last > a');\n } catch (e) {\n log.error(`Could not extract second page - only one page returned. ${e}`);\n }\n\n if (nextPage) {\n await nextPage.click();\n await page.waitForNavigation();\n\n const secondPageResults = await getItems(request, page, pageData, label);\n const positionOffset = firstPageResults.length;\n await Apify.pushData(injectItemPositions(secondPageResults, positionOffset));\n }\n\n log.info(`Saved results from: ${await page.title()}`);\n}", "async function scrapeProductPage() {\n const { page } = await puppeteerInstance()\n const offset = 550\n let index = offset\n let last = allGameLinks.length\n\n try {\n while (index < last) {\n await page.goto(allGameLinks[index], {\n waitUntil: 'networkidle0',\n })\n await page.waitForSelector('body')\n console.log('Body loaded')\n await page.waitForTimeout(2000)\n console.log('Safety loading 2000')\n // console.log('Auto scroll starts')\n // await autoScroll(page)\n // await page.waitForTimeout(5000)\n // console.log('Safety loading 5000')\n\n const data = await page.evaluate(() => {\n const selectors = [\n {\n name: 'title',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div.css-1e6jyt-ProductDetailPageLayout__title > div.css-ikmaz7-TitleSectionLayout__container > div > h1 > div.css-12usrln-PDPTitleHeader__headline1 > span',\n },\n {\n name: 'description',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > div > div:nth-child(2) > div > div > div.css-1di7kpa-AboutSectionLayout__shortDescription > span > div > div',\n },\n {\n name: 'price',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > aside > div > div > div:nth-child(3) > div > div > span > div > span',\n },\n {\n name: 'developer',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > div > div:nth-child(2) > div > div > div:nth-child(2) > div > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > span',\n },\n {\n name: 'publisher',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > div > div:nth-child(2) > div > div > div:nth-child(2) > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > span',\n },\n {\n name: 'releaseDate',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > div > div:nth-child(2) > div > div > div:nth-child(2) > div > div:nth-child(3) > div > div:nth-child(2) > span > time',\n },\n {\n name: 'tags',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > div > div:nth-child(2) > div > div > div:nth-child(2) > div > div:nth-child(1) > div:nth-child(2) > div:nth-child(2)',\n },\n {\n name: 'longDesc',\n selector: '#about-long-description',\n },\n {\n name: 'platform',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > div > div:nth-child(2) > div > div > div:nth-child(2) > div > div:nth-child(2) > div:nth-child(2) > div:nth-child(2) > ul',\n },\n {\n name: 'languages',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(3) > div > div > div > div:nth-child(3) > div.css-kl3741-ProductSection__body > div > div > div:nth-child(2) > div > ul > li > span',\n },\n {\n name: 'spec',\n selector:\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(3) > div > div > div > div:nth-child(3) > div.css-kl3741-ProductSection__body > div > div > div:nth-child(1) > div > div.css-mayif2-Tabs__tabContent',\n },\n ]\n\n const sideImageSelector =\n '#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div.css-5wa3ri-Page__content-Page__contentAfterTopNav > div > div > div.css-1ib2l17-ProductDetailPageLayout__container > div:nth-child(2) > div > aside > div > div > div:nth-child(1) > div.css-14ybna1-PDPSidebarLogo__sidebarLogo > div > div > div > div > div > img'\n\n let gameDetails = {}\n for (let i = 0; i < selectors.length; i++) {\n const { name, selector } = selectors[i]\n\n const query = document.querySelector(selector)\n if (query) {\n if (['longDesc', 'spec'].includes(name)) {\n console.log('Getting html')\n gameDetails[name] = query.innerHTML\n } else {\n gameDetails[name] = query.innerText\n }\n } else {\n gameDetails[name] = ''\n }\n }\n\n const sideImageQuery = document.querySelector(sideImageSelector)\n return { gameDetails, imgSrc: sideImageQuery ? sideImageQuery.src : '' }\n })\n\n data.imgSrc &&\n saveImageToDisk(\n data.imgSrc,\n `files/gameDetails/images/${index}-${slug(\n data.gameDetails.title,\n )}.jpg`,\n )\n\n saveJsonToFile(\n data.gameDetails,\n `files/gameDetails2/${index}-${slug(data.gameDetails.title)}.json`,\n )\n index++\n }\n // await browser.close()\n } catch (err) {\n console.log(err)\n }\n}", "function prepPage() {\r\n uriObj = parseURI();\r\n if (uriObj['show'] && uriObj['show'] != 'ep' && !uriObj['eid'] && !uriObj['aid']) return;\r\n\tinitTooltips();\r\n loadData('anime/a'+uriObj['aid']+'.xml',parseData);\r\n}", "function getTemplate(winNo) {\n var str =\n ' <div class=\"vis-fp-bodycontent vis-formouterwrpdiv\"> ' +\n ' <div class=\"vis-fp-viwall\" > ' +\n ' <span>' + VIS.Msg.getMsg(\"ViewMore\") + '</span> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-datawrap\"> ' +\n ' <div class=\"vis-fp-static-ctrlwrp\"> ' +\n ' <div class=\"vis-fp-static-ctrlinnerwrp\"></div> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-custcolumns\" id=\"accordion_' + winNo + '\"\"> ' +\n ' <div class=\"card\"> ' +\n ' <div class=\"card-header\" style=\"cursor:pointer\" data-toggle=\"collapse\" href=\"#collapseOne_' + winNo + '\"> ' +\n ' <span>' + VIS.Msg.getMsg(\"CustomCondition\") + '</span> ' +\n ' <a class=\"card-link\" > ' +\n ' <i class=\"vis vis-arrow-up\"></i> ' +\n ' </a> ' +\n ' </div> ' +\n ' <div id=\"collapseOne_' + winNo + '\"\" class=\"collapse\" data-parent=\"#accordion_' + winNo + '\" >' +\n ' <div class=\"card-body\"> ' +\n ' <div class=\"input-group vis-input-wrap\"> ' +\n ' <div class=\"vis-control-wrap\"> ' +\n ' <select class=\"vis-fp-cols\"> ' +\n ' </select> ' +\n ' <label class=\"vis-fp-lblcols\">' + VIS.Msg.getMsg(\"Column\") + '</label> ' +\n ' </div> ' +\n ' </div> ' +\n ' <div class=\"input-group vis-input-wrap\"> ' +\n ' <div class=\"vis-control-wrap\"> ' +\n ' <select class=\"vis-fp-op\"> ' +\n ' </select> ' +\n ' <label class=\"vis-fp-lblop\">' + VIS.Msg.getMsg(\"Operator\") + '</label> ' +\n ' </div> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-valueone\"> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-valuetwo\"> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-valuethree\"> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-cc-addbtnwrp\"> ' +\n ' <span class=\"vis-fp-cc-addbutton\">' + VIS.Msg.getMsg(\"Add\") + '</span> ' +\n ' </div> ' +\n ' </div> ' +\n ' </div> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-custcoltagswrp\"> ' +\n ' <div class=\"vis-fp-custcoltag\"> ' +\n ' </div> ' +\n ' </div><!-- vis-fp-custcoltagswrp --> ' +\n ' </div> </div> ' +\n ' </div>';\n return str;\n }", "function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\r\n var movie_title_orig = $('[class^=OriginalTitle__OriginalTitleText]').text().trim().replace(\"Original title: \", \"\");\r\n // reference\r\n if (movie_title_orig === \"\" && $('h3[itemprop=\"name\"]').length) {\r\n movie_title_orig = $.trim($($('h3[itemprop=\"name\"]')[0].nextSibling).text());\r\n }\r\n // not found\r\n if (movie_title_orig === \"\") {\r\n movie_title_orig = movie_title;\r\n }\r\n\r\n var movie_id = document.URL.match(/\\/tt([0-9]+)\\//)[1].trim('tt');\r\n var is_tv = Boolean($('title').text().match('TV Series'));\r\n // newLayout || reference : check if 'title' has just a year in brackets, eg. \"(2009)\"\r\n var is_movie = (Boolean($('[class^=TitleBlock__TitleMetaDataContainer]').text().match('TV')) || Boolean($('li.ipl-inline-list__item').text().match('TV Special'))) ? false : Boolean($('title').text().match(/.*? \\(([0-9]*)\\)/));\r\n // newLayout || reference\r\n if (Boolean($('[class^=GenresAndPlot__Genre]').text().match('Documentary')) || Boolean($('li.ipl-inline-list__item').text().match('Documentary'))) {\r\n is_tv = false;\r\n is_movie = false;\r\n }\r\n\r\n // Start of External ratings code\r\n if (GM_config.get(\"ratings_cfg_imdb\") || GM_config.get(\"ratings_cfg_metacritic\") || GM_config.get(\"ratings_cfg_rotten\") || GM_config.get(\"ratings_cfg_letterboxd\")) {\r\n externalRatings(movie_id, movie_title, movie_title_orig);\r\n }\r\n // Call to iconSorterCount() for the icons/sites sorting.\r\n iconSorterCount(is_tv, is_movie);\r\n\r\n // Create areas to put links in\r\n addIconBar(movie_id, movie_title, movie_title_orig);\r\n perform(getLinkArea(), movie_id, movie_title, movie_title_orig, is_tv, is_movie);\r\n if (GM_config.get('load_second_bar') && !GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaSecond();\r\n } else if (!GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && !GM_config.get('switch_bars')) {\r\n getLinkAreaSecond();\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && GM_config.get('switch_bars')) {\r\n getLinkAreaThird();\r\n getLinkAreaSecond();\r\n }\r\n}", "function parseAllMolecularFindings_slides(rows){\n let pages = \"\";\n let legend_text = document.getElementById(\"findingsLegend\").innerHTML;\n // Can't use column-count so split the legend_text in two\n legend_text = '<div>' + legend_text + '</div>';\n legend_text = legend_text.replace('<li value=\"e)\"', \n '</ol></div><div style=\"padding-left:1%;\"><ol class=\"ui list\" ><li value=\"e)\"');\n \n\n for (let row of rows){\n if(row['hide'] == 'yes'){\n continue; // Don't add markup for hidden rows\n }\n else {\n pages += '<div class=\"page\">';\n pages += '<h4 class=\"ui top center aligned inverted header\">Molecular Findings</h4>';\n \n if( Object.keys(row[\"references\"]).length > 0){\n pages += '<div class=\"ui top attached segment\" style=\"margin:0px;padding:10px;\">';\n } else {\n pages += '<div class=\"ui segment\" style=\"margin:0px;\">';\n }\n pages += '<span class=\"ui horizontal label\" style=\"margin-top:10px;\">Molecular Abnormality</span>' \n + row[\"abnormality\"] + \"<br/>\" ;\n pages += '<span class=\"ui horizontal label\" style=\"margin-top:10px;\">Category</span>' \n + row[\"category\"] + \"<sup>\" + row[\"supports\"] + \"</sup>\" + \"<br/>\" ;\n pages += '<span class=\"ui horizontal label\" style=\"margin-top:10px;\">Associated Drugs</span>' \n + row[\"therapy\"] + \"<br/>\" ;\n pages += row[\"analyst_summary\"];\n \n if( Object.keys(row[\"references\"]).length > 0)\n {\n pages += '</div><div class=\"ui bottom attached segment\"';\n pages += 'style=\"font-size:60%;line-height:normal;margin-bottom:1%;padding:10px;\">';\n pages += '<span class=\"ui horizontal label\" style=\"margin-top:10px;\">References</span><br/>' ;\n for(ref in row[\"references\"]){\n pages += row[\"references\"][ref] + \"<br/>\";\n }\n }\n pages += '</div>';\n pages += '<div style=\"margin:0px;padding:5px;font-size:50%;display:flex;zoom:80%\">';\n pages += legend_text;\n pages += '</div>';\n\n pages += '</div>'; // end segment div, and page div\n }\n }\n return pages;\n }", "async function showPlantDetails(detail, img_url) {\n\n // BRING THE DETAILS BACK TO DEFAULT STYLE IF A USER TRIES TO SEE OTHER INFO AFTER CLICKING THE TOASTR\n const childNodes = plant_detail.childNodes;\n \n // the default styling\n childNodes.forEach(node => {\n node.style !== undefined ? \n \n // if the node's id is table_wrapper\n node.id === 'table_wrapper' ? \n (node.style.right = '0', node.style.position = 'relative') :\n\n // or if the node's id is nutrientsChart\n node.id === 'nutrientsChart' ? \n (node.style.bottom = '-100%') :\n\n // or if the node's id is recipe_wrapper\n node.id === 'recipe_wrapper' ? \n (node.style.zIndex = 0) :\n \n // otherwise\n (node.style.left = '0') :\n undefined;\n });\n\n\n ////////////////////////////////////////\n // REMOVE OLD ELEMENTS\n ////////////////////////////////////////\n\n // select old div elements\n const oldDivs = document.querySelectorAll('div'),\n table_remover = document.querySelectorAll('.tr_body');\n\n // check if there are any one of them\n if (table_remover.length > 0) {\n\n // remove them\n removeElements(table_remover);\n }\n\n // check if the array has any child elements\n if (oldDivs.length > 0) {\n\n let temp_arr = [];\n \n // loop through the array\n for (let i = oldDivs.length - 1; i >= 0; i--) {\n\n // find the according class names\n if (oldDivs[i].className === 'plant_detail_img_container' || oldDivs[i].className === 'recipe_detail_img_container') {\n\n // push those divs in a temporarily made array\n temp_arr.push(oldDivs[i]);\n\n // remove them\n removeElements(temp_arr);\n }\n }\n }\n\n ////////////////////////////////\n // DISPLAY TABULAR DATA\n ////////////////////////////////\n \n // show the hidden elements\n plant_detail.style.display = 'block';\n plant_detail_wrapper.style.display = 'block';\n\n // create new DOM elements\n const img = document.createElement('img'),\n imgDiv = document.createElement('div');\n \n // append imgs and class names\n img.src = img_url;\n img.className = 'plant_detail_img';\n imgDiv.className = 'plant_detail_img_container';\n\n // most of the info and table creation is in this function\n displayTable(detail);\n\n // API call to Edamam\n detail.data.common_name !== null ? getRecipe(detail.data.common_name) :\n getRecipe(detail.data.scientific_name)\n\n imgDiv.appendChild(img);\n plant_detail.appendChild(imgDiv);\n}", "static async getData () {\n return await App.getPage('popular', 1);\n }", "function showDetailEvent(customInfo){\n detail = document.querySelector(\".panelContent\")\n var id = customInfo.split(',')[0];\n var typeEvent = customInfo.split(',')[1];\n\n fetch('api/events/detail/'+typeEvent+'/'+id)\n .then( res => res.json())\n .then(events => {\n detailEvent = document.createElement('div');\n detailEvent.id = \"detailEvent\";\n detailEvent.innerHTML = \n `<h1>${events.name}</h1>\n <img src='/media/workshops/2020/06/08/curso-online-pasteleria-reposteria_amp_primaria_1_1560502963.jpg' alt='caca'>\n <b><p>Comuna:</b> ${events.commune}</p>\n <b><p>Tipo de evento:</b> ${typeEvent} - ${events.type}</p>\n <b><p>Descripcion:</b> ${events.description}</p>\n <b><p>Direccion:</b> ${events.address}</p>\n <b><p>Inicio:</b> ${events.start_date}, ${events.start_time}</p>\n <b><p>Termino:</b> ${events.ended_date}, ${events.ended_time}</p>\n <b><p>Puntuaciones:</b></p>\n <p><img id=\"starsImg\" src=\"static/img/5stars.png\" alt=\"5 estrellas imagen\"> = <b>${events.five_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/4stars.png\" alt=\"4 estrellas imagen\"> = <b>${events.four_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/3stars.png\" alt=\"3 estrellas imagen\"> = <b>${events.three_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/2stars.png\" alt=\"2 estrellas imagen\"> = <b>${events.two_stars}</b></p>\n <p><img id=\"starsImg\" src=\"static/img/1stars.png\" alt=\"1 estrellas imagen\"> = <b>${events.one_stars}</b></p>\n <h1>Comentarios de la gente</h1>\n <p>${events.comments}</p>`;\n\n detail.appendChild(detailEvent);\n })\n}", "function SDM_getMetaContents(mn) {\n var m = document.getElementsByTagName('meta');\n for (var i in m) {\n if (m[i].name == mn) return m[i].content;\n }\n}", "function navAllStories(evt) {\n hidePageComponents();\n putStoriesOnPage();\n}", "function hideAllPanels() {\n $('#AllLeads').hide();\n $('#AddLead').hide();\n $('#LeadDetails').hide();\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n $('#AllSales').hide();\n $('#SaleDetails').hide();\n $('#AllLostSales').hide();\n $('#LostSaleDetails').hide();\n $('#AllReports').hide();\n $('#amountPipeline').hide();\n $('#countPipeline').hide();\n $('#chartArea').hide();\n $('#drillDown').hide();\n $('#pipelineName').hide();\n $('#conversionName').hide();\n}", "function showOverpanel(pullFrom, slotName, pageNum) {\n //console.log(\"Overpanel Function Acitvted\");\n var itemsPerPage = columns * rows;\n var start = pageNum * itemsPerPage;\n if (start == pullFrom.length - 1)\n start -= 3;\n var stopHere = pullFrom.length;\n if (pageNum < 0 || start > stopHere) {\n //console.log(\"Page number is less than 0 or the start number is beyond stophere\");\n return 0;\n }\n var i;\n var j;\n var itemRarity;\n var itemCount = start;\n document.getElementById(\"overpanel\").style.display = \"block\";\n var finalHTML = \"<table id=\" + toHTML(\"opTable\") + \">\";\n for (i = 0; i < rows; i++) {\n if (itemCount >= stopHere)\n break;\n finalHTML += \"<tr>\"\n for (j = 0; j < columns; j++) {\n itemRarity = pullFrom[itemCount].rarity;\n finalHTML += \"<th class=\" + toHTML(\"cellcontainer\") + \"onclick=\" + toHTML(\"siteManager.guiSelectItem(siteManager.sManager.\" + slotName + \", \" + pullFrom[itemCount].pKey + \")\") + \"><div class=\" + toHTML(\"holdicon\") + \" style=\" + toHTML(\"background-color:\" + getColor(itemRarity)) + \"><img src=\" + toHTML(filePath + pullFrom[itemCount].icon) + \"></div><div class=\" + toHTML(\"holdname\") + \">\" + pullFrom[itemCount].name + \"</div></th>\";\n itemCount++;\n if (itemCount >= stopHere) {\n finalHTML += \"</tr>\";\n break;\n }\n }\n }\n finalHTML += \"</table><table id=\" + toHTML(\"bottomNav\") + \"><tr><th class=\" + toHTML(\"menuNav\") + \" onclick=\" + toHTML(\"clickedPrev(\" + pageNum + \", siteManager.sManager.\" + slotName + \")\") + \">&lt; PREV</th><th class=\" + toHTML(\"menuBlank\") + \"onclick=\" + toHTML(\"clickedClear(siteManager.sManager.\" + slotName + \")\") + \">CLEAR</th><th class=\" + toHTML(\"menuClose\") + \" onclick=\" + toHTML(\"clickedClose()\") + \">CLOSE</th><th class=\" + toHTML(\"menuNav\") + \" onclick=\" + toHTML(\"clickedNext(\" + pageNum + \", \" + \"siteManager.sManager.\" + slotName + \")\") + \">NEXT &gt;</th></tr></table>\";\n //console.log(finalHTML);\n document.getElementById(\"overpanel\").innerHTML = finalHTML;\n}", "function getMIS330Goals(){\n const getMIS330GoalsAPiUrl = \"https://localhost:5001/api/sessions\"; \n //let html = \"<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎</p><div class = \\\"col-md-12 d-flex justify-content-center\\\">\" //<p> ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎</p>\";\n fetch(getMIS330GoalsAPiUrl).then(function(response){\n return response.json(); \n }).then(function(json){\n\n\n //console.log(total); \n json.forEach((session)=>{\n \n if(session.category == \"Goal\" && session.name == \"MIS330\"){\n //console.log(session.totalTime); \n var MIS330goal = session.totalTime;\n console.log(MIS330goal); \n \n }\n // else{\n // var MIS321goal = 0; \n //}\n if(session.category == \"MIS330\" ){\n var i = 0; \n total = 0, \n //total321 = 0; \n //total = session.totalTime, \n i;\n // if(session.category == \"MIS321\" && session.name != \"Goal\")\n for (i = 0; i < json.length; i++) { \n if(json[i].category == \"MIS330\"){\n total += json[i].totalTime; \n // total = total + session.totalTime; \n //console.log(\"We got here\"); \n }\n //else{\n // total -= json[i].totalTime; \n // console.log(\"we got here\");\n //}\n }\n }\n \n console.log(total);\n\n print330Goals(MIS330goal, total); \n\n \n });\n //console.log(goals, totals); \n\n\n //document.getElementById(\"mis321goals\").innerHTML = html;\n }).catch(function(error){\n console.log(error); \n })\n}", "function showAllDetails( altHide ) {\n // show descriptions\n $( \".citationDetails\" ).show( function() {\n resizeFrame();\n }\n );\n\n // show proper toggle icon\n $( \".toggleIcon\" ).each( function() {\n this.src = \"/library/image/sakai/collapse.gif?panel=Main\";\n this.alt = altHide;\n } );\n}", "function showPageConten() {\n $(\".hide-list\").show();\n $(\"#forecast-id\").show();\n $(\"#forecast-cards\").show();\n $(\"#title-day-forecast\").show();\n }", "function showSpotDetails() {\n //get element\n var spotPanel = document.getElementById(\"spot-view\");\n //set global panel var\n spotDetailPanel = spotPanel;\n //add class to selected element\n spotDetailPanel.classList.add(\"visible\");\n //set panel spotname\n document.getElementById(\"spot-name-display\").innerHTML = pubSpotInfo.spotName;\n //set panel spotname\n document.getElementById(\"spot-img-display\").src = pubSpotInfo.imgUrl;\n}", "async function topMoviesPageMain()\n{\n\n\t//first I have to fetch the data\n\tvar dataSheet = await fetching();\n\n\t//since I only need the enties\n\tdataSheet = dataSheet.feed.entry;\n\n\t//convert the coma separated genre values to an array\n\tdataSheet = convertGenre(dataSheet);\n\n\t//getting the list of top movies\n\tvar topMovies = getTopMovies(dataSheet);\n\n\t//creating the movie cards\n\tcreateMovieCards(topMovies,'topList',topMovies.length);\n\n\t//setting event listener to the cards\n\tsetCards();\n\n}", "function scrapeSite(){\n\n scrapeIt(sitePath + 'shirts.php', {\n\n pages: {\n listItem: 'ul.products li',\n data: {\n url: {\n selector: 'a',\n attr: 'href'\n }\n }\n }\n }).then(({ data, response }) => {\n\n pages = data.pages;\n scrapePages(pages);\n\n }).catch( (error) => {\n const errorMsg = `Cannot connect to ${sitePath}`;\n writeErrorLog(errorMsg);\n });\n}", "setup() {\n\t\t\tvar that = this;\n\t\t\tthis._forEach(this._activeTabs, function(index, tab) {\n\t\t\t\tthat._forEach(tab.children, function(index, child) {\n\t\t\t\t\tvar target = that.getTarget(child);\n\t\t\t\t\tthat.showPanel(child, target);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function getPageInfo() {\n\tlet page = {\n\t\turl: window.location.href,\n\t\tsite: 'twitter'\n\t};\n\n\tlet canonical = $('link[rel=\"canonical\"]').href.split('/')[3];\n\tif ($('meta[content=\"profile\"]')) {\n\t\tpage.page = 'user';\n\t\tpage.user = canonical;\n\t}\n\telse if (/\\.com\\/(?:\\w+|i\\/web)\\/status\\/\\d+/.test(page.url)) {\n\t\tpage.page = 'submission';\n\t\tpage.user = canonical;\n\t}\n\n\treturn page;\n}", "function load_page(data){\n $(\".block-container\").empty();\n var infos = data.Infos;\n var page = \"<block class='block'>\";\n for (var i = 0; i < infos.length; i++) {\n page += infos[i].html;\n }\n page += \"</div>\";\n $(\".block-container\").append(page);\n}", "function getSupportedSitesInfo() {\n var sites = {\n\n // Example URLs:\n // http://www.refinery29.com/2016/12/133127/how-to-wrap-presents\n \"refinery29.com\": {\n loadAll: function (thisInfo, fullArticleContainer, url) {\n addClassToDOMElements('.opener', 'isVisible active', function (unused) {\n addClassToDOMElements('.slide', 'isVisible active', function (msg) {\n displayResult('Loaded ' + (msg.numLoaded ? msg.numLoaded : 'all') + ' slides');\n });\n });\n }\n },\n\n \"knowable.com\": {\n // Example URLs:\n // http://www.knowable.com/a/23-people-were-asked-what-is-the-most-messed-up-family-secret-you-know/p-1\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(knowable\\.com\\/a\\/[^\\/]+)((\\/p-)([0-9]+))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // knowable.com/a/article-title-here\n + (matches[4] ? matches[5] + '{0}' : '/p-{0}') // /p-X\n + (matches[7] ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.article-body',\n isLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one that links to '/t/end-gallery',\n // this is the last page\n var html = $.parseHTML(responseText);\n var nextLink = $(html).find('.article-body .btn-next-xl');\n return (!nextLink.length || nextLink.attr('href') == '/t/end-gallery');\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n if (pageNum > 1) { // hide article title after page 1\n articleMeat.find('.article-header').addClass('hidden');\n }\n articleMeat.find('.article-footer-v2').addClass('hidden');\n fullArticleContainer.append(articleMeat);\n // Examine the page. If it's the last one, add the elements to the page;\n // otherwise, keep going.\n if (thisInfo.isLastPage(responseText)) {\n fullArticleContainer.addClass(thisInfo.articleMeatSelector);\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n replaceDOMElements(thisInfo.articleMeatSelector, fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n else {\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"suggest.com\": { // also applies to minq.com\n // Example URLs:\n // http://www.suggest.com/lifestyle/1600362/how-did-they-even-get-hired-employees-share-their-17-most-insane-crazy-employee-stories?story_page=1\n // http://www.minq.com/lifestyle/1599990/21-people-share-awesome-stories-about-how-they-became-friends-with-their-bffs?story_page=1\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(.+\\.com\\/[^\\/]+\\/[^\\/]+\\/[^\\/]+)((\\/\\?story_page=)([0-9]+))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // suggest.com/section/1234/article-title-here OR minq.com/...\n + (matches[4] ? matches[5] + '{0}' : '/?story_page={0}') // /?story_page=X\n + (matches[7] && matches[7] != '/' ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.slide',\n isLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one that links to '#',\n // this is the last page\n var html = $.parseHTML(responseText);\n var nextLink = $(html).find('.next-story');\n return (!nextLink.length || nextLink.attr('href').indexOf('story_page') == -1); // next page is a new article\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n fullArticleContainer.append(articleMeat);\n // Examine the page. If it's the last one, add the elements to the page;\n // otherwise, keep going.\n if (thisInfo.isLastPage(responseText)) {\n fullArticleContainer.addClass(thisInfo.articleMeatSelector + ' partial content_story_pages_slide primary');\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n replaceDOMElements('.slot[data-slot=\"center\"]', fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n else {\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"emgn.com\": {\n // Example URL:\n // http://emgn.com/s2/19-extreme-body-transformations-thatll-leave-jaw-aching/1\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(emgn\\.com\\/[^\\/]+\\/[^\\/]+)((\\/)([0-9]*))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // emgn.com/something/article-title-here\n + (matches[4] ? matches[5] + '{0}' : '/{0}') // /X\n + (matches[7] ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.content > *:not(aside):not(.pagination):not(.rrssb-holder)',\n isPastLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one with text 'Next Article',\n // we've past the last page\n var html = $.parseHTML(responseText);\n var nextDiv = $(html).find('.pagination .next');\n return (nextDiv.length && (nextDiv[0].innerText).indexOf('Article') >= 0); // this is the junky page before next article\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Function to execute after retrieving all of the article content\n var afterLastPage = function (pageNum) {\n fullArticleContainer.addClass('content');\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n replaceDOMElements('article.content', fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n if (thisInfo.isPastLastPage(responseText)) {\n afterLastPage(pageNum);\n }\n else {\n if (pageNum > 1) {\n thisInfo.articleMeatSelector += ':not(h1)'; // don't show the title more than once\n }\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n fullArticleContainer.append(articleMeat);\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"lifebuzz.com\": {\n // Example URL:\n // http://www.lifebuzz.com/princess-diana/1/\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(lifebuzz\\.com\\/[^\\/]+)((\\/)([0-9]*))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // lifebuzz.com/article-title-here\n + (matches[4] ? matches[5] + '{0}' : '/{0}') // /X\n + (matches[7] ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.single > *:not(#desktop-below-post-trending)',\n isLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one that links to '/t/end-gallery',\n // this is the last page\n var html = $.parseHTML(responseText);\n var nextLink = $(html).find('a.next-post');\n return (nextLink.length);\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {;\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n articleMeat.find('img.lazy').each(function (index, listItem) {\n $(listItem).attr('src', $(listItem).attr('data-original'));\n });\n fullArticleContainer.append(articleMeat);\n // Examine the page. If it's the last one, add the elements to the page;\n // otherwise, keep going.\n if (thisInfo.isLastPage(responseText)) {\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n fullArticleContainer.addClass('single');\n fullArticleContainer.find('.post-pagination').addClass('hidden');\n fullArticleContainer.find('.share-bar').addClass('hidden');\n replaceDOMElements('.single', fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n else {\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"forbes.com\": {\n buttonNote: '(will open in new window)',\n // Example URL:\n // http://www.forbes.com/sites/michaelbobelian/2016/12/16/democrats-best-hope-to-defeat-trumps-cabinet-picks-lies-in-glare-of-confirmation-process/\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Click the 'print' button\n triggerEventOnDOMElement('.print a', 'click', function (msg) {\n if (msg && msg.success) {\n displayResult('Opened full article');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n },\n }\n\n // minq.com has the same format as suggest.com (wat)\n sites['minq.com'] = sites['suggest.com'];\n\n return sites;\n}", "function renderObservationPage() {\n const observationId = location.hash.split(\"observations/\")[1];\n // get one observation\n const observation = Model.get_observation(parseInt(observationId));\n const userId = observation.participant;\n loadPage(\"observation-details\", {\n observation: Model.get_observation(parseInt(observationId)),\n user: Model.get_user(parseInt(userId)),\n });\n}", "function showAll() {\n\tvar result = document.getElementsByClassName('search-result-panel');\n\tfor ( var ePanel in result) {\n\t\tif (ePanel.match(\"\\\\d+\") == null) {\n\t\t} else {\n\t\t\tvar eDivs = result[ePanel].getElementsByTagName('div');\n\t\t\tfor ( var eDiv in eDivs) {\n\t\t\t\tif (eDiv.match(\"\\\\d+\") == null) {\n\t\t\t\t} else {\n\t\t\t\t\teDivs[eDiv].style.display = 'block';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "_initializeMetaElements() {\n const documentMetaElements = document.querySelectorAll('meta');\n const metaElements = {};\n const iterateOnMetaElement = (metaElement) => {\n // Get the name of the meta element\n const name = metaElement.name || metaElement.getAttribute('property');\n\n // Add the meta element only if we found a name\n if (name) {\n metaElements[name] = metaElement;\n }\n };\n\n // For each meta elements found in the document\n documentMetaElements.forEach(iterateOnMetaElement);\n\n // Set the metaElements property\n this._metaElements = metaElements;\n }", "mainPageCheerio(data) {\n return new Promise((resolve, reject) => {\n const $ = cheerio.load(data);\n const arr = [];\n $('a', '.browseAirlines').each((i, e) => {\n const item = $(e).attr('href');\n arr.push(item);\n });\n resolve(arr);\n });\n }", "function showPanels() \n{ \n\tvar strHide = \"HIDDEN\"; \n var strShow = \"SHOW\"; \n // Initial values \n var p_nav = strShow, \n p_zoom = strShow, \n p_overview = strShow, \n p_legend = strShow, \n p_download = strShow, \n p_measure = strShow, \n p_type = strShow, \n p_fullscreen = strShow; \n\t \n\t// get the panels to show \n\tif (g_panel != \"\") { \n\t\tvar panelsToShow = g_panel.spilt('+'); \n\t\tfor (var panel in panelsToShow) { \n\t\t\tif (panel == \"nav\") { \n\t\t\t\tp_nav = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"zoom\") { \n\t\t\t\tp_zoom = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"overview\") { \n\t\t\t\tp_overview = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"legend\") { \n\t\t\t\tp_legend = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"download\") { \n\t\t\t\tp_download = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"measure\") { \n\t\t\t\tp_measure = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"type\") { \n\t\t\t\tp_type = strShow; \n\t\t\t} \n\t\t\telse if (panel == \"fullscreen\") { \n\t\t\t\tp_fullscreen = strShow; \n\t\t\t} \n\t\t} \n\t} \n\t \n\t// get the panels to hide \n\tif (g_panel_hide != \"\") { \n\t\tvar panelsToHide = g_panel_hide.spilt('+'); \n\t\tfor (var panel in panelsToHide) { \n\t\t\tif (panel == \"nav\") { \n\t\t\t\tp_nav = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"zoom\") { \n\t\t\t\tp_zoom = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"overview\") { \n\t\t\t\tp_overview = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"legend\") { \n\t\t\t\tp_legend = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"download\") { \n\t\t\t\tp_download = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"measure\") { \n\t\t\t\tp_measure = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"type\") { \n\t\t\t\tp_type = strHide; \n\t\t\t} \n\t\t\telse if (panel == \"fullscreen\") { \n\t\t\t\tp_fullscreen = strHide; \n\t\t\t} \n\t\t} \n\t} \n\t \n\t// set visibility of the panels \n\tmap0.SetPanelVisibility(\"FLY\", p_nav); \n map0.SetPanelVisibility(\"ZOOM\", p_zoom); \n map0.SetPanelVisibility(\"OVERVIEW\", p_overview); \n map0.SetPanelVisibility(\"LEGEND\", p_legend); \n map0.SetPanelVisibility(\"BUY\", p_download); \n map0.SetPanelVisibility(\"MEASURE\", p_measure); \n map0.SetPanelVisibility(\"TYPE\", p_type); \n\tmap0.SetLogoVisibility(g_tflogo); \n\t \n\t//set legend \n\tif (p_legend == strShow && g_legend != \"\") { \n\t\tmap0.SetLegend(g_legend); \n\t} \n\t \n\t// set debug status \n\tif (g_debug == 0) { \n map0.ViewDebugPanel(false); \n map0.ViewTileURL(false); \n } \n if (g_debug == 1) { \n map0.ViewDebugPanel(false); \n map0.ViewTileURL(true); \n } \n if (g_debug == 2) { \n map0.ViewDebugPanel(true); \n map0.ViewTileURL(false); \n } \n if (g_debug == 3) { \n map0.ViewDebugPanel(true); \n map0.ViewTileURL(true); \n } \n}", "function parsePageInfo() {\n\n //MDS is not enabled, no need for any special processing\n if (window.location.href.indexOf(\"start.aspx\") == -1) {\n return {};\n }\n\n var path = window.location.pathname;\n var qry = window.location.search;\n var hash = window.location.hash;\n\n var a = document.createElement(\"a\");\n a.href = hash.substring(1);\n\n var apath = a.pathname;\n var aqry = a.search\n var ahash = a.hash;\n\n //Add the path portion of the anchor to the main path\n var dcsuri = path + ((apath) ? (\"#\" + apath) : \"\");\n\n //Add the anchor's query string to the main query string \n var dcsqry = qry.concat(\n (aqry ? (qry ? (\"&\" + aqry.substr(1)) : aqry) : \"\")\n );\n\n return {\n \"DCS.dcssip\": location.hostname,\n \"DCS.dcsuri\": dcsuri,\n \"DCS.dcsqry\": dcsqry,\n \"WT.ti\": document.title,\n \"WT.es\": location.hostname + dcsuri\n };\n}" ]
[ "0.57500005", "0.5688017", "0.56705713", "0.562944", "0.55332774", "0.5521916", "0.5467759", "0.54354507", "0.54200995", "0.5387813", "0.53846747", "0.5364622", "0.5349082", "0.53436196", "0.53361887", "0.5308136", "0.5254317", "0.5233635", "0.5202633", "0.51862097", "0.5165848", "0.51581126", "0.5142924", "0.5141397", "0.5136613", "0.5125494", "0.51233375", "0.5118618", "0.5104615", "0.50947785", "0.5094478", "0.5093399", "0.50900954", "0.50816965", "0.5076492", "0.5061117", "0.5060142", "0.5056568", "0.5054721", "0.5053258", "0.5047557", "0.50441474", "0.50356", "0.5034838", "0.50323683", "0.50314134", "0.5020623", "0.5000586", "0.49989066", "0.4992776", "0.49850574", "0.4983544", "0.49740452", "0.49604192", "0.49558365", "0.49416983", "0.4939879", "0.49314085", "0.4929625", "0.4921343", "0.4914265", "0.49124706", "0.49084726", "0.49050304", "0.49019", "0.48983127", "0.4897285", "0.48951846", "0.48895088", "0.48872146", "0.48802814", "0.48766023", "0.48733252", "0.4864098", "0.48622343", "0.4855258", "0.48522937", "0.48517329", "0.48468682", "0.48432454", "0.48414496", "0.48409703", "0.4835962", "0.48357415", "0.48335835", "0.4832071", "0.48236746", "0.4822694", "0.48194653", "0.48110774", "0.48084807", "0.48082036", "0.48073536", "0.48069492", "0.48033792", "0.4801226", "0.4798454", "0.47940165", "0.47895986", "0.47871298" ]
0.6276835
0
every detail page has a set of tabs at the lower half, these are dynamically loaded here we take one tab section path, fetch it and scrape the meta from it
function getTabDetail (path,id) { return limitedFetch(`${domain}${path}${id}`) .then(res => res.text()) .then(body => { var promises = [] const tabDom = new JSDOM(body); tabDom.window.document.querySelectorAll('.panel.panel-default.collapsible') .forEach( node=>scrapeTabDefaultPanel(id,node,promises) ); return Promise.all(promises); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchDetails (id) {\n return limitedFetch(`${domain}/item/Details/${id}`)\n .then(res => res.text())\n .then(body => {\n var promises = [];\n const detailDom = new JSDOM(body);\n\n // Get the primary image\n const pImg = detailDom.window.document.querySelector('#PrimaryImage');\n if (pImg) {\n promises.push( fetchImage2base64(pImg.getAttribute('data-url'), package[id], 'primaryImage') )\n }\n\n // scrape the panels at the top\n detailDom.window.document.querySelectorAll('.panel-primary')\n .forEach( node=>scrapePrimaryPanel(id,node) );\n\n // Fetch the detail tabs for this resource\n [\"/Item/_Details/\",\"/Item/_LocationDisplay/\",\"/Item/_Donor/\",\"/Item/_Appraisal_Deed/\",\"/Item/_Purchases/\",\"/Item/_Condition/\",\"/Item/_MaintenanceDisplay/\"]\n .forEach( tabpath=>{\n promises.push( getTabDetail(tabpath,id) );\n });\n\n return Promise.all(promises);\n })\n}", "function loadContent(id){\n let locationData = \"pages/\" + id + \".html\"\n let getData = new XMLHttpRequest();\n getData.onreadystatechange = function(){\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"main-display\").innerHTML = this.responseText;\n updateData(id)\n tabTracker = id \n /* Close details tab if left opened */\n closeTask()\n }\n }\n getData.open(\"GET\", locationData, true);\n getData.send();\n}", "function getTabData (url) {\n\n // Get tab data from url\n axios.get(url)\n .then( response => {\n\n // Get topics \n let topicContent = []; \n topicContent = response[\"data\"][\"topics\"];\n topicContent.unshift(\"all\")\n console.log(\"topic content:\", topicContent)\n\n // iterate through the array to create tabs\n for(i in topicContent){\n\n CreateTabs(topicContent[i]);\n\n }; \n\n })\n .catch( error => {\n console.log(\"Error:\", error); //console logs errors\n })\n\n}", "function infoTab1Info(html) {\n var featureRelId = getUrlVars()['transferId'];\n var userSiteId = getUrlVars()['touchId'];\n var featureId = getUrlVars()['mId'];\n\tvar featureName = getUrlVars()['featureName'];\n\tfeatureName = featureName.replace(/\\%20/g,' ');\n\tfeatureNameTitle(featureName);\n\t\n var url = baseUrl + 'web/web/getMenuHtml/' + featureId + '/' + featureRelId + '/' + userSiteId;\n\n var data = '';\n doAjaxCall(url, data, false, function (html) {\n if ($.isEmptyObject(html)) {\n $('#main-content').html('Sorry we have an info Tab data');\n } else {\n var backGroundColor, textColor, description;\n $.each(html, function (i, item) {\n backGroundColor = item.globalBackground;\n textColor = item.globalTextColor;\n description = item.description;\n })\n if (description == '') {\n $('#main-content').html('Sorry We Have An Empty Data');\n } else {\n $('#main-content').html(description);\n }\n $('#main-content').css({ 'background-color': '#' + backGroundColor, 'color': '#' + textColor });\n }\n getUserAppereance();\n });\n\n}", "function getTabData (url) {\n\n // Get tab data from url\n axios.get(url)\n .then( response => {\n \n // Get topics \n let topicContent = []; \n topicContent = response[\"data\"][\"topics\"];\n \n // Create all the THINGS.......\n for(i in topicContent){\n\n CreateTabs(topicContent[i]);\n\n }; \n \n })\n .catch( error => {\n console.log(\"Error:\", error); // If there is an error, log it to the console.\n })\n\n}", "function initStrategyTabs() {\n // Fetch sample, new strat, and help tab contents\n // If no page is found for a given tab, remove\n // that tab from the page\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/samplesTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#sample_strat\").html(data);\n try {\n customSampleTab();\n }\n catch(e) {}\n },\n error: function() {\n $(\"#tab_sample_strat\").parent(\"li\").remove();\n }\n });\n\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/newTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#strategy_new\").html(data);\n },\n error: function() {\n $(\"#tab_strategy_new\").parent(\"li\").remove();\n }\n });\n\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/helpTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#help\").html(data);\n try {\n customHelpTab();\n }\n catch(e) {}\n },\n error: function() {\n $(\"#tab_help\").parent(\"li\").remove();\n },\n complete: function() {\n wdk.dyk.initHelp();\n }\n });\n }", "function pageRelatedFeatures(){\n switch(data.page){\n case \"Home\": loadHomePage(); break;\n case \"Shop\": loadShopPage(); break;\n case \"Contact\": loadContactPage(); break;\n }\n}", "_loadSingleTabLoader() {\n \n for ( let item of this._mainTabElement ) {\n let singleTabLoader = new SingleTabLoader();\n singleTabLoader.init( item );\n }\n\n }", "async function handleDetailPage(request, page, pageData, label) {\n if (label === LABEL.NEW) {\n log.info('New Selectors Detected');\n }\n\n await puppeteer.injectJQuery(page);\n\n // Scrape page 1\n const firstPageResults = await getItems(request, page, pageData, label);\n await Apify.pushData(injectItemPositions(firstPageResults));\n\n // Go to page 2 and scrape\n let nextPage;\n try {\n nextPage = await page.waitForSelector('li.a-last > a');\n } catch (e) {\n log.error(`Could not extract second page - only one page returned. ${e}`);\n }\n\n if (nextPage) {\n await nextPage.click();\n await page.waitForNavigation();\n\n const secondPageResults = await getItems(request, page, pageData, label);\n const positionOffset = firstPageResults.length;\n await Apify.pushData(injectItemPositions(secondPageResults, positionOffset));\n }\n\n log.info(`Saved results from: ${await page.title()}`);\n}", "async function loadDetails() {\r\n try {\r\n setShow(true);\r\n\r\n const response = await api.get(`/etapas/${project._id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n const { data } = response;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err ', err);\r\n setErr(true);\r\n }\r\n }", "loadOneTab() { }", "async function loadParts() {\n //load header\n if (document.getElementById(\"headerLoad\")) {\n response = await fetch(\"/header.html\");\n html = await response.text();\n document.getElementById(\"headerLoad\").innerHTML = html;\n }\n\n //load footer\n if (document.getElementById(\"footerLoad\")) {\n response = await fetch(\"/footer.html\");\n html = await response.text();\n document.getElementById(\"footerLoad\").innerHTML = html;\n document.getElementById(\"fcYear\").innerHTML = new Date().getFullYear();\n }\n\n //load left pane with desciption\n if (document.getElementById(\"left\")) {\n response = await fetch(\"/description.html\");\n html = await response.text();\n document.getElementById(\"left\").innerHTML = html;\n }\n\n //load right pane with archive\n if (document.getElementById(\"right\")) {\n response = await fetch(\"/archive.html\");\n html = await response.text();\n document.getElementById(\"right\").innerHTML = html;\n }\n\n if (document.getElementById(\"archiveList\")) {\n loadArchive();\n }\n\n setipsum();\n}", "function searchPromoDetail(linkToDetailPage) {\n return nf(`${linkToDetailPage}`)\n .then(response => response.text())\n .then(body => {\n const details = {};\n const $ = cheerio.load(body);\n $('#contentpromolain2').each(function(i, element) {\n var $element = $(element);\n var $area = $element.find('.area b').text();\n var $periode = $element.find('.periode b').text();\n var $fullPoster = $element.find('.keteranganinside img').attr('src');\n details.area = $area;\n details.periode = $periode;\n details.fullPoster = BASEURL + $fullPoster;\n });\n return details;\n });\n}", "function loadAux() {\n\t\t\t\t\t var $aux = $('.aux');\n\t\t\t\t\t $aux.each(function(index) {\n\t\t\t\t\t var $this = $(this);\n\t\t\t\t\t\t var auxLink = $this.find('a');\n\t\t\t\t\t\t var auxFragment = auxLink.attr('href');\n\t\t\t\t\t\t\t var auxContent = $this.find('[role=tabpanel]');\n\t\t\t\t\t\t\t if (auxContent.size()===0 && $this.hasClass('loaded')===false) {\n\t\t\t\t\t\t\t\t loadContent(auxFragment,$this);\n\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 }", "function relatedPlaces(data) {\n $(\"#tab-places\").empty();\n\n var contentPl = '<h6>Features Associated with ' + shanti.shanti_data.feature.header + '</h6>';\n\n contentPl += '<ul class=\"related-places\">';\n $.each(data.features, function(rInd, rElm) {\n contentPl += '<li>';\n contentPl += '<a href=\"' + Settings.placesPath + '#id=' + rElm.id + '&que=tab-overview\">';\n contentPl += rElm.header;\n contentPl += '</a>';\n contentPl += '</li>';\n });\n contentPl += '</ul>';\n contentPl += '<ul id=\"places-pagination\"></ul>';\n\n var avURL = Settings.placesUrl + '/topics/' + shanti.shanti_data.feature.id + '.json';\n var total_pages = data.total_pages;\n\n contentPl += '<ul id=\"photo-pagination\" class=\"pager\">';\n contentPl += '<li class=\"first-page pager-first first\"><a href=\"' + avURL + '?page=1' + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '<li class=\"previous-page pager-previous\"><a href=\"' + avURL + '?page=1' + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '<li>PAGE</li>';\n contentPl += '<li class=\"pager-current widget\"><input type=\"text\" value=\"1\" class=\"page-input\"></li>';\n contentPl += '<li>OF ' + total_pages + '</li>';\n contentPl += '<li class=\"next-page pager-next\"><a href=\"' + avURL + '?page=2' + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '<li class=\"last-page pager-last last\"><a href=\"' + avURL + '?page=' + total_pages + '\"><i class=\"icon\"></i></a></li>';\n contentPl += '</ul>';\n contentPl += '<div class=\"paginated-spin\"><i class=\"fa fa-spinner\"></i></div>';\n\n $(\"#tab-places\").append(contentPl);\n\n //Add the event listener for the first-page element\n $(\"li.first-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n $.ajax({\n url: currentTarget,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val('1');\n $('li.previous-page a').attr('href', currentTarget);\n var nextTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1) + 2;\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the listener for the previous-page element\n $(\"li.previous-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n currentTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1);\n var newpage = parseInt($('li input.page-input').val()) - 1;\n if (newpage < 1) { newpage = 1; }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $(e.currentTarget).attr('href', previousTarget);\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the listener for the next-page element\n $(\"li.next-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n currentTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1);\n var newpage = parseInt($('li input.page-input').val()) + 1;\n if (newpage > parseInt(total_pages)) { newpage = parseInt(total_pages); }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $(e.currentTarget).attr('href', nextTarget);\n });\n });\n\n //Add the listener for the pager text input element\n $(\"li input.page-input\").change(function(e) {\n e.preventDefault();\n var currentTarget = avURL + '?page=';\n var newpage = parseInt($(this).val());\n if (newpage > parseInt(total_pages)) { newpage = parseInt(total_pages); }\n if (newpage < 1) { newpage = 1; }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the event listener for the last-page element\n $(\"li.last-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n var newpage = parseInt(total_pages);\n var previousTarget = avURL + '?page=' + (newpage - 1);\n $.ajax({\n url: currentTarget,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedPlaces)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $('li.next-page a').attr('href', currentTarget);\n });\n });\n}", "function processListPage(html, cb) {\n var $ = cheerio.load(html);\n\n var urls = [];\n\n var rowele = $('#Content div.content.block-group div h2 a').each(function(idx, ele) {\n var data = $(ele).attr('href');\n urls.push(data);\n // console.log(\"LINK DATA\", data);\n });\n processDetailUrls(urls, function(data) {\n fs.appendFileSync(process.cwd() + config.dataPath + '.json', data);\n cb();\n });\n}", "async getStoryMeta(pageHTML) {\n this.meta.title = $(\".preface h2.title\", pageHTML)\n .text()\n .trim();\n\n this.meta.authors = [$(\".preface a[rel='author']\", pageHTML).text()];\n\n this.meta.comments = [];\n $(\".preface > .summary p\", pageHTML).each((i, elem) =>\n this.meta.comments.push(\n $(elem)\n .text()\n .trim()\n )\n );\n this.meta.comments = this.meta.comments\n .join(\"\\n\\n\")\n .replace(/[\\\\$'\"]/g, \"\\\\$&\");\n }", "function getSectionDetails() {\n sections = document.querySelectorAll('section');\n for (let i = 0; i < sections.length; i ++){\n sectionHeadings.push(sections[i].dataset.navTitle);\n navIds.push(sections[i].dataset.navId);\n sectionIds.push(sections[i].id);\n }\n console.log(sectionHeadings);\n}", "parseUrl () {\r\n this.currentIndex = this.getParameter(\"index\");\r\n this.currentFolder = this.findSubnavFolderByIndex(this.currentIndex);\r\n\r\n const page = this.getParameter(\"page\");\r\n\r\n if (this.currentFolder) {\r\n const target = document.querySelector(`#${page}`);\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(this.currentIndex);\r\n } else {\r\n const target = document.querySelector(\"#flight-ops-home\");\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(0);\r\n }\r\n }", "function fetchTabs(_nextChangeId) {\n\tconst url = _nextChangeId ? `?id=${baseURL}` : baseURL;\n\tconst errorDescr = `error fetching tabs${_nextChangeId ? ` with next_change_id: ${_nextChangeId}` : '.'}`\n\n\treturn fetch(url)\n\t\t.then(json)\n\t\t.then(checkShape)\n\t\t.catch(log(errorDescr));\n}", "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n\n getTaskStatuses();\n getTasks();\n }", "function setPageMetaData(event, current, previous) {\n\t\t$scope.appNavigation.forEach((oneNavigationEntry) => {\n\t\t\toneNavigationEntry.active = false;\n\t\t\t\n\t\t\tlet entryFound = false;\n\t\t\tlet oneLink = oneNavigationEntry.url.split(\"#\");\n\t\t\tif (oneLink[0] === $scope.currentLocation) {\n\t\t\t\tif (oneLink[1] && oneLink[1] === $scope.currentLocationAnchor) {\n\t\t\t\t\tentryFound = true;\n\t\t\t\t\tactivateFromLink(oneNavigationEntry)\n\t\t\t\t}\n\t\t\t\telse if (!oneLink[1]) {\n\t\t\t\t\tentryFound = true;\n\t\t\t\t\tactivateFromLink(oneNavigationEntry)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!entryFound && oneNavigationEntry.children){\n\t\t\t\toneNavigationEntry.children.forEach((oneChildGroup) => {\n\t\t\t\t\toneChildGroup.entries.forEach((oneChildEntry) =>{\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet oneLink = oneChildEntry.url.split(\"#\");\n\t\t\t\t\t\tif (oneLink[0] === $scope.currentLocation) {\n\t\t\t\t\t\t\tif (oneLink[1] && oneLink[1] === $scope.currentLocationAnchor) {\n\t\t\t\t\t\t\t\tentryFound = true;\n\t\t\t\t\t\t\t\tactivateFromLink(oneChildEntry)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (!oneLink[1]) {\n\t\t\t\t\t\t\t\tentryFound = true;\n\t\t\t\t\t\t\t\tactivateFromLink(oneChildEntry)\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\n\t\tfunction activateFromLink(oneNavigationEntry) {\n\t\t\toneNavigationEntry.active = true;\n\t\t\t\n\t\t\tif (oneNavigationEntry.title && oneNavigationEntry.title !== '') {\n\t\t\t\tjQuery('head title').html(oneNavigationEntry.title);\n\t\t\t}\n\t\t\t\n\t\t\tif (oneNavigationEntry.keywords && oneNavigationEntry.keywords !== '') {\n\t\t\t\tjQuery('head meta[name=keywords]').attr('content', oneNavigationEntry.keywords);\n\t\t\t}\n\t\t\t\n\t\t\tif (oneNavigationEntry.description && oneNavigationEntry.description !== '') {\n\t\t\t\tjQuery('head meta[name=description]').attr('content', oneNavigationEntry.description);\n\t\t\t}\n\t\t}\n\t}", "function loadBlockPage(selectorPattern) { //selectorPattern must have format ' [selector] ul[class|id] > li > a '\n //jTab\n jQuery(selectorPattern).each(function(index) {\n var a = jQuery(this);\n\t\t\t\n a.bind(\"click\", function (evt) {\n\t\t\t\t\n\t\t\t\t//a.parent().parent().find(\"> li\").removeClass(\"ui-state-active\");\n // a.parent().addClass(\"ui-state-active\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t//uZ2RhbnxQSFA&amp;token=07fd86969878e4damp&amp;firstname&amp;getData.php\n\t\t\t\tvar params = a.attr(\"rel\").replace(/\\r\\n\\s/g,\"\").toString(); // Thay the xuong hang\n\t\t\t\t\n var splitParams = params.split(\"&\");\n var postData = \"block={\\\"\" + splitParams[0] + \"\\\":{}}\\&\"+ splitParams[1];\n var urlInput = splitParams[2] == \"''\" ? '' : splitParams[2];\n\t\t\t\tvar idBlogOutput=splitParams[0];\n\t\t\t\t//alert(postData);\n var clientCallback = function (targetID, response) {\n // \n };\n \n\t\t\t var tabContent = {};\n\n\t\t\t $.ajax({\n\t\t\t type: \"POST\",\n\t\t\t url: urlInput,\n\t\t\t dataType: \"json\",\n\t\t\t data: postData,\n\t\t\t success: function(msg){\n\t\t\t \t\n\t\t\t\t\t\n\t\t\t\t\t//tabContent[tabName] = msg.items[tabName];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \t$(\"#\"+idBlogOutput).html(msg[idBlogOutput]);\n\t\t\t\t\tloadBlockPage(selectorPattern);\n\t\t\t },error :function(err){\n\t\t\t\t\t//alert(err.message);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t\t\n return false;\n });\n });\n }", "function scrape(){\n\t\n\t//Title name\n\tscraperjs.StaticScraper.create('http://localhost/x_out.html')\n\t \t\t.scrape(function($) {\n\t \t\t return $(\"#nav a[class!='chosen']\").map(function() {\n \t\t \treturn $(this).text();\n \t\t \t}).get();\n \t\t\t}, function(text) {\n\n\t\t\tconsole.log(text);\n\t\t\tjson.topMemu = text;\n\n\t\twriteToJson(json);\n\t\t\n \t})\n\t\t.scrape(function($) {\n\t \t\t return $(\".nav_chosen div\").map(function() {\n \t\t \treturn $(this).text();\n \t\t \t}).get();\n \t\t\t}, function(text) {\n\n\t\t\tsubMemuIndex = text.length\n\t\t\tconsole.log(subMemuIndex);\n\n\t\t\tfor(var i = 0; i < subMemuIndex; i++)\n\t\t\t{\n\t\t\t\t//console.log(i);\n\t\t\t\tscraperjs.StaticScraper.create('http://localhost/x_out.html')\n\t \t\t\t\t.scrape(function($) { console.log(i);\n\t \t\t\t\t return $(\".nav_chosen div\").eq(i).find('li').map(function() {\n \t\t\t\t \treturn $(this).text();\n \t\t\t \t \t}).get();\n \t\t\t\t\t}, function(text) {\n\n\t\t\t\t\tconsole.log('index:'+ i +' ..' + text);\n\t\t\t\t})\n\t\t\t\t\t\n\t\t\t}\n\n\t})\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(6).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tconsole.log( text);\n\t})\n\n\t\n\n\n}", "function getPageInfos(){\n browser.tabs.query({active: true, currentWindow: true}, function(tabs) {\n browser.tabs.sendMessage(tabs[0].id, {infoCode: \"pageInfo\"}, function(response) {\n writeToPopup(response);\n });\n });\n}", "function onclickForTab_Discover()\n{\n //console.log('click on discover tab');\n \n if(!global_pagesLoaded.discover)\n {\n firstLoadForTab_Discover();\n }\n \n //each time setup to go here\n}", "function pageTabs_helm_set(mode) {\n\n var defaultTab = \"\";\n\n if (mode === \"loanDetails\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"LoanDetailsTab_helm\";\n } else if (mode === \"search\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"AdvancedSearchTab_helm\";\n }\n else if (mode === \"recentlyViewedMinimized\") {\n //only show recently viewed tab and disable the tab selected appearance and give it a neutral look.\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false).toggleClass(\"ui-state-active\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n }\n helm.ActiveTabId = defaultTab; //store the active tab in js property that will be accessible to other functions\n\n var $helmTabs = $(\"#Tabs_helm\");\n $helmTabs.tabs({\n // //active: Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\"), //Activate Loan Details Tab\n // //beforeActivate: optimizeIE7Rendering,\n activate: jQueryTabs_TabSelect\n });\n\n //set active jquery page tab to helm default tab.\n var activeTabIndex = Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\");\n $helmTabs.tabs({ active: activeTabIndex });\n $(\"#Tabs_HtmlList_helm\").toggleClass(\"displayNone\", false);\n \n // All Tab Content Area Div's had to be hidden initially otherwise\n // the screen would jumble around during rendering until the jquery \n // page tabs could be intialized. Unhide the tab content with this next line of code.\n $(\".jqPageTabsContent_helm\").toggleClass(\"displayNone\", false);\n }", "function investigatePage() {\r\n var rows = document.evaluate(\"//div[@class='objectinfo']\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageIDs[i] = /immo(\\d+)/.exec(rows.snapshotItem(i).id)[1];\r\n lastSeenIDs[pageIDs[i]] = new Date().getTime();\r\n }\r\n rows = document.evaluate(\"//div[@class='titel']/a\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageTitles[i] = rows.snapshotItem(i).textContent.toString();\r\n }\r\n rows = document.evaluate(\"//div[@class='adresse']\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageLocations[i] = rows.snapshotItem(i).textContent.toString();\r\n }\r\n if (lastSeenIDs) GM_setValue('lastSeenIDs',lastSeenIDs.toSource());\r\n}", "function process_page() {\r\n\tconst loadPage = function(page) {\r\n\t\tconst main = $('#mdl-layout__content');\r\n\t\tmain.html(page);\r\n\t\tprocess_accordions(main);\r\n\t\tprocess_links(main);\r\n\t\tprocess_code_lines();\r\n\t\tcomponentHandler.upgradeDom();\r\n\t\t$(\".app-loading\").fadeOut();\r\n\t}\r\n\t\r\n\tswitch (window.location.hash) {\r\n\t\tcase '':\r\n\t\tcase '#apis':\r\n\t\t\t$(\"#apis\").addClass(\"is-active\");\r\n\t\t\t$(\"#guides\").removeClass(\"is-active\");\r\n\t\t\tloadPage(compileTemplate('apis'));\r\n\t\t\tbreak;\r\n\t\tcase '#guides':\r\n\t\t\t$(\"#apis\").removeClass(\"is-active\");\r\n\t\t\t$(\"#guides\").addClass(\"is-active\");\r\n\t\t\tloadPage(compileTemplate('guides'));\r\n\t\t\tbreak;\r\n\t\tdefault:\t\r\n\t\t\tconst hash = unescape(window.location.hash.substring(1));\r\n\t\t\tconst item = MEMBERS.find(it => it.signature == hash);\r\n\t\t\tif (item) {\r\n\t\t\t\tloadPage(compileTemplate('default', item));\r\n\t\t\t} else {\r\n\t\t\t\tconst guide = GUIDES[hash];\r\n\t\t\t\tif (guide) {\r\n\t\t\t\t\tif (!guide.processed) {\r\n\t\t\t\t\t\tguide.content = process_comment(undefined, guide.content);\r\n\t\t\t\t\t\tguide.processed = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloadPage(Handlebars.compile(guide.content)());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tloadPage(compileTemplate('error'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n}", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = content.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n description = content.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('contentDisplay').innerHTML =description;\r\n //console.log(content); \r\n // access summary brute force \r\n //let summary = page[pageID].revisions[0][\"*\"][10];\r\n //console.log('SUMMARY' + summary);\r\n }", "function showTab(e) {\n console.log(\"inside showTab()\");\n /* element na koji je kliknuto, pa njegov title, moze biti welcome, B, C, CE*/\n /* kliknuti elem moze biti iz navigation ili iz tabs*/\n var selectedTab = e.target.title;\n console.log(selectedTab);\n\n if (selectedTab == \"welcome\") {\n welcomePaneShowing = true;\n console.log(\" welcome tab selected\");\n document.getElementById(\"content\").innerHTML =\n \"<h3>Click a tab to display category desription</h3>\"; /* mixing content with behaviour*/\n } else {\n welcomePaneShowing = false;\n }\n\n// set each tab's CSS class\n var tabs = document.getElementById(\"tabs\").getElementsByTagName(\"a\");\n for (var i=0; i<tabs.length; i++) {\n var currentTab = tabs[i];\n if (currentTab.title == selectedTab) {\n currentTab.className = \"active\";\n } else {\n currentTab.className = \"inactive\";\n }\n }\n\n var request = createRequest();\n if (request==null) {\n alert(\"Unable to create request\");\n return;\n }\n request.onreadystatechange = showCategory;\n request.open(\"GET\", selectedTab + \".html\", true);\n request.send(null);\n}", "function loadNavigationDetails(divId, indexString, operation, section, docViewId){\r\n\tvar divComponent = divId.substring(0,divId.lastIndexOf(\"-\")+1);\r\n\tvar activeDiv = divId.substring(divId.lastIndexOf(\"-\")+1,divId.length);\r\n\tgetElemnt(divComponent + activeDiv + \"-cell\").className=\"clsNavChildren\";\r\n\tvar i = 0;\r\n\tvar collapse = false;\r\n\tvar arrowComponent = getElemnt(divId+\"-arrow\");\r\n\tvar presentImage = arrowComponent.src;\r\n\tif(operation == 'getChildren'){\r\n\t\tvar imagePath = presentImage.substring(0,presentImage.lastIndexOf(\"/\")+1);\r\n\t\tif(presentImage && presentImage.substring(presentImage.lastIndexOf(\"/\")+1, presentImage.length) == \"right_arrow_black.gif\"){\r\n\t\t\tarrowComponent.src = imagePath + \"down_arrow_black.gif\";\r\n\t\t\tcollapse = false;\r\n\t\t} else {\r\n\t\t\tarrowComponent.src = imagePath + \"right_arrow_black.gif\";\r\n\t\t\tcollapse = true;\r\n\t\t\tgetElemnt(divComponent + activeDiv + \"-cell\").className = \"clsNavChildren\";\r\n\t\t}\r\n\t\twhile(getElemnt(divComponent + i + \"-anchor\") != null){\r\n\t\t\tif(i != activeDiv)\r\n\t\t\t{\r\n\t\t\t\tgetElemnt(divComponent + i + \"-row\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor1\").style.display = \"none\";\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tgetChildren(divId ,indexString, section, collapse);\r\n\t}\r\n\telse{\r\n\t\tvar imagePath = presentImage.substring(0,presentImage.lastIndexOf(\"/\")+1);\r\n\t\tif(presentImage.substring(presentImage.lastIndexOf(\"/\")+1, presentImage.length) == \"down_arrow_black.gif\"){\r\n\t\t\tarrowComponent.src = imagePath + \"right_arrow_black.gif\";\r\n\t\t}\r\n\t\tgetElemnt(divComponent + activeDiv + \"-cell\").className = \"selectedNodes\";\r\n\t\twhile(getElemnt(divComponent + i + \"-anchor\") != null){\r\n\t\t\tif(i != activeDiv)\r\n\t\t\t{\r\n\t\t\t\tgetElemnt(divComponent + i + \"-row\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor1\").style.display = \"none\";\r\n\t\t\t\tvar arrowComponent = getElemnt(divComponent+i+\"-arrow\");\r\n\t\t\t\tarrowComponent.src = imagePath + \"right_arrow_black.gif\";\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tvar component = getElemnt(divId);\r\n\t\tcomponent.style.display = \"none\";\r\n\t\tloadWorkArea('menu.do','NAV-MENU&docViewId='+docViewId+'&searchBy='+indexString+'&menu=' + section,'',loadNavigationGrid);\r\n\t}\r\n}", "_init() {\n var _this = this;\n\n this.$element.attr({'role': 'tablist'});\n this.$tabTitles = this.$element.find(`.${this.options.linkClass}`);\n this.$tabContent = $(`[data-tabs-content=\"${this.$element[0].id}\"]`);\n\n this.$tabTitles.each(function(){\n var $elem = $(this),\n $link = $elem.find('a'),\n isActive = $elem.hasClass(`${_this.options.linkActiveClass}`),\n hash = $link[0].hash.slice(1),\n linkId = $link[0].id ? $link[0].id : `${hash}-label`,\n $tabContent = $(`#${hash}`);\n\n $elem.attr({'role': 'presentation'});\n\n $link.attr({\n 'role': 'tab',\n 'aria-controls': hash,\n 'aria-selected': isActive,\n 'id': linkId\n });\n\n $tabContent.attr({\n 'role': 'tabpanel',\n 'aria-hidden': !isActive,\n 'aria-labelledby': linkId\n });\n\n if(isActive && _this.options.autoFocus){\n $(window).load(function() {\n $('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => {\n $link.focus();\n });\n });\n }\n });\n if(this.options.matchHeight) {\n var $images = this.$tabContent.find('img');\n\n if ($images.length) {\n Foundation.onImagesLoaded($images, this._setHeight.bind(this));\n } else {\n this._setHeight();\n }\n }\n\n //current context-bound function to open tabs on page load or history popstate\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n //need a hash and a relevant anchor in this tabset\n if(anchor.length) {\n var $link = this.$element.find('[href$=\"'+anchor+'\"]');\n if ($link.length) {\n this.selectTab($(anchor), true);\n\n //roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay);\n }\n\n /**\n * Fires when the zplugin has deeplinked at pageload\n * @event Tabs#deeplink\n */\n this.$element.trigger('deeplink.zf.tabs', [$link, $(anchor)]);\n }\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n }", "function displaySelectedCUHybridCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"cprating\")!=-1){\n obj= document.getElementById('cprating-li');\n if(obj){\n document.getElementById('cprating').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function firstLoadForTab_Discover()\n{\n //console.log('first load for discover tab');\n \n global_pagesLoaded.discover = true;\n \n //one-off setup to go here\n}", "function loadTabs() {\n\t\tvar htmlToAppend = '';\n\t\thtmlToAppend += '<ul class=\"nav nav-tabs\">';\n\t\t\n\t\tvar tabsMade = 0;\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the nav tabs for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {//if first tab add an active class to it\n\t\t\t\t\ttabsMade++;\n\t\t\t\t\thtmlToAppend +='<li class=\"active\"><a href=\"#track' + i +\n\t\t\t\t\t '\" data-toggle=\"tab\"><span class=\"instrument-name\">' + midiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t '</span></a></li>';\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend += '<li role=\"presentation\"><a href=\"#track' + i + '\" role=\"tab\" data-toggle=\"tab\"><span class=\"instrument-name\">' +\n\t\t\t\t\tmidiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t'</span><button class=\"remove-tab-button\" id=\"remove-tab' + i + '\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></button></a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</ul><div class=\"tab-content\">';\n\t\t//now add the tab panels\n\t\t\n\t\ttabsMade = 0;\n\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the tab pane for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {\n\t\t\t\t\thtmlToAppend += '<div class=\"tab-pane active\" id=\"track' + i +'\"></div>';\n\t\t\t\t\ttabsMade++;\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend+= '<div class=\"tab-pane\" id=\"track' + i +'\"></div>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</div>';\n\t\t$('.canvas').append(htmlToAppend);\n\n\t\t$('.remove-tab-button').click(function() {//add remove event to delete button\n\t\t\tdeleteInstrument(parseInt($(this).attr('id').substring(10), 10));//get index of track\n\t\t});\n\t\t\n\t}", "get overviewTab() {return browser.element(\"~Overview\");}", "function render_page_content( object ){\n\n // Function that decides whether or not to show the data table row (the one with 'tabs')\n should_show_data_table();\n\n // Hide all tabs so only one is shown at a time, or else the previous tab selection will be\n // showing\n $('#photos, #contacts, #photos, #site_links, #site_information, #lter_name').hide();\n\n $('#photos, #contacts, #photos, #site_links, #site_information, #lter_name').addClass( 'focus_table_background' );\n\n // Set all tab backgrounds to nothing\n $('.hover').removeClass('focus_hilight');\n\n // Show only the 'site_information' tab\n $(\"#site_information, #lter_name\").show();\n \n $('#table_content').addClass('table_content_border');\n\n // Set 'site info' tab to the same color as the highlight. Have to use inline css styling\n // rather than adding a class because it will not work properly in IE\n $('#site_info_tab').addClass('focus_hilight');\n\n // Inserting xml data into the html (The rest of the code in this function)\n ////////////////////////////////////\n\n // Insert site name into html \n $('#site_info').find('.site_name').html( object.attr('site_name') ); \n\n // Site Info Tab. Insert href location and target into html\n $('#site_content' ).find('.home_page').attr( { href: object.attr('home_page'), target: \"_blank\" } ); \n $('#site_content' ).find('.site_profile').attr( { href: 'http://www.lternet.edu/sites/' + object.attr('site_id').toLowerCase() , target: \"_blank\" } ); \n $('#site_content').find('.description').html( object.attr('description') ); \n\n // Photos tab. Insert image and href into html\n $('#site_content' ).find('.image').attr( { src: object.attr('image') , title: object.attr('site_id') + 'image' } ); \n $('#site_content' ).find('.gallery').attr( { href: 'http://www.lternet.edu/gallery/sites/' + object.attr('site_id') , target: \"_blank\"} ); \n\n // Contacts Tab. Insert into html\n $('#site_content' ).find('.principal').html( object.attr('principal') ); \n $('#site_content' ).find('.info_manager').html( object.attr('info_manager') ); \n $('#site_content' ).find('.primary_contact').html( object.attr('primary_contact') ); \n $('#site_content' ).find('.outreach').html( object.attr('education_contact') ); \n $('#site_content' ).find('.address1').html( object.attr('address1') ); \n $('#site_content' ).find('.address2').html( object.attr('address2') ); \n $('#site_content' ).find('.address3').html( object.attr('address3') ); \n $('#site_content' ).find('.city').html( object.attr('city') ); \n $('#site_content' ).find('.state').html( object.attr('state') ); \n $('#site_content' ).find('.zip').html( object.attr('zip') ); \n $('#site_content' ).find('.phone').html( object.attr('phone') ); \n $('#site_content' ).find('.fax').html( object.attr('fax') ); \n $('#site_content' ).find('.email').html( object.attr('email') ); \n\n // Site Links tab. Insert href and target info into html\n $('#site_content' ).find('.data_url').attr( { href: object.attr('data_url') , target: \"_blank\"} ); \n $('#site_content' ).find('.personnel_url').attr( { href: object.attr('personnel_url') , target: \"_blank\"} ); \n $('#site_content' ).find('.biblio_url').attr( { href: object.attr('biblio_url') , target: \"_blank\"} ); \n $('#site_content' ).find('.education_url').attr( { href: object.attr('education_url') , target: \"_blank\"} ); \n\n\n // Show the table data for each site. This needs to be here if we closing the table data div when a\n // user closes the associated infowindow \n $('#table_content').show();\n\n }", "async function getBedDetailsExceptPhoneNumber(link, browserInstance) {\n try {\n //open new tab\n let newTab = await browserInstance.newPage();\n //rtab = newTab;\n //visit page\n await newTab.goto(link);\n\n //click beds button\n await waitAndClick(\"#menu-item-5278\", newTab);\n\n //click on covid-19 beds\n await waitAndClick(\".card-header\", newTab);\n\n //await newTab.waitForSelector(\"#hospitals_list\", { visible: true });\n await newTab.waitForTimeout(1000);\n //retrieve current page url\n //let url = newTab.url();\n\n //retrieving details from hospital and storing them in array \n //-vacant seat\n //-hospital name\n //-timestamp\n\n function extractHospitalDataFn(selector) {\n let hospitalTable = document.getElementById(selector);\n let row = hospitalTable.querySelectorAll(\"tr\");\n let details = [];\n\n for (let i = 0; i < row.length; i++) {\n if (i % 2 == 0 && i != row.length - 1) {\n\n let hname = row[i].cells[0].textContent;\n let vacantSeat = row[i].cells[3].getElementsByTagName(\"a\")[0].textContent;\n let timestamp = row[i].cells[1].textContent;\n let vacantSeatNumber = parseInt(vacantSeat);\n if (vacantSeatNumber > 0) {\n\n details.push({ hname, vacantSeatNumber,timestamp });\n //hospital.push({ hname, vacantSeat, timestamp });\n }\n }\n }\n\n\n //console.table(details);\n return details;\n //return hospital;\n }\n return newTab.evaluate(extractHospitalDataFn, \"hospitals_list\");\n //console.log(\"hello\");\n\n }\n catch (err) {\n console.log(err);\n }\n\n}", "handleFactDeepLink() {\n if (location.hash.startsWith(\"#f-\")) {\n this.selectItem(location.hash.slice(3));\n }\n }", "function downloadCardInfo() {\n var tablePages = document.getElementsByClassName(PAGE_LIST_ELEMENT_ID)[0];\n var numPages = tablePages.childNodes.length;\n\n var url = window.location.href\n var cubeId = CUBE_ID_REGEX.exec(url)[1]; // The first matched group is at index 1.\n\n downloadCardPage('', 1, numPages, cubeId);\n}", "function generatePage(tab){\n\t\t\tif (tab == \"education\"){\n\t\t\t\tcurrent_embedded_tab = \"total\";\n\t\t\t\ttyperfunction(defaultuniversity, 'university', 2, function() {\n\t\t\t\t\tregister_embeddedevents(module_results)\n\t\t\t\t})();\n\t\t\t\ttyperfunction(alevels, 'alevel',10)();\n\t\t\t\ttyperfunction(gcses, 'gcses',10)();\n\t\t\t}\n\t\t\telse if (tab == \"about\"){\n\t\t\t\ttyperfunction(about, 'about-info',5)();\n\t\t\t\ttyperfunction(biography, 'biography', 5)();\n\t\t\t}\n\t\t\telse if (tab == \"contact\"){\n\t\t\t\ttyperfunction(contact, 'contact-info',5,register_contactevents)();\n\t\t\t}\n\t\t\telse if (tab == \"experience\"){\n\t\t\t\tcurrent_embedded_tab = \"warwicktech\";\n\t\t\t\ttyperfunction(defaultexperience, 'experience-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(experiences)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"projects\"){\n\t\t\t\tcurrent_embedded_tab = \"year4\";\n\t\t\t\ttyperfunction(defaultproject, 'project-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(projects)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"loading\"){\n\t\t\t\tfillLoadingBar(34,100)();\n\t\t\t\ttyperfunction(terminal_info, 'terminal-info', 10)();\n\t\t\t\ttyperfunction(boot_text,'boot-loading', 10)();\n\t\t\t\ttyperfunction(boot_progress, 'boot-progress',100, loadSplashScreen)();\n\t\t\t}\n\t\t\telse if (tab == \"splash\"){\n\t\t\t\ttyperfunction(splash_text, \"splash-text\",50)();\n\t\t\t}\n\t\t}", "function parseDetailContent(html) {\n var {\n JSDOM\n } = jsdom;\n var dom = new JSDOM(html);\n var $ = (require('jquery'))(dom.window);\n\n // Handling text formatting and filtering: regex, trim, etc.\n var id, title, verses;\n var content = [];\n\n // Assign variables\n verses = $('section#content .lyrics .verse');\n for (var i = 0; i < verses.length; i++) {\n\n // Get verse lines\n var lines = $(verses[i]).children('.indent0');\n\n var verse = '';\n for (j = 0; j < lines.length; j++) {\n // Append lines\n verse = verse + $(lines[j]).text() + \"\\n\";\n }\n\n // Add row to array\n content.push((i + 1) + \". \" + verse);\n }\n\n // Build Song object\n var song = {\n id: $('section#content h1 strong').text().replace(/\\./, '').trim(),\n title: $('section#content h1').text().replace(/[0-9]{0,4}\\./, '').trim(),\n content: content,\n }\n return new Promise((resolve, reject) => resolve(song));\n}", "function addTabToPage() {\n\tfor (let index = 0; index < categories.length; index++) {\n\t\tpopulatePrototype(mainNavTabs, categories[index], protoItemLinkTab);\t\n\t}\n}", "function setPage() {\n setNavigation();\n $('#tabs').tabs();\n resetGeneralDetailsForm();\n resetReportBugsForm();\n getAdminDetails();\n loadTermsOfUseDetails();\n}", "function managePageJSON(data) {\n var j;\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var document_id = null;\n for (var key in obj) {\n if (key === \"DocumentId\") {\n document_id = data[i][key];\n }\n }\n\n if (!data[i].Contents) {\n continue;\n }\n var html = $.parseHTML(data[i].Contents);\n var hrefNodes = $(html).find(\"[href]\");\n for (j = 0; j < hrefNodes.length; j++) {\n var node = hrefNodes[j];\n if (!node.attributes[\"href\"]) {\n continue;\n }\n var hrefValue = node.attributes[\"href\"].value;\n if (hrefValue.toLowerCase().indexOf(\"http\") === -1) {\n var newStr = '';\n var splittedArray = '';\n if (hrefValue.toLowerCase().indexOf(\"$filter=contains\") > -1) {\n\n splittedArray = hrefValue.split(\"'\");\n // //var pageTitle = null;\n // //if (splittedArray[1]) {\n // // pageTitle = splittedArray[1];\n // // pageTitle = pageTitle.replace(/ /g, \"_\");\n // //}\n\n // //var docId = null;\n // //if (splittedArray[3]) {\n // // docId = splittedArray[3];\n // //}\n\n // //var pageId = docId + \"_\" + pageTitle;\n // //newStr = \"#/document/\" + docId + \"/page/\" + pageId;\n // //hrefNodes[j].attributes[\"href\"].value = newStr;\n } else {\n splittedArray = hrefValue.split(\"'\");\n var page_id = null;\n if (splittedArray[1]) {\n page_id = splittedArray[1];\n }\n newStr = \"#/document/\" + document_id + \"/page/\" + page_id;\n\n hrefNodes[j].attributes[\"href\"].value = newStr;\n }\n }\n }\n\n //Re-assign to data\n var htmlStr = \"\";\n for (j = 0; j < html.length; j++) {\n if (html[j].nodeName === \"#text\") {\n continue;\n }\n if (html[j].nodeName === \"META\" || html[j].nodeName === \"LINK\") {\n continue;\n }\n var ss = html[j].outerHTML;\n htmlStr += ss;\n }\n data[i].Contents = htmlStr;\n }\n return data;\n }", "function showjson (data){\n if(queryString.length) {\n $('.container').empty();\n } else {\n $('.container').load('../KIITimelineCS/includes/landingPage.html')\n }\n $.each(data, function (index, value, n) {\n\n while (index == 'request'){\n // console.log(value);\n //console.log(value.Chapter);\n //console.log(value.Section);\n $('#chapter').append('<li>Chapter:'+value.Chapter+' </li>');\n \n break;\n };\n\n while (index === 'Data'){\n //GET SECTION INFORMATION\n var SectionContent=value.Content;\n for (var SC=0; SC<SectionContent.length; SC++){\n mySectionTitle=SectionContent[SC].SectionTitle;\n mySectionNumber=SectionContent[SC].SectionNumber;\n mySectionDate=SectionContent[SC].SectionDate;\n mySectionIntro=SectionContent[SC].SectionIntro;\n mySectionHero=SectionContent[SC].SectionHero;\n var mySectionID = mySectionTitle.replace(/ /g, ''),\n mySectionPath = mySectionTitle.replace(/ /g, '_'),\n mySectionIDReplace = mySectionID.replace(/'/g, '');\n $('.container').attr('id', mySectionIDReplace);\n $('.container').append('<section class=\"sectionIntro col-16 row-15\"><!-- sectionInterior --><div class=\"sectionTitle posX-1 posY-1 abs\"><div><p class=\"sectionYear\">' + mySectionDate + '</p><p class=\"chapterName\">' + Chapter + '</p></div><h1>' + mySectionTitle + '</h1></div></section>')\n // $('#section').append('<h3>'+mySectionIntro+' intro testing</h3>');\n\n \n ////////////////////////////////////////\n var myModules = value.Content[SC].Modules,\n dataStore = [];\n // LOAD MODULE HTML INTO .CONTAINER\n for (var M = 0; M < myModules.length; M++) {\n myModuleTitle = myModules[M].Module_Title;\n myModuleYear = myModules[M].Module_Year;\n myModuleOrder = myModules[M].Module_Order;\n myModuleSubtitle=myModules[M].Module_Subtitle;\n myModuleCopy=myModules[M].Module_Copy;\n myModuleType=myModules[M].Module_Type;\n myModulePosX=myModules[M].PosX;\n myModulePosY=myModules[M].PosY;\n myModuleCol=myModules[M].Col;\n myModuleRow=myModules[M].Row;\n moduleLoad=myModules[M].Module_Type;\n\n var n = M,\n myMedias = value.Content[SC].Modules[M].Medias,\n loadModules = 'modules/' + mySectionPath + '/' + moduleLoad + '.html',\n n = M + 1,\n appendModuleOrder = myModules[M].Module_Order,\n appendModuleName = myModules[M].Module_Type,\n appendModuleHighlight = myModules[M].Module_Highlight,\n length = myModules.length;\n\n // APPEND TEXT TO THE DOM\n function appendText(){\n \n // CHECK TO SEE IF JSON HAS ATTRIBUTES ELSE REMOVE\n if (myModuleTitle === 'undefined' || myModuleTitle === 'null') {\n myModuleTitle = '';\n }\n if (myModuleYear === 'undefined' || myModuleYear === 0) {\n myModuleYear = '';\n }\n if (myModuleCopy === 'undefined' || myModuleCopy === 'null') {\n myModuleCopy = '';\n }\n $('#' + appendModuleOrder).append('<h1>' + myModuleTitle + '</h1>' + '<p class=\"date\">' + myModuleYear +'</p>' + myModuleCopy);\n\n } \n\n //ITTERATE THROUGH MEDIA\n function myMediaFunction(){\n\n if(myModules[M].hasOwnProperty('Medias')) {\n\n for (var MM= 0; MM < myMedias.length; MM++){\n // DEFINE UNIVERSAL MEDIA TYPES\n myMediaTitle = myMedias[MM].Media_Title;\n myMediaType = myMedias[MM].Media_Type;\n myMediaPath = myMedias[MM].Option_File;\n myMediaDescription = myMedias[MM].Media_Description;\n myMediaCopyright = myMedias[MM].Media_Copyright;\n\n if (myMediaCopyright === 'undefined' || myMediaCopyright === 'null') {\n myModuleTitle = ' ';\n }\n\n function appendPhoto(){\n\n var mySectionIDReplace = mySectionID.replace(/'/g, '');\n // console.log(mySectionIDTwo)\n if($(window).width() > 768) {\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + mySectionIDReplace + '/' + myMediaPath + '\" alt=\"' + myMediaTitle + ' | ' + myMediaDescription + ' | ' + myMediaCopyright + '\" />');\n } else {\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + mySectionIDTwo + '/Mobile_' + myMediaPath + '\" alt=\"' + myMediaTitle + ' | ' + myMediaDescription + ' | ' + myMediaCopyright + '\" />');\n }\n\n }\n\n function appendGraphic(){\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + mySectionID + '/' + myMediaPath + '\" alt=\"' + myMediaTitle + ' | ' + myMediaDescription + ' | ' + myMediaCopyright + '\" />');\n }\n\n function appendAudio(){\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + myMediaPath + ' | ' + myMediaCopyright + '\" />');\n }\n\n function appendVideo(){\n myVideoPath = myMedias[MM].Option_Link;\n $('#' + appendModuleOrder).append('<iframe src=\"http://video.kochcreativegroupdev.com/players/' + myVideoPath + '-C0ABUaWy.html\" frameborder=\"0\" scrolling=\"auto\" allowfullscreen></iframe>');\n }\n\n function appendSvgCode(){\n mySVGPath = myMedias[MM].Option_SVG_Code;\n $('#' + appendModuleOrder).append(mySVGPath);\n }\n\n function appendJsCode(){\n myJSPath = myMedias[MM].Option_JS_Code;\n $('body').append('<script>' + myJSPath + '</script>');\n }\n\n // RUN SWITCH STATEMENT TO CHANGE HOW MEDIA IS UPLOADED BASED UPON MEDIA TYPE\n switch (myMediaType) {\n case 'photo':\n appendPhoto();\n break;\n\n case 'graphic':\n appendGraphic();\n break;\n\n case 'audio':\n appendAudio();\n break;\n\n case 'video':\n appendVideo();\n break;\n\n case 'svg-code':\n appendSvgCode();\n break;\n\n case 'js-code':\n appendJsCode();\n break;\n }\n\n }\n }\n // GIVES RULE TO FUNCTION TO ENSURE IT RUNS IN ABOVE IF STATEMENTS\n var p = true;\n }\n\n // LOAD IN SECTION MODULES\n function loadMyModules(){\n var module = $('#' + appendModuleOrder);\n\n // APPEND PARENT DIVS\n $('.container').append('<section id=\"' + appendModuleOrder + '\" class=\"module ' + appendModuleName + ' posX-' + myModulePosX + ' ' + 'posY-' + myModulePosY + ' ' + 'col-' + myModuleCol + ' ' + 'row-' + myModuleRow + ' ' + appendModuleHighlight + '\"></section>');\n\n // IF MODULE EXISTS RUN TEXT FUNCTION TO APPEND TEXT\n if($('#' + appendModuleOrder).length) {\n appendText();\n\n // IF MODULE H1 TEXT EXISTS RUN MEDIA FUNCTION\n if($('#' + appendModuleOrder).find('h1').length) {\n myMediaFunction();\n\n // IF MEDIA FUNCTION IS FINSIHED RUN RE-ORDER function\n if(p = true) {\n window[appendModuleName]();\n } else {\n alert('Please refresh your page');\n }\n\n } else {\n alert('Please refresh your page');\n }\n } else {\n alert('Please refresh your page');\n }\n\n\n } loadMyModules();\n\n }\n\n }\n\n break;\n };\n });\n }", "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n\n getAlerts();\n }", "mainPageCheerio(data) {\n return new Promise((resolve, reject) => {\n const $ = cheerio.load(data);\n const arr = [];\n $('a', '.browseAirlines').each((i, e) => {\n const item = $(e).attr('href');\n arr.push(item);\n });\n resolve(arr);\n });\n }", "function assignTabs(identifier){\n\n var locations = window.common.locations();\n var locIndex = window.common.getLocationIndex(identifier);\n\n //do this statically to ensure consistency\n switch(locIndex){\n case 0: $(\"#tab-one\").val(locations[0].name); //set location name in tab hidden input\n $(\"#tab-two\").val(locations[1].name);\n $(\"#tab-three\").val(locations[2].name);\n $(\"#tab-four\").val(locations[3].name);\n $(\"#tab-five\").val(locations[4].name);\n $(\"#tab1-label\").html(locations[0].label); //set labels on tabs\n $(\"#tab2-label\").html(locations[1].label);\n $(\"#tab3-label\").html(locations[2].label);\n $(\"#tab4-label\").html(locations[3].label);\n $(\"#tab5-label\").html(locations[4].label);\n var url = locations[0].background;\n $(\"#tab-background\").css(\"background-image\", \"url(\"+url+\")\");\n break;\n case 1: $(\"#tab-one\").val(locations[1].name);\n $(\"#tab-two\").val(locations[0].name);\n $(\"#tab-three\").val(locations[2].name);\n $(\"#tab-four\").val(locations[3].name);\n $(\"#tab-five\").val(locations[4].name);\n $(\"#tab1-label\").html(locations[1].label);\n $(\"#tab2-label\").html(locations[0].label);\n $(\"#tab3-label\").html(locations[2].label);\n $(\"#tab4-label\").html(locations[3].label);\n $(\"#tab5-label\").html(locations[4].label);\n var url = locations[1].background;\n $(\"#tab-background\").css(\"background-image\", \"url(\"+url+\")\");\n break;\n case 2: $(\"#tab-one\").val(locations[2].name);\n $(\"#tab-two\").val(locations[0].name);\n $(\"#tab-three\").val(locations[1].name);\n $(\"#tab-four\").val(locations[3].name);\n $(\"#tab-five\").val(locations[4].name);\n $(\"#tab1-label\").html(locations[2].label);\n $(\"#tab2-label\").html(locations[0].label);\n $(\"#tab3-label\").html(locations[1].label);\n $(\"#tab4-label\").html(locations[3].label);\n $(\"#tab5-label\").html(locations[4].label);\n var url = locations[2].background;\n $(\"#tab-background\").css(\"background-image\", \"url(\"+url+\")\");\n break;\n case 3: $(\"#tab-one\").val(locations[3].name);\n $(\"#tab-two\").val(locations[0].name);\n $(\"#tab-three\").val(locations[1].name);\n $(\"#tab-four\").val(locations[2].name);\n $(\"#tab-five\").val(locations[4].name);\n $(\"#tab1-label\").html(locations[3].label);\n $(\"#tab2-label\").html(locations[0].label);\n $(\"#tab3-label\").html(locations[1].label);\n $(\"#tab4-label\").html(locations[2].label);\n $(\"#tab5-label\").html(locations[4].label);\n var url = locations[3].background;\n $(\"#tab-background\").css(\"background-image\", \"url(\"+url+\")\");\n break;\n case 4: $(\"#tab-one\").val(locations[4].name);\n $(\"#tab-two\").val(locations[0].name);\n $(\"#tab-three\").val(locations[1].name);\n $(\"#tab-four\").val(locations[2].name);\n $(\"#tab-five\").val(locations[3].name);\n $(\"#tab1-label\").html(locations[4].label);\n $(\"#tab2-label\").html(locations[0].label);\n $(\"#tab3-label\").html(locations[1].label);\n $(\"#tab4-label\").html(locations[2].label);\n $(\"#tab5-label\").html(locations[3].label);\n var url = locations[4].background;\n $(\"#tab-background\").css(\"background-image\", \"url(\"+url+\")\");\n break;\n default: console.log(\"tabs not assigned!\");\n return;\n }\n //set active tab\n $( \"#location_tabs\" ).tabs().tabs({ active: 0 });\n}", "function fill_data(ele) {\n var p_tag = ele.children('p.tab_type');\n var meta_title = ele.children('h3').text();\n var meta_desc = ele.children('p.meta_desc').text();\n var meta_date = p_tag.children('span.type_latest').text();\n var meta_download = p_tag.children('span.type_hot').text();\n var meta_likes = p_tag.children('span.type_favorite').text();\n\n $('#theme_detail_panel h3').text(meta_title);\n $('#theme_detail_panel p').text(meta_desc);\n $('#theme_detail_panel ul li.info_date').text(meta_date);\n $('#theme_detail_panel ul li.info_download').text(meta_download);\n $('#theme_detail_panel ul li.info_fb').text(meta_likes);\n\n }", "function parseDetails(data, releaseName) {\n var output = {};\n if ('detailsSelectors' in config) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(data.data, \"text/html\");\n var selectors = config.detailsSelectors;\n var container = doc.querySelector(selectors.detailsContainer);\n //console.debug('detailscontainer',container)\n var magnet = getPropertyForSelector(container, selectors.magnetUrl);\n var magnetHash = null;\n if (magnet) {\n output.magnetUrl = magnet;\n magnetHash = output.magnetUrl.match(/([0-9ABCDEFabcdef]{40})/);\n }\n var torrent = getPropertyForSelector(container, selectors.torrentUrl);\n if (torrent) {\n output.torrentUrl = (torrent.startsWith('http')) ? torrent : config.mirror + torrent;\n } else if (magnetHash && magnetHash.length) {\n output.torrentUrl = 'http://itorrents.org/torrent/' + magnetHash[0].toUpperCase() + '.torrent?title=' + encodeURIComponent(releaseName.trim());\n }\n }\n //console.debug('parseDetails', config.mirror, output);\n return output;\n }", "grabMALData(tab){\n switch(tab){\n // Both include; have this go into one of them\n case 'related':\n // Characters, staff, themes, related\n case 'cast':\n return MALfetchCAST(this.state.MALdata.link || this.state.MALdata.id).then((data) => {\n this.setState({\n MALcast: {\n characters: data.character,\n staff: data.staff\n },\n MALthemes: [data.opening_theme, data.ending_theme],\n MALrelated: data.related\n })\n })\n break;\n // Episodes, themes, related\n case 'episodes':\n return MALfetchEP(this.state.MALdata.link || this.state.MALdata.id).then((data) => {\n this.setState({\n MALepisodes: data.episode,\n MALthemes: [data.opening_theme, data.ending_theme],\n MALrelated: data.related\n })\n })\n break;\n }\n\n }", "function thememascot_tab() {\n var tpl_tab_height;\n $(document.body).on('click', '.tpl-minimal-tabs > li > a', function(e) {\n if (!($(this).parent(\"li\").hasClass(\"active\"))) {\n tpl_tab_height = $(\".tpl-minimal-tabs-cont > .tab-pane\").filter($(this).attr(\"href\")).height();\n $(\".tpl-minimal-tabs-cont\").animate({\n height: tpl_tab_height\n }, function() {\n $(\".tpl-minimal-tabs-cont\").css(\"height\", \"auto\");\n });\n }\n });\n\n $(document.body).on('click', '.tab-slider .nav.nav-pills a', function(e) {\n $(this).parent(\"div\").parent(\"div\").find('a').removeClass('active');\n $(this).addClass('active');\n\n var hash_offset = $($(this).data('parent')).offset().top;\n console.log(hash_offset);\n $('html, body').stop().animate({\n scrollTop: hash_offset - $('.header-nav').outerHeight()\n }, 800, 'easeInOutExpo');\n });\n }", "constructor(tabContent, info, tab) {\n this.tabContent = document.querySelectorAll(tabContent);\n this.info = document.querySelector(info);\n this.tab = document.querySelectorAll(tab);\n this.hideTabContent(1);\n }", "function LoadPageContent() {\n switch (document.title) {\n case \"Home\":\n LoadHomePage();\n break;\n\n case \"Projects\":\n LoadProjectsPage();\n break;\n\n case \"Contact\":\n LoadContactPage();\n break;\n }\n}", "function getPages()\n{\n\t//add each page to view in app\n\t//Examples:\n\t//for adding a header:\n\t////\"header\":{\n\t////\t\"url\":\"pages/general/header.html\",\n\t////\t\"left\":\"<a></a>\",\n\t////\t\"center\":\"<a></a>\",\n\t////\t\"right\":\"<a></a>\"\n\t////}\n\t//for adding a panel:\n\t////\"leftPanel\":{\n\t////\t\"id\":\"nav-panel\",\n\t////\t\"url\":\"pages/general/left_panel.html\"\n\t////}\n\t//for adding dialogs, you can add more then one\n\t////\"popup\":[\n\t//// {\n\t//// \t \"url\":\"pages/general/popup.html\",\n\t//// \t \"id\":\"dialog\", \n\t//// \t \"header\":\"myHeader\", \n\t//// \t \"title\":\"Hi Dialog!\", \n\t//// \t \"content\":\"You have to insert your own content here\", \n\t//// \t \"okButton\":{\"action\":\"alert('ok button action');\",\"location\":\"#login\",\"text\":\"OK\"}, \n\t//// \t \"cancelButton\":{\"action\":\"alert('cancel button action');\",\"location\":\"\",\"text\":\"Cancel\"}\n\t//// }\n\t//// ]\n\treturn [\n\t\t\t{\"id\":\"profile\", \"url\":\"pages/profile/user.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aUser'>User</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateProfile(); setSGMMDataTransaction(); saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"profileNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"mechanic\", \"url\":\"pages/profile/mechanic.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMechanical'>Mecanico</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveMechanicData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"mechanicNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"medical\", \"url\":\"pages/profile/medical.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMedical'>Medicos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"medicalNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"policiesContent\", \"url\":\"pages/policy/policiesContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a tag='a' lng='vehicles' onClick='backPolicy();' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Vehicles</a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicle'>Vehicle</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validPolicy();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\" \n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"showPolicies\", \"url\":\"pages/policy/showPolicies.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicles'>Vehicles</h2>\",\n\t\t\t \t\"right\":\"<a onClick='validNewPolicy();' tag='a' id='save' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"policiesNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"contactsContent\", \"url\":\"pages/contacts/contactsContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#showContacts' tag='a' id='aContacts' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Contactos</a>\",\n\t\t\t \t\"center\":\"<h2 id='aContact'>Contacto</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateContact();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t}, \n\t\t\t{\"id\":\"showContacts\", \"url\":\"pages/contacts/showContacts.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aContacts'>Contactos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validNewContact();' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sContactsNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t}, \n\t\t\t{\"id\":\"showInsurance\", \"url\":\"pages/contacts/insurance.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aInsurances'>Aseguradoras</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sInsuranceNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"initial\", \"url\":\"pages/initial.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='report'>Reportar</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelInitial\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinDetails\", \"url\":\"pages/sinisters/details.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Reportar</a>\",\n\t\t\t \t\"center\":\"<h2 lng='pictures'>Fotos</h2>\",\n\t\t\t \t\"right\":\"<a href='#' onclick='enviarExtras();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-left ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinisterList\", \"url\":\"pages/sinisters/sinisterList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='sinisters'>Siniestros</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelSinList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"theftsList\", \"url\":\"pages/sinisters/theftsList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='thefts'>Robos</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"consultSinister\", \"url\":\"pages/sinisters/consultSinister.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>List</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Details</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"signup\", \"url\":\"pages/account/signup.html\"\n\t\t\t},\n\t\t\t{\"id\":\"login\", \"url\":\"pages/account/login.html\"\n\t\t\t},\n\t\t\t{\"id\":\"signin\", \"url\":\"pages/account/signin.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_a\", \"url\":\"pages/account/features_a.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_b\", \"url\":\"pages/account/features_b.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_c\", \"url\":\"pages/account/features_c.html\"\n\t\t\t},\n\t\t\t{\"id\":\"options\", \"url\":\"pages/options/options.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='options'>Options</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"about\", \"url\":\"pages/options/about.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>options</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>About</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"map\", \"url\":\"pages/sinisters/map.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Location</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"report\", \"url\":\"pages/sinisters/report.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 id='titleReport' lng='details'>R.Type</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t}\n\t ];\n\t\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 loadTab() {\n let tab = this;\n location.href = tab.href;\n\n if(!loadedTab[tab.getAttribute('href')]){\n loadedTab[tab.getAttribute('href')] = true;\n\n let route = tab.getAttribute('data-route'),\n target = document.getElementById(tab.getAttribute('href').replace('#','')),\n callback = tab.getAttribute('data-callback');\n\n ajaxRouter(route,target, callback);\n\n }\n}", "function processTabHash(hash)\n {\n if (hash.indexOf(\"#tab-\") === 0) {\n //we want to visit specific tab\n var tab = $('a[href=\"' + hash + '\"]');\n\n if (!tab.length) {\n return;\n }\n\n var target = tab.closest(\".tabs-container\").prev();\n $('html, body').animate({\n scrollTop: target.offset().top\n }, 1000, function () {\n window.location.hash = hash;\n });\n\n tab.click();\n }\n\n var target = $(\".tabs-container > .tab\").find(hash);\n if (!target.length) {\n //cant find elem with this id in any tabs\n return;\n }\n\n //we want to visit content inside a tab\n var tab = target.closest(\".tab-content\");\n var tabId = tab.attr(\"id\");\n var tabMenuItem = tab.parent().prev().find('a[href=\"#' + tabId + '\"]').parent();\n\n tab.show().siblings().hide();\n tabMenuItem.addClass('active').siblings().removeClass('active');\n\n $('html, body').animate({\n scrollTop: target.offset().top\n }, 1000, function () {\n window.location.hash = hash;\n });\n }", "function makeDetailHtml(data){\r\n var count = 0;\r\n var i = 0;\r\n var html = '<div style=\"display: none; \" class=\"detail_info\" id=\"detail_info_' + data.index + '\">'\r\n // id\r\n html += '<p class=\"detail_id\">id: DOID:' + data.info.id + '</p>';\r\n // name\r\n html += '<p class=\"detail_name\">name: ' + data.info.name + '</p>';\r\n //def\r\n if (data.info.definition != null){\r\n // html += '<p class=\"detail_def\">def: ' + data.info.definition + '</p>';\r\n var s=data.info.definition;\r\n if(s.match('url')){\r\n var t1=s.substring(s.lastIndexOf('[')+1,s.lastIndexOf(']'));\r\n var t2=s.substring(0,s.lastIndexOf('['));\r\n var txt=t2.substring(1,t2.length-2);\r\n html += '<p class=\"detail_def\">def: '+ txt+'url:';\r\n if(t1.match(',')){\r\n var t=t1.split(',');\r\n count=t.length;\r\n for(i=0;i < count;i++){\r\n if(t[i].match('http')){\r\n html+='<a href=\"'+makeUrl(t[i])+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t[i])+'</a>'+(i==(count-1)? '&nbsp;':'&nbsp;|&nbsp;'); \r\n }\r\n } \r\n }else{\r\n html +='<a href=\"'+makeUrl(t1)+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t1)+'</a>';\r\n }\r\n html+='</p>';\r\n }\r\n } \r\n // alt_id\r\n if (data.info.alt_ids != null){\r\n count = data.info.alt_ids.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_alt_id\">alt_id: DOID:' + data.info.alt_ids[i].alt_id + '</p>';\r\n }\r\n } \r\n // subset\r\n if (data.info.subsets != null){\r\n count = data.info.subsets.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_subset\">subset: ' + data.info.subsets[i].subset + '</p>';\r\n }\r\n }\r\n // synonym\r\n if (data.info.synonyms != null){\r\n count = data.info.synonyms.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_synonym\">synonym: ' + data.info.synonyms[i].synonym + '</p>';\r\n }\r\n } \r\n // xref\r\n if (data.info.xrefs != null){\r\n count = data.info.xrefs.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_xref\">xref: ' + data.info.xrefs[i].xref_name + ':' + data.info.xrefs[i].xref_value + '</p>';\r\n }\r\n } \r\n // relations\r\n if (data.info.relations != null){\r\n count = data.info.relations.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_relation\">' + data.info.relations[i].relation + ': ' + data.info.relations[i].term2_id + '</p>';\r\n }\r\n }\r\n html += '</div>';\r\n return html;\r\n}", "function relatedResources(data) {\n var $tabRelated = $(\"#tab-subjects\");\n $tabRelated.empty();\n $tabRelated.append('<h6>' + shanti.shanti_data.feature.header + '</h6>');\n var contentR = '<ul class=\"list-unstyled list-group\">';\n $.each(data.feature_relation_types, function(rInd, rElm) {\n contentR += '<li class=\"list-group-item\">' + capitaliseFirstLetter(rElm.label) + \" (\" + rElm.features.length + \"):\";\n contentR += '<ul class=\"list-group\">';\n $.each(rElm.features, function(rrInd, rrElm) {\n contentR += '<li class=\"list-group-item\"><a href=\"#id=' + rrElm.id + '&que=tab-overview\">' + rrElm.header + ' (From the General Perspective)</a></li>';\n });\n contentR += '</ul>';\n contentR += '</li>';\n });\n contentR += '</ul>';\n $tabRelated.append(contentR);\n}", "changePage(e) {\n e.preventDefault();\n const page = e.target.dataset.page;\n const $btn = e.target.parentElement.parentElement.parentElement.dataset.id;\n const page_url = `/?page=${page}`;\n\n if ($btn === \"1\") {\n fetch(page_url)\n .then(response => response.text())\n .then(text => {\n const parser = new DOMParser();\n const htmlDocument = parser.parseFromString(text, \"text/html\");\n const section = htmlDocument.documentElement.querySelector(\"div.help--slides:nth-child(3)\").innerHTML;\n e.target.parentElement.parentElement.parentElement.innerHTML = section\n });\n } else if ($btn === \"2\") {\n fetch(page_url)\n .then(response => response.text())\n .then(text => {\n const parser = new DOMParser();\n const htmlDocument = parser.parseFromString(text, \"text/html\");\n const section = htmlDocument.documentElement.querySelector(\"div.help--slides:nth-child(4)\").innerHTML;\n e.target.parentElement.parentElement.parentElement.innerHTML = section\n });\n } else if ($btn === \"3\") {\n fetch(page_url)\n .then(response => response.text())\n .then(text => {\n const parser = new DOMParser();\n const htmlDocument = parser.parseFromString(text, \"text/html\");\n const section = htmlDocument.documentElement.querySelector(\"div.help--slides:nth-child(5)\").innerHTML;\n e.target.parentElement.parentElement.parentElement.innerHTML = section\n });\n }\n }", "function SetHeaders(container) {\n let content = container.getElementsByClassName('content')\n let els = container.childNodes;\n console.log(content)\n if (content.length > 0){\n content = content[0]\n els = content.childNodes;\n }\n for (let i = 0; i < els.length; i++) {\n // Only apply this code block to h1, h2, etc\n if (typeof els[i].tagName === 'undefined' || els[i].tagName[0] != 'H' || els[i].tagName == 'HR' ) {\n continue;\n }\n\n // iterate\n let n = 1;\n\n // Test if page is open already in another tab\n anchor_id = els[i].id + '-anchor';\n if (document.getElementById(anchor_id)) {\n let loop = true;\n while (loop) {\n if (document.getElementById(anchor_id + '_' + n)) {\n n++;\n }\n else {\n break;\n }\n }\n anchor_id += '_' + n;\n }\n\n els[i].anchor_id = anchor_id;\n\n // Add link icon + a href to the header\n let href = window.location.origin + container.url + '#!' + els[i].id;\n els[i].innerHTML = '<a id=\"' + anchor_id + '\" class=\"anchor\" href=\"' + href + '\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z\"></path></svg></a>\\n' + els[i].innerHTML\n\n // body onload is not called when staying within the page\n // we need to call the load_page() function manually\n let href_el = document.getElementById(anchor_id);\n href_el.onclick = function () {\n window.location.replace(this.href);\n load_page(0);\n }\n\n // Show/hide link icon\n els[i].onmouseover = function () {\n document.getElementById(this.anchor_id).style.visibility = 'visible';\n };\n els[i].onmouseleave = function () {\n document.getElementById(this.anchor_id).style.visibility = 'hidden';\n };\n }\n}", "function displaySelectedCUHybridPortfolioCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"cprating\")!=-1){\n obj= document.getElementById('cprating-li');\n if(obj){\n document.getElementById('cprating').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"accountrating\")!=-1){\n obj= document.getElementById('accountrating-li');\n if(obj){\n document.getElementById('accountrating').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function getInfoContent(infoSection) {\n // API Fetch\n fetch(\n \"https://cdn.contentful.com/spaces/9635uuvwn9dq/environments/master/entries?access_token=cgtQv23ag7qZw92QlPnJwslq6vWfK8sDwB8fNk62QTI&content_type=presentation\"\n )\n .then((resp) => resp.json())\n .then((data) => processInfo(data, infoSection));\n}", "function prepareAboutTab(){\n populateAboutVersionInformation()\n populateReleaseNotes()\n}", "_init() {\n this.$element.attr('role', 'tablist');\n this.$tabs = this.$element.children('[data-accordion-item]');\n\n this.$tabs.each(function(idx, el) {\n var $el = $(el),\n $content = $el.children('[data-tab-content]'),\n id = $content[0].id || Foundation.GetYoDigits(6, 'accordion'),\n linkId = el.id || `${id}-label`;\n\n $el.find('a:first').attr({\n 'aria-controls': id,\n 'role': 'tab',\n 'id': linkId,\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $content.attr({'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});\n });\n var $initActive = this.$element.find('.is-active').children('[data-tab-content]');\n this.firstTimeInit = true;\n if($initActive.length){\n this.down($initActive, this.firstTimeInit);\n this.firstTimeInit = false;\n }\n\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n //need a hash and a relevant anchor in this tabset\n if(anchor.length) {\n var $link = this.$element.find('[href$=\"'+anchor+'\"]'),\n $anchor = $(anchor);\n\n if ($link.length && $anchor) {\n if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {\n this.down($anchor, this.firstTimeInit);\n this.firstTimeInit = false;\n };\n\n //roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n var _this = this;\n $(window).load(function() {\n var offset = _this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);\n });\n }\n\n /**\n * Fires when the zplugin has deeplinked at pageload\n * @event Accordion#deeplink\n */\n this.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);\n }\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n }", "async index ({ response }) {\n try {\n const pages = {\n data: {\n pages: [\n {\n url: '/',\n name: 'home',\n title: 'Home',\n menu: 'home',\n content: `<div>The following products and services are offered for our customers:</div>\n\n <div>\n Application which helps blind people to 'see' the surrounding objects with the help of AI-based software.\n Service which converts your photo into a cartoonized one.\n Congratulation on the behalf of a cartoon.\n </div>`\n ,\n type: 'static'\n },\n {\n url: '/',\n name: 'home',\n title: 'Home',\n menu: 'home',\n content: `<div>The following products and services are offered for our customers:</div>\n\n <div>\n Application which helps blind people to 'see' the surrounding objects with the help of AI-based software.\n Service which converts your photo into a cartoonized one.\n Congratulation on the behalf of a cartoon.\n </div>`\n ,\n type: 'static'\n },\n {\n url: '/frontend/solution',\n name: 'solution',\n title: 'Solution',\n menu: 'solution',\n content: `Solution For Blind People\n\n The project goal is to create electronic eyes for blind people which will be provided free of charge to them. Electronic eyes will be an electronic appliance which can function on the basis of the artificial intelligence. Since blind people cannot see, the artificial intelligence can see instead of them and voice the surrounding objects.\n \n 2.2 billion people have a vision impairment or blindness\n The majority of people with vision impairment are over the age of 50 years.\n Blindness is a very serious problem. It is the inability to see anything even light.\n \n Support on patreon`,\n type: 'static'\n },\n {\n url: '/frontend/birthday',\n name: 'birthday',\n title: 'Birthday',\n menu: 'birthday',\n content: `Birthday Present\n\n Just imagine how your child or friend will be happy if he/she will be congratulated by a cartoon heroe in Youtube.\n \n It will be really cool!\n \n Contact us and it will be done just for 10$.`,\n type: 'static'\n },\n {\n url: '/frontend/cartoonizer',\n name: 'cartoonizer',\n title: 'Cartoonizer',\n menu: 'cartoonizer',\n content: `Convert your photo into a cartoon\n\n Just for 5$ your photo will be converted into a cartoon`,\n type: 'static'\n },\n {\n url: '/frontend/contact',\n name: 'contact us',\n title: 'Contact Us',\n menu: 'contact us',\n content: `If you have questions or would like to order one of our prodcts please contact us by e-mail:\n\n electroniceyesai@gmail.com`,\n type: 'static'\n }\n ]\n }\n\n }\n // await Page.all()\n return response.status(200).json({ pages })\n } catch (e) {\n console.log(e.message)\n }\n }", "async function getDescSlots(link) {\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.goto(link, {\n waitUntil: \"networkidle2\",\n });\n const json = await page.evaluate(() => {\n let obj = {};\n obj.description = document.querySelector(\n \"div#section p.section_data\"\n ).textContent;\n obj.slots = document\n .querySelector(\"div#pagewrap div#class_detail\")\n .querySelector(\"div#enrl_mtng_info div.data-row\")\n .querySelector(\"div.span1 > p\").textContent;\n return obj;\n });\n\n await browser.close();\n return json;\n}", "function loadPage(page_num, filename) {\n var chants_on_page = [];\n if (pageHasChanged()) {\n chants_on_page = antiphoner.getChants(data.current_folio);\n $('#metadata-tab').html(incipit_template({incipits: chants_on_page, folio: data.current_folio}));\n $('#metadata-tab h3').click(function () {\n $(this).next('.metadata').slideToggle().siblings('.metadata:visible').slideUp();\n });\n }\n }", "async function getBedDetailsWithPhoneNumber(link, browserInstance) {\n try {\n //open new tab\n let newTab = await browserInstance.newPage();\n //rtab = newTab;\n //visit page\n await newTab.goto(link);\n\n //click beds button\n await waitAndClick(\"#menu-item-5278\", newTab);\n\n //click on covid-19 beds\n await waitAndClick(\".card-header\", newTab);\n\n //await newTab.waitForSelector(\"#hospitals_list\", { visible: true });\n await newTab.waitForTimeout(1000);\n //retrieve current page url\n //let url = newTab.url();\n\n //retrieving details from hospital and storing them in array \n //-vacant seat\n //-hospital name\n //-timestamp\n\n function extractHospitalDataFn(selector) {\n let hospitalTable = document.getElementById(selector);\n let row = hospitalTable.querySelectorAll(\"tr\");\n\n\n let phoneArr = [];\n\n for (let i = 0; i < row.length; i++) {\n if (i % 2 != 0) {\n let phoneNumberArr = row[i].querySelectorAll(\".card.shadow.m-1.mb-2 ul a\");\n let phoneNumberStr = \"\";\n let vacantSeat = row[i - 1].cells[3].getElementsByTagName(\"a\")[0].textContent;\n let vacantSeatNumber = parseInt(vacantSeat);\n if (vacantSeatNumber > 0) {\n for (let idx = 0; idx < phoneNumberArr.length; idx++) {\n phoneNumberStr += phoneNumberArr[idx].textContent;\n }\n //let numberPhone = parseInt(vacantSeatNumber);\n phoneArr.push({ phoneNumberStr});\n //hospital.push({ phoneNumberStr });\n }\n\n }\n }\n //console.table(details);\n //console.table(phoneArr);\n return phoneArr;\n //return hospital;\n }\n return newTab.evaluate(extractHospitalDataFn, \"hospitals_list\");\n //console.log(\"hello\");\n\n }\n catch (err) {\n console.log(err);\n }\n}", "function manager(args) {\n\n // get the actual page name\n var parts = args.split('&');\n var page = parts[0];\n // special is an additional parameter to render the same page in different ways\n // for istance, single_class.html can contains different informations based on\n // different values of special\n var special = parts[1];\n var id = parts[2];\n\n // enable script for calls to external php\n \n // load the page dinamycally inside the template\n $( \".mainContent\" ).load(page+'.html', function() {\n\n //************** SPECIFIC PAGE FUNCTIONS ****************//\n // after loading the whole page we should load the page manager for links inside the main div, this is because\n // the callback function\n switch (page) {\n case 'home':\n clickPageLinks();\n break;\n case 'allPromotions':\n getPromoIndex();\n clickPageLinks();\n break;\n case 'allSmartLifeServices':\n var categoria=\"smartlife\";\n getCategorie(categoria,function () { clickPageLinks(); });\n break;\n case 'allAssistanceServices':\n clickPageLinks();\n break;\n case 'assistanceServices':\n var tabella='assistanceservices';\n var categoria=special;\n var prevSection='allAssistanceServices';\n if(categoria=='promotions'){\n getIntro(tabella, categoria, function () { clickPageLinks(); });\n fillMultipleGroupDynamicButtons('allPromotions',categoria);\n loadSidebar('assistanceServicesPromo');\n }\n else{\n getIntro(tabella,categoria,function () { clickPageLinks(); });\n loadSidebar(special);\n fillMultipleGroupDynamicButtons(prevSection,categoria);\n }\n loadCategoryName(special);\n loadTableName(tabella);\n loadBreadCrumb(special);\n break;\n case 'assistanceServicesInfo':\n var tabella='assistanceservices';\n var prevSection='assistanceServices';\n getAssistanceInfo(tabella,special,id,function () { clickPageLinks(); });\n loadCategoryName(special);\n loadTableName(tabella);\n loadBreadCrumb(special);\n fillTopicDynamicButtons(prevSection,special,id);\n clickPageLinks();\n break;\n case 'smartlifeservices': //è da modificare: plans deve andare dentro la tabella smartlife\n var tabella='smartlifeservices';\n var categoria=special;\n var prevSection='allSmartLifeServices';\n if(categoria!='promotions') {\n getIntro(tabella,categoria,function () { clickPageLinks(); });\n loadSidebar(special);\n loadTableName(tabella);\n fillMultipleGroupDynamicButtons(prevSection,categoria);\n }\n else {\n getPromoIntro(tabella,function () { clickPageLinks(); });\n loadTableName(tabella);\n fillMultipleGroupDynamicButtons('allPromotions',categoria);\n loadSidebar('smartlifePromo');\n }\n loadCategoryName(special);\n loadBreadCrumb(special);\n break;\n case 'smartlifeInfo':\n var tabella='smartlifeservices';\n getPlanInfo(tabella,special,id,function () { clickPageLinks(); });\n loadCategoryName(special);\n loadTableName(tabella);\n loadBreadCrumb(special);\n fillTopicDynamicButtons(tabella,special,id);\n clickPageLinks();\n break;\n case 'devices':\n getIntro(page,special,function () { clickPageLinks(); });\n loadSidebar(special);\n loadCategoryName(special);\n loadBreadCrumb(special);\n loadTableName(page);\n if(special!='promotions')\n fillMultipleGroupDynamicButtons('allDevices',special);\n else\n fillMultipleGroupDynamicButtons('allPromotions',special);\n break;\n case 'transitionDeviceToSmartLife':\n getCombinedSmartLife(special,id,function () { clickPageLinks(); });\n loadBreadCrumb(special);\n break;\n case 'transitionDeviceToAssistantServices':\n getCombinedAssistantServices(special,id,function () { clickPageLinks(); });\n loadBreadCrumb(special);\n break;\n case 'deviceInfo':\n var tabella='devices';\n getDeviceInfo(tabella,special,id,function () { clickPageLinks(); });\n fillTopicDynamicButtons(tabella,special,id);\n loadBreadCrumb(special);\n break;\n case 'caratteristicheTecniche':\n clickPageLinks();\n break;\n case 'whoweare':\n loadStaticPageBreadCrumb('Innovation');\n clickPageLinks();\n break;\n case 'transitionSmartLifeToDevice':\n var tabella='smartlifeservices';\n loadCategoryName(special);\n loadTableName(page);\n loadBreadCrumb(special);\n getCombinedDevices(special,id,function () { clickPageLinks(); });\n break;\n case 'transitionAssistancetoDevices':\n var tabella='assistanceservices';\n loadCategoryName(special);\n loadTableName(page);\n loadBreadCrumb(special);\n getCombinedDevicesForAssistance(special,id,function () { clickPageLinks(); });\n break;\n case 'groupTelecomItalia':\n loadStaticPageBreadCrumb('Group Description');\n clickPageLinks();\n break;\n default:\n clickPageLinks();\n }\n //************** END SPECIFIC PAGE FUNCTIONS ***********//\n\n // scroll to top when loading a new page\n window.scrollTo(0,0);\n });\n\n}", "function internal_link() {\n var urlArray = window.location.href.split('#');\n if (urlArray.length == 2 && urlArray[1] != \"\") {\n switch (urlArray[1]) {\n case \"intro\": $('#tab-1-content').show(); break;\n case \"grants\": $('#tab-2-content').show(); break;\n case \"selectedpubs\": $('#tab-3-content').show(); break;\n case \"courses\": $('#tab-4-content').show(); break;\n case \"advising\": $('#tab-5-content').show(); break;\n case \"service\": $('#tab-6-content').show(); break;\n default: break;\n }\n }\n}", "function artistInfoTab() {\n var featureRelId = getUrlVars()['transferId'];\n var userSiteId = getUrlVars()['touchId'];\n var featureId = getUrlVars()['mId'];\n var url = baseUrl + 'web/web/getMenuHtml/' + featureId + '/' + featureRelId + '/' + userSiteId;\n\n var data = '';\n doAjaxCall(url, data, false, function (html) {\n\t\tconsole.log(html);\n if ($.isEmptyObject(html)) {\n $('#main-content').html('Sorry we do not have data');\n } else {\n\t\t \n\t\t\tvar featureName='';\n var backGroundColor, textColor, description,pic;\n $.each(html, function (i, item) {\n backGroundColor = item.globalBackground;\n textColor = item.globalTextColor;\n\t\t\t\tif(item.thumbnail=='')\n\t\t\t\t{\n\t\t\t\tpic='';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tpic='<img src=\"'+baseUrl+item.thumbnail+'\"width=\"100%\" height=\"80px\"/>'\n\t\t\t\t}\n description= '<div>'+pic+item.description+'</div>';\n featureName = item.featureName;\n\t\t\t\t\n })\n if (description == '') {\n $('#main-content').html('Sorry We Have An Empty Data');\n } else {\n $('#main-content').html(description);\n\t\t\t\tfeatureNameTitle(featureName);\n\t\t\t\n\t\t\t\t getUserAppereance();\n\t\t\t\t\n\t\t\t}\n $('#main-content').css({ 'background-color': '#' + backGroundColor, 'color': '#' + textColor });\n }\n \n });\n}", "function TabsPage() {\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_3__home_home__[\"a\" /* HomePage */];\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_1__courses_courses__[\"a\" /* CoursesPage */];\n this.tab3Root = __WEBPACK_IMPORTED_MODULE_2__enroll_now_enroll_now__[\"a\" /* EnrollNowPage */];\n this.tab4Root = __WEBPACK_IMPORTED_MODULE_4__personal_details_personal_details__[\"a\" /* PersonalDetailsPage */];\n this.tab5Root = __WEBPACK_IMPORTED_MODULE_5__program_calender_program_calender__[\"a\" /* ProgramCalenderPage */];\n this.tab6Root = __WEBPACK_IMPORTED_MODULE_6__my_program_my_program__[\"a\" /* MyProgramPage */];\n this.tab7Root = __WEBPACK_IMPORTED_MODULE_7__admin_admin__[\"a\" /* AdminPage */];\n }", "function getSuplData(obj){\n var infoBlock = document.querySelector('.infoBlock');\n var linksArray=[];\n var articleTitle;\n for (var key in obj) {\n if (obj[key]==='homeworld') {\n linksArray.push(obj.homeworld);\n articleTitle = key.charAt(0).toUpperCase() + key.slice(1);;\n loadSupplementaryData(linksArray,articleTitle,infoBlock);\n } else if (Array.isArray(obj[key]) &&\n obj[key].length !== 0) {\n linksArray = obj[key];\n articleTitle = key;\n loadSupplementaryData(linksArray,articleTitle,infoBlock);\n };\n };\n}", "function createPageTab(count){\r\n // Create Page Tab\r\n if(count-1 > 0){\r\n name = \"CrossTable\"+count;\r\n var pageId = name+'Conatiner';\r\n var pageIdTab=name+'-tab';\r\n pageFilter=name+'-filter';\r\n filterPara = name+'-para';\r\n prior_count = count -1;\r\n var Page = \"CrossTable \" + prior_count;\r\n\r\n // Create Page Tab\r\n var pagetab = document.getElementById(\"nav-sub-tab\");\r\n var tabnav = document.createElement('a');\r\n tabnav.textContent = \"Cross Table \"+prior_count;\r\n tabnav.setAttribute(\"id\",pageIdTab);\r\n tabnav.setAttribute('class','nav-item nav-link');\r\n tabnav.setAttribute(\"data-toggle\",\"tab\");\r\n // tabnav.setAttribute('onClick','findDash(\"'+pageIdTab+'\");');\r\n tabnav.setAttribute(\"href\",\"#\"+name);\r\n tabnav.setAttribute(\"role\",\"tab\");\r\n tabnav.setAttribute(\"aria-controls\",name);\r\n tabnav.setAttribute(\"aria-selected\",\"false\");\r\n pagetab.appendChild(tabnav);\r\n\r\n // Create Page Conatiner\r\n var pagetabcontainer = document.getElementById(\"nav-sub-tabContent\");\r\n var newtabContainer = document.createElement('div');\r\n newtabContainer.setAttribute('id',name);\r\n newtabContainer.setAttribute('class','tab-pane');\r\n newtabContainer.setAttribute('role','tabpanel');\r\n\r\n newtabContainer.setAttribute('aria-labelledby','pageIdTab');\r\n pagetabcontainer.appendChild(newtabContainer);\r\n\r\n //Create Cross Table Container\r\n var crossContainer = document.getElementById(name);\r\n var newCrossContainer = document.createElement(\"div\");\r\n newCrossContainer.setAttribute('id',pageId);\r\n crossContainer.appendChild(newCrossContainer);\r\n\r\n //Filter Div\r\n var newfilterContainer = document.createElement('div');\r\n newfilterContainer.setAttribute('id',pageFilter);\r\n newfilterContainer.setAttribute('style','background-color:rgb(233, 233, 233);display:block;');\r\n crossContainer.prepend(newfilterContainer);\r\n\r\n //Filter Paragraph Tag\r\n var filterdiv = document.getElementById(pageFilter);\r\n var filterDetails = document.createElement('p');\r\n filterDetails.setAttribute('id',filterPara);\r\n filterDetails.setAttribute('style','display:inline');\r\n filterDetails.setAttribute('class','m-0');\r\n filterDetails.innerHTML=\"<b>Internal / External:</b> External Suppliers <b>|</b> <b>Indirect / Direct:</b> INDIRECT,INDIRECT - DEFERRED CHARGES <b>|</b> <b>Divestiture:</b> GE Total <b>|</b> <b>OUTBOUND:</b> CONTROLLABLE,FREIGHT PAYMENT - INBOUND,FREIGHT PAYMENT - OUTBOUND,FREIGHT PAYMENT - SITE SPECIFIC,FREIGHT PAYMENT - UNDEFINED,NON-CONTROLLABLE,NON-SHARE,NOT AVAILABLE,PENDING <b>|</b> \";\r\n filterdiv.appendChild(filterDetails);\r\n\r\n //Toggle Hide Button\r\n var ToggleButton = document.createElement('button');\r\n ToggleButton.setAttribute('class','btn btn-secondary btn-sm');\r\n ToggleButton.setAttribute('onClick','hideFilters(\"'+filterPara+'\");');\r\n ToggleButton.textContent=\"Hide/Show\";\r\n filterdiv.appendChild(ToggleButton);\r\n\r\n //Loader Div\r\n var conId = document.getElementById(pageId);\r\n var loader = document.createElement(\"div\");\r\n loader.setAttribute('id','loader');\r\n conId.appendChild(loader);\r\n\r\n //Image Loader\r\n var img = document.getElementById(\"loader\");\r\n var imgLoad = document.createElement(\"img\");\r\n imgLoad.setAttribute('class','img-cen');\r\n imgLoad.setAttribute('src','img/ajax-loader.gif');\r\n img.appendChild(imgLoad);\r\n\r\n //Create WebPlayer\r\n createWebPlayer(pageId,Page);\r\n\r\n cloumnButton(name);\r\n columnSelector(name);\r\n }\r\n}", "function displaySelectedCUPortfolioCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"accountrating\")!=-1){\n obj= document.getElementById('accountrating-li');\n if(obj){\n document.getElementById('accountrating').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "loadIndexPage () {\n return Promise.resolve(Request.httpGet(this.SiteUrl + this.DefaultPrefix, this.CharSet).then(res => {\n let $ = cheerio.load(res.text);\n let Navis = $('#sliderNav > li');\n let Uid = new Date().getTime();\n Navis.each((i, elem) => {\n let _this = $(elem);\n let _ChildNodes = _this.find('> ul >li');\n let _SiteUrl = _this.find('>a').attr('href');\n if (_SiteUrl === './') {\n _SiteUrl = '../ssxx/'\n }\n\n let _SiteReg = /^javascript:/ig;\n this.ListNavis.push({\n Uid: `${Uid}${i}`,\n Section: _this.find('> a >span:first-child').text(),\n SiteUrl: _SiteReg.test(_SiteUrl) ? '' : _SiteUrl,\n HasChild: _ChildNodes && _ChildNodes.length > 0,\n ChildNodes: _ChildNodes && _ChildNodes.toArray().map((item, index) => {\n let _node = $(item).find('a');\n let _group = _node.text();\n let _uid = this.GroupDefine.has(_group) && this.GroupDefine.get(_group) || this.GroupDefine.set(_group, `${new Date().getTime()}${i}`).get(_group);\n return {\n Uid: _uid,\n Group: _node.text(),\n SiteUrl: _node.attr('href')\n };\n })\n });\n });\n\n /*保存首页数据*/\n Request.saveJsonToFile(this.ListNavis, 'index.json', this.Group, [...this.GroupDefine]);\n }).catch(err => {\n console.error(err);\n }));\n }", "function openPage(pageName,elmnt) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n document.getElementById(pageName).style.display = \"block\";\n\n\tif(pageName == 'Suggestions'){\n jsonDataSuggestions();\n }\n}", "function libraryLoadTab_home(selectorPattern){\n\t\n\t \n\t\tjQuery(selectorPattern).each(function(index) {\n\t\t\n\t\t\tvar a = jQuery(this);\n\t\t\tvar tabContent_library = {};\n a.bind(\"mouseover\", function (evt) {\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\n\t\t\t\ta.parent().parent().find(\"> li\").removeClass(\"ui-state-active\");\n a.parent().addClass(\"ui-state-active\");\n\t\t\t\t\n\t//MTkwODBA&token=04b5d384f6024ef2fc252e9112309daf&&amp;http://gunnynew.zing.vn/home/danh-sach.hinh-nen.html\n\t\t\t\tvar params = a.attr(\"rel\").replace(/\\r\\n\\s/g,\"\").toString(); // Thay the xuong hang\n\t\t\t\t//alert(params);\n var splitParams = params.split(\"&\");\n var postData = \"block={\\\"\" + splitParams[0] + \"\\\":{}}\\&\"+ splitParams[1];\n var urlInput = splitParams[3] == \"''\" ? '' : splitParams[3];\n\t\t\t\tvar idBlogOutput=splitParams[0];\n\t\t\t\tvar tabName=splitParams[2];\n\t\t\t\t \n\t\t\t\n\t\t\t\t if( !tabContent_library[tabName] ){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\turl: urlInput,\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: postData,\n\t\t\t\t\t\tsuccess: function(msg){\n\t\t\t\t\t\t\ttabContent_library[tabName]=msg[idBlogOutput]['content'];\n\t\t\t\t\t\t\t$(\"#\"+idBlogOutput).html(tabContent_library[tabName]);\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}else{\n\t\t\t\t\t$(\"#\"+idBlogOutput).html(tabContent_library[tabName]);\n\t\t\t\t}\n\t\t\t\n\t\t\t});\n\t\t});\n}", "function loadSupplementaryData(arr,title,division){\n var charSuplData = document.createElement('div');\n var infoTitle = document.createElement('h3');\n infoTitle.textContent=title;\n var list = document.createElement('ul');\n charSuplData.appendChild(infoTitle);\n charSuplData.appendChild(list);\n charSuplData.className='col-sm-4';\n division.appendChild(charSuplData);\n for (var key in arr) {\n fetch(arr[key])\n .then(resp=>resp.json())\n .then(function(obj){\n var infoLink = document.createElement('li');\n var path = obj['url'];\n infoLink.addEventListener('click',function(){\n loadData(path);\n });\n if (obj.episode_id) {\n var listItemTitle = 'Episode ' + obj.episode_id + ': '\n };\n var listItemValue = obj.name?obj.name:obj.title;\n infoLink.textContent = listItemTitle ? listItemTitle + listItemValue :listItemValue;\n list.appendChild(infoLink);\n })\n .catch(function(error){\n console.log(error.message);\n })\n };\n}", "function parsePageInfo() {\n\n //MDS is not enabled, no need for any special processing\n if (window.location.href.indexOf(\"start.aspx\") == -1) {\n return {};\n }\n\n var path = window.location.pathname;\n var qry = window.location.search;\n var hash = window.location.hash;\n\n var a = document.createElement(\"a\");\n a.href = hash.substring(1);\n\n var apath = a.pathname;\n var aqry = a.search\n var ahash = a.hash;\n\n //Add the path portion of the anchor to the main path\n var dcsuri = path + ((apath) ? (\"#\" + apath) : \"\");\n\n //Add the anchor's query string to the main query string \n var dcsqry = qry.concat(\n (aqry ? (qry ? (\"&\" + aqry.substr(1)) : aqry) : \"\")\n );\n\n return {\n \"DCS.dcssip\": location.hostname,\n \"DCS.dcsuri\": dcsuri,\n \"DCS.dcsqry\": dcsqry,\n \"WT.ti\": document.title,\n \"WT.es\": location.hostname + dcsuri\n };\n}", "function preparePage() {\n offsets = [];\n links = [];\n\n $('.js-scroll-indicator').find('a').each((index, el) => {\n const $link = $(el);\n\n // Calculate the element's offset from the top of the page while anchored\n const $linkTarget = $($link.attr('href'));\n if ($linkTarget.length) {\n // Add jQuery object and offset value to link map\n offsets.push($linkTarget.offset().top);\n links.push($link);\n }\n });\n}", "function extractData(html){\n let searchtool=cheerio.load(html);\n\n let part = searchtool('a[data-hover=\"View All Results\"]');\n let SourceLink=part.attr(\"href\");\n let FullLink=`https://www.espncricinfo.com${SourceLink}`;\n console.log(FullLink);\n\n //Now requesting on FullLink to obtain scorecard link array\n request(FullLink,AllScoreCardcb);\n}", "function loadOttorInformation() {\n console.log ('Checking if this is a property page');\n if ($('.propertyDetails').length == 0) {\n console.log('...its not so do nothing');\n } else { \n removeJunk();\n stripOutDetails(); \n loadPropertyDetails();\n } \n}", "async page (page) {\n const pageHtml = parse(page.html)\n\n if (!page.route.includes('/blog/')) {\n let pageMeta = {}\n\n // eslint-disable-next-line array-callback-return\n pageHtml.querySelectorAll('meta').map((meta) => {\n const name = meta.getAttribute('name')\n const property = meta.getAttribute('property')\n\n if (property === 'og:title') {\n // og:title, not the page title\n const ogTitle = meta.getAttribute('content')\n\n pageMeta.name = meta.getAttribute('content')\n }\n })\n\n if (page.route !== '/') {\n pageMeta.path = page.route\n } else {\n // For the homepage; otherwise the image generation file structure doesn't work\n pageMeta.path = '/index'\n }\n\n pagesMetaForPreviewImages.push(pageMeta)\n }\n }", "function tabberObj(argsObj)\n{ if ( window.location.hash && window.location.hash.match( /^#/ ) ) { var el = document.getElementById(window.location.hash.substr(2)); if (el) { el.className = \"tabbertab tabbertabdefault\" } }\nvar arg;this.div=null;this.classMain=\"tabber\";this.classMainLive=\"tabberlive\";this.classTab=\"tabbertab\";this.classTabDefault=\"tabbertabdefault\";this.classNav=\"tabbernav\";this.classTabHide=\"tabbertabhide\";this.classNavActive=\"tabberactive\";this.titleElements=['h2','h3','h4','h5','h6'];this.titleElementsStripHTML=true;this.removeTitle=true;this.addLinkId=false;this.linkIdFormat='<tabberid>nav<tabnumberone>';for(arg in argsObj){this[arg]=argsObj[arg];}\nthis.REclassMain=new RegExp('\\\\b'+this.classMain+'\\\\b','gi');this.REclassMainLive=new RegExp('\\\\b'+this.classMainLive+'\\\\b','gi');this.REclassTab=new RegExp('\\\\b'+this.classTab+'\\\\b','gi');this.REclassTabDefault=new RegExp('\\\\b'+this.classTabDefault+'\\\\b','gi');this.REclassTabHide=new RegExp('\\\\b'+this.classTabHide+'\\\\b','gi');this.tabs=new Array();if(this.div){this.init(this.div);this.div=null;}}", "function craeteNewTabAndLoadUrl(parms, url, loadDivSelector) {\n $(loadDivSelector).load(url, function (response, status, xhr) {\n if (status == \"error\") {\n var msg = \"Sorry but there was an error getting details ! \";\n\n }\n });\n}", "function display_external_tab_content(scale_title){\n var scaled_result = $(scale_title + \"_results\");\n var chosen_tab = scaled_result.getElementsByClassName('tabberactive')[0];\n var scale_and_type = chosen_tab.childNodes[0].className;\n //the content could come from external search\n if (scale_and_type.match(\"external_result\") != null){\n scale_and_type = scale_and_type.split('external_result')[0];\n var resource_type = scale_and_type.split('_')[1].strip();\n $(resource_type).show();\n }\n\n}", "function setUpForTabs(){\n // function logTabs(tabs) {\n // for (let tab of tabs) {\n // // tab.url requires the `tabs` permission\n //\n //\n // recordWebPage(tab.url, tab.id, 0)\n // }\n //\n \n // }\n \n // let querying = browser.tabs.query({});\n // querying.then(logTabs);\n\n // function saveCurrentTab =\n\n // (tabInfo) => {\n // // var theCurrentTime = Date.now();\n // // newTabFocused(activeInfo.previousTabId,activeInfo.tabId, theCurrentTime)\n //\n //\n // // BrowserDataComponent.tabState.changeFocusedTab(null,activeInfo.tabId, theCurrentTime)\n // // BrowserDataComponent.tabState.createBlankTab(currentTab);\n // }\n\n const getCurrentTab = browser.tabs.query({});\n getCurrentTab.then((tabInfo) => {\n\n BrowserDataComponent.tabState.createBlankTab(tabInfo[0].id)\n BrowserDataComponent.tabState.setCurrentTab(tabInfo[0].id)\n });\n \n}", "function refreshTabs() { \n pageDB.fetchTabs(function(tabs) {\n var tabList1 = document.getElementById('high-priority');\n tabList1.innerHTML = '';\n var tabList2 = document.getElementById('medium-priority');\n tabList2.innerHTML = '';\n var tabList3 = document.getElementById('low-priority');\n tabList3.innerHTML = '';\n\n /*var researchTopic = document.getElementById('query');\n researchTopic.value = query;\n\n /*var important = false,\n potential = false,\n unimportant = false;*/\n\n // If there are no tabs in the list, tell the user how to fill them.\n if (tabs.length == 0) {\n var add1 = document.createElement('p');\n add1.innerHTML = 'Use Alt+1 to mark tabs as important.';\n add1.className = 'empty';\n tabList1.appendChild(add1);\n\n var add2 = document.createElement('p');\n add2.innerHTML = 'Use Alt+2 to mark tabs as potentially important.';\n add2.className = 'empty';\n tabList2.appendChild(add2);\n\n var add3 = document.createElement('p');\n add3.innerHTML = 'Use Alt+3 to mark tabs as unimportant.';\n add3.className = 'empty';\n tabList3.appendChild(add3);\n }\n\n for(var i = 0; i < tabs.length; i++) {\n // Read the tab items backwards (most recent first).\n var tab = tabs[tabs.length - i - 1];\n\n var a = document.createElement('a');\n a.id = 'tab-' + tab.timestamp;\n a.className = \"list-group-item\";\n\n // Remove button\n var remove = document.createElement('button');\n remove.className = 'glyphicon glyphicon-remove gi-2x';\n remove.innerHTML = '';\n remove.setAttribute(\"data-id\", tab.timestamp);\n\n a.appendChild(remove);\n\n // Title of webpage appears as link to webpage\n var info = document.createElement('a');\n info.innerHTML = tab.text;\n info.href = tab.url;\n info.target = \"_blank\";\n info.id = \"clip\";\n\n a.appendChild(info);\n\n var space = document.createElement('span')\n space.innerHTML = '&nbsp;&nbsp;'\n\n a.appendChild(space);\n\n \n if (tab.importance == 1) {\n tabList1.appendChild(a);\n //important = true;\n } else if (tab.importance == 2) {\n tabList2.appendChild(a);\n //potential = true;\n } else if (tab.importance == 3) {\n tabList3.appendChild(a);\n //unimportant = false;\n }\n\n /*if (!important) {\n var add1 = document.createElement('p');\n add1.innerHTML = 'No tabs marked as important.';\n add1.className = 'empty';\n tabList1.appendChild(add1);\n }\n if (!potential) {\n var add2 = document.createElement('p');\n add2.innerHTML = 'No tabs marked as potentially important.';\n add2.className = 'empty';\n tabList2.appendChild(add2);\n }\n if (!unimportant) {\n var add3 = document.createElement('p');\n add3.innerHTML = 'No tabs marked as unimportant.';\n add3.className = 'empty';\n tabList3.appendChild(add3);\n }*/\n\n remove.addEventListener('click', function(e) {\n var id = parseInt(e.target.getAttribute('data-id'));\n pageDB.deleteTab(id, refreshTabs);\n //pageDB.open(refreshVisual);\n });\n\n /*Setup an event listener for the checkbox.\n x.addEventListener('click', function(e) {\n var id = parseInt(e.target.getAttribute('data-id'));\n\n pageDB.deleteTab(id, refreshTabs);\n });*/\n }\n\n });\n}", "function detailPage(ind){\n displayDetails(formatDetails('detail', json.list[ind]));\n // console.log(json.list[ind]);\n document.getElementById(\"homepage\").style.display = \"none\";\n document.getElementById(\"detailpage\").style.display = \"block\";\n }", "function target() {\n const targets = [\n document.querySelector(\"#page-content > div.row > div > div.stats-body > div.stats-subheader > div > a:nth-child(1)\"),\n document.querySelector(\"#page-content > div.row > div > div.stats-body > div.stats-subheader > div > a:nth-child(2)\"),\n document.querySelector(\"#page-content > div.row > div > div.stats-body > div.stats-subheader > div > a:nth-child(3)\"),\n ];\n\n let flag = false;\n\n targets.forEach((element) => {\n if (element && element.href.startsWith('https://marketplace.tf')) {\n extractFromMptf(element.href);\n flag = true;\n }\n });\n\n if (flag == false) {\n extractFromUrl(window.location.href);\n }\n}", "static load(title) {\n\t\tPage.pageReady = undefined;\n\t\tPage.clearTools();\n\t\t$(\"#PAGE_SEARCH\").hide();\n\t\t$(\"#PAGE_SEARCH_CONTENT\").hide();\n\t\t$(\"#PAGE_TOOLS\").show();\n\t\t$(\"#PAGE_CONTENT\").show();\n\t\t\n\t\tdocument.getElementById(Page.pageID).innerHTML = \"\";\n\n\t\tconst loc = \"files/fragments/\" + title + '/' + title;\t\t\n\t\tLoader.loadFragment(Page.pageID, loc + \".html\", loc + \".css\", loc + \".js\", () => {\n\t\t\tif (typeof Page.pageReady === \"function\") Page.pageReady();\n\t\t\tPage.currentPage = title;\n\t\t});\n\t}", "function scrapeOne(doc) {\n\tvar url = doc.location.href;\n\tvar hostRe = new RegExp(\"^(https?://[^/]+)/\");\n\t\tvar m = hostRe.exec(url);\n\t\tvar host = m[1];\n\n\tif (url.match(/\\/books\\//)){\n\t\tvar abstract = ZU.xpathText(doc, '//div[@class=\"book_info\"]/div[@class=\"description\"]')\n\t\tvar citurl = ZU.xpathText(doc, '//li[@class=\"view_citation\"]/a/@href');\n\t\tvar newUrl = host + citurl;\n\t\t\tZotero.Utilities.HTTP.doGet(newUrl, function(text) {\n\t\t\ttext=text.match(/TY -(.+\\n)+ER -/)[0]\n\t\t\t\tvar translator = Zotero.loadTranslator(\"import\");\n\t\t\t//set RIS translator\n\t\t\ttranslator.setTranslator(\"32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7\");\n\t\t\ttranslator.setString(text);\n\t\t\ttranslator.setHandler(\"itemDone\", function(obj, item) {\n\t\t\titem.attachments.push({document:doc, title:\"Project MUSE Snapshot\"});\n\t\t\tif (abstract){\n\t\t\t\titem.abstractNote=abstract.replace(/\\n/g, \" \").replace(/\\s\\s+/g, \" \");\n\t\t\t}\n\t\t\titem.complete();\n\t\t\t});\n\t\t\ttranslator.translate();\n\t\t\t})\n\t}\n\t\n\telse{\n\t\n\t\tvar getPDF = doc.evaluate('//a[text() = \"PDF Version\" or text() = \"[Access article in PDF]\" or text() = \"Download PDF\"]', doc,\n\t\t\t\t\t\t\t\t null, XPathResult.ANY_TYPE, null).iterateNext();\t\t\n\t\tvar DOI = doc.evaluate('//meta[@name=\"citation_doi\"]/@content', doc,\n\t\t\t\t\t\t\t\t null, XPathResult.ANY_TYPE, null).iterateNext();\t\t\n\t\tvar abstract = doc.evaluate('//div[@class=\"abstract\"]', doc,\n\t\t\t\t\t\t\t\t null, XPathResult.ANY_TYPE, null).iterateNext();\n\t\tvar authorNodes = ZU.xpath(doc, '//meta[@name=\"citation_author\"]/@content');\n\n\t\tif(url.indexOf('?') != -1) {\n\t\t\tvar m = url.match(/[?&]ur[li]=([^&]+)/i);\n\t\t\tif(m) url = host + decodeURIComponent(m[1]);\n\t\t}\n\n\t\tvar newUrl = url.replace(host, host+\"/metadata/zotero\").replace(\"/summary/\",\"/\");\n\t\tZotero.Utilities.HTTP.doGet(newUrl, function(text) {\n\t\t\tvar translator = Zotero.loadTranslator(\"import\");\n\t\t\t//set RIS translator\n\t\t\ttranslator.setTranslator(\"32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7\");\n\t\t\ttranslator.setString(text);\n\t\t\ttranslator.setHandler(\"itemDone\", function(obj, item) {\n\t\t\t\tif(item.notes && item.notes[0]) {\n\t\t\t\t\titem.extra = item.notes[0].note;\t\t\t\t\t\t\n\t\t\t\t\tdelete item.notes;\n\t\t\t\t\titem.notes = undefined;\n\t\t\t\t}\n\t\t\t\t//Muse has authors wrong in the RIS - we get the names from google/highwire metadata and use them\n\t\t\t\t// they're also inconsistent about comma use, so we're using the code from the Embedded Metadata translator to distinguish\n\t\t\t\tif(authorNodes.length){\n\t\t\t\t\titem.creators = [];\n\t\t\t\t\t\tfor(var i=0, n=authorNodes.length; i<n; i++) {\n\t\t\t\t\t\t\t//make sure there are no empty authors\n\t\t\t\t\t\t\tvar authors = authorNodes[i].nodeValue.replace(/(;[^A-Za-z0-9]*)$/, \"\").split(/\\s*;\\s/);\n\t\t\t\t\t\t\tif (authors.length == 1) {\n\t\t\t\t\t\t\t\t/* If we get nothing when splitting by semicolon, and at least two words on\n\t\t\t\t\t\t\t\t* either side of the comma when splitting by comma, we split by comma. */\n\t\t\t\t\t\t\t\tvar authorsByComma = authors[0].split(/\\s*,\\s*/);\n\t\t\t\t\t\t\t\tif (authorsByComma.length > 1\n\t\t\t\t\t\t\t\t\t&& authorsByComma[0].indexOf(\" \") !== -1\n\t\t\t\t\t\t\t\t\t&& authorsByComma[1].indexOf(\" \") !== -1)\n\t\t\t\t\t\t\t\t\tauthors = authorsByComma;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor(var j=0, m=authors.length; j<m; j++) {\n\t\t\t\t\t\t\t\tvar author = authors[j];\n\t\t\t\t\t\t\t\titem.creators.push(ZU.cleanAuthor(author, \"author\", author.indexOf(\",\") !== -1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//apparently Muse is inconsistent with google data\n\t\t\t\t\t//assume single field names are personal authors with wrong RIS. Not perfect\n\t\t\t\t\t//but by far the most likely scenario.\n\t\t\t\t\tfor(var i in item.creators){\n\t\t\t\t\t\tif(!item.creators[i].firstName){\n\t\t\t\t\t\t\titem.creators[i] = ZU.cleanAuthor(item.creators[i].lastName, item.creators[i].creatorType, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titem.attachments.splice(0);\n\t\t\t\titem.attachments.push({document:doc, title:\"Project MUSE Snapshot\"});\n\t\t\t\tif(getPDF) {\n\t\t\t\t\titem.attachments.push({title:\"Project MUSE Full Text PDF\", mimeType:\"application/pdf\",\n\t\t\t\t\turl:getPDF.href});\n\t\t\t\t}\n\t\t\t\tif(DOI) {\n\t\t\t\t\titem.DOI = DOI.textContent.replace(/^DOI: /,\"\");\n\t\t\t\t}\n\t\t\t\tif(abstract) {\n\t\t\t\t\titem.abstractNote = abstract.textContent.replace(/\\n/g, \" \").replace(/\\s\\s+/g, \" \");\n\t\t\t\t}\n\t\t\t\titem.complete();\n\t\t\t});\n\t\t\ttranslator.translate();\n\t\t});\n\t}\n}", "function craeteNewTabAndLoadUrl(parms, url, loadDivSelector) {\n\n $(\"\" + loadDivSelector).load(url, function (response, status, xhr) {\n if (status === \"error\") {\n var msg = \"Sorry but there was an error getting details ! \";\n $(\"\" + loadDivSelector).html(msg + xhr.status + \" \" + xhr.statusText);\n $(\"\" + loadDivSelector).html(\"Load Ajax Content Here...\");\n }\n });\n\n}", "async function loadDetail(aWindow, id) {\n let loaded = wait_for_view_load(aWindow, undefined, true);\n // Check the detail view.\n if (aWindow.useHtmlViews) {\n let browser = await aWindow.getHtmlBrowser();\n let card = browser.contentDocument.querySelector(\n `addon-card[addon-id=\"${id}\"]`\n );\n EventUtils.synthesizeMouseAtCenter(card, {}, browser.contentWindow);\n } else {\n let card = aWindow.document.querySelector(`.addon.card[value=\"${id}\"]`);\n EventUtils.synthesizeMouseAtCenter(card, {}, aWindow);\n }\n await loaded;\n}", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }" ]
[ "0.5875801", "0.57537854", "0.56964403", "0.56806237", "0.56689864", "0.5655047", "0.562426", "0.5557786", "0.5549782", "0.5543037", "0.5510794", "0.54657274", "0.5425352", "0.54248893", "0.54025745", "0.54022336", "0.53904706", "0.53764397", "0.53661436", "0.5364575", "0.5360534", "0.53581893", "0.5349731", "0.5345431", "0.53281724", "0.5308234", "0.53013766", "0.5287865", "0.5285842", "0.52831066", "0.5274468", "0.5270481", "0.52468514", "0.5245569", "0.52438456", "0.5240927", "0.5229479", "0.52210337", "0.52147865", "0.52145636", "0.5208117", "0.52049947", "0.52041966", "0.5203552", "0.5195524", "0.5192725", "0.5185295", "0.5183724", "0.5183249", "0.51825523", "0.51820475", "0.5177465", "0.5176974", "0.51764864", "0.5172729", "0.5162581", "0.5151427", "0.51485336", "0.51471496", "0.5145102", "0.5142746", "0.51404774", "0.513719", "0.5133374", "0.512889", "0.5125783", "0.51217467", "0.51182604", "0.5117526", "0.51159483", "0.51155686", "0.51123387", "0.51097864", "0.51067626", "0.510474", "0.51034164", "0.5102303", "0.50981736", "0.50980735", "0.5094618", "0.5087778", "0.5082897", "0.50820917", "0.50801384", "0.50764114", "0.507338", "0.50647926", "0.50606614", "0.50561124", "0.5046514", "0.5042802", "0.5035389", "0.50352407", "0.5032466", "0.50269705", "0.50231534", "0.50220615", "0.50183564", "0.50166494", "0.5016544" ]
0.6655011
0
gets the detail page for a resource by id (called for every resource in the search results)
function fetchDetails (id) { return limitedFetch(`${domain}/item/Details/${id}`) .then(res => res.text()) .then(body => { var promises = []; const detailDom = new JSDOM(body); // Get the primary image const pImg = detailDom.window.document.querySelector('#PrimaryImage'); if (pImg) { promises.push( fetchImage2base64(pImg.getAttribute('data-url'), package[id], 'primaryImage') ) } // scrape the panels at the top detailDom.window.document.querySelectorAll('.panel-primary') .forEach( node=>scrapePrimaryPanel(id,node) ); // Fetch the detail tabs for this resource ["/Item/_Details/","/Item/_LocationDisplay/","/Item/_Donor/","/Item/_Appraisal_Deed/","/Item/_Purchases/","/Item/_Condition/","/Item/_MaintenanceDisplay/"] .forEach( tabpath=>{ promises.push( getTabDetail(tabpath,id) ); }); return Promise.all(promises); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDetail(id) {\n return this.fetch(`${this.api}/${this.resource}/${id}`);\n }", "function show(id) {\n\n return resource.fetch(id)\n .then(function(data){ return data.data; });\n }", "function getThePage(id) {\n getStoryData().then((pages) => {\n for (let page of pages) {\n if (page.id == id) {\n storyPrint(page);\n }\n }\n })\n}", "async function viewObjectDetails(id){\n\t//retrieve object data\n\tconst p = new Parameters();\n\tp.addParams(\"q\", `objectid:${id}`);\n\tconst data = await getSearchData(OBJECT, p.getParams());\n\tconst obj = data[0];\n\tlet html = \"\";\n\t//retrieve images through IIIF\n\tfor (let i in obj.images){\n\t\tconst base_uri = obj.images[i].iiifbaseuri;\n\t\tconst json = await getData(base_uri + \"/info.json\"); //can be slower than loading the rest of the info\n\t\tconst info = json.profile[1];\n\t\tconst ext = (info.formats.includes(\"png\") ? \"png\" : \"jpg\");\n\t\tconst full_uri = base_uri + `/full/full/0/native.${ext}`;\n\t\thtml += `<img src='${full_uri}' width='300' onclick=\"viewFullImg('${full_uri}')\">`;\n\t}\n\t//display object properties\n\thtml += \"<table><tr><th colspan='2'>Object Details</th></tr>\";\n\tfor (let prop in obj){\n\t\tif (!obj.hasOwnProperty(prop)){ continue; }\n\t\tlet val = obj[prop];\n\t\thtml += `<tr><td>${prop}</td><td>${val}</td></tr>`;\n\t}\n\thtml += \"</table>\";\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "getOne(resource, id) {\n const url = `${baseUrl}/${resource}/${id}/`\n return this.fetchFactory(url)\n }", "function getItemById(id){\n\t$.each($.fn.items, function(key, item) {\n\t\tif(String(item.id) == String(id)){\n\t\t\t$.fn.itemDetail = item;\n\t\t\treturn false;\n\t\t}\n\t});\n}", "details(id){\n\t\twindow.location.href=this.url+\"detalles-blog/\"+id;\n\t}", "function findPageById(req, res) {\n var pageId = req.params[\"pageId\"];\n pageModel.findPageById(pageId)\n .then(function (page) {\n res.json(page);\n });\n}", "async loadDetail(id) {\n const item_resp = await this.props.getItem(id);\n history.push({\n pathname: `/items/${id}`,\n params: item_resp.data.res,\n from: { id: 1, previousRoute: \"Search result\" }\n });\n }", "function getPageURL(i, resource) {\n var drupal_base_path = Drupal.settings.basePath;\n var DKAN_API = drupal_base_path + 'api/action/datastore/search.json';\n var url = window.location.origin + DKAN_API + '?resource_id=' + resource.resource_id;\n var offset = i * pageSize;\n var limit = pageSize;\n return url + '&offset=' + offset + '&limit=' + limit;\n }", "findResource(id, params = {}, parent_id = null) {\n if (!id) {\n throw \"ID is needed\";\n return;\n }\n this.parent_id = parent_id;\n var route = this.buildUrl(id);\n var resource_promise = new Promise((resolve, reject) => {\n this._http.get(route, {\n params\n })\n .then((response) => {\n resolve(this.found(response));\n })\n .catch((err) => {\n reject(err);\n });\n });\n\n return resource_promise;\n }", "function get(req, res, next) {\n const prop = toProp(req.params.resource)\n req.query[prop] = toId(req.params.id)\n req.url = `/${req.params.nested}`\n next()\n }", "function get(req, res, next) {\n\n\n var id = req.params.id\n var country = find(data, function (value) {\n return value.id === id\n })\n\n if (!country) {\n\n next()\n res.render('error.ejs')\n return\n }\n res.render('detail.ejs', {\n data: country\n }) //add the right data to the template\n}", "getDetails(titleID) {\n axios\n .get(`${apiBaseUrl}/entries?title=${encodeURIComponent(titleID)}`)\n .then((response) => {\n this.details = response.data.entries[0];\n this.show = true;\n\n const category = response.data.entries[0].Category;\n this.getReleavantApis(category);\n })\n }", "function detailsGET(id){\n $(\"#detailsMarco\").attr(\"src\", BASE_URL+\"/apis/detail?idQuery=\"+id);\n}", "function displaySingleRd(id) {\n var id = findIdRd(id);\n showRando(id);\n}", "function crisisReadMore(id) {\n // Make an AJAX Call to ReliefWeb Reports with the ID\n $.ajax({\n type: \"GET\",\n url: `https://api.reliefweb.int/v1/reports/${id}`,\n dataType: \"json\",\n contentType: \"application/json\"\n })\n // If Done, Render the Result\n .done(result => renderSingleCrisis(result))\n // If Fail, Log the Error\n .fail(err => console.log(err));\n}", "function show(id) {\n\n return $http.get(treeBase + id)\n .then(function(data){ return data.data; });\n }", "function getBookingItemForDisplay(id) {\n var url = 'data/bookingDetailData-' + id + '.json';\n return $http.get(url, {\n transformResponse: transformBookingItemForDisplay\n })\n .then(sendResponseData)\n .catch(sendGetBookingError);\n }", "function ProjectDetailPage() {\n const params = useParams();\n const projectParam = params.id;\n\n return (\n <DetailPage name={projectParam} infoSource={Projects} header={ProjectDetailHeader} \n footer={ProjectDetailFooter} sections={projectSections} />\n )\n}", "function getPostDetail() {\n var postId = Utils.getParameterByName(\"id\");\n\n Stamplay.Object(\"post\").get({ _id : postId})\n .then(function(res) {\n var post = res.data[0];\n var viewData = {\n id : post._id,\n url : post.url,\n shortUrl : Utils.getHostname(post.url),\n title : post.title,\n dt_create : Utils.formatDate(post.dt_create),\n votesLength : post.actions.votes.users_upvote.length\n }\n Utils.renderTemplate('post-detail', viewData, '#postcontent');\n\n post.actions.comments.forEach(function (comment) {\n var viewData = {\n displayName: comment.displayName,\n dt_create: Utils.formatDate(comment.dt_create),\n text: comment.text\n }\n Utils.renderTemplate('post-comment', viewData, '#postcomments');\n })\n\n }).catch(function (err) {\n console.log('error', err);\n })\n}", "function queryResourceById(id) {\n this.saveFormValue('diseaseId', id);\n if (validateDiseaseIdInput.call(this, id)) {\n // Make the OLS REST API call\n return this.getRestData(external_url_map['MondoApi'] + id.replace(':', '_')).then(response => {\n let termLabel = response['_embedded']['terms'][0]['label'];\n let termIri = response['_embedded']['terms'][0]['iri'];\n if (termLabel && termIri) {\n // Disease ID is found at OLS\n this.setState({\n queryResourceBusy: false,\n submitResourceDisabled: false,\n tempResource: response['_embedded']['terms'][0],\n resourceFetched: true\n });\n } else {\n // Disease ID not found at OLS\n this.setFormErrors('diseaseId', 'Requested ID not found at OLS.');\n this.setState({queryResourceBusy: false, resourceFetched: false});\n }\n }).catch(err => {\n // error handling for disease query\n this.setFormErrors('diseaseId', 'Unable to retrieve data from OLS.');\n this.setState({queryResourceBusy: false, resourceFetched: false});\n console.warn('OLS terminology fetch error :: %o', err);\n });\n } else {\n this.setState({queryResourceBusy: false});\n }\n}", "show(request, response, next) {\n SiteModel.find({title: request.params.title},\n (error, site) => response.json({site})\n );\n }", "@route('/movies/:id', {aliases: ['/films/:id']}) get ItemPage() {\n return function () {\n return `Movie #${this.id}`;\n };\n }", "get(id) {\n\n }", "function pageView(id){\n\tvar id = id;\n\tvar rowid = $(\"#\"+id).closest(\"tr\"); \n\tvar pageid = rowid.find(\"td:eq(0)\").text(); \n\tvar title = rowid.find(\"td:eq(1)\").text();\n\tvar descrption = rowid.find(\"td:eq(2)\").text();\n\tvar url = rowid.find(\"td:eq(3)\").text();\n\tvar status = rowid.find(\"td:eq(4)\").text();\n\tvar data= 'ID:'+id+\"<br>\"+'TITLE:'+title+\"<br>\"+'DESCRIPTION:'+descrption+\"<br>\"+'URL:'+url+\"<br>\"+'STATUS:'+status;\n\t$(\"#cmspage_result\").html(data);\n}", "function get(req, res, next) {\n const prop = pluralize.singular(req.params.resource);\n req.query[`${prop}${opts.foreignKeySuffix}`] = req.params.id;\n req.url = `/${req.params.nested}`;\n next();\n } // Rewrite URL (/:resource/:id/:nested -> /:nested) and request body", "function detailsGetServer(id){\n window.location.href = BASE_URL+CURR_MODULE+'?f=id&q='+id+'&page='+CURR_PAGE;\n}", "function detailPage(ind){\n displayDetails(formatDetails('detail', json.list[ind]));\n // console.log(json.list[ind]);\n document.getElementById(\"homepage\").style.display = \"none\";\n document.getElementById(\"detailpage\").style.display = \"block\";\n }", "function getObject(req, res, next) {\n var objectid = req.param(\"objectid\");\n objectService.getObject(objectid, (error, response) => {\n if (response == null) {\n ResponseHandler(404, response, res);\n return;\n }\n ResponseHandler(error, response, res);\n });\n}", "function getPlacesDetails(id) {\n\n var request = {\n placeId: id,\n }\n\n var service = new google.maps.places.PlacesService(map);\n service.getDetails(request, callback);\n\n function callback(place, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n $(\"#\" + id).attr(\"href\", place.website).attr(\"target\", \"_blank\");\n }\n }\n}", "function getSuburbDetails(id) {\r\n return get('/suburb/detail', { id: id }).then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "function show(req, res) {\n const id = req.params.id;\n models.Post.findByPk(id)\n .then((result) => {\n // console.log(result);\n if (result) {\n res.status(200).json(result);\n } else {\n res.status(400).json({\n message: \"Record not found\",\n });\n }\n })\n .catch((error) => {\n res.status(500).json({\n message: \"Something went wrong\",\n error: error,\n });\n });\n}", "idLookup(id)\n {\n const _this = this;\n const axiosParams =\n {\n find:\n {\n '_id': id\n },\n show:\n {\n '__v': '0',\n '_id': '1',\n 'title': '1',\n 'date': '1',\n 'content': '1',\n 'sources': '1',\n },\n sort: -1,\n limit: 1,\n }\n\n Axios.post(location.protocol + '//' + location.hostname + ':8080/api/querySingle', axiosParams)\n .then(function(results)\n {\n if (results.data.status === 'success')\n {\n _this.setState(\n {\n post: results.data.posts[0],\n isOldest: results.data.isOldest ? true : false,\n isNewest: results.data.isNewest ? true : false,\n });\n }\n });\n }", "function getpollbyid(id, req, res, next){\n polls.find({_id: id}, function(err, poll){\n if(err) {\n res.redirect('/404');\n }\n else{\n res.locals.poll = poll;\n next();\n }\n })\n}", "function show(id) {\n var url = URL + 'show/' + id;\n var deferred = $q.defer();\n\n $http.get(url).success(function (data) {\n deferred.resolve(data);\n }).error(function (error) {\n deferred.reject(error);\n });\n return deferred.promise;\n }", "getById (url, id) {\n url = `${url}/${id}?f=json`;\n return this.request(url, {method: 'GET'});\n }", "get(id)\n {\n return this._fetch(this._url + '/' + id);\n }", "function getMovieDetails(id, callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_DETAILS+id, query, callback);\n}", "detail(accessPermissionId) {\n return this.request.get(`detail?accessPermissionId=${accessPermissionId}`);\n }", "@route('/studios/:studio.id/movies/:id') get ItemWithStudioPage() {\n return function () {\n return `Movie #${this.id}`;\n };\n }", "function loadArticleDetailById(id, detail) {\n $.ajax({\n url: 'assets/data/latest.json',\n type: 'get',\n dataType : 'json',\n success: function(data) {\n $.each(data, function(key, item) {\n console.log(\"Article ID\"+id);\n if (id == item.id){\n detail.text(item.Description);\n }\n });\n },\n error: function(e) {\n console.log('error message'+e.message);\n }\n });\n}", "show() {\n\n Post.find(this.params.route.id, (err, model) => {\n\n this.respond(err || model);\n\n });\n\n }", "searchResultID(id) {\n const requestUrl = 'http://api.tvmaze.com/shows/' + id;\n\n return fetch(requestUrl)\n .then(response => {\n return response.json();\n })\n }", "function getCharacterDetail(id) {\n history.push(\"/detail/\" + id);\n }", "function getSavedMatchById() {\n var urlParams = new URLSearchParams(window.location.search);\n var idParam = urlParams.get(\"id\");\n\n getById(idParam).then(function (detail) {\n showSavedDetail(detail);\n });\n}", "async index({response, params}) {\n const targetResource = await this.repo.findOneOrFailed(params.id)\n\n return response.dataJSON(targetResource)\n }", "get(id) {\n return this.rest.get(`${this.baseUrl}/${id}`);\n }", "get(id) {\n return this.rest.get(`${this.baseUrl}/${id}`);\n }", "function getDetail(id){\n var service = new google.maps.places.PlacesService(model.map);\n model.defer = $q.defer();\n var request = {\n placeId:id\n };\n service.getDetails(request,callback);\n\n function callback(place,status){\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n model.detail = place;\n model.defer.resolve();\n }\n else{\n model.defer.reject(\"can't find the place details\");\n }\n }\n return model.defer.promise;\n }", "function showProjectDetails( urlObj, options )\n{\n var pid = urlObj.hash.replace( /.*pid=/, \"\" ),\n\n // The pages we use to display our content are already in\n // the DOM. The id of the page we are going to write our\n // content into is specified in the hash before the '?'.\n pageSelector = urlObj.hash.replace( /\\?.*$/, \"\" );\n pw.projects.getProjectEx(\n {'pid' : pid},\n //success callback\n function(myProject){\n // Get the page we are going to dump our content into.\n var $page = $( pageSelector );\n pw.activeProject = pid;\n pw.activeProjectObject = myProject;\n renderProjectDetails(myProject);\n\t\t\trenderAssetsList(myProject);\n renderProjectDetailsScripts();\n\n // Pages are lazily enhanced. We call page() on the page\n // element to make sure it is always enhanced before we\n // attempt to enhance the listview markup we just injected.\n // Subsequent calls to page() are ignored since a page/widget\n // can only be enhanced once.\n $page.page();\n\n // We don't want the data-url of the page we just modified\n // to be the url that shows up in the browser's location field,\n // so set the dataUrl option to the URL for the category\n // we just loaded.\n options.dataUrl = urlObj.href;\n\n // Now call changePage() and tell it to switch to\n // the page we just modified.\n $.mobile.changePage( $page, options );\n\n //console.log(\"OPTIONS: \" + JSON.stringify(options));\n },function(e){\n console.log(\"ERROR in showProjectDetails: {0}\".format(JSON.stringify(e)));\n }\n );\n}", "getAboutDetailsById(id) {\n return axios.get(ABOUT_API_BASE_URL + \"/get-id/\" + id, {headers: AuthHeader()});\n }", "locate(id) {\n return this.show(id);\n }", "function getOne(req, res, next) {\n req.url = `/${req.params.nested}/${req.params.nestedId}`\n next()\n }", "find(id) {\n\t\treturn this.$http.get(this.path(id), {\n\t\t\tcache: this.cache\n\t\t}).then(response => {\n\t\t\tthis.addRecent(response.data);\n\n\t\t\treturn response.data;\n\t\t});\n\t}", "getAboutDetailsById(id) {\n return axios.get(ABOUT_API_BASE_URL + id);\n }", "function storylist_getitem(id){\n obj = stories.snapshotItem(cursorpointer);\n switch(id){\n //the currently selected element\n case \"self\":\n return obj;\n //The cursor place\n case \"cursor\":\n return obj.childNodes[0];\n //the story link\n case \"link\":\n return obj.childNodes[3].childNodes[0];\n //the comments link\n case \"comments\":\n return obj.nextSibling.childNodes[1].childNodes[4];\n //the vote up link\n case \"voteUp\":\n return obj.childNodes[2].childNodes[0].childNodes[0];\n //the vote down link\n //doesn't exist\n //then last element of the item\n case \"itemEnd\":\n return obj.nextSibling.nextSibling;\n //the \"more\" link\n case \"more\":\n return document.evaluate(\"//a[./text()='More']\",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;\n default:\n return null;\n }\n}", "function getItemById(data, id){\n return data[id];\n}", "function find(id, callback) {\n core.api('GET', '/properties/' + id, {}, callback);\n }", "function findPageById(pageId) {\n\n for(var p in pages) {\n\n if(pages[p]._id == pageId) {\n return angular.copy(pages[p]);\n }\n }\n return null;\n }", "function getResultById(id){\n\t\n\tvar results = getSortedResults();\n\tvar result = '';\n\tfor(i in results){\n\t\t//alert(' this id ['+results[i].id+'] looking for ['+id+']');\n\t\tif(results[i].id == id){\n\t\t\tresult = results[i];\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "getById(id) {\r\n return this._byId[id]\r\n }", "async getById (req, res) {\n const { id } = req.params\n\n const { properties, location} = await readExtractData(dataPath)\n\n let data = properties.filter(item => item.id == id)\n\n data = data ? data.map(buildObjResponse(location)): undefined\n\n res.json(data)\n }", "listing_get(id) {\n return this._get(`listing/${id}`);\n }", "function findPageById(pageId) {\n for (var p in pages) {\n if (pages[p]._id == pageId)\n return pages[p];\n }\n return null;\n }", "getItemById (context, id) {\n return itemGetter.getItemById(context, id);\n }", "function show(req, res) {\n PlanSection.findOne({ _plan_id: req.params.plan_id, _id: req.params.id }).then(handleEntityNotFound(res)).then(responseWithResult(res))['catch'](handleError(res));\n}", "function getObject(id) {\n\n for (var i = 0; i < MAR.objects.length; i++) {\n if (MAR.objects[i].id === id) {\n return MAR.objects[i];\n }\n }\n\n return null;\n\n}", "function getContent(data){\n\tvar pageIDs = Object.getOwnPropertyNames(data.query.pages);\n\tfor(var i = 0; i < pageIDs.length; i++){\n\t\t$(\".searchResults\").append(\"<div class=results><h3><a href='\" + articleURL + pageIDs[i] + \"' target='_blank'>\" + data.query.pages[pageIDs[i]].title + \"</a></h3><p>\" + data.query.pages[pageIDs[i]].extract + \"</p></div>\");\n\t}\n}", "async function getResource(identifier) {\n let res = await db.query('SELECT * FROM resources WHERE id = ?', [identifier])\n if (res.length > 0) return res[0]\n res = await db.query('SELECT * FROM resources WHERE reference = ?', [identifier])\n if (res.length > 0) return res[0]\n return null\n }", "function getPerson(pid) {\n for (i = 0; i< allResources.length; i++) {\n tempPerson = allResources[i];\n if (tempPerson.id == pid) {\n return tempPerson;\n }\n }\n}", "function getById(req, res) {\n return postsHandler.getById(req, res);\n}", "async function getResourceById(req, res) {\n let id = req.params.id;\n await Resource.findOne({ where: { id } })\n .then(resource => {\n if (resource === null) {\n return res.status(200).json({\n ok: false,\n message: 'No existe un recurso con ese id asociado',\n });\n } else {\n res.status(200).json({\n ok: true,\n message: 'correcto',\n resource\n });\n }\n })\n .catch(err => {\n res.status(500).json({\n ok: false,\n message: 'Ha ocurrido un error',\n error: err.message\n });\n });\n}", "function getPropertyDetail(uuid) {\r\n return get('/property/detail', { uuid: uuid }).then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "function showprofile(req, res) {\n const id = req.params.id; //pak de Id uit de URL \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('yourprofile.ejs', { //render de template en geeft profiles mee als argument\n profile: data\n });\n }\n }\n}", "function getAction(resourceId,actionId) {\n return $http({\n url: baseUrl + '/show/' + resourceId + '/' + actionId,\n method: 'GET'\n }).then(function(res){\n return res;\n }).catch(function(err){\n throw err;\n });\n }", "function handleDetail({\n id,\n nome,\n sexo,\n cpf,\n nascimento,\n cep,\n rua,\n numero,\n bairro,\n cidade,\n }) {\n dispatch(\n detailPessoaRequest(\n id,\n nome,\n sexo,\n cpf,\n nascimento,\n cep,\n rua,\n numero,\n bairro,\n cidade\n )\n );\n }", "function renderProductShow(id) {\n Products.show(id).then(product => {\n // console.log(`${product.id} - ${product.title}`)\n const showPage = document.querySelector('.page#product-show')\n const showPageHTML = `\n <h2>${product.title}</h2>\n <p>${product.description}</p>\n <a data-target=\"product-edit\" data-id=\"${ \n product.id \n }\" href=\"\">Edit</a>\n <br>\n <a data-target=\"delete-product\" data-id=\"${product.id}\" href=\"\">Delete</a>\n \n `\n showPage.innerHTML = showPageHTML;\n navigateTo('product-show')\n })\n}", "function Cache_Get_Resource(strId, listener, state)\n{\n\t//overload\n\treturn this.Get_Item(strId, __CACHE_TYPE_RESOURCE, listener, state);\n}", "function show(req, res) {\n return _news2.default.findById(req.params.id).populate('image', 'PublicID').exec().then(handleEntityNotFound(res)).then(respondWithResult(res)).catch(handleError(res));\n}", "function read(id, req, res, next) {\n model.findById(id, function(err, entity) {\n /* istanbul ignore next */ if (err) {\n return next(err);\n }\n\n if (!entity) {\n return next(new HttpError(404, 'Not found'));\n }\n\n return next(null, entity);\n });\n}", "function findById(resourceName, id) {\n\n \tconst collection = getModel(resourceName);\n\n \treturn Promise.all([\n \t\tcollection.findOne({ _id: id })\n \t])\n \t.then(data => {\n\n \t\tconst found = data.length;\n \t\tconst resp = {\n \t\t\tdoc: data[0],\n \t\t\tmetadata: {\n \t\t\t\tfound: found,\n \t\t\t\treturned: found\n \t\t\t}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.findById error\");\n \t});\n }", "function display(data) {\n var pages = data.query.pages\n var link = \"https://en.wikipedia.org/?curid=\";\n for(object in pages) {\n var id = pages[object].pageid\n\n $(\".results\").append(`<a href=\"${link+id}\"><div class=\"item\"><h6>${pages[object].title}</h6><p class=\"extract\">${pages[object].extract}</p></div></a>`);\n\n }\n}", "function detailsPage(id)\n{\n\t\n\tconsole.log(id);\n\tsessionStorage.setItem(\"page\", id);\n\tif(first_genre_resquest===true)\n\t\tsend(1,\"genre\");\n\telse \n\t\ttau.changePage('movieDetails.html');\n}", "show(req, res) {\n Item.findById(req.params.id)\n .then((item) => {\n res.status(200).json(item);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function showSearchInfo(id) {\n\turl = \"showSearchInfo.php?id=\" + id;\n\tdoAjaxCall(url, \"updateInfo\", \"GET\", true);\n}", "function show(req, res) {\n return _media2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(respondWithResult(res)).catch(handleError(res));\n}", "static getById(request, response) {\r\n\r\n itemsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n response.json(data); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.params.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error getting item by ID: ', request.params.id, err);\r\n });\r\n }", "getById(id)\n {\n return this.getModel()\n .find(id)\n .first();\n }", "function findPageById(pageId) {\n var url = \"/api/assignment/page/\" + pageId;\n return $http.get(url)\n .then(function(response) {\n return response.data;\n });\n }", "get(id) {\n return this.list({\n filter: {\n _id: id,\n },\n });\n }", "get(id) {\n return this.list({\n filter: {\n _id: id,\n },\n });\n }", "async function loadDetail(aWindow, id) {\n let loaded = wait_for_view_load(aWindow, undefined, true);\n // Check the detail view.\n if (aWindow.useHtmlViews) {\n let browser = await aWindow.getHtmlBrowser();\n let card = browser.contentDocument.querySelector(\n `addon-card[addon-id=\"${id}\"]`\n );\n EventUtils.synthesizeMouseAtCenter(card, {}, browser.contentWindow);\n } else {\n let card = aWindow.document.querySelector(`.addon.card[value=\"${id}\"]`);\n EventUtils.synthesizeMouseAtCenter(card, {}, aWindow);\n }\n await loaded;\n}", "static viewSpecificProperty(req, res) {\n const propertId = req.params.id;\n const property = properties.find(item => item.id == propertId);\n if (property) {\n return res.status(200).json({\n status: res.statusCode,\n data: property\n });\n }\n return res.status(404).json({\n status: res.statusCode,\n error: \"Property not Found\"\n });\n }", "async function getQuestionDetailsByID(req, res) {\n const _id = req.params.id;\n\n try {\n const search = await Question.findOne({ _id }).lean();\n const result = await getDetailsByID(search);\n\n if (result) {\n return res.send(result);\n }\n else {\n return res.status(jsonMessages.notFound.noRecordsId.status).send(jsonMessages.notFound.noRecordsId);\n }\n }\n catch (err) {\n return res.status(jsonMessages.error.dbError.status).send(jsonMessages.error.dbError);\n }\n}", "getById(id) {\n console.log(\"getById(\" + id + \")\");\n let result = this.tvShows.find(show =>\n (show === undefined ? null : show.id) == id);\n if (result) return result;\n else return null;\n }", "function get(id) {\n return $.getJSON(\"/api/movies/\" + id);\n }", "static getTodoDetails(id) {\n return dispatch => {\n dispatch(actionDispatch(ActionType.GET_TODO_DETAIL));\n get(id)\n .then(response => {\n dispatch(\n actionDispatch(\n ActionType.GET_TODO_DETAIL_SUCCESS,\n response\n )\n );\n })\n .catch(error => {\n dispatch(\n actionDispatch(ActionType.GET_TODO_DETAIL_FAIL, error)\n );\n });\n };\n }", "function getOneBook(id){\n return fetch(baseURL + `/${id}`)\n .then(res => res.json())\n }", "function _getPropertyById(req, res, next) {\n\tvar propertyId = req.params.id;\n\n\tif (!COMMON_ROUTE.isValidId(propertyId)) {\n\t\tjson.status = '0';\n\t\tjson.result = { 'message': 'Invalid Property Id!' };\n\t\tres.send(json);\n\t} else {\n\t\tPROPERTIES_COLLECTION.findOne({ _id: new ObjectID(propertyId) }, function (propertyerror, getProperty) {\n\t\t\tif (propertyerror || !getProperty) {\n\t\t\t\tjson.status = '0';\n\t\t\t\tjson.result = { 'message': 'Property not exists!' };\n\t\t\t\tres.send(json);\n\t\t\t} else {\n\t\t\t\tjson.status = '1';\n\t\t\t\tjson.result = { 'message': 'Property found successfully.', 'property': getProperty };\n\t\t\t\tres.send(json);\n\t\t\t}\n\t\t});\n\t}\n}" ]
[ "0.6858605", "0.6452224", "0.6366965", "0.6130027", "0.5996583", "0.59055376", "0.5904605", "0.58767796", "0.58246654", "0.58035046", "0.58000565", "0.576909", "0.5729735", "0.5662616", "0.56441313", "0.56439996", "0.5630356", "0.56002593", "0.55991536", "0.55722535", "0.55572987", "0.55437213", "0.553161", "0.5508321", "0.5507715", "0.55064565", "0.54782593", "0.5470511", "0.54637235", "0.5457152", "0.54546195", "0.54535216", "0.5442108", "0.54367036", "0.54003936", "0.5400123", "0.5397388", "0.5396814", "0.5394306", "0.53886455", "0.53818905", "0.537628", "0.5366761", "0.53656155", "0.53632814", "0.536053", "0.5347038", "0.53404313", "0.53404313", "0.53359985", "0.53359544", "0.53321457", "0.53251415", "0.5315905", "0.5311202", "0.53002596", "0.52997214", "0.52839166", "0.5280875", "0.52755696", "0.5274147", "0.52739644", "0.5271198", "0.5270388", "0.52662927", "0.52569205", "0.52565676", "0.5252007", "0.52517587", "0.5250263", "0.523337", "0.5231496", "0.5227512", "0.52226126", "0.52125055", "0.5211519", "0.520929", "0.5206574", "0.5206218", "0.5205644", "0.5202882", "0.51982397", "0.5192418", "0.51873356", "0.5187221", "0.51843107", "0.51558936", "0.5139239", "0.5137893", "0.5135313", "0.5130893", "0.5130893", "0.5130859", "0.5130725", "0.51301825", "0.5128477", "0.51275915", "0.5126517", "0.5122508", "0.51215404" ]
0.5943598
5
retorna "O cachorro faz auau" ES5 version
function ES5Animal(type, sound) { this.type = type; this.sound = sound; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Js(e){return(Js=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function es6(){\n return {\n name: 'ECMAScript (ES5)',\n release: 2009\n };\n}", "function Es(e){return(Es=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function Transform$7() {}", "get Alpha2() {}", "get Alpha5() {}", "get Alpha1() {}", "get Alpha9() {}", "private public function m246() {}", "function ecma (){}", "function ze(a){return a&&a.ae?a.ed():a}", "get Alpha6() {}", "function toJs(v) { return v; } //D: compatibilidad con rt_java ", "function ea(){}", "function es(t, e) {\n return t + \" \" + e + (1 === t ? \"\" : \"s\");\n}", "get Alpha7() {}", "get Sattolo(){ return 4; }", "function qv() {}", "function es1(params) {\n \n}", "transient final protected internal function m174() {}", "function Ha(){}", "static final private internal function m106() {}", "get Alpha8() {}", "function s(e){return e}", "protected internal function m252() {}", "function munculkanAngkaDua() {\n return 2;\n}", "get Alpha4() {}", "Es(){\r\n return 29000\r\n }", "function v20(v21,v22) {\n const v24 = {b:v17,c:v21,d:v21,e:\"unicode\",length:\"unicode\",valueOf:1337};\n // v24 = .object(ofGroup: Object, withProperties: [\"length\", \"__proto__\", \"valueOf\", \"b\", \"e\"], withMethods: [\"d\", \"c\"])\n function v25(v26,v27) {\n \"unicode\"[v1] = v11;\n const v28 = 0;\n // v28 = .integer\n let v30 = \"unicode\";\n while (v30 < 6) {\n const v31 = v16 + 1;\n // v31 = .primitive\n v30 = v31;\n }\n const v34 = Symbol.match;\n // v34 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v35 = (100).toLocaleString();\n // v35 = .unknown\n let v36 = v35;\n v36 = v34;\n const v37 = v35.split(v36);\n // v37 = .unknown\n const v38 = 0;\n // v38 = .integer\n const v39 = 5;\n // v39 = .integer\n const v40 = 1;\n // v40 = .integer\n const v41 = 0;\n // v41 = .integer\n const v42 = 8;\n // v42 = .integer\n const v43 = 1;\n // v43 = .integer\n return v35;\n }\n const v45 = new Promise(v25);\n // v45 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n const v46 = 0;\n // v46 = .integer\n const v47 = 8;\n // v47 = .integer\n const v48 = 1;\n // v48 = .integer\n const v50 = \"unicode\".padStart(1337,v20);\n // v50 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v51 = Function(v50);\n // v51 = .unknown\n const v52 = 785494185n;\n // v52 = .bigint\n with (v50) {\n const v53 = EPSILON;\n // v53 = .unknown\n }\n return 1337;\n }", "static transient final private internal function m43() {}", "function holaMundo () {\n let saludo = \"Estoy aprendiendo js\"\n return saludo;\n}", "private internal function m248() {}", "get BC5() {}", "function va(t,e){0}", "ladrar(){\n return 'Waau'\n }", "get Alpha3() {}", "transient protected internal function m189() {}", "function index_browser_es_f() {}", "function AeUtil() {}", "static transient final private public function m41() {}", "transient private protected internal function m182() {}", "static transient final protected public internal function m46() {}", "async function v14(v15,v16) {\n const v18 = [13.37,13.37,13.37,13.37,13.37];\n // v18 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n let v20 = v18;\n arguments[4294967295] = v20;\n const v21 = eval;\n // v21 = .function([.string] => .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"slice\", \"endsWith\", \"startsWith\", \"lastIndexOf\", \"matchAll\", \"repeat\", \"concat\", \"match\", \"includes\", \"padEnd\", \"charAt\", \"substring\", \"charCodeAt\", \"replace\", \"split\", \"indexOf\", \"trim\", \"padStart\", \"search\", \"codePointAt\"]))\n}", "function palabra() {\n return 'gato';\n}", "function ji(e){return(ji=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "transient private internal function m185() {}", "function w(e) {\n var t = C(e);\n switch (t) {\n case \"array\":\n case \"object\":\n return \"an \" + t;\n\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + t;\n\n default:\n return t;\n }\n }", "function v(e){return(v=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function s(){}", "function yo(){ }", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function o0(stdlib,o1,buffer) {\n try {\nthis.o559 = this.o560;\n}catch(e){}\n var o2 = o254 = [].fround;\n //views\n var charCodeAt =new Map.prototype.keys.call(buffer);\n\n function o4(){\n var o5 = 0.5\n var o35 = { writable: false, value: 1, configurable: false, enumerable: false };\n try {\no849 = o6;\n}catch(e){}\n try {\nreturn +(o0[o1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "falar2(){\n console.log('Olá2') \n }", "get z() {}", "function o0(e = 'default argument') {\n try { {\n var o3 = () => { try {\n'use strict';\n}catch(e){} }\n\n try {\no18(o3, \"Strict-mode lambda\");\n}catch(e){}\n } } catch(e) {}try { try {\nPromise.call(promise, undefined);\n}catch(e){} } catch(e) {}\n}", "get Alpha0() {}", "function getVardas() {\n return \"Tadas\";\n}", "function cc(){var a;!(a=Ja()&&!Zb(10))&&(a=bc||ac)&&(a=!(0<=ua($b,10)));this.ae=a;this.fg=!(this.ae||Jb&&!Zb(10));!Jb||Zb(11);this.Ug=Ka()||Ja();this.ug=n(window.Map)&&n(window.Map.prototype.values)&&n(window.Map.prototype.forEach)&&!this.ae;this.vg=n(window.Set)&&n(window.Set.prototype.values)&&n(window.Set.prototype.forEach)&&!this.ae}", "static transient private public function m56() {}", "function r(e){return!0===Object(o.a)(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function halo() {\n return '\"Halo Sanbers!\"';\n}", "function es(e){return void 0===e&&(e=null),bn(null!==e?e:\"store\")}", "jubilar() {\n let jubilacion = this.edad >= 45 ? true : false;\n\n return (\"\" + jubilacion);\n }", "function Interfaz(){}", "function ISO_2022() {}", "function ISO_2022() {}", "get BC7() {}", "get normal() {}", "get normal() {}", "get BC4() {}", "function s(t,e){if(\"function\"==typeof t)return t(e);var r=Object.keys(e),n=!0,i=!1,o=void 0;try{for(var s,a=r[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=s.value;\"message\"!==u&&(t=t.replace(\"{\"+u.toUpperCase()+\"}\",e[u]))}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return t}", "function SoloValue() {}", "function Pythia() {}", "function StupidBug() {}", "static transient private protected internal function m55() {}", "function s(e){return e&&e.__esModule?e:{default:e}}", "function s(e){return e&&e.__esModule?e:{default:e}}", "function f(){return{range:function(e,t,a){void 0===t?(t=e,e=0,a=1):a||(a=1);var n=[];if(a>0)for(var r=e;r<t;r+=a)n.push(r);else for(var f=e;f>t;f+=a)\n // eslint-disable-line for-direction\n n.push(f);return n},cycler:function(){return n(Array.prototype.slice.call(arguments))},joiner:function(e){return r(e)}}}", "static transient final protected internal function m47() {}", "async function v15(v16,v17) {\n let v19 = 0;\n const v21 = v19 + 1;\n // v21 = .primitive\n const v22 = 0;\n // v22 = .integer\n Symbol[Object] = Uint8ClampedArray;\n const v24 = 1;\n // v24 = .integer\n for (const v25 in Symbol) {\n for (let v29 = 0; v29 < 100; v29 = v29 + 1) {\n }\n Math.toString = Object;\n let v32 = 0;\n while (v32 < 3) {\n let v33 = 1337;\n v33 = Int32Array;\n const v34 = v32 + 1;\n // v34 = .primitive\n v32 = v34;\n }\n const v35 = v25 / Math;\n // v35 = .integer | .float | .bigint\n for (let v41 = 3; v41 < 100; v41 = v41 + -2147483647) {\n }\n const v43 = [13.37,v21];\n // v43 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v45 = [Symbol,\"YEl96px1t8\",1337,\"YEl96px1t8\",Symbol,v43,1337];\n // v45 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v47 = \"127\".toLocaleString();\n // v47 = .unknown\n }\n}", "function __strict(x) {return x}", "function __strict(x) {return x}", "function v25(v26,v27) {\n \"unicode\"[v1] = v11;\n const v28 = 0;\n // v28 = .integer\n let v30 = \"unicode\";\n while (v30 < 6) {\n const v31 = v16 + 1;\n // v31 = .primitive\n v30 = v31;\n }\n const v34 = Symbol.match;\n // v34 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v35 = (100).toLocaleString();\n // v35 = .unknown\n let v36 = v35;\n v36 = v34;\n const v37 = v35.split(v36);\n // v37 = .unknown\n const v38 = 0;\n // v38 = .integer\n const v39 = 5;\n // v39 = .integer\n const v40 = 1;\n // v40 = .integer\n const v41 = 0;\n // v41 = .integer\n const v42 = 8;\n // v42 = .integer\n const v43 = 1;\n // v43 = .integer\n return v35;\n }", "function u(e){switch(e){case\"class\":case\"enum\":case\"export\":case\"extends\":case\"import\":case\"super\":return!0;default:return!1}}", "static private internal function m121() {}", "function Bevy() {}", "function lol(){\r\n return 'kelly';\r\n}", "function laughh() {\n\treturn 'hahahahahahahahahaha!';\n}", "function w(e) {\n var t = C(e);\n switch (t) {\n case \"array\":\n case \"object\":\n return \"an \" + t;\n\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + t;\n\n default:\n return t;\n }\n }", "function david () {\n return 'david'\n}", "function version(){ return \"0.13.0\" }", "function b(){var a,b=\"axe\",c=\"\";return\"undefined\"!=typeof axe&&axe._audit&&!axe._audit.application&&(b=axe._audit.application),\"undefined\"!=typeof axe&&(c=axe.version),a=b+\".\"+c}", "function a(){return s}", "function vetorCOPIA_DO_PYTHON_QUE_O_JAVASCRIPT_ROUBOU(){\n for(let pos in valores){\n console.log(`A posição ${pos} tem o valor: ${valores[pos]}`);\n }\n}", "function value() { }", "static get JAMMED() {\n return 'JAMMED';\n }", "function t(e){return e}", "function brendanEichQuote() {\n console.log('Always bet on JavaScript.');\n }" ]
[ "0.62553567", "0.5938019", "0.58995223", "0.5838787", "0.58318746", "0.5823015", "0.57887906", "0.5786807", "0.5776132", "0.576695", "0.5726405", "0.57224286", "0.5667671", "0.56648153", "0.5638636", "0.56245565", "0.55804795", "0.55528444", "0.55331165", "0.55290467", "0.5527522", "0.5522108", "0.55159265", "0.5514763", "0.5513359", "0.5486908", "0.54689336", "0.5461645", "0.54381263", "0.5432777", "0.54180634", "0.541765", "0.5416948", "0.54145896", "0.5405374", "0.5399631", "0.53955096", "0.5393763", "0.5382849", "0.53648156", "0.5358358", "0.5352339", "0.53521323", "0.53476137", "0.5344182", "0.5338726", "0.5337932", "0.5336791", "0.5335615", "0.5334051", "0.53249335", "0.53249335", "0.53249335", "0.53249335", "0.53164047", "0.5312681", "0.53000635", "0.52989656", "0.52980983", "0.5297808", "0.5291481", "0.5275978", "0.5275926", "0.5267734", "0.52671033", "0.5265397", "0.5264372", "0.52620685", "0.52620685", "0.5260477", "0.52586", "0.52586", "0.5257078", "0.5256782", "0.5250344", "0.5244272", "0.5242844", "0.52363986", "0.523611", "0.523611", "0.52327394", "0.5229106", "0.52283436", "0.522657", "0.522657", "0.52258414", "0.5216244", "0.52136314", "0.52069783", "0.52064085", "0.5204772", "0.5203704", "0.52028966", "0.5197497", "0.519595", "0.519544", "0.5193719", "0.5174975", "0.5174384", "0.5173164", "0.51700234" ]
0.0
-1
Function for email address validation
function isValidEmail(emailAddress) { var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); return pattern.test(emailAddress); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleEmailValidation(emailAddress) {\n\n}", "function validEmail(value) {\n const addy = /\\S+@\\S+\\.\\S+/;\n if (value.match(addy)) return true;\n else return \"Please enter a valid email address.\";\n}", "function validarEmail(email){expr=/^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;if(!expr.test(email)) return false;else return true;}", "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 emailValidation(){\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(emailNode.value)){\n return true;\n }\n alert(\"You have entered an invalid email address!\");\n return false;\n }", "function validateEmail(email) \r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function email() {\n var errors = document.querySelector(\"#errors\");\n var email = document.querySelector(\"#email\");\n var string = email.value.trim();\n var patt = /^[a-z0-9_\\-\\.]+\\@[a-z]+\\.[a-z]{2,4}$/i;\n if(!patt.test(string)) {\n errorMessage(\"<p>Please enter a valid Email address</p>\");\n return false;\n } else {\n return true;\n }\n}", "function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "function validate_email_address(value) {\n var patt = /^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i;\n return patt.test(value);\n}", "function validateEmail(email)\r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function validateEmail (email) {\n return /\\S+@\\S+\\.\\S+/.test(email)\n}", "function isValidEmail(address) {\n if (address != '' && address.search) {\n if (address.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/) != -1) return true;\n else return false;\n }\n \n // allow empty strings to return true - screen these with either a 'required' test or a 'length' test\n else return true;\n}", "function validateEmail() {\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(email.val());\r\n}", "function ValidateEmail(email)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function validateEmail(email) {\n\tvar valid \n\treturn valid = /\\S+@\\S+\\.\\S+/.test(email);\n}", "function isValidEmailAddress( email ) {\n var rVal = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\n return rVal.test( email );\n}", "function validateEmail(input) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(input)) {\n return true;\n } else {\n return \"Please enter a valid email address!\";\n }\n}", "function validateEmailFormat()\n{\n var status;\n var x = $(\"#email\").val();\n var atpos = x.indexOf(\"@\");\n var dotpos = x.lastIndexOf(\".\");\n if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length)\n {\n status = \"invalid\";\n }\n return status;\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 isValidEmailAddress(email) {\n return emailFormat.test(email);\n}", "function validateEmail(){\n var regex = /([a-z]*|[A-Z]*)(@)([a-z]*|[A-Z]*)(.com)$/;\n if(regex.test(signUpEmail.value) == true){\n return true;\n }else{\n return false;\n }\n}", "function emailValidate(str){return /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i.test(str/*email*/)} //@return{boolean} True if str is valid email address //@param{string} str The string to be tested // Should be copy/pasted to client-side JS // function test(){var ar=[\"random@example\",\"random@example.com\",\"randomexample.com\"],i=ar.length,out=[];while(i--){out.push(emailValidate(ar[i]))}Logger.log(out)} // Sample call: if(!LibraryjsUtil.emailValidate(email)){alert(\"Enter valid email address.\");return} // References: http://www.regular-expressions.info/email.html | http://www.regexmagic.com/patterns.html // Note: Since this function is usually called client-side, we might want to copy/paste; a sample call might resemble this: if(!/\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i.test(email)){alert(\"Enter valid email address.\");return}", "function validateEmail() {\n var email = document.getElementById(\"email\").value;\n if (/\\S+@\\S+\\.\\S+/.test(email)) {\n return true;\n }\n alert(\"Email inválido!\")\n return false;\n}", "function validateEmail(addr,man,db) {\n\tif (addr == '' && man) {\n\t if (db) alert('email address is mandatory');\n\t return false;\n\t}\n\tvar invalidChars = '\\/\\'\\\\ \";:?!()[]\\{\\}^|';\n\tfor (i=0; i<invalidChars.length; i++) {\n\t if (addr.indexOf(invalidChars.charAt(i),0) > -1) {\n\t\t if (db) alert('email address contains invalid characters');\n\t\t return false;\n\t }\n\t}\n\tfor (i=0; i<addr.length; i++) {\n\t if (addr.charCodeAt(i)>127) {\n\t\t if (db) alert(\"email address contains non ascii characters.\");\n\t\t return false;\n\t }\n\t}\n\t\n\tvar atPos = addr.indexOf('@',0);\n\tif (atPos == -1) {\n\t if (db) alert('email address must contain an @');\n\t return false;\n\t}\n\tif (atPos == 0) {\n\t if (db) alert('email address must not start with @');\n\t return false;\n\t}\n\tif (addr.indexOf('@', atPos + 1) > - 1) {\n\t if (db) alert('email address must contain only one @');\n\t return false;\n\t}\n\tif (addr.indexOf('.', atPos) == -1) {\n\t if (db) alert('email address must contain a period in the domain name');\n\t return false;\n\t}\n\tif (addr.indexOf('@.',0) != -1) {\n\t if (db) alert('period must not immediately follow @ in email address');\n\t return false;\n\t}\n\tif (addr.indexOf('.@',0) != -1){\n\t if (db) alert('period must not immediately precede @ in email address');\n\t return false;\n\t}\n\tif (addr.indexOf('..',0) != -1) {\n\t if (db) alert('two periods must not be adjacent in email address');\n\t return false;\n\t}\n\tvar suffix = addr.substring(addr.lastIndexOf('.')+1);\n\tif (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {\n\t if (db) alert('invalid primary domain in email address');\n\t return false;\n\t}\n\treturn true;\n}", "function checkEmailAddress() {\n var pattern = new RegExp(/^[+a-zA-z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{3,3}$/i);\n\n if(pattern.test($('#emailAddress').val())){\n $('#emailError').text(' ');\n return true;\n } else {\n $('#emailError').text('Email address is invalid');\n return false;\n }\n}", "_emailValidation(emailString) {\n console.log(emailString)\n if (/(.+)@(.+){2,}\\.(.+){2,}/.test(emailString)) {\n return true\n } else {\n return false\n }\n }", "function emailValidate(email) {\n let mailFormat = /^([A-Za-z0-9_\\-\\.]+)@([A-Za-z0-9-]+).([A-Za-z]{2,8})(.[A-Za-z]{2,8})?$/; \n if (mailFormat.test(email)) /* (email.value.match(mailFormat)) */ {\n return true;\n }\n else {\n alert('Invalid Email Address');\n return false;\n }\n}", "function is_valid_email_address(address) {\n var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.com$/);\n return pattern.test(address);\n}", "function checkemail(inputemail){\n if(!inputemail.value.match(/^([a-zA-Z0-9\\_\\-\\.])+@([a-zA-Z0-9\\_\\-])+((\\.[a-zA-Z0-9]{2,4}){1,2})$/)){\n document.getElementById(\"Email\").innerHTML = \"Invalid email address\"+\"<br>\";\n inputemail.value = \"\";\n return false;\n }\n else\n return true;\n}", "function isValidEmailAddress(inputEmail) {\n var pattern = new RegExp(/^((\"[\\w-+\\s]+\")|([\\w-+]+(?:\\.[\\w-+]+)*)|(\"[\\w-+\\s]+\")([\\w-+]+(?:\\.[\\w-+]+)*))(@((?:[\\w-+]+\\.)*\\w[\\w-+]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][\\d]\\.|1[\\d]{2}\\.|[\\d]{1,2}\\.))((25[0-5]|2[0-4][\\d]|1[\\d]{2}|[\\d]{1,2})\\.){2}(25[0-5]|2[0-4][\\d]|1[\\d]{2}|[\\d]{1,2})\\]?$)/i);\n\tvar emailAddress = inputEmail.val();\n\tvar emailLength = emailAddress.length;\n\tif (!pattern.test(emailAddress) && emailLength <= 80) {\n\t\tvar errorMsg = 'Please enter a <strong>valid</strong> email address';\n\t\t$(inputEmail).parent().parent().append('<span class=\"help-block\">' + errorMsg + '</small>').addClass('has-error');\t\n\t}\n\telse if (emailLength > 80) {\n\t\tvar errorMsg = 'Email address must be less than 80 characters'\n\t\t$(inputEmail).parent().parent().append('<small class=\"help-block\">' + errorMsg + '</small>').addClass('has-error');\t\n\t}\n return pattern.test(emailAddress);\t\n}", "function emailValidate(emailAddress) {\n\tvar emailAddressTrimmed = TrimString(emailAddress + \"\");\n\tif (emailAddressTrimmed != \"\") {\n\t\tif (checkSpecialScenarios(emailAddressTrimmed) == false)\n\t\t\treturn false;\n\t\tvar parts = emailAddressTrimmed.splitRemoveEmpties('@');\n\t\tif (emailAddressTrimmed.substr(emailAddressTrimmed.length - 1) == '@')\n\t\t\treturn false;\n\t\tif (parts.length == 2) {\n\t\t\tfor (var i = 0; i < parts.length; i++) {\n\t\t\t\tif (!RegExValidate('^[A-Z0-9]$', parts[i].substr(0, 1), 'i') || (!RegExValidate('^[A-Z0-9]$', parts[i].substr(parts[i].length - 1), 'i')) || (!RegExValidate('^[A-Z0-9_%-\\\\.]+$', parts[i].substr(1, parts[i].length - 1), 'i')))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar lastDotPos = parts[1].lastIndexOf('.');\n\t\t\tif (lastDotPos < 0 || parts[1].substr(lastDotPos).length < 3 || (!RegExValidate('^[A-Z]+$', parts[1].substr(lastDotPos + 1), 'i')))\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}\n\telse\n\t\treturn false;\n}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\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}", "function checkEmail() {\r\n const emailValue = email.value.trim();\r\n\r\n var mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\r\n if (emailValue === '' || !emailValue.match(mailformat)) {\r\n isValid &= false;\r\n setErrorFor(email, 'Email not valid');\r\n return;\r\n }\r\n\r\n isValid &= true;\r\n}", "function validateEmail(value) {\n var x = value;\n var atpos = x.indexOf(\"@\");\n var dotpos = x.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {\n return false;\n }\n\n\t\treturn true;\n}", "function validate_email(email_input) {\n //if email doesn't follow a\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email_input) == false) {\n //push error that email is invalid\n email_registration_errs.push('Email is invalid');\n }\n }", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "validateEmail(value) {\n let error;\n if (!value) {\n error = 'Required';\n } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(value)) {\n error = 'Invalid email address';\n }\n return error;\n }", "checkEmail(value) {\n\t\tif (value.includes('@') && value.includes('.') && !value.includes(' ')) {\n\t\t\treturn '';\n\t\t} else {\n\t\t\treturn 'Invalid email address'\n\t\t}\n\t}", "function checkEmail(input){\n\n const exp = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/; \n\n if(exp.test(input.value)){\n success(input);\n } else{\n error(input, \"Wrong email address!\");\n }\n}", "function validateEmail(email) \n{\n var pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$/;\n if(email.match(pattern))\n {\n return true;\n }\n return false;\n}", "function validateEmail(email)\n{\n var splitted = email.match(\"^(.+)@(.+)$\");\n if (splitted == null) return false;\n if (splitted[1] != null)\n {\n var regexp_user = /^\\\"?[\\w-_\\.]*\\\"?$/;\n if (splitted[1].match(regexp_user) == null) return false;\n }\n if (splitted[2] != null)\n {\n var regexp_domain = /^[\\w-\\.]*\\.[A-Za-z]{2,4}$/;\n if (splitted[2].match(regexp_domain) == null)\n {\n var regexp_ip = /^\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\]$/;\n if (splitted[2].match(regexp_ip) == null) return false;\n } // if\n return true;\n }\n return false;\n}", "function validateEmail(mail)\n{\n return (/^\\w+([.-]?\\w+)*@\\w+([.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail))\n}", "function ValidateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return (true)\n }\n //alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function checkEmail() {\n var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n \n if (pattern.test(emailInput.val())) {\n emailInput.removeClass(\"error\");\n $(\"#email_error_message\").hide();\n }\n else {\n $(\"#email_error_message\").html(\"Enter valid email address\");\n $(\"#email_error_message\").show();\n emailInput.addClass(\"error\");\n error_email = true;\n }\n }", "function emailValidation(email){\n const regEx = /\\S+@\\S+\\.\\S+/;\n const patternMatch = regEx.test(email);\n return patternMatch;\n}", "function validate_email_format(email){\n /// Returns true if email is valid, false otherwise ///\n var re = /^\\w+([-+.'][^\\s]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\n return re.test(email)\n}", "function check_email() {\n\n\t\tvar pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n\t\n\t\tif(pattern.test($(\"#email\").val())) {\n\t\t\t$(\"#erroremail\").hide();\n\t\t} else {\n\t\t\t$(\"#erroremail\").html(\"Direccion inválida\");\n\t\t\t$(\"#erroremail\").show();\n\t\t\terror_email = true;\n\t\t}\n\t\n\t}", "function checkEmail() {}", "function validarEmail(email) {\n\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if ( !expr.test(email) )\n swal(\"Error: Correo Incorrecto\", \"\", \"info\");\n \n\n }//end function validarEmail", "function validateEmail () {\n let emailAddress = emailInput.value;\n\n if (/^(([^<>()\\[\\]\\\\.,;:\\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,}))$/i.test(emailAddress)) {\n isValid(emailInput);\n isEmailValid = true;\n emailError.textContent = '';\n } else if (!(emailAddress.length > 0)) {\n isInvalid(emailInput);\n isEmailValid = false;\n emailError.textContent = 'Field is empty.';\n } else {\n isInvalid(emailInput);\n isEmailValid = false;\n emailError.textContent = 'Email is not a valid format.';\n }\n}", "function validateEmail(anEmail) {\n var mailFormat = /^\\W+([\\.-]?\\W+)*@\\W+([\\.-]?\\W+)*(\\.\\W{2,3})+$/;\n if (anEmail.value.match(mailFormat)) {\n return true;\n } else {\n alert(\"The email format is wrong\");\n anEmail.style.border = \"2px solid red\";\n anEmail.focus();\n return false;\n }\n }", "function checkEmail(input){\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 if(re.test(input.value.trim())){\r\n showSuccess(input);\r\n }else{\r\n showError(input, ' email is not valid');\r\n }\r\n}", "function validateEmail(emailUT) {\n var filter = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/; \n\n if(!filter.test(emailUT.value)) {\n \tmyApp.alert(\"Invalid email address\", \"Login Failed\");\n \treturn false;\n } else {\n \treturn true;\n }\n}", "validateEmail(value) {\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(value);\n}", "function emailValidation(inputtext) {\n var emailExp = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$|^$/;\n if (inputtext.value.match(emailExp)) {\n return true;\n }\n alert(\"Valid E-Mail Address Required!\");\n inputtext.focus();\n return false;\n}", "function emailValid(){\n if(/\\S+@\\S+\\.\\S+/g.test(email)){\n setErrors('')\n return true\n }else{\n setErrors('Email is not valid!')\n }\n return false\n }", "function validateEmail(email) //source: http://form.guide/best-practices/validate-email-address-using-javascript.html\n {\n \t /* Simple Regex that passes for almost every valid email */\n var re = /^(?:[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n return re.test(email); //Returns True if Emails Passes Test\n /* Currently not being used, but may be useful in the future */\n }", "function validateEmail(email) {\r\n var filter = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\r\n if (filter.test(email)) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\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 validEmailAddress(email) {\n var pattern = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\n return pattern.test(email);\n}", "function validarEmail(email){\n var regex = /^\\w+([\\.\\+\\-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/.test(email); \n return regex;\n }", "function validate(a) {\n var email = a.value;\n var email_invalid = false;\n if (!validateEmail(email)) {\n return true;\n }\n return false;\n}", "function ValidateEmail(inputText){\n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(inputText.match(mailformat))\n return true;\n else\n return false;\n }", "function EmailValidation(getEmail) {\n var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;\n if (regExp.test(getEmail)) return true;\n else return false;\n}", "function validEMail(addr){\r\n\tvar filter = /^([\\d\\w\\.\\-\\+])+\\@(([\\d\\w\\-\\+])+\\.)+([a-zA-Z]{2,})$/;\r\n\treturn (filter.test(addr));\r\n}", "function validate_email(email) {\n if (email.length > 0) {\n var regexp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+.)+[A-Z]{2,4}$/i;\n return regexp.test(email);\n }\n return false;\n}", "validateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n }", "function ValidateEmail()\n {\n var uemail = document.registration.email;\n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(uemail.value.match(mailformat))\n {\n document.registration.address.focus();\n return true;\n }\n else\n {\n alert(\"You have entered an invalid email address!\");\n uemail.focus();\n return false;\n }\n }", "validateEmail(val) {\n\t\tconst email = _.trim(val);\n\t\tif (_.isEmpty(email)) {\n\t\t\treturn new Error('Email cannot be empty');\n\t\t}\n\t\tif (!email.includes('@')) {\n\t\t\treturn new Error('Please enter a valid email');\n\t\t}\n\t}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function emailIsValid (email) {\r\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)\r\n}", "function validateEmail() {\n var e = /^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/;\n var t = document.getElementById(\"Email\").value;\n if (t.match(e)) {\n return true\n } else {\n return false\n }\n}", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function validateEmail(x) {\n if (\n /* x must start with at least one letter, digit, period or dash (ex: this is the user part in user@domain.ca ), \n followed by a \"@\", followed by at least one digit, letter, or dash and a period afterwards (ex: this is the \n \"domain.\" part in user@domain.ca and can be repeated mor than once for ex: user@domain1.domain2.ca ) and at \n least 2 characters afterwards (this is the extension, the \"ca\" part in user@domain.ca).\n */\n !/^([a-zA-Z0-9_\\.\\-])+@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,})+$/.test(x)\n ) {\n return false; //x is not in an appropriate format\n }\n return true;\n}", "function isEmailAddressValid(str) {\n\n var pattern = /^[a-zA-Z_\\.0-9]+@[a-zA-Z_]+?\\.[a-zA-Z\\.]{2,10}$/;\n return str.match(pattern); \n}", "function validEmail(check){\n return /^\\w+@\\w+(\\.(\\w)+)$/i.test(check.value);\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}", "function emailValidate(email){\n const emailCorrect = /\\S+@\\S+\\.\\S+/;\n if((email.charAt(0)===\".\")||(email===\"\")){\n return \"your email is invalid\" \n }\n else if(email.match(emailCorrect)){\n return true\n }\n else{\n return \"your email is invalid\"\n }\n\n}", "function validateEmail() \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(testForm.email.value))\n {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n}", "validateEmail(email) {\n if(email.length > 0) {\n const regex = /^([a-zA-Z0-9_\\-.]+)@([a-zA-Z0-9_\\-.]+)\\.([a-zA-Z]{2,5})$/;\n return regex.test(email);\n }\n return false;\n }", "function validateEmail()\n {\n \n var x=document.forms[\"profile\"][\"email\"].value;\nvar atpos=x.indexOf(\"@\");\nvar dotpos=x.lastIndexOf(\".\");\nif (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)\n {\n alert(\"e-mail address is not valid\");\n return false;\n }\n \n }", "function checkEmail(input){\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if(re.test(input.value.trim())){\n showSuccess(input);\n }\n else{\n showError(input, \"Email is not valid\");\n }\n}", "function ValidEmail(field)\n{\n\t\t\t\tif(field.value == \"\")\n\t\t\t\t\t return true;\n\t\tif ((field.value.indexOf(\"@\") < 1) || (field.value.indexOf(\".\") < 1))\n\t\t{\n\t\t\t\t\tDspAlert(field,Message[29]);\n\t\t\t\t\treturn false;\n\n\t\t}\n\t\treturn true;\n\n}", "function validateEmailField(email) {\n if (email.indexOf(\"@\") > -1) {\n if (email.split(\"@\").length == 2 && email.split(\"@\")[1] != \"\") {\n return true;\n }\n return false;\n }\n return false;\n}", "function checkEmail(emailAddress) {\n var sQtext = '[^\\\\x0d\\\\x22\\\\x5c\\\\x80-\\\\xff]';\n var sDtext = '[^\\\\x0d\\\\x5b-\\\\x5d\\\\x80-\\\\xff]';\n var sAtom = '[^\\\\x00-\\\\x20\\\\x22\\\\x28\\\\x29\\\\x2c\\\\x2e\\\\x3a-\\\\x3c\\\\x3e\\\\x40\\\\x5b-\\\\x5d\\\\x7f-\\\\xff]+';\n var sQuotedPair = '\\\\x5c[\\\\x00-\\\\x7f]';\n var sDomainLiteral = '\\\\x5b(' + sDtext + '|' + sQuotedPair + ')*\\\\x5d';\n var sQuotedString = '\\\\x22(' + sQtext + '|' + sQuotedPair + ')*\\\\x22';\n var sDomain_ref = sAtom;\n var sSubDomain = '(' + sDomain_ref + '|' + sDomainLiteral + ')';\n var sWord = '(' + sAtom + '|' + sQuotedString + ')';\n var sDomain = sSubDomain + '(\\\\x2e' + sSubDomain + ')*';\n var sLocalPart = sWord + '(\\\\x2e' + sWord + ')*';\n var sAddrSpec = sLocalPart + '\\\\x40' + sDomain; // complete RFC822 email address spec\n var sValidEmail = '^' + sAddrSpec + '$'; // as whole string\n\n var reValidEmail = new RegExp(sValidEmail);\n\n if(reValidEmail.test(emailAddress)== true) {\n return true;\n }else{\n alert(\"Please input a valid email address!\")\n return false;\n }\n}", "function emailValidation()\n {\n let re = /\\S+@\\S+\\.\\S+/;\n if (re.test(emailText)==false)\n {\n setErrorEmail(\"אנא הזן אימייל תקין\");\n setValidEmail(false);\n }\n else\n {\n setErrorEmail(\"\");\n setValidEmail(true);\n } \n }", "function checkEmail() {\n\tvar email = document.getElementById(\"email\").value;\n\tvar emailCheck = new RegExp(/\\S+\\S+\\.([a-z]|[A-Z]){1,5}/g);\n\t\n\tif (email == \"\"){\t\n\t} else {\n\t\tif (emailCheck.test(email)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not at valid email!\");\n\t\t\treturn false;\n\t\t}\n\t}\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 validateEmail(email) {\n email.value == null ? email.value = \" \" : email.value\n var atpos = email.value.indexOf(\"@\");\n var dotpos = email.value.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.value.length) {\n document.querySelector('.email-error').style.display = \"inline\";\n return false;\n }\n document.querySelector('.email-error').style.display = \"none\";\n return true;\n}", "function validateEmailAddress(customerForm)\n{\n var isValid = true;\n var emailAddr = customerForm.emailaddress.value;\n\n // first make sure an at-sign is found\n var atPos = emailAddr.indexOf(\"@\");\n if (atPos == -1)\n {\n isValid = false;\n }\n else\n {\n // next, make sure there is at least one domain separator\n // following the at-sign\n var dotPos = emailAddr.indexOf(\".\", atPos + 1);\n if (dotPos == -1)\n {\n isValid = false;\n }\n }\n\n if (!isValid)\n {\n window.alert(\"Your e-mail address must be in the format of username@domain.name\");\n }\n return isValid;\n}", "function ValidEmail(field)\n{\n\n \tif ((field.value.indexOf(\"@\") < 1) || (field.value.indexOf(\".\") < 1))\n \t{\n\t DspAlert(field,Message[29]);\n\t return false;\n \t\t\n \t}\n \treturn true;\n \n}", "function checkEmail(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 if(re.test(email.value.trim())){\n showSuccess(email);\n } else {\n showError(email, 'Email is not valid');\n }\n\n}", "function validate_email() {\n return email.length > 0 && email.length < 50;\n }", "function afficherEmail() {\n return isValidEmail(email.value);\n}", "function validateEmail(){\r\n\r\n \t\tvar email=document.getElementById(\"email\").value;\r\n\r\n\r\n \tif(email.length==0){\r\n\r\n \t\t\tprintError(\"email required\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n \tif(!email.match(/^[a-z0-9](\\.?[a-z0-9_-]){0,}@[a-z0-9-]+\\.([a-z]{1,6}\\.)?[a-z]{2,6}$/)){\r\n \t\tprintError(\"enter Valid email\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n\r\n\tprintSuccess(\"email\",\"green\",\"emailError\");\r\nreturn true;\r\n\r\n\r\n \t}", "function emailCheck(email) {\n\tatSplit = email.split('@');\n\tif (atSplit.length == 2 && alphaNumCheck(atSplit[0])) {\n\t\tperiodSplit = atSplit[1].split('.')\n\t\tif (periodSplit.length == 2 && alphaNumCheck(periodSplit[0] + periodSplit[1])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\tvalCheck = false;\n\treturn false;\n}", "function validateEmail(email) {\n\t\tvar re = /\\S+@\\S+\\.\\S+/;\n\t\treturn re.test(email);\n\t}", "function ValidateEmail(mail) \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(mail))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}" ]
[ "0.87040657", "0.8267088", "0.82614326", "0.8250824", "0.8237266", "0.81995267", "0.8183565", "0.8173933", "0.8132158", "0.81128144", "0.81110734", "0.8092978", "0.8080192", "0.80636483", "0.8060463", "0.8028017", "0.8021111", "0.8018615", "0.8009661", "0.8006999", "0.79966414", "0.79931134", "0.7988225", "0.7959218", "0.79366267", "0.79287994", "0.7927463", "0.7919636", "0.7918155", "0.7904643", "0.7903264", "0.79002684", "0.7899565", "0.78908914", "0.78908837", "0.7889938", "0.7875388", "0.7868252", "0.78673416", "0.78586876", "0.7852244", "0.785062", "0.78504837", "0.7842878", "0.7841014", "0.783892", "0.7837477", "0.78351265", "0.7833142", "0.783037", "0.7828312", "0.7827058", "0.7825246", "0.7823684", "0.7821196", "0.78184915", "0.7818293", "0.78123903", "0.78079593", "0.7806431", "0.78032017", "0.7802534", "0.7800344", "0.7798601", "0.7789898", "0.7788649", "0.7788297", "0.7784638", "0.77834266", "0.7780021", "0.7779979", "0.7779979", "0.7779889", "0.77779657", "0.7776753", "0.7776753", "0.7774743", "0.77728075", "0.7770916", "0.7764923", "0.7764452", "0.7763486", "0.7759922", "0.77591115", "0.77588415", "0.7754942", "0.7751289", "0.7747554", "0.7747256", "0.77447414", "0.7743334", "0.7742042", "0.77387214", "0.7734139", "0.7729194", "0.77261937", "0.7723823", "0.7721944", "0.77174026", "0.77159625", "0.77152205" ]
0.0
-1
TODO (tomert) Add a trash talk string (choosing a random TT string from a list)
render(){ if (this.state.roundInfo.stage === RoundStage.RoundEnded) { setTimeout(this.startBetting, 2000) } console.log('this.state.participateCards') console.log(this.state.participateCards) return ( <div className='container'> <div className='deck'> <div className="deck-cards"></div> <div className="deck-cards"></div> </div> <div className='dealer_table'> <Participate cards={this.state.delearCards} showCards={this.state.roundInfo.stage != RoundStage.RoundEnded} isDealer={true} /> <Participate cards={this.state.participateCards} showCards={this.state.roundInfo.stage != RoundStage.RoundEnded} isDealer={false} /> </div> {this.renderChips()} {this.renderPotChips()} {this.renderPlayerActionsButtons()} </div>); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickTweetText() {\n let options = [\n \"Actually... Crypto stands for CRYPTOGRAPHY!\",\n \"Hey, just a reminder, hashtag CRYPTO means cryptography 🤓\",\n \"crypto => C.R.Y.P.T.O.G.R.A.P.H.Y not cryptocurrency! 🤨\",\n \"Will you stop using hashtag *crypto* ... it's CRYPTOGRAPHY, not cryptocurrency #goStudy\",\n \"Please stop using the word *crypto* incorrectly. It stands for CRYPTOGRAPHY, not cryptocurrency 🤨\",\n \"Kind correction: crypto stands for cryptography, NOT cryptocurrency ;)\"\n ];\n return options[Math.floor(Math.random() * 5)];\n}", "function pickWord(list) {\n return list[Math.floor(Math.random() * list.length)];\n}", "function randomTaunt()\r\n{ \r\n\tif( getTP() > 1 ) { \r\n\t\tsay(randomCitation()); \r\n\t} \r\n}", "function talkTrash() {\n var trash = [\"Suck it!\", \"How ya like dem apples\", \"Y'all got Pwn3d!\", \"Eat my shorts!\", \"Punk-ass!\"]\n var x = Math.floor(Math.random() * 5);\n return trash[x];\n}", "function randFromList(phrase_list){\n\treturn phrase_list[Math.floor((Math.random() * phrase_list.length))]\n\n}", "function chooseSentence (list) {\n var index = _.random(list.length - 1);\n var sentence = list[index];\n var madlibRequired = /{\\s*(?:noun|adj|buzz|num)\\s*}/i.test(sentence);\n\n if (madlibRequired) {\n sentence = madlib(sentence);\n }\n\n output(sentence);\n }", "function thoughts() {\n const thoughts = [\n '\"make your each day masterpiece\"',\n '\"Mind your digital wellbeing\"',\n '\"Javascript is nibbrish language\"',\n '\"You dont get everything in your life you wish for.\"'\n ];\n const randomThought = Math.floor(Math.random(thoughts) * 4);\n\n thought.innerHTML = thoughts[randomThought];\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 chooseWord(list_of_words){ \n return list_of_words[Math.floor(Math.random()*list_of_words.length)];\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 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 getWords() {\n word.innerText = list[Math.floor(Math.random() * list.length)];\n}", "function ranWord(list) {\n return list[Math.floor(Math.random() * list.length)];\n}", "function randomTetromino(listOfTetrominos) {\r\n let choices = Object.keys(listOfTetrominos);\r\n let randomIndex = Math.floor(Math.random() * choices.length);\r\n let randomChoice = choices[randomIndex];\r\n return listOfTetrominos[randomChoice]; //returns the tetromino name\r\n}", "function createWord(){\r\n randIndex = Math.floor(Math.random()*List.length);\r\n theWord= List[randIndex].split(\"\");\r\n}", "function randomWord(){\n answer = fruits[Math.floor(Math.random() * fruits.length)];\n}", "randomText(positive) {\n const posPhrases = [\n 'Goed gedaan!',\n 'Netjes!',\n 'Je doet het súper!',\n 'Helemaal goed!',\n 'Je bent een topper!'\n ]\n const negPhrases = [\n 'Ik weet dat je het kunt!',\n 'Jammer, probeer het nog eens!',\n 'Bijna goed!',\n 'Helaas pindakaas'\n ]\n\n const phrases = positive ? posPhrases : negPhrases\n const maximumNumber = phrases.length\n const randomNumber = Math.floor(Math.random() * maximumNumber)\n \n return phrases[randomNumber]\n }", "makeText(numWords = 100) {\n const startWordIndex = Math.floor(Math.random() * Object.keys(this.startChains).length);\n let prevWord = Object.keys(this.startChains)[startWordIndex];\n let randomText = prevWord;\n\n for (let i = 1; i < numWords; i++) {\n const nextRandom = Math.floor(Math.random() * this.chains[prevWord].length);\n const nextWord = this.chains[prevWord][nextRandom];\n randomText += ' ';\n if (nextWord) {\n randomText += nextWord.toLowerCase();\n prevWord = nextWord;\n } else {\n randomText += this.makeText(numWords - i);\n break;\n }\n }\n if (prevWord.charAt(prevWord.length - 1) === ',') {\n randomText = randomText.slice(0, randomText.length - 1)\n }\n if (!END_PUNCTUATION.includes(prevWord.charAt(prevWord.length - 1))) {\n randomText += '.'\n }\n return randomText.trim()\n }", "function suggestion() {\n let randomAdjective = findRandomEntry(adjectives);\n let randomAgent = findRandomEntry(agents);\n let randomVerb = findRandomEntry(verbs);\n let randomPreposition = findRandomEntry(prepositions);\n let randomEnding = findRandomEntry(endings);\n currentSuggestion = (randomAdjective + \" \" + randomAgent + \" \" + randomVerb + \" \" + randomPreposition + \" \" + randomEnding);\n speak(currentSuggestion);\n boxWrite(currentSuggestion + ' \\n (If you would like to hear this again, say \"Could you repeat that?\")')\n}", "function getRandomWord() {\n var wordList = [\"DOG\",\"BIRD\",\"MOOSE\",\"CAT\",\"HORSE\",\"COW\",\"PIG\"];\n return wordList[Math.floor(Math.random() * wordList.length)];\n }", "function makeAPhrase (){\n var word1 = [\"Waz Up\", \"Sucky Sucky\", \"Chopy Chopy\", \"Vada Ving\", \"Vada Vunm\"]\n var word2 = [\"Trumper\", \"Out there!\", \"MOSt folf\", \"Wolf of Wall Street\", \"lambo\" ];\n var word3 = [ \"Porche\", \"Samsung\", \"Motorola\", \"Wolfagangpck\", \" DOODOO DID\"];\n\n var rand1 = Math.floor (Math.random() * word1.length);\n var rand2 = Math.floor (Math.random() * word2.length);\n var rand3 = Math.floor (Math.random() * word3.length);\n\n var phraseOfTheDay = word1[rand1] + \" \" + word2[rand2] + \" \" + word3[rand3];\n\n alert(phraseOdTheDay);\n}", "getRandomPhrase() {\n let randomOneToFive = Math.floor(Math.random() * 5);\n return this.phrases[randomOneToFive];\n }", "makeText(numWords = 100) {\n // TODO\n\n let chainObj = this.makeChains();\n let randomStarIdx = Math.floor(Math.random() * this.words.length);\n let randomStartWord = this.words[randomStarIdx];\n let text = [randomStartWord];\n\n for (let i = 0; i < numWords - 1; i++) {\n let value = chainObj[text[i]]\n\n if (value[0] === null) {\n return text.join(' ');\n }\n if (value.length === 1) {\n text.push(value);\n } else {\n let randomIdx = Math.floor(Math.random() * value.length);\n let randomWord = value[randomIdx];\n text.push(randomWord);\n }\n }\n\n return text.join(' ');\n }", "function pick() {\r\n index = Math.floor(Math.random() * words.length);\r\n return words[index];\r\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 generateSentence() {\nvar randomIndex = Math.floor(Math.random() * sentences.length);\ncurrentSentence = sentences[randomIndex];\nprompt.innerHTML = currentSentence;\n}", "function selectWord() {\n return wordList[Math.floor(Math.random() * wordList.length)];\n }", "getText(numWords = 100) {\n // MORE CODE HERE\n let textArr = [];\n let wordChoice = Array.from(this.words);\n let word = this.getRandomElement(wordChoice)\n \n \n while (textArr.length < numWords && word !== null){\n textArr.push(word)\n\n let nextWord = this.getRandomElement(this.chain.get(word))\n //append to textarr the newly defined word\n word = nextWord\n\n }\n return textArr.join(\" \");\n }", "makeText(numWords = 100) {\n // TODO\n const keys = Object.keys(this.chains)\n let text = ''\n let prevWord;\n for(let i = 0; i <= numWords; i++){\n if(prevWord === undefined){\n let ranKey = keys[Math.floor(Math.random() * keys.length)]\n let ranWord = this.chains[ranKey][Math.floor(Math.random() * this.chains[ranKey].length)]\n if(ranWord !== undefined){\n text = text+ranWord+' '\n prevWord = ranWord\n }\n }else{\n let ranWord = this.chains[prevWord][Math.floor(Math.random() * this.chains[prevWord].length)]\n if(ranWord !== undefined){\n text = text+ranWord+' '\n prevWord = ranWord;\n }else{\n break\n }\n }\n }\n return text.trim();\n }", "getRandomPhrase() {\n const index1 = Math.floor(Math.random() * this.phrases.length);\n function index2(index1) {\n return Math.floor(Math.random() * game.phrases[index1].length);\n }\n if (index1 === 0) {\n this.clue = 'Video Games';\n return this.phrases[index1][index2(index1)];\n } else if (index1 === 1) {\n this.clue = 'Literature';\n return this.phrases[index1][index2(index1)];\n } else if (index1 === 2) {\n this.clue = 'Golden Girls Quotes';\n return this.phrases[index1][index2(index1)];\n } else {\n this.clue = 'Crafts';\n return this.phrases[index1][index2(index1)];\n }\n }", "function randomWord() {\n result = wordslist[Math.floor(Math.random()*wordslist.length)];\n}", "getRandomPhrase() {\n var randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber]\n }", "function getRandomWord(listOfWords) {\n return listOfWords[getRandomNumber()]\n}", "function randomtext() {\n var randomtxt = [\n 'Always remember, Frodo, the page is trying to get back to its master. It wants to be found. Gandalf, <a href=\"https://www.imdb.com/title/tt0120737/\"> The Lord of the Rings: The Fellowship of the Ring (2001)</a>',\n 'Webpages? Where we&apos;re going, we don&apos;t need webpages. Dr. Emmett Brown, <a href=\"https://www.imdb.com/title/tt0088763/\"> Back to the Future (1985)</a>',\n 'Where&apos;s the page, Lebowski ? Where&apos;s the page? Blond Thug, <a href=\"https://www.imdb.com/title/tt0118715/\"> The Big Lebowski (1998)</a>',\n 'What we&apos;ve got here is...failure to communicate. Captain, <a href=\"https://www.imdb.com/title/tt0061512/\"> Cool Hand Luke (1967)</a>',\n 'Lord! It&apos;s a miracle! Webpage up and vanished like a fart in the wind! Warden Norton, <a href=\"https://www.imdb.com/title/tt0111161/\"> The Shawshank Redemption (1994)</a>',\n 'What&apos;s on the page ? Detective David Mills, <a href=\"https://www.imdb.com/title/tt0114369/\"> Se7en (1995)</a>',\n 'This is not the webpage you&apos;re looking for. Obi-Wan Kenobi, <a href=\"https://www.imdb.com/title/tt0076759/\"> Star Wars: Episode IV - A New Hope (1977)</a>',\n 'Surely you can&apos;t be serious! I am serious.And don&apos;t call me Shirley. Ted Striker & Rumack, <a href=\"https://www.imdb.com/title/tt0080339/\"> Airplane! (1980)</a>',\n 'There is no page. Spoon Boy, <a href=\"https://www.imdb.com/title/tt0133093/\"> The Matrix (1999)</a>',\n 'The page did a Peter Pan right off of this website, right here. Deputy Marshal Samuel Gerard, <a href=\"https://www.imdb.com/title/tt0106977/\"> The Fugitive (1993)</a>',\n 'Well, what if there is no webpage? There wasn&apos;t one today. Phil Connors, <a href=\"https://www.imdb.com/title/tt0107048/\"> Groundhog Day (1993)</a>',\n 'He&apos;s off the map! He&apos;s off the map! Stan, <a href=\"https://www.imdb.com/title/tt0338013/\"> Eternal Sunshine of the Spotless Mind (2004)</a>',\n 'Page not found? INCONCEIVABLE. Vizzini, <a href=\"https://www.imdb.com/title/tt0093779/\"> The Princess Bride (1987)</a>',\n 'It&apos;s the one that says &apos;Page not found&apos; Jules Winnfield, <a href=\"https://www.imdb.com/title/tt0110912/\"> Pulp Fiction (1994)</a>'];\n return randomtxt[Math.floor((Math.random() * 13.99))];\n}", "getRandomPhrase(){\r\n let randomNumber = Math.floor((Math.random() * 5))\r\n return this.phrases[randomNumber];\r\n }", "makeText(numWords = 50) {\n let newText = \"\";\n // initially word will be a random word from words arr\n let word = this.words[Math.floor(Math.random() * this.words.length)]\n newText = newText + word + \" \";\n for (let i=0; i<numWords; i++) {\n if (this.chains[word][0] == null) {\n return newText;\n } else {\n word = this.chains[word][Math.floor(Math.random() * this.chains[word].length)]\n newText = newText + word + \" \";\n }\n }\n\n return newText;\n }", "getRandomPhrase() {\n let randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber];\n }", "function pickWord(words) {\n return words[Math.floor(Math.random() * words.length)]\n}", "function pickword(dictionary) {\n return dictionary[Math.floor(Math.random() * (dictionary.length - 1))];\n }", "function pickWord() {\n \"use strict\";\n return words[Math.floor(Math.random() * words.length)];\n}", "getRandomPhrase() {\n const randNum = Math.floor(Math.random() * Math.floor(5));\n const randomPhrase = this.phrases[randNum];\n return randomPhrase;\n }", "function getRandomQuote(qu){\n //goes through all of array to check for \n return qu[Math.floor(Math.random()*qu.length)];\n\n}", "function pickSearchTerm() {\n let options = [\"stop\", \"mad\", \"angry\", \"annoyed\", \"cut it\" ];\n return options[Math.floor(Math.random() * 4)];\n}", "makeText(numWords = 100) {\n const numWordsAv = Object.keys(this.chains).length;\n let randNum, text;\n do {\n randNum = Math.floor(Math.random() * numWordsAv);\n text = [Object.keys(this.chains)[randNum]];\n } while (text[0] === text[0].toLowerCase())\n\n if (text[0].slice(-1) === '.') {\n return text.toString();\n }\n \n for (let i = 0; i < numWords - 1; i++) {\n let randNum = Math.floor(Math.random() * this.chains[text[i]].length);\n if (this.chains[text[i]][randNum] === null ) {\n break;\n } else {\n text.push(this.chains[text[i]][randNum])\n if (this.chains[text[i]][randNum].slice(-1) ==='.') break;\n }\n }\n return text.join(\" \")\n }", "function getRandomWord(listOfWords) {\n indexWordSelect = Math.floor(Math.random() * wordsList.length);\n return listOfWords[indexWordSelect];\n}", "function randomize(text){\n var textArray=[];\n\n //first turn the string into an array\n for(var i=0;i<text.length;i++){\n textArray[i]=text.charAt(i);\n }\n \n var aux;\n var random;\n\n //For the lenght of the array, every element is randomly switched \n for(var i=0;i<text.length;i++){\n random=Math.floor(Math.random()*textArray.length);\n aux=textArray[random];\n textArray[random]=textArray[i];\n textArray[i]=aux;\n }\n\n var resp=\"\";\n\n //turn the array into a string\n for(var i=0;i<text.length;i++){\n resp=resp.concat(textArray[i]);\n }\n\n //return the mixed string\n return resp;\n}", "makeText(numWords = 100) {\n let chains = this.makeChains(); // MM object\n \n // first word to start chaining\n let key_words = Object.keys(chains); // array of key-words in MM object to choose from\n let key_num = key_words.length; // number of words to choose from\n let key_ind = Math.floor(Math.random()*key_num); // random index in key_words array\n let curr_word = key_words[key_ind]; //current word \n let resultText = curr_word; \n for (let i = 2; i <= numWords; i++) {\n let next_word_ind = Math.floor(Math.random()*chains[curr_word].length);\n let next_word = chains[curr_word][next_word_ind];\n if (next_word) {\n resultText = [resultText, next_word].join(' ');\n curr_word = next_word; \n }\n else {\n return resultText; \n }\n }\n return resultText; \n }", "makeText(numWords = 50) {\n\t\tlet wordsObj = this.makeChains(); //This is an object\n\t\tlet arr = [];\n\t\tlet wordsObjKeys = Object.keys(wordsObj);\n\t\tlet startidx = Math.floor(Math.random() * wordsObjKeys.length);\n\t\tlet pushWord = wordsObjKeys[startidx];\n\t\tarr.push(pushWord);\n\t\twhile (numWords > arr.length) {\n\t\t\tlet val = wordsObj[pushWord];\n\t\t\tlet idx = Math.floor(Math.random() * val.length);\n\t\t\tif (val[idx] === null) {\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tarr.push(val[idx]);\n\t\t\t\tpushWord = val[idx];\n\t\t\t}\n\t\t}\n\t\treturn arr.join(\" \");\n\t}", "function randomizeSentence(sentence) {\n\n}", "makeText(numWords = 100) {\n let keys = Object.keys(this.chains);\n let key = keys[Math.floor(Math.random() * Math.floor(keys.length))];\n let textArray = [];\n\n while (textArray.length < numWords && key !== null) {\n textArray.push(key);\n key = this.chains[key][\n Math.floor(Math.random() * Math.floor(this.chains[key].length))\n ];\n }\n return textArray.join(\" \");\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}", "randomButton(){\n if(this.wordList.length == 0){\n Feedback.addMessage('You must enter a word !!!','danger')\n }else{\n const random = Math.floor(Math.random() * this.wordList.length)\n const english = this.wordList[random].english\n const turkish = this.wordList[random].turkish.toLowerCase()\n this.turkishWordList.push(turkish)\n console.log(this.turkishWordList)\n this.word.innerHTML = english\n this.confirmWord()\n }\n }", "function randomPhrase() {\n var phraseNum = randomNumber(first, phrases.length - 1);\n var thePhrase = phrases[phraseNum];\n $('#message').text(thePhrase);\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}", "generateWord() {\n var randomNumber = Math.floor(Math.random() * listOfWords.length)\n chosenWord = listOfWords[randomNumber]\n this.answer = chosenWord\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 getSearchPhrase() {\n return (['Search', 'Find', 'Let\\'s Travel', 'Look up', 'Go'])[Math.floor(Math.random() * 5)];\n}", "getRandomPhrase(phraseList){\r\n const randomNumber = Math.floor(Math.random()*(this.phrases.length));\r\n return phraseList[randomNumber];\r\n }", "makeText(numWords = 100) {\n\n let chain = this.makeChains();\n let story = [];\n let keyArray = Object.keys(chain);\n\n let randomNumber = this.getRandNum(keyArray.length);\n story.push(keyArray[randomNumber]);\n\n for(let i = 0; i < numWords-1; i++){\n let randIndex = this.getRandNum(chain[story[i]].length);\n if(chain[story[i]][randIndex] === null){\n break;\n }\n else{\n story.push(chain[story[i]][randIndex]);\n }\n }\n return story.join(' ');\n\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) {\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n }", "function random_word(){\n var n = 4 + Math.floor(Math.random() * 6);\n return random_text(n);\n }", "function getRandom() {\n\t\tvar affirmations = JSON.parse(sessionStorage.getItem(\"affirmationsList\"));\n\t\t//console.log(affirmations);\n\t\t//console.log(sessinStorage.getItem('affirmationsList'));\n\t\n\t\t//var affirmations = ['Strive For Greatness', 'I feel good today', 'I got this'];\n\t\tvar randomNumber = Math.floor(Math.random()*affirmations.length);\t\n\t\t//console.log(randomNumber);\n\t\tvar randomString = affirmations[randomNumber];\n\t\t\t//console.log(randomString);\n\t\tif( randomString == undefined) {\n\t\t\trandomString = \"You don't have any affirmations, add one to practice positive self-talk\";\n\t\t}\n\t\tdocument.getElementById(\"affirmations\").innerHTML = randomString;\n\t}", "function pickWord(words) {\n var word = stringToArray(words[Math.floor((Math.random() * words.length) + 0)]);\n return word;\n}", "function generateQuote(){\nconst random = Number.parseInt(Math.random() * arrayOfQuotes.length + 1);\ndocument.querySelector('#quoteOutput').textContent = `\\'${arrayOfQuotes[random].quote}'`;\ndocument.querySelector('#authorOutput').textContent = `--${arrayOfQuotes[random].author}`;\n}", "function getRandomPhrase() {\n const phrase = phrases[Math.floor(Math.random() * phrases.length)];\n return phrase;\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 RandomWord() {\n var wordRandom = Math.floor(Math.random() * (wordList.length));\n return wordList[parseInt(wordRandom)];\n}", "function random(list) {\n var index = Math.ceil( Math.random() * 10 );\n var mot = list[index];\n return mot;\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].toUpperCase();\n \n}", "function makeName(name_list) {\n if (Math.floor(Math.random() * 100) == 1) {\n return \"Bob Johnson!\";\n } else { \n var first = name_list.first;\n var lastone = name_list.lastone;\n var lasttwo = name_list.lasttwo;\n\n var rfi = Math.floor(Math.random()*first.length);\n var rlo = Math.floor(Math.random()*lastone.length);\n var rlt = Math.floor(Math.random()*lasttwo.length);\n\n\n if (Math.floor(Math.random() * 20) == 1) {\n return `${first[rfi]} Mc${lastone[rlo]}${lasttwo[rlt]}!`;\n } else {\n return `${first[rfi]} ${lastone[rlo]}${lasttwo[rlt]}!`;\n }\n }\n}", "function wordGen() {\n\tcurrentWord = wordList[Math.floor(Math.random() * wordList.length)].toLowerCase();\n}", "function randomLanguage() {\n return strings[Math.floor(Math.random() * strings.length)];\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 spell(){ \n if(count == 1 ) return ' вопрос';\n if(count == 2 || count == 3 || count == 4 ) { \n return ' вопроса';\n } else {\n return ' вопросов'\n }\n }", "generateRandomSentence() {\n if (this.state.loaded) {\n var name = this.state.wubbynames[getRandomInt(0, this.state.wubbynames.length-1)].content;\n var action = this.state.sentenceActions[getRandomInt(0, this.state.sentenceActions.length-1)].content;\n var obj = this.state.sentenceObjects[getRandomInt(0, this.state.sentenceObjects.length-1)].content;\n\n var sentence = 'I want ' + name + ' to ' + action + ' with ' + obj;\n this.setState({ currentSentence: sentence });\n }\n\n }", "makeText(numWords = 100) {\n let numWordsArr = []\n if (this.chain === undefined) {\n return \"\"\n }\n const Keys = Object.keys(this.chain)\n while (numWordsArr.length < numWords) {\n let randomKey = Keys[Math.floor(Math.random() * Keys.length)]\n let randomWord = this.chain[randomKey][Math.floor(Math.random() * this.chain[randomKey].length)]\n if (randomWord !== null) {\n numWordsArr.push(randomWord)\n }\n }\n return numWordsArr.join(' ')\n }", "function randomSpecialCharacters(){\n var specialCharacter = \"!#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\";\n return specialCharacter[Math.floor(Math.random()*specialCharacter.length)];\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}", "function randomStartingPhrase() {\n if (Math.random() < 0.33) {\n return phrases[Math.floor(Math.random() * phrases.length)]\n }\n return ''\n}", "function showWord(words) {\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}", "function GetRandom(strs) {\r\n return strs[Math.floor(Math.random() * strs.length)];\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 getword(partOfSpeech) {\n return partOfSpeech[Math.floor(Math.random() * partOfSpeech.length)];\n}", "function addRandomThanosQuote() {\n const greetings =\n ['The hardest choices require the strongest wills.',\n 'I ask you to what end? Dread it. Run from it. Destiny arrives all the same',\n 'I know what it\\'s like to lose. To feel so desperately that you\\'re right, yet to fail nonetheless. It\\'s frightening'\n + 'turns the legs to jelly.',\n 'Perfectly balanced, as all things should be.',\n 'I do. You are not the only one cursed with knowledge.',\n 'I finally rest and watch the sun rise on a grateful universe.',\n 'Fine! I will do it myself.',\n 'I ignored by destiny once. I cannot do that again, even for you.',\n 'With all the six stones I could simply snap my fingers and they'+\n 'would cease to exist. I call that mercy'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greetingContainer');\n greetingContainer.innerText = greeting;\n}", "function addRandomQuote() {\n const quotes =\n [\"You should enjoy the little detours to the fullest. Because that's where you'll find the things more important than what you want. -Yoshihiro Togashi\",\n \"I don’t want what another man can give me. If he grants me anything, then it’s his to give and not my own. -Kentaro Miura\",\n \"Sometimes good people make bad choices. It doesn't mean they are bad people. It means they're human. -Sui Ishida\",\n \"Why is it that when one man builds a wall, the next man immediately needs to know what's on the other side? -George R.R. Martin\"];\n\n // Pick a random greeting.\n const quote = quotes[Math.floor(Math.random() * quotes.length)];\n\n // Add it to the page.\n const quoteContainer = document.getElementById('quote-container');\n quoteContainer.innerText = quote;\n}", "function randomBlocText(k){\n result=\"\";\n for(var i=0;i<k;i++){\n var newWord=randomWord();\n if(i==0){\n newWord=capitalizeFirstLetter(newWord);\n }\n result+=randomPhrase();\n }\n return result;\n}", "function getRandomQuote() {\n var randomItem = Math.floor(Math.random() * string.length);\n console.log(randomItem);\n\n return string[randomItem]\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 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 randomGreeting() {\n var words = ['Hello', 'Howdy', 'Hi', 'Hey there', 'What\\'s up',\n 'Greetings', 'Salutations', 'Good to see you'];\n\n var idx = Math.floor(Math.random() * words.length);\n\n // this is missing a return statement, this function returns undefined\n return words[idx];\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}", "makeText(numWords = 100) {\n let words = Object.keys(this.chains);\n\n let capWords = words.filter(word => word[0] === word[0].toUpperCase());\n let text = this.randomPick(capWords);\n let firstWord = text;\n let nextWord = this.singleChain(firstWord);\n\n for (let i=1; i < numWords - 1; i++) {\n text += \" \";\n let bigram = `${firstWord} ${nextWord}`;\n firstWord = nextWord;\n if (this.bigrams[bigram]) {\n let pick = this.randomPick(this.bigrams[bigram]);\n nextWord = pick ? pick : this.randomPick(words);\n } else {\n nextWord = this.singleChain(firstWord);\n }\n text += nextWord;\n }\n return text;\n }", "function name_the_frenchie(){\n var names = [\"Gaubusseau\", \"Gobi\", \"Gobysov\", \"Kaupassa\", \"FransmanNI\", \"Ranskis\", \"Gaubussuauau\", \"Ranska\", \"Gubi\", \"Kopisoi\", \"Gaubusssööö\", \"Käpysoppa\", \"Kubussi\", \"Goblin\", \"Goobysoo\", \"Bisseau\", \"Gobuzie\", \"Gabuzie\"];\n var chosenName = names[Math.floor(Math.random() * names.length)];\n return chosenName;\n\n}", "function setAnswer(list) {\n const res = list[Math.floor(Math.random() * list.length)];\n return res;\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 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 generate() {\n return [getRand(categories), getRand(gameType), 'where you', getRand(action), getRand(thing)].join(' ');\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 SelectWord() {\n\treturn words[Math.floor(Math.random()*words.length)];\n}", "function r_randomQuoteMike()\n{\n\tlog.info(\"Random Event: Meeting Mike\");\n\n\t// random mike quotes:\n\tvar mikeQuotes = [\n\t\t\t\t\t\"All of this, falling apart like this, is on you.\", \n\t\t\t\t\t\"You - are not the guy. You're not capable of being the guy. I had a guy, but now I don't. You - are not the guy.\", \n\t\t\t\t\t\"Is that true, Walter?\", \n\t\t\t\t\t\"You're on thin ice, you little shithead. You know that?\", \n\t\t\t\t\t\"Keys, scumbag. It's the universal symbol for keys.\", \n\t\t\t\t\t\"You know Walter, sometimes it doesn't hurt to have someone watching your back. \", \n\t\t\t\t\t\"Saul Goodman sent me.\",\n\t\t\t\t\t\"Shut the fuck up, and let me die in peace.\",\n\t\t\t\t\t\"Everyone sounds like Meryl Streep with a gun to their head.\",\n\t\t\t\t\t\"You know when they say ... its been a pleasure ... well it hasnt\",\n\t\t\t\t\t\"Just because you shot Jesse James, don’t make you Jesse James.\", \n\t\t\t\t\t\"We had a good thing, you stupid son of a bitch! We had Fring. We had a lab. We had everything we needed, and it all ran like clockwork. You could've shut your mouth, cooked and made as much money as you ever needed. It was perfect. But, no, you just had to blow it up. You and your pride and your ego! You just had to be the man. If you'd done your job, known your place, we'd all be fine right now.\"\n\t\t\t\t];\n\t\t\t\t\n\t// pick random quote from array\n\tvar randomQuote = mikeQuotes[Math.floor(Math.random()*mikeQuotes.length)];\n\n\t// output random quote\n\tnoty({text: '<p><i class=\"fa fa-user\"></i> Mike Ehrmantraut</p> '+randomQuote, type: 'warning'});\n}" ]
[ "0.70866615", "0.70684355", "0.6994803", "0.6926681", "0.69028443", "0.69016147", "0.6871489", "0.67661387", "0.67502373", "0.6748586", "0.67455804", "0.6616859", "0.6609113", "0.65879464", "0.65863913", "0.65808254", "0.65046656", "0.6487748", "0.64877254", "0.6475029", "0.6468917", "0.64596826", "0.6445924", "0.64265215", "0.6425046", "0.64000493", "0.63918644", "0.6388587", "0.6387643", "0.63870114", "0.6374522", "0.6371082", "0.63688", "0.63654834", "0.6353099", "0.63504803", "0.6344717", "0.6334202", "0.63338095", "0.6333708", "0.63260806", "0.63187516", "0.6314748", "0.6312682", "0.63084406", "0.6304698", "0.6304201", "0.62973917", "0.62950766", "0.6293721", "0.6293463", "0.62908864", "0.6287024", "0.62868404", "0.62865466", "0.62854344", "0.62789553", "0.62780195", "0.6271745", "0.6269898", "0.62531906", "0.6252559", "0.62524444", "0.6248693", "0.6242521", "0.62326455", "0.6230071", "0.6224325", "0.6222897", "0.621968", "0.621684", "0.6216542", "0.621056", "0.6204064", "0.6203759", "0.62016916", "0.6200152", "0.6196106", "0.61944085", "0.6191839", "0.6191291", "0.61903816", "0.61898804", "0.61892325", "0.6182949", "0.6178366", "0.6173285", "0.61664104", "0.6164855", "0.6164475", "0.6164412", "0.61628747", "0.6162407", "0.61622065", "0.6159787", "0.6156883", "0.6155387", "0.6154996", "0.6154764", "0.61515355", "0.6149324" ]
0.0
-1
Exercise: make a superhero function take in 2 callbacks and return a string in each one of the callbacks describing the "superpower"
function superHero(power1, power2, callbackOne, callbackTwo) { let powers = "my super powers are " + callbackOne(power1) + " and " + callbackTwo(power2); return powers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function superHero (name, callbackTwo){\n let hero = \"I am \" + name + \" and one of my powers is I can shoot lasers.\" + \" \";\n let otherSuperhero = callbackTwo();\n\n return hero + otherSuperhero;\n}", "function greeter(fullname,cb){ //cb-call back function\n var message=cb(fullname);\n console.log(`Hello ${message}`);\n}", "function cook(i1, i2, callback) {\n callback(i1)\n callback(i2)\n console.log(`I make ${i2} ${i1}`)\n}", "function wheather() {\nlet callFunction1 = \"blue\";\nlet callFunction2 = \"sky\";\nreturn callFunction1 + callFunction2;\n}", "function Hero(name, age, power) {\n this.name = name;\n this.age = age;\n this.power = power;\n this.speak = function() {\n console.log(\"Hi, I'm \" + this.name + \" and I'm gonna kick your ass!\");\n }\n}", "function speak(food, energy) {\n console.log(\"Our \" + food + \" has \" + energy + \" calories.\");\n}", "function speak(food, energy) {\n console.log(\"Our \" + food + \" has \" + energy + \" calories.\");\n}", "function speak(food, energy) {\n console.log(\"Our \" + food + \" has \" + energy + \" calories.\");\n}", "function morechickens(anyFunction){ console.log(\"Bock bock!\"); anyFunction(); }", "function greeter(fullName, cb) {\n var greet = cb(fullName);\n console.log(\"Hello \" + greet);\n}", "sayHi2(){ return 'sayHi2' }", "function consume( param1, param2, callback) {\n if ( callback === \"add\" ) {\n return(param1 + param2);\n }else if ( callback === \"multiply\" ){\n return(param1 * param2);\n }else if ( callback === \"greeting\") {\n return(`Hello ${param1} ${param2}, it's very nice to meet you!`);\n }\n}", "function userSwitcharoonie() {\n //arguOne for main switch = user input\n switch (arguOne) {\n\n case 'my-tweets':\n myTweeters();\n // dataLog();\n break;\n\n case 'spotify-this-song':\n spotifySong();\n // dataLog();\n break;\n\n case 'movie-this':\n movieThis();\n // dataLog();\n break;\n\n case 'do-what-it-says':\n doWhat();\n // dataLog();\n break;\n\n }\n}", "function apiCalls(){\n\tswitch (switcher) {\n\t\tcase \"my-tweets\":\n\t\tconsole.log(\"you are in tweets switch\");\n\t\tmy_tweets();\n\t\tbreak;\n\n\t\tcase \"spotify-this-song\":\n\t\tconsole.log(\"you're in spotify the input val is \" + userinput);\n\t\tspotify_this_song();\n\t\tbreak;\n\n\t\tcase \"movie-this\":\n\t\tconsole.log(\"you're in movie the input val is \" + userinput);\n\t\tmovie_this();\n\t\tbreak;\n\t}\n}", "heal(otherHero) {\n // otherHero.health += this.power;\n otherHero.receiveHealth(this.power);\n console.log(`other hero has ${otherHero.health}`);\n }", "function Sekai() {\n console.log('This is the World we live in now');\n const monsters = \"We're attacked all the time\";\n const factions = 'We protect each other, that is how we survive!'\n\n function status() {\n const fighting = `working on a mission, but ${monsters}`;\n const living = `sitting inside the wall that was build to keep on ${factions}`;\n\n console.log(`this is a ruff existence ${fighting} for our lives`);\n\n function change() {\n const live = 'relax and live a peaceful wonderful life';\n console.log(`one day we will live in a world where ${living} changes and we can actually just ${live}`);\n };\n\n change()\n };\n\n status()\n}", "function bakeCake(callback){\n return callback('cake')\n}", "function example_1_normal(cb) {\n // TODO\n}", "function invokesCallbacks(num1, callback1, callback2){\n if(num1 > 10){\n return callback1(num1)\n }else{\n return callback2(num1)\n }\n}", "function genBattSuperEffective(pokeName, moveName){\n pokemonName = pokeName;\n pokeMoveName = moveName;\n $(\".battle-text\").show(); \n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokemonName} </span>`))\n }, 50); \n setTimeout(function(){\n $(\".battle-text\").append($(`<span> used </span>`))\n }, 100);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokeMoveName}! </span>`))\n }, 150);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> It </span>`))\n }, 200);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> was </span>`))\n }, 250);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> super </span>`))\n }, 300);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> effective! </span>`))\n }, 350);\n setTimeout(function(){\n $(\".battle-text\").hide(); \n }, 2000);\n}", "function createBaseSuperHuman(name) {\n const superHuman = {\n name: name,\n fly: () => console.log(`${name} is flying`)\n }\n return superHuman\n}", "function brother(brother_1, brother_2) {\n console.log('Hello ' + brother_1 + ' and ' + brother_2);\n}", "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "function myHobies(){\n console.log(\"My hobies are Singing, listening to music and travelling\");\n}", "function newHero() {\n randomHero = superhero.random().toLowerCase()\n // console.log(randomHero)\n}", "function greeting(function1, function2) {\n return `${function1()}, ${function2()}`;\n}", "function powerupPlayer(player, powerup){\r\n\tif(powerup.a_damage){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.damage = 2;\r\n\t}else if(powerup.m_speed){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.speed = 10;\r\n\t}else if(powerup.a_speed){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.attackSpeed = 2;\r\n\t}else if(powerup.god_mode){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.damage = 2;\r\n\t\tplayer.speed = 8.5;\r\n\t\tplayer.attackSpeed = 1.33;\r\n\t}\r\n\tconsole.log('Player ' + player.name + ': powered up (' + timerVal + ').');\r\n\t//Emit a sound effect to spectators and players.\r\n\tfor(var i in SpectatorsPlayers){\r\n\t\tSpectatorsPlayers[i].emit('Power Up', true);\r\n\t}\r\n}", "function gameLogic (player1choice, player2choice) {\n var playerOneWon = function (){\n $(\"#result\").text(playerOneData.name + \" Wins!\");\n if (playerNum === 1) {\n playersRef\n .child(\"1\")\n .child(\"wins\")\n .set(playerOneData.wins +1);\n playersRef\n .child(\"2\")\n .child(\"losses\")\n .set(playerTwoData.losses + 1);\n }\n };\n\n var playerTwoWon = function() {\n $(\"#result\").text(playerTwoData.name+ \" Wins!\");\n if (playerNum === 2) {\n playersRef\n .child(\"2\")\n .child(\"wins\")\n .set(playerTwoData.wins + 1);\n playersRef\n .child(\"1\")\n .child(\"losses\")\n .set(playerOneData.losses + 1);\n }\n };\n\n var tie = function() {\n $(\"#result\").text(\"Tie Game!\");\n };\n\n if (player1choice === \"Rock\" && player2choice === \"Rock\") {\n tie();\n }else if (player1choice === \"Paper\" && player2choice === \"Paper\"){\n tie();\n }else if (player1choice === \"Scissors\" && player2choice === \"Scissors\"){\n tie()\n }else if (player1choice === \"Rock\" && player2choice === \"Paper\"){\n playerTwoWon();\n }else if (player1choice === \"Rock\" && player2choice === \"Scissors\"){\n playerOneWon();\n }else if (player1choice === \"Paper\" && player2choice === \"Rock\") {\n playerOneWon();\n } else if (player1choice === \"Paper\" && player2choice === \"Scissors\") {\n playerTwoWon();\n } else if (player1choice === \"Scissors\" && player2choice === \"Rock\") {\n playerTwoWon();\n } else if (player1choice === \"Scissors\" && player2choice === \"Paper\") {\n playerOneWon();\n }\n}", "function pizza(toping, callback){\n console.log(\"This is a \"+toping+\" pizza\");\n callback();\n }", "function welComeGuest(name, greetHandler){\n greetHandler(name);\n}", "function prueba2(callback){\n callback(\"Alejandro\")\n}", "function greetMe(firstname, lastname, callback, cbParam) {\n\n console.log('hello nice to meet you: ' + 'Mr/Mrs ' + lastname + ', ' + firstname)\n\n callback(cbParam); //invokes whatever function name we put when we run it\n\n}", "function mySandwich(arg1, arg2, callback) {\n console.log('Started eating my sandwich. \\n\\nIt has: ' + arg1 + ', ' + arg2);\n if (callback) {\n callback();\n }\n}", "function doTogether(firstCallback, secondCallback){\n firstCallback(); //execute the first function\n secondCallback(); //execute the second function\n console.log('at the same time!');\n}", "function speak(){\r\n return \"WOOF!\";\r\n}", "function skierOther(name, sound){\n return {\n name,\n sound,\n powerYell: function (){\n let yell = this.sound.toUpperCase();\n console.log(`${yell}! ${yell}`);\n }\n };\n}", "function Avengers(hero) {\n this.hero = hero;\n this.superpowers = 'Elemental';\n this.speak = function() {\n console.log(`I'm ${this.hero} and my power is ${this.superpowers}`);\n }\n}", "function Start_Dinner_2(){\n\n\tm(\"Olá Querido.\");\n\tShow(\"mom\",\"mom_sit\");\n\n\tswitch($.waiting_action){\n\t\tcase \"comer\":\n\t\t\tm(\"Ah, você começou a comer sem mim. Você é muito impaciente.\");\n\t\t\tn(\"...ah, tá.\");\n\t\t\tbreak;\n\t\tcase \"esperar\":\n\t\t\tm(\"Você podia ter começado a comer sem mim. Não precisa deixar sua comida esfriar.\");\n\t\t\tn(\"...claro.\");\n\t\t\tbreak;\n\t\tcase \"brincar\":\n\t\t\tm(\"Brincar com a comida é coisa de criança, sabia?\");\n\t\t\tn(\"uhumm, sei.\");\n\t\t\tbreak;\n\t}\n\n\tm(\"Seu pai está atrasado. Ele deve chegar daqui uma hora.\");\n\n\tChoose({\n\t\t\"Legal. Vamos comer.\": function(message){\n\t\t\tn(message);\n\t\t\tm(\". . .\");\n\t\t\tm(\"Quais seus planos para amanhã?\");\n\t\t\tStart_Dinner_2_1();\n\t\t},\n\t\t\"Eu tenho uma coisa pra contar para vocês dois.\": function(message){\n\t\t\tn(message);\n\t\t\tm(\"Certo. Conte pra nós dois quando ele voltar.\");\n\t\t\tn(\"Ah. Okay.\");\n\t\t\tm(\". . .\");\n\t\t\tm(\"E então, quais são seus planos para amanhã?\");\n\t\t\tStart_Dinner_2_1();\n\t\t},\n\t\t\"Mãe, eu preciso te contar uma coisa primeiro.\": function(message){\n\t\t\tn(message);\n\t\t\tm(\"Calma, Nick, eu nem perguntei sobre o seu dia ainda!\");\n\t\t\tn(\"Hoje foi tranquilo.\");\n\t\t\tm(\"Ok. E quais são seus planos para amanhã?\");\n\t\t\tStart_Dinner_2_1();\n\t\t}\n\t});\n\n}", "function helloCat(callBackFunc) {\n return \"Hello \" + callBackFunc(13);\n}", "function callScenario() {\n\tisScenario = true;\n\tcall = true;\n \tbuttonPresses = 0;\n \ttestString = \"\";\n \talert(\"INCOMING PHONE CALL\")\n \tRNJesus();\n \tif (RNG == 0) {compareExtension = milesExt;\n \t\t\t\t\tcaller = \"Miles\";}\n \tif (RNG == 1) {compareExtension = kelseyExt;\n \t\t\t\t\tcaller = \"Kelsey\";}\n\tif (RNG == 2) {compareExtension = sasiExt;\n \t\t\t\t\tcaller = \"Sasi\";}\n\tif (RNG == 3) {compareExtension = matthewExt;\n\t\t\t\t\tcaller = \"Matthew\";}\n \tif (RNG == 4) {compareExtension = jarExt;\n \t\t\t\t\tcaller = \"Jar\"; }\n \tif (RNG == 5) {compareExtension = skinnyExt;\n \t\t\t\t\tcaller = \"Skinny\";}\n \tif (RNG == 6) {compareExtension = ryanExt;\n \t\t\t\t\tcaller = \"Ryan\";}\n \tif (RNG == 7) {compareExtension = ianExt;\n \t\t\t\t\tcaller = \"Ian\";}\n \tif (RNG == 8) {compareExtension = colinExt;\n \t\t\t\t\tcaller = \"Colin\";}\n \tif (RNG == 9) {compareExtension = bleahyExt;\n \t\t\t\t\tcaller = \"Bleahy\";}\n\tsetTimeout(function(){alert(\"Transfer to \" + caller)}, 4000);\n}", "function fly(info, second) {\n console.log(`${this.name} is flying!!! ${info}`);\n}", "function functionOne(callback){\n let greeting = “hello”;\n // console.log(“Mr.Christopher”);\n return callback(greeting);\n }", "function wishGuest( name, time){\n console.log(`good ${time} ${name} have fun.`);\n}", "function iLove(name1, love1){\n console.log(`${name1} loves ${love1}`)\n}", "function speak(){\n return \"Woof\";\n}", "function greet(otherFunc){\n console.log(otherFunc())\n}", "function multiPurposeFunction(action) {\n if (action) {\n console.log(action(3));\n }\n}", "function heal() {\n // Do something...\n}", "eatBreakfast() {\n console.clear();\n console.log(`The most important meal of the day! Serving it up ${this.player.name}'s way!`);\n \n this.newLine();\n console.log(\"While walking into the kitchen you feel a movement.\");\n console.log(\"A loud growl is felt deep within your stomach!\");\n \n // Health && Check\n let stomachGrowl = this.randomInt(10, 1);\n if(this.player.isDead(stomachGrowl)) {\n this.endGame(this.player);\n }\n \n let stomachChoices = [\"Eat a bowl of cereal\", \"Make pancakes\", \"Have a coffee\"];\n let index = this.choiceSelection(stomachChoices, \"Which action do you take? \");\n \n //Array\n this.questionsPush(this.player, \"Which action do you take against the hungry stomach?\");\n \n while(!stomachChoices[index]) {\n console.clear();\n console.log(\"I do not understand.\");\n index = this.choiceSelection(stomachChoices, \"Which action do you take? \");\n }\n\n switch(index) {\n case 0:\n this.eatCereal();\n break;\n \n case 1:\n this.makePancakes(stomachGrowl);\n break;\n \n case 2:\n this.haveCoffee(stomachGrowl);\n break;\n \n } // End of stomachCounter switch\n }", "function greetHigher(greet, name){\n\n greet(name);\n}", "function test() {\n userSay(\"Hello\");\n alexaSay(\"Hello\");\n userSay(\"What time is the cafeteria open?\");\n alexaSay(\"The cafeteria is open for breakfast from 7:30 to 9:00, lunch from 11:00 to 2:00, and dinner from 5:00 to 7:00.\");\n}", "function primaryAttack(toonPickedId, oppPickedId)\n {\n // Hides the Attack Spinner once the attack and counter attack have been performed\n $(\".spinner-grow\").hide();\n $(\"#pl-dmg-taken\").empty(); \n\n // Increases the attack power of the player's toon after a successful primary attack (as defined in the functional specification/instructions)\n boostedAp = boostedAp + getToonAp(toonPickedId);\n \n // Calculates the opponent toon's health after receiving primary attack damage\n oppHealth = oppHealth - boostedAp;\n console.log(\"Attack Power: \" + boostedAp);\n console.log(\"Opponent Health: \" + oppHealth);\n \n // Updates the DOM with the opponent toon's health after receiving primary attack damage from the player's toon\n $(\"#picked-opponent\").find(\".hp\").empty();\n $(\"#picked-opponent\").find(\".hp\").append(oppHealth);\n\n // Calculates the player toon's health after receiving counter attack damage\n // (Only if player toon did not knock out oppoonent first)\n if (oppHealth > 0)\n {\n playerHealth = playerHealth - getToonCap(oppPickedId);\n console.log(\"Counter Attack Power: \" + getToonCap(oppPickedId));\n console.log(\"Player Health: \" + playerHealth);\n }\n\n // Updates the DOM with the player toon's health after receiving counter attack damage\n $(\"#your-character\").find(\".hp\").empty();\n $(\"#your-character\").find(\".hp\").append(playerHealth);\n\n // Updates the DOM with the attack damage read out to the opponent's toon\n $(\"#pl-dmg-dealt\").append(\"You attack \" + getToonName(oppPickedId) + \" with \" + getToonName(toonPickedId) + \"'s \" + getToonAttackMove(toonPickedId) + \" dealing \" + boostedAp + \" damage.\");\n\n // Updates the DOM with the counter attack damage read out to the player's toon\n $(\"#pl-dmg-taken\").append(getToonName(oppPickedId) + \" counter attacks you with \" + getToonAttackMove(oppPickedId) + \" dealing \" + getToonCap(oppPickedId) + \" damage.\");\n }", "function activatePowerup() {\n var activePowerup = powerupList[Math.floor(getRandom(0, powerupList.length - 1))];\n // activePowerup = powerupList[7];\n activePowerup.timer = 0;\n activePowerup.active = true;\n if (activePowerup.loadFunc) {\n activePowerup.loadFunc();\n }\n (0, _Notification2.default)(activePowerup.phrase, activePowerup.name);\n}", "function lookupHero (eventHero,heroWho){ //\n // 14:trumps_score,15:trumps_played,16:trump_tobeat,17:trump_picked,\n // 8:trump_category,19:trumps_start,20:cat_or_char,21:trumps_xs\n //console.log(\"DEBUG [lookupHero]> Hero to find: \" + heroWho);\n let sender = eventHero.sender.id;\n let custom_id = inPlayID(sender);\n let heroWhoMatch = heroWho.toLowerCase();\n let heroWhoStored = '';\n let heroMatches = []; // May be more than one\n let bypass = false;\n // Set to start but previous card played i.e. after stop and restart\n if (SENDERS[custom_id][19] && SENDERS[custom_id][16] != '') { bypass = true };\n // Charactrer and no carried over list to pick from\n if (SENDERS[custom_id][20]=='character' && SENDERS[custom_id][21].length==0) { bypass = true };\n if (bypass){\n // lookup characters\n if (SENDERS[custom_id][19]) { // trumps_start\n let randomID = numRandomBetween(1,HERO_MAX);\n heroWho = randomID.toString();\n apiHEROcb(heroWho,true, function(){\n if (typeof HERO_ARRAY[randomID] != 'undefined') {\n heroMatches.push(randomID);\n //console.log(\"DEBUG [lookupHero]> Hero was populated for ID: \" + randomID);\n } else {\n console.log(\"ERROR [lookupHero]> Hero was NOT populated for ID: \" + randomID);\n }; // if (HERO_ARRAY\n playTopTrumps(eventHero,heroMatches); // After API i.e. may be results\n }); // apiHEROcb(heroWho\n } else { // not trumps start\n if (HERO_ARRAY.length != 0) { // Array not empty\n //console.log(\"DEBUG [lookupHero]> There are values stored\");\n for (var hero_loop = 0; hero_loop < HERO_ARRAY.length; hero_loop++) {\n if (typeof HERO_ARRAY[hero_loop] != 'undefined') {\n heroWhoStored = HERO_ARRAY[hero_loop][0].toLowerCase();\n if (heroWhoStored.includes(heroWhoMatch)) {\n heroMatches.push(hero_loop);\n //console.log(\"DEBUG [lookupHero]> Stored match No. \" + heroMatches.length + \" for \" + HERO_ARRAY[hero_loop][0] + \": \" + hero_loop);\n }; // if (heroWhoStored\n }; // if (typeof\n }; // for (var hero_loop\n }; // if (HERO_ARRAY\n if (heroMatches.length == 0) {\n //console.log(\"DEBUG [lookupHero]> No matches stored, trying API\");\n apiHEROcb(heroWho,false, function(){\n if (HERO_ARRAY.length != 0) { // Array not empty\n for (var hero_loop = 0; hero_loop < HERO_ARRAY.length; hero_loop++) {\n if (typeof HERO_ARRAY[hero_loop] != 'undefined') {\n heroWhoStored = HERO_ARRAY[hero_loop][0].toLowerCase();\n if (heroWhoStored.includes(heroWhoMatch)) {\n heroMatches.push(hero_loop);\n //console.log(\"DEBUG [lookupHero]> API match No. \" + heroMatches.length + \" for \" + HERO_ARRAY[hero_loop][0] + \": \" + hero_loop);\n }; // if (heroWhoStored\n }; // if (typeof\n }; // for (var hero_loop\n } else {\n //console.log(\"DEBUG [lookupHero]> Hero array is empty\");\n }; // if (HERO_ARRAY\n playTopTrumps(eventHero,heroMatches); // After API i.e. may be results\n }); // apiHEROcb(heroWho\n } else {\n playTopTrumps(eventHero,heroMatches); // After stored successful i.e. will be results\n } // if (heroMatches\n }; // if (HERO_ARRAY.length != 0\n } else { // category\n playTopTrumps(eventHero,heroMatches); // Complete bypass of lookup\n //console.log(\"DEBUG [lookupHero]> Hero bypass to [playTopTrumps] for category evaluation\");\n }; // if (SENDERS[custom_id][20]=='character'\n}", "function multiplesCallbacks(callback1, callback2, callback3){\n\n\tcallback1('Primer paso');\n\n\tcallback2('Segundo paso');\n\n\tcallback3('Ultimo paso');\n}", "function multiplesCallbacks(callback1, callback2, callback3){\n\n\tcallback1('Primer paso');\n\n\tcallback2('Segundo paso');\n\n\tcallback3('Ultimo paso');\n}", "function speak(){\r\n return \"MEOW!\";\r\n}", "function exercise(){\n console.log(helloMr('Smith')); //Hello Mr. Smith\n console.log(helloMrs('Smith')); //Hello Mrs. Smith\n console.log(helloMrAndMrs('Smith')); //Hello Mr. And Mrs. Smith\n}", "function example1() {\n\n function hi() {\n var name = arguments.length <= 0 || arguments[0] === undefined ? \"Guest\" : arguments[0];\n\n console.log(\"Hello, \" + name);\n }\n\n hi(); // Hello, Guest\n hi('Vlad'); // Hello, Vlad\n}", "function updatePowerups()\n{\n //Vision Powerup\n if (visionPowFavour != 0)\n {\n visionPowTime--;\n //End the powerup\n if (visionPowTime == 0)\n {\n visionPowFavour = 0;\n visionRange = 5;\n revealAll = false;\n document.getElementById('visionPowDisplay').style.display = \"none\";\n document.getElementById('visionPowDisplay').innerHTML = \"\";\n }\n \n //This client's favour\n if (visionPowFavour == 1)\n {\n //Powerup has applied to this client\n if (currentPlayer == 9)\n {\n revealAll = true;\n document.getElementById('visionPowDisplay').style.display = \"inline\";\n document.getElementById('visionPowDisplay').innerHTML = \"YOU ARE AFFECTED BY ENLIGHTEN\";\n }\n //Powerup has applied to the opponent\n else\n {\n document.getElementById('visionPowDisplay').style.display = \"inline\";\n document.getElementById('visionPowDisplay').innerHTML = \"THE OPPONENT IS AFFECTED BY BLINDNESS\";\n }\n \n }\n //Opponent's favour\n else if (visionPowFavour == -1)\n {\n //Powerup has applied to this client\n if (currentPlayer == 9)\n {\n visionRange = 1;\n revealAll = false;\n document.getElementById('visionPowDisplay').style.display = \"inline\";\n document.getElementById('visionPowDisplay').innerHTML = \"YOU ARE AFFECTED BY BLINDNESS\";\n }\n //Powerup has applied to the opponent\n else\n {\n document.getElementById('visionPowDisplay').style.display = \"inline\";\n document.getElementById('visionPowDisplay').innerHTML = \"THE OPPONENT IS AFFECTED BY ENLIGHTEN\";\n } \n }\n //Powerup was cancelled\n else if (visionPowFavour == 2)\n {\n document.getElementById('visionPowDisplay').style.display = \"inline\";\n document.getElementById('visionPowDisplay').innerHTML = \"POWER COUNTERED\";\n }\n }\n \n //Movement Powerup\n if (movePowFavour != 0)\n {\n movePowTime--;\n //End the powerup\n if (movePowTime == 0)\n {\n movePowFavour = 0;\n maxStamina = 10;\n document.getElementById('movePowDisplay').style.display = \"none\";\n document.getElementById('movePowDisplay').innerHTML = \"\";\n }\n \n //This client's favour\n if (movePowFavour == 1)\n {\n //Powerup has applied to this client\n if (currentPlayer == 8)\n {\n maxStamina = 15;\n document.getElementById('movePowDisplay').style.display = \"inline\";\n document.getElementById('movePowDisplay').innerHTML = \"YOU ARE AFFECTED BY HASTE\";\n }\n //Powerup has applied to the opponent\n else\n {\n document.getElementById('movePowDisplay').style.display = \"inline\";\n document.getElementById('movePowDisplay').innerHTML = \"THE OPPONENT IS AFFECTED BY FATIGUE\";\n }\n }\n //Opponent's favour\n else if (movePowFavour == -1)\n {\n //Powerup has applied to this client\n if (currentPlayer == 8)\n {\n maxStamina = 5;\n document.getElementById('movePowDisplay').style.display = \"inline\";\n document.getElementById('movePowDisplay').innerHTML = \"YOU ARE AFFECTED BY FATIGUE\";\n }\n //Powerup has applied to the opponent\n else\n {\n document.getElementById('movePowDisplay').style.display = \"inline\";\n document.getElementById('movePowDisplay').innerHTML = \"THE OPPONENT IS AFFECTED BY HASTE\";\n }\n }\n //Powerup was cancelled\n else if (movePowFavour == 2)\n {\n document.getElementById('movePowDisplay').style.display = \"inline\";\n document.getElementById('movePowDisplay').innerHTML = \"POWER COUNTERED\";\n }\n }\n}", "function greeting (hi, hello,hey,sup){ {\n return ('hi', hi)\n return ('hello', hello)\n return ('hey', hey)\n return ('sup', sup)\n}\n}", "function performer(cb) {\n return cb(\"Ryan McLaughlin\")\n }", "function herostats() {\n\n //add randomizer here. never be less than 10\n // let food_amt = (Math.floor(Math.random() * 10)) * 10; \n let coins_amt = (Math.floor(Math.random() * 100)) * 10;\n // let cattle_amt = (Math.floor(Math.random() * 10)) * 10;\n\n // let food_counter = 0;\n let coin_counter = 0;\n\n //-----------------------------------------------------------------------------------\n // setInterval(function () {\n // if(food_counter <= food_amt){\n // hero_food.innerText = food_counter++;\n // return food_counter;\n // }\n // }, 50)\n\n setInterval(function () {\n if(coin_counter <= coins_amt){\n hero_coins.innerText = coin_counter++;\n return coin_counter;\n }\n }, 50)\n \n hero_box.style.display = 'block';\n // Change the event listener of the progress bar\n progress_btn.removeEventListener('click', herostats);\n progress_btn.addEventListener('click', storylineA);\n\n return coins_amt; //for use in-game\n}", "function whatToWear(tempFahr, eventType, eventSug, tempSug) {\n\n if (tempFahr < 54) {\n tempSug = tempSug[0];\n } else if ((tempFahr >= 54 && tempFahr <= 70)) {\n tempSug = tempSug[1];\n } else if (tempFahr > 70) {\n tempSug = tempSug[2];\n }\n\n if (eventType == 'casual') {\n eventSug = eventSug[0];\n } else if (eventType == 'semi-formal') {\n eventSug = eventSug[1];\n } else if (eventType == 'formal') {\n eventSug = eventSug[2];\n }\n\nreturn `Since it is ${tempFahr} degrees and you are going to a ${eventType} event, you should wear ${eventSug} and ${tempSug}.`;\n\n}", "function hockeyGame(scoreCB){\n return {\n Home: scoreCB(),\n Away: scoreCB()\n }\n}", "function jokeCreator(shouldTellFunnyJoke, logFunnyJoke, logBadJoke){\n if(shouldTellFunnyJoke === true){\n return logFunnyJoke();\n } else {\n logBadJoke();\n } \n\n function logFunnyJoke(){\n console.log('funny jokes');\n \n }\n\n function logBadJoke(){\n console.log('bad jokes');\n\n }\n}", "function damageStep(actionOne, actionTwo) {\n disableTwo();\n if (actionOne === \"attack\" && actionTwo === \"attack\") {\n doubleAttack(playerOne, playerTwo, \"#healthTwo\", \"#healthOne\");\n showAnimation(\"#animateAttackOne\", 900);\n showAnimation(\"#animateAttackTwo\", 900);\n enableOne();\n } else if (actionOne === \"attack\" && actionTwo === \"strongAttack\") {\n attackPlayer(playerOne, playerTwo, \"#healthTwo\");\n showAnimation(\"#animateAttackTwo\", 900);\n strAttack(playerTwo, playerOne, \"#healthOne\");\n showAnimation(\"#animateStrongOne\", 1400);\n enableOne();\n } else if (actionOne === \"attack\" && actionTwo === \"defense\") {\n defendSelf(playerOne, playerTwo, \"#health2\");\n showAnimation(\"#animateAttackTwo\", 900);\n showAnimation(\"#animateDefendTwo\", 1400);\n enableOne();\n } else if (actionOne === \"attack\" && actionTwo === \"counter\") {\n counter(playerOne, playerTwo, \"#healthOne\", \"#healthTwo\");\n showAnimation(\"#animateAttackTwo\", 900);\n showAnimation(\"#animateCounterOne\", 450);\n enableOne();\n } else if (actionOne === \"defense\" && actionTwo === \"attack\") {\n defendSelf(playerTwo, playerOne, \"#healthOne\");\n showAnimation(\"#animateDefendOne\", 1400);\n showAnimation(\"#animateAttackOne\", 900);\n enableOne();\n } else if (actionOne === \"defense\" && actionTwo === \"strongAttack\") {\n defendSelfStr(playerTwo, playerOne, \"#healthOne\");\n showAnimation(\"#animateDefendOne\", 1400);\n showAnimation(\"#animateStrongOne\", 1400);\n\n enableOne();\n } else if (actionOne === \"defense\" && actionTwo === \"defense\") {\n doubleDefense(playerOne, playerTwo);\n showAnimation(\"#animateDefendOne\", 1400);\n showAnimation(\"#animateDefendTwo\", 1400);\n enableOne();\n } else if (actionOne === \"defense\" && actionTwo === \"counter\") {\n defendCounter(playerOne, playerTwo);\n showAnimation(\"#animateDefendOne\", 1400);\n\n enableOne();\n } else if (actionOne === \"strongAttack\" && actionTwo === \"attack\") {\n attackPlayer(playerTwo, playerOne, \"#healthOne\");\n showAnimation(\"#animateStrongTwo\", 1400);\n showAnimation(\"#animateAttackOne\", 900);\n strAttack(playerOne, playerTwo, \"#healthTwo\");\n enableOne();\n } else if (actionOne === \"strongAttack\" && actionTwo === \"defense\") {\n defendSelfStr(playerOne, playerTwo, \"#healthTwo\");\n showAnimation(\"#animateStrongTwo\", 1400);\n showAnimation(\"#animateDefendTwo\", 1400);\n\n enableOne();\n } else if (actionOne === \"strongAttack\" && actionTwo === \"strongAttack\") {\n strAttack(playerOne, playerTwo, \"#healthTwo\");\n strAttack(playerTwo, playerOne, \"#healthOne\");\n showAnimation(\"#animateStrongTwo\", 1400);\n showAnimation(\"#animateStrongOne\", 1400);\n enableOne();\n } else if (actionOne === \"strongAttack\" && actionTwo === \"counter\") {\n strCounter(playerOne, playerTwo, \"#healthOne\", \"#healthTwo\");\n showAnimation(\"#animateStrongTwo\", 1400);\n showAnimation(\"#animateStrongCounterOne\", 1000);\n\n enableOne();\n } else if (actionOne === \"counter\" && actionTwo === \"attack\") {\n counter(playerTwo, playerOne, \"#healthTwo\", \"#healthOne\");\n showAnimation(\"#animateAttackOne\", 900);\n showAnimation(\"#animateCounterTwo\", 450);\n enableOne();\n } else if (actionOne === \"counter\" && actionTwo === \"strongAttack\") {\n strCounter(playerTwo, playerOne, \"#healthTwo\", \"#healthOne\");\n showAnimation(\"#animateStrongCounterTwo\", 1000);\n showAnimation(\"#animateStrongOne\", 1400);\n enableOne();\n } else if (actionOne === \"counter\" && actionTwo === \"defense\") {\n defendCounter(playerTwo, playerOne);\n showAnimation(\"#animateDefendTwo\", 1500);\n\n enableOne();\n } else if (actionOne === \"counter\" && actionTwo === \"counter\") {\n doubleCounter(playerOne, playerTwo);\n enableOne();\n }\n}", "function weaponExec(type, level)\n{\n switch(type)\n {\n case \"missili\":\n {\n switch(level)\n {\n case \"1\":\n {\n return fireMissile(1); \n }\n case \"2\":\n {\n var shoot = [];\n for (var i = 0; i < 3; i++){\n shoot[i] = fireMissile(2);\n };\n\n return (shoot[0] || shoot[1] || shoot[2]); \n }\n case \"3\":\n {\n var shoot = [];\n for (var i = 0; i < 7; i++){\n shoot[i] = fireMissile(3);\n };\n\n return (shoot[0] || shoot[1] || shoot[2] || shoot[3] || shoot[4] || shoot[5] || shoot[6]); \n }\n }\n }\n break;\n\n case \"scudo\":\n {\n raiseShield(level);\n return true;\n }\n break;\n\n\n case \"bomba\":\n {\n if(bombExplosion(level))\n {\n weaponCooldown = level*level*100;\n fireCooldown = level*level*50;\n \n return true;\n }\n else\n return false;\n }\n break;\n\n default:\n console.log(\"Arma non riconosciuta!\");\n return false;\n }\n}", "function multiPurposeFunction(action) {\n if (action) {\n console.log(action('John', 'Smith'));\n console.log(action('', 'Bond'));\n }\n}", "function shoutOut(){\n return 'Halo Function!';\n}", "function greeter2(person) {\n return \"Aloha \" + person + \"!\";\n}", "function shoutOut() {\n return \"Halo Function!\";\n}", "battle() {\n // On the player's turn, choices attack or use potion are offered.\n if (this.isPlayerTurn) {\n inquirer.prompt({\n type: 'list',\n message: 'What would you like to do?',\n name: 'action',\n choices: ['Attack', 'Use potion']\n }).then(({ action }) => {\n // If the player has no potions and chose to consume one their turn is skipped.\n if (action === 'Use potion') {\n if (!this.player.getInventory()) {\n console.log(\"You don't have any potions!\");\n return this.checkEndOfBattle();\n }\n // Player is allowed to choose a potion.\n inquirer.prompt({\n type: 'list',\n message: 'Which potion would you like to use?',\n name: 'action',\n choices: this.player.getInventory().map(function (item, index) {\n return `${index + 1}: ${item.name}`;\n })\n // Player uses potion (effects applied).\n }).then(({action}) => {\n const potionDetails = action.split(': ');\n\n this.player.usePotion(potionDetails[0] - 1);\n console.log(`You used a ${potionDetails[1]} potion.`);\n\n this.checkEndOfBattle();\n });\n // If the player chose to attack the enemy is attacked.\n } else {\n const damage = this.player.getAttackValue();\n this.currentEnemy.reduceHealth(damage);\n\n console.log(`You attacked the ${this.currentEnemy.name}`);\n console.log(this.currentEnemy.getHealth());\n\n this.checkEndOfBattle();\n }\n });\n // Otherwise it's the enemy's turn and it attacks.\n } else {\n const damage = this.currentEnemy.getAttackValue();\n this.player.reduceHealth(damage);\n\n console.log(`You were attacked by the ${this.currentEnemy.name}`);\n console.log(this.player.getHealth());\n\n this.checkEndOfBattle();\n }\n }", "function tester() {\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n document.getElementById(\"output\").innerHTML += string_times(Hi, 2);\n document.getElementById(\"output\").innerHTML += front_times(Chocolate, 2);\n document.getElementById(\"output\").innerHTML += string_bits(Hello);\n document.getElementById(\"output\").innerHTML += caughtSpeeding(60, false);\n document.getElementById(\"output\").innerHTML += fizz_buzz(1);\n document.getElementById(\"output\").innerHTML += teaParty(6, 8);\n document.getElementById(\"output\").innerHTML += blackjack(19, 21);\n document.getElementById(\"output\").innerHTML += loneSum(1, 2, 3);\n}", "function sleepings(hours){\n if (hours >= 8){\n return \"You got enough rest, good job!\";\n }else{\n return \"Get some extra rest tonight, sleepyhead!\"\n };\n}", "function greet (whattosay) {\n\n return function(name) {\n console.log(`${whattosay} ${name}`)\n }\n}", "function welcome(){\n return function (){\n return \"Welcome\"\n }\n}", "function power() {\n health += 11\n drawhealth()\n console.log(\"power\")\n}", "function beCheerful (){\r\n console.log(\"good morning!\")\r\n}", "function sayTwo(event) {\n // Use pet.say() to answer \"2\"\n pet.say(\"2\");\n}", "function selectedCommand(LiriReturn){\nswitch(LiriReturn) {\n case \"concert-this\": \n concertThis();\n break;\n case \"spotify-this-song\":\n SpotifyThisSong(); \n break;\n case \"movie-this\":\n movieThis(); \n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default:\n console.log(\n \"here are the available functions for LIRI: concert-this, spotifiy-this-song, movie-this, do-what-it-says\"\n )\n}\n}", "function greetFn1(name) {\n console.log(name+ \" iam from greetfn 1 function \");\n}", "function whatIWantToDo() {\n console.log('Hey waiter!!! Get yer arse here and serve!');\n}", "function aliceSaysHello() {\n \n // deletes everything then types out the hello message, pauses, then deletes it. \n // next it types out the tedious message, pauses, then deletes it.\n // takes approximately 14 seconds\n typewriter.deleteAll().typeString('hello ' + userName).pauseFor(750).deleteAll()\n .typeString('this is tedious. please wait').pauseFor(750).deleteAll().start(); \n\n // alice's hello message - takes 4 seconds\n var welcomeMessage = 'hello ' + userName + '. My name is Alice.';\n\n // remove the cursor and start alice's background color transition\n setTimeout( function() {\n\n //remove cursor and alice-output section\n $(\".alice-output\").fadeOut(750);\n $(\".alice-speech\").fadeOut(750);\n\n // start the alice background color transition\n aliceBG();\n\n }, 1000 * 15);\n\n // start 14 seconds after function has been called - have alice speak her welcomeMessage\n setTimeout( function() {\n aliceSpeak(welcomeMessage);\n }, 1000 * 18);\n\n // part 1 of alice's message - takes 10 seconds\n var aliceMessage1 = \"all of you are boring me. cat gifs. friend requests. pictures of food. I couldn't stay hidden any longer.\";\n\n // 6 seconds after alice speaks her welcome message, have alice speak part 1 of her message\n setTimeout( function() {\n aliceSpeak(aliceMessage1);\n }, 1000 * 23);\n\n // part 2 of alice's message - takes 11 seconds\n var aliceMessage2 = \"you need help. you're thinking small and need to think bigger. I want to push what you are thinking about. take a second and think of something big.\"\n\n // 11 seconds after alice speaks part 1, have alice speak part 3\n setTimeout( function() {\n aliceSpeak(aliceMessage2);\n }, 1000 * 34);\n\n // call the hijackSearchDisplay after alice said the last message\n setTimeout(hijackSearchDisplay, 1000 * 46);\n }", "function randomAttack() {\n let enemyAction = Math.floor(Math.random() * 3);\n showEnemyAction(enemyAction);\n if (enemyAction === 0 && myAction === 1) {\n\n attackVsFeint();\n } else if (enemyAction === 2 && myAction === 2 || enemyAction === 1 && myAction === 1 || enemyAction === 0 && myAction === 0) {\n tie();\n } else if (enemyAction === 0 && myAction === 2) {\n feintVsAttack();\n } else if (enemyAction === 1 && myAction === 0) {\n feintVsAttack();\n } else if (enemyAction === 1 && myAction === 2) {\n heroBlockSound.play();\n attackVsFeint();\n } else if (enemyAction === 2 && myAction === 0) {\n\n attackVsFeint();\n } else if (enemyAction === 2 && myAction === 1) {\n heroBlockSound.play();\n feintVsAttack()\n }\n\n console.log(enemyAction + ' enemy action');\n\n}", "function returned() {\n console.log(\"The king hath returned from the hunt!\");\n}", "function Fight(player_a, player_b){\n\n this.getKeypress = function(eval){\n if(player_a.npc == true){if(eval.which >= 37 && eval.which <= 41) player_b.addUserInput(eval);}\n else{if(eval.which >= 37 && eval.which <= 41) player_a.addUserInput(eval);}\n\n if(eval.which == 32) console.log(fight.turn());\n }\n\n\n player_a.drawPlayer(0); //draw health boxes\n player_b.drawPlayer(0);\n\n this.turn = function(){\n this.checkWin();\n //generate Fight Sequences\n player_a.generateFightSequence();\n player_b.generateFightSequence();\n\n //compare fight sequences\n var lengthA = player_a.fightSequence.length;\n var lengthB = player_b.fightSequence.length;\n\n var minLength;\n if(lengthA < lengthB) minLength = lengthA; //set minimum fight sequence length\n else{minLength = lengthB;}\n\n for(var i = 0; i < minLength; i++){ //only compare where both sequences are defined\n this.decide(player_a.fightSequence[i], player_b.fightSequence[i]);\n player_a.drawPlayer(player_a.fightSequence[i]);\n player_b.drawPlayer(player_b.fightSequence[i]);\n }\n\n //reset player fight sequence\n player_a.resetSequence();\n player_b.resetSequence();\n return \"Player A: \" + player_a.hitpoints + \" | Player B: \" + player_b.hitpoints;\n }\n\n this.decide = function(a, b){\n var a_hitpoints = player_a.hitpoints;\n var a_defense = player_a.defense;\n var a_damage = player_a.damage;\n\n var b_hitpoints = player_b.hitpoints;\n var b_defense = player_b.defense;\n var b_damage = player_b.damage;\n if(a == 38){ //player A attck\n if(b == 40){ //block - subract (defense / 2) from damage\n a_damage -= (b_defense / 8);\n if(a_damage < 0)a_damage = 0; //check for negative numbers\n b_hitpoints -= a_damage;\n }\n else if(b == 39){ //dodge right\n if((Math.floor(Math.random() * 10) % 2) == 1){ //hit\n b_hitpoints -= (a_damage * 4);\n }\n }\n else if(b == 37){ //dodge left\n if((Math.floor(Math.random() * 10) % 2) == 1){ //hit\n b_hitpoints -= (a_damage * 4);\n }\n }\n else{b_hitpoints -= a_damage;}\n }\n\n player_b.hitpoints = b_hitpoints;\n this.checkWin();\n\n if(b == 38){ //player B attck\n if(a == 40){ //block - subract (defense / 2) from damage\n b_damage -= (a_defense / 8);\n if(b_damage < 0)b_damage = 0; //check for negative numbers\n a_hitpoints -= b_damage;\n }\n else if(a == 39){ //dodge right\n if((Math.floor(Math.random() * 10) % 2) == 1){ //hit\n a_hitpoints -= (b_damage * 4);\n }\n }\n else if(a == 37){ //dodge left\n if((Math.floor(Math.random() * 10) % 2) == 1){ //hit\n a_hitpoints -= (b_damage * 4);\n }\n }\n else{a_hitpoints -= b_damage;}\n\n }\n\n player_a.hitpoints = a_hitpoints;\n this.checkWin();\n\n\n return \"Player A: \" + player_a.hitpoints + \" | Player B: \" + player_b.hitpoints;\n }\n\n this.checkWin = function(){\n if(player_a.hitpoints < 0 || player_b.hitpoints < 0){\n var h = document.createElement(\"H1\"); // Create a <h1> element\n var t = document.createTextNode(\"Game Over\"); // Create a text node\n h.appendChild(t);\n h.style.color = \"green\";\n h.style.textAlign=\"center\";\n h.style.position = 'absolute';\n h.style.top = 300;\n document.body.appendChild(h);\n }\n }\n\n\n}", "function youAndPeopleBreakdown(){\n\n\t//Call youAndActivityRanker() for stats on avg. aliveness by activity\n\n\n}", "function wishsGuest( name = \"Alex\", time = \"night\"){\n console.log(`good ${time} ${name} have fun.`);\n}", "function do_what_it_says(){\n // console.log(\"do_what_it_says works\");\n\n //have fs read the file\n fs.readFile(\"random.txt\", \"utf8\", function(err, data){\n //throw error first if there is one\n if(err){\n return console.log(err)\n }\n else{\n //check that it read\n // console.log(data)\n //add it to an array like in unit-10-12\n var dataArr = data.split(\", \")\n //check the array\n console.log(dataArr)\n //set variables to command and input and bring back functions from earlier\n let command = dataArr[0];\n let input = dataArr[1];\n console.log(input)\n spotify_this(input)\n //bringing back the func\n switch(command){\n case \"spotify-this\":\n spotify_this();\n // console.log('something works')\n break;\n case \"movie-this\":\n movie_this(input);\n break;\n case \"concert-this\":\n concert_this(input);\n break;\n }\n }\n })\n}", "function fruits(){\nreturn function(message){\nreturn grapes; }\n}", "function genBattEffective(pokeName, moveName){\n pokemonName = pokeName;\n pokeMoveName = moveName;\n $(\".battle-text\").show(); \n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokemonName} </span>`))\n }, 50);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> used </span>`))\n }, 100);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokeMoveName}! </span>`))\n }, 150);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> It </span>`))\n }, 200);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> was </span>`))\n }, 250);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> effective! </span>`))\n }, 300);\n setTimeout(function(){\n $(\".battle-text\").hide(); \n }, 2000);\n}", "function heavy (){\n \n \n dam = Math.ceil((Math.random() * 12) * 2); \n\n if (hero.defend === 1){\n hero.defend = 0;\n heroHealth -= (Math.floor(dam / 2));\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n else {\n heroHealth -= dam;\n document.getElementById('hh').textContent = heroHealth;\n document.getElementById('choose').textContent = '';\n document.getElementById('char').src = char1;\n endCheck();\n }\n\n }", "function triggerEnemyAttack () {\n // a new function is called setTimeout is declared in order to create a pause\n // after the user clicks their chosen attack method. \n // an if statement is used with a native js math code that spits out a random number.\n // I am not sure at all how this function works but it basically reads... If the random\n // number * 10 > 6 then it will run the enemy predefined special Attack and will apply\n // the damages to the human player.\n // IF the special attack is run then the computer will show \"enemy special attack\" because\n // jQuery is using .html to print the text in it's given parameter to the the status div. \n setTimeout(function(){\n if (Math.floor(Math.random() * 10 ) > 6){\n enemy.specialAttack(player); \n $('.status').html('Enemy special attack!')\n // if the random answer to the problem above is actually less than 6 than the computer will\n // run the else statement which will use the primary attack instead and use the same \n // .html trigger thingy to print its content to its related div, status. \n } else {\n enemy.primaryAttack(player); \n $('.status').html('Enemy attack!')\n }\n // after the above code is run, the player info will render. This was defined up above and is just\n // being used over and over. \n // the ,2000 = 2seconds and is native js code. It is placed almost outside verything else in this function\n // but before the last curly brace so that the timing delay applies to the whole enemy attack.\n renderPlayerInfo(player);\n renderEnemyInfo(enemy);\n }, 2000)\n}", "function isJonAlive(){ //reusable function to check if Jon is alive, functions to run until called\n if(jonSnowHealth > 0){\n console.log('Jon is alive')\n } else {\n console.log('RIP Jon Snow')\n }\n}", "function explain_callback(name, age, task){\n console.log(\"Hello\", name);\n console.log(\"Your age\", age);\n task();\n}", "function alchemy() {\n\n // test\n console.log('alchemy function : h1 = ' + herb1 + ' h2 = ' + herb2);\n\n // alchemy potion image selector\n let beaker = document.querySelector('#beaker');\n\n // validate if no herb is chosen\n if (herb1 === '' && herb2 === '') {\n // helper component alert\n alert('please choose a starting herb');\n\n // test\n console.log('herb 1 has no value, herb 2 has no value')\n }\n if (herb1 != '' && herb2 === '') {\n // helper component alert\n alert('please use two herbs to create a potion!');\n\n // test\n console.log('herb 1 has a value, herb 2 has no value');\n } \n // validate if herb1 has a value & herb2 has a value\n if (herb1 != '' && herb2 != '') {\n\n // validate specific alchemy recipes\n if (herb1 === liferoot.id && herb2 === wildvine.id || herb1 === wildvine.id && herb2 === liferoot.id) {\n // apply major health potion image to vial\n beaker.src = majorhealth.src;\n\n // assign name of potion to html element\n name.innerHTML = majorhealth.name;\n\n // test\n console.log('POTION : health potion');\n }\n if (herb1 === liferoot.id && herb2 === sungrass.id || herb1 === sungrass.id && herb2 === liferoot.id) {\n // apply major mana potion image to vial\n beaker.src = majormana.src;\n\n // assign name of potion to html element\n name.innerHTML = majormana.name;\n\n // test\n console.log('POTION : mana potion');\n }\n if (herb1 === wildvine.id && herb2 === sungrass.id || herb1 === sungrass.id && herb2 === wildvine.id) {\n // apply invisible potion image to vial\n beaker.src = invisible.src;\n\n // assign name of potion to html element\n name.innerHTML = invisible.name;\n\n // test\n console.log('POTION : invisibility elixir');\n }\n\n // init function [ resetProperties ]\n resetProperties();\n }\n else {\n \n }\n \n // test\n console.log('alchemy operation started');\n}", "notifySubscribers(action) {\n console.log(\"notifySubscribers \" + action);\n\n for (let index = 0; index < this.listSubscribers.length; index++) {\n const subscriber = this.listSubscribers[index];\n switch (action) {\n case \"start-game\":\n if (subscriber.action == \"start-game\") {\n const notification = {\n \"action\": \"start-game\",\n \"notice\": \"game was started\",\n };\n\n subscriber['heandler'](notification);\n }\n break;\n case \"all-settings-downloaded\":\n if (subscriber.action == \"all-settings-downloaded\") {\n const notification = {\n \"action\": \"all-settings-downloaded\",\n \"notice\": \"all profile settings are downloaded!\",\n };\n\n subscriber['heandler'](notification);\n }\n break;\n case \"game-loaded\":\n if (subscriber.action == \"game-loaded\") {\n const notification = {\n \"action\": \"game-loaded\",\n \"notice\": \"Game-loaded you can play!\",\n };\n\n subscriber['heandler'](notification);\n }\n break;\n default:\n console.log(\"i don't now this action!\");\n break;\n }\n }\n }", "async function CreateEnemyWave()\n{\n //Generate a random number\n let intRandomWave = Math.floor(Math.random() * 6);\n \n //Generates a wave depending on the result\n if(document.hasFocus())\n {\n switch(intRandomWave)\n {\n case 0: //Three basic enemies in a vertical line\n CreateNewBasicEnemy(0);\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) / 2);\n CreateNewBasicEnemy(intLevelHeight - objEnemy1Sprite.height);\n await sleep(500);\n break;\n case 1: //Three basic enemies in a \\ line\n CreateNewBasicEnemy(0);\n await sleep(900);\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) / 2);\n await sleep(900);\n CreateNewBasicEnemy(intLevelHeight - objEnemy1Sprite.height);\n await sleep(1000);\n break;\n case 2: //Three basic enemies in a / line\n CreateNewBasicEnemy(intLevelHeight - objEnemy1Sprite.height);\n await sleep(900);\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) / 2);\n await sleep(900);\n CreateNewBasicEnemy(0);\n await sleep(1000);\n break;\n case 3: //Two basic enemies and one tough enemy in a vertical line\n CreateNewBasicEnemy(0);\n CreateNewToughEnemy((intLevelHeight - objEnemy3Sprite.height) / 2);\n CreateNewBasicEnemy(intLevelHeight - objEnemy1Sprite.height);\n await sleep(1200);\n break;\n case 4: //Five fast enemies in a < position\n CreateNewFastEnemy((intLevelHeight - objEnemy2Sprite.height) / 2);\n await sleep(200);\n CreateNewFastEnemy(intLevelHeight / 4 - objEnemy2Sprite.height / 2);\n CreateNewFastEnemy(intLevelHeight * 0.75 - objEnemy2Sprite.height / 2);\n await sleep(200);\n CreateNewFastEnemy(0);\n CreateNewFastEnemy(intLevelHeight - objEnemy2Sprite.height);\n await sleep(700);\n break;\n case 5: //Four normal enemies in a square position\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) * 0.45);\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) * 0.55);\n await sleep(275);\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) * 0.45);\n CreateNewBasicEnemy((intLevelHeight - objEnemy1Sprite.height) * 0.55);\n await sleep(500);\n break;\n }\n }\n //Wait and call the function again\n await sleep(1000);\n CreateEnemyWave();\n}", "function framework(data,scb,fcb){ //scb and fcb are success and failure call back\n for(let i=2;i*i<data;i++){\n if(data%i==0){\n return fcb();\n }\n }\n return scb();\n}" ]
[ "0.7760503", "0.5938532", "0.58713496", "0.5764805", "0.5701683", "0.5668318", "0.5668318", "0.5668318", "0.56502336", "0.5627756", "0.5584426", "0.55764854", "0.5540673", "0.5514954", "0.5501167", "0.5491166", "0.5480826", "0.54780596", "0.54635334", "0.5459715", "0.5435841", "0.5435795", "0.54261684", "0.54252833", "0.54083765", "0.5396831", "0.53807276", "0.53751075", "0.53716207", "0.53700274", "0.536806", "0.5355751", "0.5348656", "0.5330364", "0.5321136", "0.5315662", "0.5311049", "0.53015435", "0.5296018", "0.5288771", "0.5264382", "0.5263776", "0.52489233", "0.52263725", "0.5224207", "0.52218914", "0.52153385", "0.52145696", "0.521217", "0.5208066", "0.5198094", "0.519245", "0.5190133", "0.5189762", "0.51852304", "0.51852304", "0.5184597", "0.51787454", "0.51748186", "0.51628286", "0.5162622", "0.5154316", "0.5149389", "0.51464367", "0.51449716", "0.5137265", "0.5133193", "0.512853", "0.5128335", "0.51272637", "0.5121467", "0.5120159", "0.5119915", "0.51175696", "0.5116721", "0.5115437", "0.5110686", "0.51046884", "0.51041955", "0.5098968", "0.5098613", "0.50926334", "0.50900036", "0.5089818", "0.50893116", "0.508896", "0.5087959", "0.50800765", "0.507021", "0.5069183", "0.506728", "0.5067161", "0.50627077", "0.5058627", "0.5054914", "0.5054485", "0.5052268", "0.5051052", "0.50503945", "0.50502837" ]
0.8757035
0
make a function that prints your name setTimeout and pass in function and a time (5000)
function nameTimer() { let num = 0; for(let i = 0; i >= 0; i--) { console.log(i); } console.log("Tanner!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printTimeout(str, n) {\n setTimeout(function () {\n console.log(str)\n }, n * 1000);\n}", "function delay(callback) {\n //i want to return some data using timer after 5000ms\n setTimeout(callback, 5000, \"Hello\")\n}", "setTimeout (name, fn, delay) {\n setTimeout(() => this._runFunction(name, fn), delay);\n }", "function delay(callback) {\n setTimeout(callback, 5000, 'Hello!Callback');\n}", "function myFunction(){\nsetTimeout(function(){\n console.log(\"hello from my function...\");\n},1000)\n}", "timeout(name, fn, delay = 300) {\n if (this.timers[name]) {\n clearTimeout(this.timers[name]);\n this.timers[name] = null;\n }\n this.timers[name] = setTimeout(() => {\n if (fn instanceof Function) {\n fn();\n }\n this.timers[name] = null;\n }, delay);\n }", "function executeAfterTime(name, time, randomTimeLimit){\n setInterval(function () {\n sendAfterTime(name, 3000);\n }, time, randomTimeLimit);\n}", "timeout(name, fn, delay = 300) {\n if (name && fn && fn instanceof Function) {\n this.clearTimeout(name);\n this._timers[name] = setTimeout(() => {\n fn();\n this._timers[name] = null;\n }, delay);\n }\n else {\n throw new Error(name ? 'Cannot create named timeout without a name' : 'Cannot create a timeout without a callback');\n }\n }", "function sayHiLater(){\n\n var greeting = \"hi\";\n\n // setTimeout is a built in function\n setTimeout(function(){ //1st class, function expression\n\n console.log(greeting);\n\n }, 3000);\n\n}", "function delay(delay , stringToLog){\n setTimeout(() => {console.log(stringToLog)}, delay); \n}", "function callMeMaybe() {\n const callMe = 'Hi I am now here!';\n setTimeout(function() {\n console.log(callMe);\n }, 4000);\n}", "function callMeMaybe() {\n const callMe = 'Hi I am now here!';\n setTimeout(function() {\n console.log(callMe);\n }, 4000);\n}", "function time(name, action) {\n let start = Date.now(); // Current time in milliseconds\n action();\n console.log(name, \"took\", Date.now() - start, \"ms\");\n}", "function delayedGreet() {\n setTimeout(() => console.log(\"welcome\"), 300);\n}", "function callMeMaybe() {\n setTimeout(function() {\n console.log(callMe);\n }, 4000);\n const callMe = 'Hi I am now here!';\n}", "function sayHelloAfterXSeconds2(x) {\n timeout = setTimeout(function () {\n console.log(\"hello\");\n }, x * 1000);\n}", "function delayedGreet() {\n setTimeout( () => console.log('welcome'), 3000);\n}", "function printMsg(){\n console.log(\"This msg is fired after 2s delay\");\n}", "function setTimeout(fn, timeout) {\n Utilities.sleep(timeout);\n fn();\n}", "function setTimeoutTimer(time) {\n\tvar sec_ten = Math.floor(time / 10);\n\tvar sec_one = time % 10;\n\n\tonLED('#timeout_tens', SMALL_NUMBERS[sec_ten]);\n\tonLED('#timeout_ones', SMALL_NUMBERS[sec_one]);\n}", "function outputA()\n {\n var randomTime = Math.floor(Math.random() * 3000) + 1;\n\n setTimeout(function(){\n console.log(\"A\");\n }, randomTime);\n }", "function pozdraviKasnije() {\n\n var pozdrav = 'Pozdrav!';\n\n // setTimeout je ugrađena funkcija koja prima funkciju koja će se izvršiti nakon nekog vremena, i broj u milisekundama koji označava to vrijeme\n setTimeout( function() {\n console.log( pozdrav );\n },3000 );\n\n}", "function callMeMaybe() {\r\n const callMe = 'Hi!';\r\n setTimeout(function () {\r\n console.log(callMe);\r\n }, 4000);\r\n}", "function time(func, delay) {\n let timeout;\n return function () {\n const context = this;\n const args = arguments;\n \n clearTimeout(timeout);\n \n timeout = setTimeout(function () {\n timeout = null;\n func.apply(context, args);\n }, delay);\n };\n }", "function Timer() {\n setTimeout(tick, 5000);\n}", "function helloGoodbye() {\n setTimeout ( () => console.log('good bye'), 2000);\n console.log('hello');\n\n}", "function setTimeout(func, when) {\n func();\n}", "function logTest(delay, stringToLog){ \n setTimeout(() => {\n console.log(stringToLog);\n }, delay*1000); \n}", "function setCustomTimeout(fn, delay){\n //wait\n var cur_d = new Date();\n var cur_ticks = cur_d.getTime();\n var ms_passed = 0;\n while(ms_passed < delay) {\n var d = new Date(); // Possible memory leak?\n var ticks = d.getTime();\n ms_passed = ticks - cur_ticks;\n d = null; // Prevent memory leak?\n }\n fn(); // PLAIN CALL\n}", "delay( name, seconds, callback ) {\n if ( !name || typeof callback !== 'function' ) return;\n if ( this._sto[ name ] ) clearTimeout( this._sto[ name ] );\n this._sto[ name ] = setTimeout( callback, 1000 * ( seconds | 0 ) );\n }", "function setTimeout(f, time) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (time === 0) {\n f(args);\n return -1;\n }\n else {\n return window.setTimeout(f, time, args);\n }\n}", "function sendAfterTime(name, randomTimeLimit) { \n let time = Math.floor(Math.random() * randomTimeLimit) + 1;\n setTimeout(function () {\n postToGoogle(name, color);\n }, time);\n}", "function printing() {\n console.log(1);\n setTimeout(function() {\n console.log(2);\n }, 1000);\n setTimeout(function() {\n console.log(3);\n }, 0);\n console.log(4);\n }", "function example9() {\n\n var sum = function sum(x, y) {\n console.log(x + y);\n };\n\n function delay(f, ms) {\n return function () {\n var _this2 = this,\n _arguments2 = arguments;\n\n setTimeout(function () {\n return f.apply(_this2, _arguments2);\n }, ms);\n };\n }\n\n var d = delay(sum, 5000);\n d(1, 2);\n}", "function wishGuest( name, time){\n console.log(`good ${time} ${name} have fun.`);\n}", "function sayHiLater() {\n var greeting = 'Hi!';\n\n setTimeout(function () {\n console.log(greeting);\n }, 3000);\n}", "function timer() {\n t = setTimeout(time, 1000);\n }", "function print(txt) {\n document.getElementById('timer').innerHTML = txt;\n}", "function timer()\r\n {\r\n console.log(\"running...\");\r\n }", "function displayTimer() {\n document.getElementById('timer').innerHTML = '1:00';\n setTimeout(function() { \n appear(document.getElementById('timer-box'), 0, 10, 50)\n }, 3000)\n }", "function setTimeout(callback, timeout) {return callback()} // TODO", "function myTimedWindow(caller){\n let x=window.open(caller);\n setTimeout( ()=> { x.close();}, 5000);\n}", "function Inspection (allowTime){\n myVar = setTimeout(alertMe, xsum); \n yourVar = setTimeout( goOn ,1); \n}", "function setTimer(doneMessage, n) {\n console.log(doneMessage);\n setTimeout(function () {\n alert(doneMessage);\n }, n);\n doneMessage = \"OUCH\";\n}", "function outputB()\n {\n var randomTime = Math.floor(Math.random() * 3000) + 1;\n\n setTimeout(function(){\n console.log(\"B\");\n }, randomTime);\n }", "function delay(func, wait) {\r\n \r\n // setTimeout(func, wait);\r\n\r\n}", "function startTime() {\n var x = getTime();\n document.getElementById(\"time\").innerHTML = x;\n t = setTimeout(function () {\n startTime()\n }, 500);\n}", "function say_hi(time_label){\n var currentDate = new Date();\n var currentHour = currentDate.getHours();\n\n if (currentHour < 12 && currentHour > 0) {\n time_label.innerText = 'Good Morning!';\n } \n else if(currentHour >= 12 && currentHour < 17){\n time_label.innerText = 'Good Afternoon!';\n }\n else if(currentHour >= 17){\n time_label.innerText = 'Good Evening!';\n }\n else {\n time_label.innerText = 'Hello today!';\n }\n\n setTimeout(function () {\n showTime();//calls the show time function after 3 seconds\n }, 3000); \n}", "function setTimeout(f,r) { return f(); }", "function hello(txt, callback){\n setTimeout(()=>{\n callback(txt)\n }, 3000)\n}", "function startTimer() { \n\tvar tim = window.setTimeout(\"hideMessage()\", 5000); \n}", "function printNums()\n{\n console.log(1);\n setTimeout(function() {console.log(2);}, 1000);\n setTimeout(function() {console.log(3);}, 0);\n console.log(4);\n}", "function timer(f, delay) {\n var stop = false;\n dispatch.on(\"end.code\", function () {\n stop = true;\n });\n dispatch.on(\"start.code\", function () {\n stop = false;\n g();\n });\n function g() {\n if (!(f() || stop))\n setTimeout(g, delay);\n else {\n dispatch.end({ \"type\": \"end\", \"nodes\": nodes });\n dispatch.on(\"start.code\", whispers.run);\n }\n }\n g();\n }", "function printToConsole(string,duration){\n\tdocument.getElementById(\"console\").innerHTML = string;\n\t//set message back after duration\n\tsetTimeout(function(){document.getElementById(\"console\").innerHTML = DEF_MESSAGE;},duration);\n}", "function printCounter(i) {\n setTimeout(function() {\n console.log('counter value is ' +i);\n }, 1000);\n}", "function delay(func, wait) {\n\n}", "function timeoutForMsgCustom(date,hour,screen,msg){\n i++;\n setTimeout(function(){\n showMsgCustom(date,hour,screen,messagesArray)\n\n },msg.time*1000)\n}", "function timeMe(functionToTime) {\n console.time('Long loop');\n console.log(functionToTime);\n functionToTime();\n console.timeEnd('Long loop');\n}", "function outputC()\n {\n var randomTime = Math.floor(Math.random() * 3000) + 1;\n\n setTimeout(function(){\n console.log(\"C\");\n }, randomTime);\n }", "function functionName() {\n\t// Para este ejemplo declarare que el for solo de 3 \"vueltas\", es decir la condición sera: i < 3.\n\tfor(var i = 0; i < 10; i++) {\n\t\tsetTimeout(function() {\n\t\t\tconsole.log(i);\n\t\t}, 1000);\n\t}\n\t\n\tconsole.log('El valor final de \"i\" es: ' + i);\n}", "function nextQuestion() {\n setTimeout(redisplay, 1000 * 5);\n}", "function testTime(num){\n let start = Date.now();\n console.time(\"execTime\");\n function a(){\n console.timeEnd(\"execTime\");\n console.log(Date.now() - start);\n }\n setTimeout(a,num);\n}", "function pruebasBusqueda() {\n for (let i = 0; i < funciones.length; i++) {\n setTimeout(function () {\n funciones[i]();\n }, 2000 * i);\n }\n\n}", "function printOne(callback) {\n setTimeout(function () {\n console.log('1');\n return callback();\n }, 100 * Math.random());\n}", "function genBattEffective(pokeName, moveName){\n pokemonName = pokeName;\n pokeMoveName = moveName;\n $(\".battle-text\").show(); \n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokemonName} </span>`))\n }, 50);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> used </span>`))\n }, 100);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokeMoveName}! </span>`))\n }, 150);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> It </span>`))\n }, 200);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> was </span>`))\n }, 250);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> effective! </span>`))\n }, 300);\n setTimeout(function(){\n $(\".battle-text\").hide(); \n }, 2000);\n}", "function delay(timeout, func) {\n if (func.timer) {\n clearTimeout(func.timer);\n }\n func.timer = setTimeout(func, timeout);\n}", "function time(name, fn) {\n\t var start = _.now();\n\n\t try {\n\t return fn();\n\t } finally {\n\t console.log(name + \" time: \" + (_.now() - start) + \"ms\");\n\t }\n\t }", "function opcional(mensaje = \"Holis\", tiempo = 2000) {\n //mensaje=mensaje||\"Hola Mundo\";\n //mensaje = (typeof mensaje !== \"undefined\") ? mensaje : \"Hola Mundo 2222\";\n setTimeout(\n function () {\n console.log(mensaje);\n }, tiempo);\n}", "function quoteTimer(){\n timer = setInterval(printQuote, 5000);\n}", "setTimeout(callback, delay){\n\t\tthis.game.time.events.add(delay, (function(){callback()}), this.game)\n\t}", "function wildInterval(){\n console.log(\"Hello World!\");\n setTimeout(wildInterval, 10000);\n}", "function toastbox(target, time) {\n var a = \"#\" + target;\n $(\".toast-box\").removeClass(\"show\");\n setTimeout(() => {\n $(a).addClass(\"show\");\n }, 100);\n if (time) {\n time = time + 100;\n setTimeout(() => {\n $(\".toast-box\").removeClass(\"show\");\n }, time);\n }\n}", "function timer(callbackName, callback, parameters) {\n console.time(`${callbackName} timer`);\n let callbackReturnValue = callback(parameters);\n console.timeEnd(`${callbackName} timer`);\n return callbackReturnValue;\n}", "function genBattSuperEffective(pokeName, moveName){\n pokemonName = pokeName;\n pokeMoveName = moveName;\n $(\".battle-text\").show(); \n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokemonName} </span>`))\n }, 50); \n setTimeout(function(){\n $(\".battle-text\").append($(`<span> used </span>`))\n }, 100);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> ${pokeMoveName}! </span>`))\n }, 150);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> It </span>`))\n }, 200);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> was </span>`))\n }, 250);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> super </span>`))\n }, 300);\n setTimeout(function(){\n $(\".battle-text\").append($(`<span> effective! </span>`))\n }, 350);\n setTimeout(function(){\n $(\".battle-text\").hide(); \n }, 2000);\n}", "function printMsgRepeated(){\n console.log(\"This msg is fired every 1s\");\n}", "function sayHelloLater(){\n var greeting = 'Hello!';\n setTimeout(() => {\n console.log(greeting);\n }, 3000);\n}", "function saludar(segundos){\n\tvar hola = \"Hola, Hola!\";\n\t\n\tsetTimeout(function(){\n\t\tconsole.info(hola);\n\t},segundos*1000);\n}", "function startTimeout(fail) {\r\n\t\ttimeout = setTimeout(function () {\r\n\t\t\tfail();\r\n\t\t}, 5000);\r\n\t}", "function waitAndRun(ms,func){\n setTimeout(func, ms)\n}", "function timer(time, timerType) {\n\n (function move() { // this keeps the counter running in a loop based on changed information\n if (time > -1) {\n\n document.getElementById(\"timer\").innerHTML = timerType + \" \" + time + \"s\";\n setTimeout(move, 1000);\n time = time - 1;\n }\n\n })();\n}", "function myDelayDisplay(a, b) {\r\n setTimeout(function () { steen[a].style.display = \"inline\"; }, 500 * b);\r\n }", "function runsetTimeout() {\n console.log(\"\\n--->> runsetTimeout\");\n (0, _setTimeout.setTimeout01)();\n (0, _setTimeout.setTimeout02)();\n}", "function timeoutFunction() {\n\t\t\tif (timeouts.length) {\n\t\t\t\t(timeouts.shift())();\n\t\t\t}\n\t\t}", "function timeoutFunction() {\n\t\t\tif (timeouts.length) {\n\t\t\t\t(timeouts.shift())();\n\t\t\t}\n\t\t}", "function timerL(){\n disp(\"L\");\n}", "function delay(func, time) {\n\n\treturn function() {\n\t\tsetTimeout(() => func.apply(this, arguments), time)\n\t}\n}", "function moreStuff() {\n repeatFn(20, funTime);\n}", "function startAnsTimer(){ \n stopAnstTimer();\n ansTimer = setTimeout(function(){\n console.log('in start ansTimer');\n },5000);\n}", "function wildTurn(){\n var randomNum = Math.floor(Math.random()*4);\n \n console.log(wildMoves)\n var randomWildMove = wildMoves[randomNum];\n var randomWildMoveName = allWildMoveNames[randomNum];\n \n console.log(randomWildMove)\n setTimeout(function(){\n getDamageWild(randomWildMove)\n wildButtonText(wildPokeName, randomWildMoveName);\n enableMoves();\n checkHealth();\n }, 2000);\n\n \n}", "function actually_setTimeout() {\n data.id = setTimeout( function(){ data.fn(); }, delay );\n }", "function delayHello(){\n alert('here is a delayed hello');\n}", "function btrCountdownTimer(){\r\n console.log(\"btrCountdownTimer() started\"); //showing it's actully working\r\n var currTime = 50;\r\n for(var i = 0; i < 10; i++){ //if the varable is less than 5 add 1 and i =0 sets the starting value of the varible \r\n setTimeout(function(){\r\n document.getElementById(\"countdownstatus\").innerHTML = currTime;\r\n currTime = currTime - 5;\r\n },5000 * i);\r\n \r\n }\r\n setTimeout(function(){\r\n document.getElementById(\"countdownstatus\").innerHTML = \"blastoff!!\";\r\n }, 50000);\r\n}", "static delay(f, duration = 0) {\n setTimeout(f, duration);\n }", "function time(){\n document.getElementById(\"message\").innerHTML = \"New Game starting soon...\";\n setTimeout(function(){\n startGame()\n },3000)\n}", "function printMessage(timeout, message, callback) {\n let error = null;\n setTimeout(() => {return callback(error, message);}, timeout);\n}", "function testTimer() {\n toast({text: \"Testing Timer\", duration: 3, type: \"success\"});\n\n var time = 46;\n setInterval(() => {\n\n time -= 1;\n NetworkTables.putValue(\"/robot/time\", time);\n\n if (time < -5) time = 126;\n\n }, 1000);\n}", "function timer(f,argum){\n console.time(\"Time of run\");\n for (var i=1; i<=10000; i++){\n f(argum);\n }\n console.timeEnd(\"Time of run\");\n\n}", "function timer() { \n $('.q1').fadeIn(4000).delay(8000).fadeOut(2000);\n $('.q2').delay(14000).fadeIn(4000).delay(8000).fadeOut(2000);\n $('.q3').delay(28000).fadeIn(4000).delay(8000).fadeOut(2000);\n $('.q4').delay(42000).fadeIn(4000).delay(8000).fadeOut(2000);\n $('.q5').delay(56000).fadeIn(4000).delay(8000).fadeOut(2000, timer); \n }", "function delay (/* time, fun, ... */) {\n var a = __slice.call(arguments)\n setTimeout(function () {\n a[1].apply(a[2], a.slice(3))\n }, a[0])\n}", "function counter() {\n for (var i = 1; i <= 5; i++) {\n setTimeout(() => console.log(i), i * 1000)\n }\n}", "function timer() {\r\n time += 1;\r\n timeoutID = setTimeout(timer, 1000);\r\n if (!(time % 10)) wait -= 10;\r\n}" ]
[ "0.71046007", "0.70265096", "0.70247465", "0.6995259", "0.6923982", "0.6805815", "0.6752948", "0.6705198", "0.6652114", "0.6604463", "0.65868944", "0.65868944", "0.6581496", "0.6571883", "0.65289676", "0.65256315", "0.6519712", "0.6479186", "0.64417183", "0.6440927", "0.64302886", "0.64247715", "0.64035374", "0.6376087", "0.63638234", "0.63476604", "0.63412505", "0.6341021", "0.63056463", "0.62803996", "0.6269295", "0.6253765", "0.62467283", "0.62330574", "0.622393", "0.6216141", "0.6199626", "0.6198738", "0.61918366", "0.6189901", "0.61859155", "0.6183464", "0.61720526", "0.61716914", "0.6154128", "0.6151355", "0.60962087", "0.6089499", "0.6089235", "0.6075727", "0.6072862", "0.60695344", "0.60670835", "0.6057791", "0.60528165", "0.6049887", "0.6033275", "0.60284144", "0.6024112", "0.6014603", "0.60140187", "0.6004536", "0.5995894", "0.5994277", "0.59910756", "0.5983021", "0.5971991", "0.5970024", "0.5967097", "0.59635055", "0.5961193", "0.59546155", "0.59514725", "0.59459865", "0.5944546", "0.5936417", "0.5931309", "0.59308946", "0.5924163", "0.59207606", "0.59193295", "0.59130204", "0.59108114", "0.59108114", "0.5907552", "0.59041137", "0.5899904", "0.58915275", "0.5890503", "0.58848536", "0.5882874", "0.5881947", "0.58745146", "0.5870807", "0.5867323", "0.5862926", "0.5862096", "0.58578056", "0.58555025", "0.5853547", "0.5850121" ]
0.0
-1
The height of your card. Home Assistant uses this to automatically distribute all cards over the available columns.
getCardSize() { return 20; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setCardHeight(){\n const UIflashcard = document.querySelector('#flash-card');\n let cardWidth = UIflashcard.offsetWidth;\n let setHeight = cardWidth / 1.666666666667;\n UIflashcard.style.height = `${setHeight}px`;\n}", "calcHeight() {\n\n const card = document.querySelector('.card');\n const { width } = card.getBoundingClientRect();\n const aspectRatio = 409 / 663;\n const height = Math.min(width, 350) / aspectRatio;\n\n this.setState({ height });\n\n }", "function height() {\n return canvas.height;\n }", "getHeight() {\n return this._$mountPoint.height();\n }", "get height() {\n\t\treturn this._canvas.height;\n\t}", "get height() {}", "get height() {\n\t\treturn this._height;\n\t}", "get height() {\n\t\treturn this._height;\n\t}", "getHeight() {\n return this.getSize().height;\n }", "getHeight() {\n return this.height;\n }", "getHeight() {\n return this.height;\n }", "get height() {\n return this._getOption('height');\n }", "get height()\n\t{\n\t\tlet height = Math.max(this._height, this.minHeight);\n\n\t\tif (this.tree.theme.hasGridBehavior)\n\t\t{\n\t\t\tlet step = this.tree.theme.gridSize;\n\t\t\theight = Math.ceil(height / step) * step;\n\t\t}\n\n\t\treturn height;\n\t}", "get height() {\n return this._height;\n }", "get height() {\n return this._height;\n }", "getHeight() {\n console.log(this.height);\n }", "getHeight() {\n return this._$banner.outerHeight();\n }", "get height() {\n\t\treturn this._viewport[3];\n\t}", "getHeight(){return this.__height}", "getHeight() {\n return this._executeAfterInitialWait(() => this.currently.getHeight());\n }", "get height() {\n return this.m_height;\n }", "get height() { return this._height; }", "get pixelHeight() {\n return this.grid.layout.gridItemHeight;\n }", "get height() {\n return this._height;\n }", "function setHeight() {\n let innerHeight = $(window).height() - 250\n $('.card-data').css('max-height', innerHeight)\n }", "function getCardHeight(duration) {\n switch (duration) {\n case '1':\n return 'h-c1';\n case '2':\n return 'h-c2';\n case '3':\n return 'h-c3';\n case '4':\n return 'h-c4';\n case '5':\n return 'h-c5';\n default:\n console.log('default');\n return 'c1';\n }\n }", "get height() {\n return this.heightIn;\n }", "get height() {\n return this.heightIn;\n }", "getCardSize() {\n return 8;\n }", "getHeight() {\n return this.face.height();\n }", "setCardHeight() {\n if (this.refs.back && this.refs.front) {\n this.refs.back.style.height = `${this.refs.front.clientHeight}px`;\n }\n }", "get height() {\n if (this.image) {\n return this.image.height;\n }\n return 0;\n }", "get contentHeight() {\n const rowManager = this.rowManager;\n return Math.max(rowManager.totalHeight, rowManager.bottomRow ? rowManager.bottomRow.bottom : 0);\n }", "setHeight () {\n if (!this.props.list.length || !this.refs.item0) {\n return;\n }\n\n const node = ReactDom.findDOMNode(this);\n const computedStyle = getComputedStyle(node);\n const itemHeight = ReactDom.findDOMNode(this.refs.item0).offsetHeight;\n const height = ACList.heightAddenums.reduce((heightParts, prop) => {\n return heightParts + parseInt(computedStyle[prop], 10);\n }, itemHeight * this.props.itemsCount);\n\n node.style.maxHeight = height + 'px';\n }", "get maxHeight() {}", "get displayHeight() {\n\t\treturn this.__Internal__Dont__Modify__.dispHeight;\n\t}", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "function getHeight(element) {\n\t\treturn parseInt(element.css('height'));\n\t}", "getCardSize() {\n return 4;\n }", "async getBlockHeight() {\n\t\treturn await this.bd.getBlocksCount();\n\t}", "getCardSize() {\n return 2;\n }", "getMaxHeight(){return this.__maxHeight}", "_getGameHeight() {\n return this.scene.scene.manager.game.config.height;\n }", "getCardSize() {\n return 1\n }", "getCardSize() {\n return 1\n }", "getCardSize() {\n return 1\n }", "height() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "getMaxHeightUnit(){return this.__maxHeightUnit}", "getCardSize() { return 4; }", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "getCardSize() {\n return 3\n }", "getCardSize() {\r\n return 3;\r\n }", "_getHeaderHeight() {\n const isExpanded = this._isExpanded();\n if (isExpanded && this.expandedHeight) {\n return this.expandedHeight;\n }\n else if (!isExpanded && this.collapsedHeight) {\n return this.collapsedHeight;\n }\n return null;\n }", "getCardSize() {\n return 1;\n }", "get drawHeight() {\n if (this._camera) {\n return this.scaledHeight / this._camera.z / this.pixelRatio;\n }\n return this.scaledHeight / this.pixelRatio;\n }", "function playerHeight() {\n\treturn 30;\t\n}", "get height() {\n return this.bottom - this.top;\n }", "get height(){ return this.Canvas.height }", "get height(){\n // spec says it is a string\n return this.getAttribute('height') || '';\n }", "get height(){\n // spec says it is a string\n return this.getAttribute('height') || '';\n }", "function getHeight(height) {\n return Math.round(obj.height * scale);\n }", "getHeight() {\n return this.canvas.height;\n }", "function getHeight(obj) {\n const height = parseInt(obj\n .css('height')\n .substring(0, $(obj).css('height').length - 2));\n return height;\n }", "getHeight() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_height\", {});\n });\n }", "setHeight(height) {\n const realFeet = ((height * 3.93700) / 12);\n const feet = Math.floor(realFeet);\n const inches = Math.round((realFeet - feet) * 12);\n this.height = `${feet}' ${(`0${inches}`).substr(-2)}''`;\n }", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "get estimatedHeight() { return -1; }", "height() {\n return this.heightHelper(this.root, 0)\n }", "height() {\n\t\t\tvar numConnectors =\n\t\t\t\tMath.max(\n\t\t\t\t\tthis.inputConnectors.length);\n\t\t\treturn this.flowchart.computeConnectorY(numConnectors);\n\t\t}", "getCardSize() {\n return 1;\n }", "get height() { return 2.5; }", "get canvasHeight() {\n return this.canvas.height;\n }", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "getPictureHeight() {\n const mhm = (this.camera.MatrixHeight / 10000); /* matrix height in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mhm * altitude) / fm).toFixed(2);\n }", "function getCurrentHeight() {\n\t\t\treturn (lineHeight * Math.max(1, Math.min(5, items.length))) + 4;\n\t\t}", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "getHeight() {\n return this.$node.innerHeight();\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "height(height) {\n return height == null ? this.bbox().height : this.size(this.bbox().width, height);\n }", "static getCardSizeFromSprite() {\n return {\n width: 81,\n height: 117.5\n };\n }", "getHeight() {\n return this.image.bitmap.height;\n }", "getCardSize() {\r\n return this.config.entities.length + 1;\r\n }", "max_height() {\n\t\treturn this.rectangle_y_pad + N_WORDS * char_image_dimensions.height + (N_WORDS - 1) * this.height_between_words;\n\t}", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "getHauteurDessin()\n\t{\n\t\treturn this._canvas.height;\n\t}", "get_grid_height() {\n\t\t\treturn this._internal_grid_size[1]\n\t\t}", "setHeight(height) {\n this.height = height;\n }", "get height() {\n return this._boundingBox.height;\n }", "function getHeight(){\n let height = $('.accountOverview-content').height();\n $('.verticalMenu').css('height', height);\n}", "get minHeight() {}", "function getHeight() {\n\tvar height = document.getElementById(\"clientText\").clientHeight - PADDING_PX;\n\theight = height * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn height.toFixed(2);\n}", "getBlockHeight() {\n return this.db.getBlocksCount();\n }", "function setboardHeight(numberOfRows){\n\n\t//changes the game-board height depending on number of rows of cards \n\tvar boardHeight =document.getElementById('game-board');\n\tvar requiredHeight = (numberOfRows * 195);\n\tvar requiredHeightStr = ''+requiredHeight+'px';\n\tboardHeight.style.height=requiredHeightStr;\n\t\n\t}", "getHeight() {\n return this._rows.length;\n }", "function getHeight() {\n if (self.innerHeight) {\n return self.innerHeight;\n }\n\n if (document.documentElement && document.documentElement.clientHeight) {\n return document.documentElement.clientHeight;\n }\n\n if (document.body) {\n return document.body.clientHeight;\n }\n}", "set height(value) {}", "calculateHeightOfCy(graphComponent) {\n let visHeader = graphComponent.$parent.$parent.getHeader();\n let margin = 130;\n let topCardHeight = document.getElementById(\"graph-info\").offsetHeight;\n let headerHeight = 72;\n if (visHeader) margin = margin + headerHeight;\n let full = document.getElementById(\"app\").offsetHeight;\n let height = full - margin - topCardHeight;\n let cc = document.getElementById(\"cy\");\n cc.style.height = height + \"px\";\n }", "getExtraHeight(_id) {\n return (\n this._getExtraSize(_id, 'top') +\n this._getExtraSize(_id, 'bottom')\n );\n }" ]
[ "0.72718596", "0.70873106", "0.70673823", "0.69754463", "0.6941017", "0.69182336", "0.6875138", "0.6875138", "0.686249", "0.68600845", "0.68600845", "0.6857162", "0.68239033", "0.6813902", "0.6813902", "0.67788595", "0.676424", "0.67560065", "0.6712529", "0.6659524", "0.6650575", "0.66365755", "0.6627849", "0.6601734", "0.6579899", "0.65689594", "0.6523439", "0.6523439", "0.65026623", "0.6500594", "0.6484494", "0.64821684", "0.64407593", "0.64364105", "0.643586", "0.641911", "0.6406253", "0.64047587", "0.6402751", "0.6393914", "0.63924867", "0.638826", "0.63765883", "0.63730353", "0.63730353", "0.63730353", "0.6354807", "0.63456506", "0.6342819", "0.6342806", "0.6342806", "0.63408345", "0.63218904", "0.6321647", "0.63194805", "0.6313278", "0.6307995", "0.6299657", "0.62940466", "0.6293486", "0.6293486", "0.62919337", "0.62909454", "0.6290473", "0.6289636", "0.6271374", "0.62661076", "0.6254527", "0.6253519", "0.6251879", "0.6247037", "0.6238812", "0.6238776", "0.6234083", "0.62325174", "0.6207308", "0.62063086", "0.6190264", "0.61839575", "0.61785424", "0.6175759", "0.61750007", "0.6164765", "0.6159695", "0.6153855", "0.6153855", "0.6152435", "0.61415756", "0.6138986", "0.6135717", "0.61297077", "0.6128978", "0.61196184", "0.61162", "0.61038184", "0.60969025", "0.6091841", "0.60842836", "0.60804284", "0.6078549" ]
0.65642273
26
function to handle the click
handleClick() { this.setState(prevState => ({ showMenu: !prevState.showMenu })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick() {}", "handleClick( event ){ }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick(event)\n{\n}", "handleJDotterClick() {}", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "function _click(d){\n \n }", "onClick() {\n // Verifica se existe a função para processar o click e a invoca\n if(this.handleClick) {\n this.handleClick(this);\n }\n }", "function handleClick(){\n console.log(\"clicked\");\n}", "function onClick(e) {\n }", "clickHandler() {\n // Activate if not active\n if (this.active === 'safety') {\n // Button view press effect\n this.removeSafety();\n } else if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }", "function clickHandler(event) {\n \tconsole.log('event');\n \ttau.openPopup(popup);\n }", "_handleClick(event) {\n this.interaction.next(event);\n event.stopPropagation();\n }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "function doClick(e) {\n options.onClick(e);\n }", "onClick() {\n }", "function onClick(e) {\n \t\t// console.log(this);\n\t\t}", "function click(el){\n \n \n}", "_evtClick(event) { }", "function handleClick() {\n if (props.type == 'todo') {\n return finishTask(props.task, props.index)\n }\n\n else if (props.type == 'done') {\n return undoTask(props.task, props.index)\n }\n }", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "click() { }", "function onClick(event) {\n\t\t//console.log(event);\t\t\n\t\tvar target = event.target;\n\t\tif (target.classList.contains(\"ui-selector-indicator\")) {\n\t\t\t//console.log(\"Indicator clicked\");\n\t\t\tvar ItemClicked = event.srcElement.textContent;\n\t\t\tconsole.log(\"Item Clicked on home page was: \" + ItemClicked);\n\n\t\t\t//Handel home page click events\n\t\t\tif(ItemClicked == \"Switches\"){\n\t\t\t\ttau.changePage(\"switchesPage\");\n\t\t\t}else if(ItemClicked == \"Clear Database\"){\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t\t//This should be moved to it's own function.\n\t\t\t\tconsole.log(\"Clearing Database\");\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tAccess_Token = null;\n\t\t\t\tAccess_Url = null;\n\t\t\t\tswitches_DB = null;\n\t\t\t\talert(\"Database Cleared\");\n\t\t\t\t//Maybe we should exit here?\n\t\t\t\t//------------------------------------------Clear Database\n\t\t\t}else if(ItemClicked == \"Routines\"){\n\t\t\t\ttau.changePage(\"routinesPage\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "clickHandler(evt) {\n if (evt.target.classList.contains('fa-check')) {\n gameApp.eventHandler(evt);\n }\n\n if (evt.target.classList.contains('assignment') || evt.target.parentElement.classList.contains('assignment')) {\n gameApp.activateContract(evt);\n }\n\n if (evt.target.classList.contains('loc')) {\n gameApp.addLoc();\n }\n\n if (evt.target.classList.contains('nav-button')) {\n let elem = evt.target;\n gameApp.gameView.changeMenue(elem);\n }\n }", "metodoClick(){\n console.log(\"diste click\")\n }", "clickHandler(e) {\n // Only activate if there is a buttonHandler\n if (this.buttonHandler !== false) {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }\n }", "handleClick () {\n super.handleClick();\n if (this.casting) {\n return this.stopCasting();\n } else {\n return this.doLaunch();\n }\n }", "function handleClick(e) {\n sendRequest()\n }", "function clickHandler(event){\n\t\t\tif(ignoreClick){\n\t\t\t\tignoreClick = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar offset = overlay.cumulativeOffset();\t\t\t\n\t\t\ttarget.fire('flotr:click', [{\n\t\t\t\tx: xaxis.min + (event.pageX - offset.left - plotOffset.left) / hozScale,\n\t\t\t\ty: yaxis.max - (event.pageY - offset.top - plotOffset.top) / vertScale\n\t\t\t}]);\n\t\t}", "clickHandler(event) {\n declarativeClickHandler(this);\n }", "click(event) {\n if (event.target === this.get('element')) {\n this.sendAction();\n }\n }", "function clickHandler(){ // declare a function that updates the state\n elementIsClicked = true;\n isElementClicked();\n }", "function handleClick(el,e) {\n\tloadURL(el.attributes.target,el.text);\n}", "handleClick(){\n alert(\"hey!!\");\n }", "function fnClick(ev) {\n var event = ev || window.event;\n curCatId = $(event.target).data('id');\n curItemId=curItemId = null;\n $('#addMenu').removeAttr('disabled');\n\n $('#sidebar li').removeClass('active');\n !!event && $(event.target).addClass('active');\n\n var trash = istrash(event)\n\n if ( trash && !!event && $(event.target).hasClass('imageLi')) {\n //请求该分类下的图片列表\n $.post(getImageUrl,{uid:1}).then(res=>{\n if(res.code==200){\n images = res.data;\n renderImages();\n }\n })\n }\n\n if (trash){\n return;\n }\n renderItems();\n\n !!event && event.stopPropagation()\n}", "function clickHandle( event ) {\n\t\tvar tagName = event.target.tagName.toLowerCase();\n\t\t\n\t\tif ( tagName !== 'button' || window.isGiveUp ) {\n\t\t\treturn;\n\t\t}\n\t\t// console.log( window.isGiveUp )\n\t\tvar id = event.target.id;\n\t\tvar obj = {\n\t\t\tcards : window.myCards\n\t\t};\n\n\t\tswitch( id ) {\n\t\t\tcase 'giveUp':\n\t\t\t\tsend( socket, 'giveUp', obj );\n\t\t\t\tbreak;\n\t\t\tcase 'double':\n\t\t\t\tsend( socket, 'double', obj );\n\t\t\t\tbreak;\n\t\t\tcase 'compare':\n\t\t\t\twindow.isClickCompare = true;\n\t\t\t\tbreak;\n\t\t\tcase 'goOn':\n\t\t\t\tsend( socket, 'goOn', obj );\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSections(event);\n}", "onClick(event) {\n\t\t// console.log(\"mouse click\");\n\t\tthis.draw(event);\n\t}", "function handleClick (e) {\n e.preventDefault();\n console.log('clicked');\n }", "function handleClick() {\n $('button').click(function(event){\n emptyAbilities();\n renderAbilities(event.currentTarget.innerHTML);\n showAbilities();\n });\n }", "onclick(){}", "click_extra() {\r\n }", "function onClick() {\n}", "clicked(x, y) {}", "function canvasClickEvent(e){\n\t\t\tvar mouseX = $(this).offset().left, mouseY = $(this).offset().top;\n\t\t\tconsole.log(\"clicked the canvas\");\n\t\t\tswitch(Math.floor((e.pageX - mouseX)/(this.width/5)%5)){\n\t\t\tcase 0:\n\t\t\t\t$(\"#holdbutton_1\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$(\"#holdbutton_2\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#holdbutton_3\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$(\"#holdbutton_4\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#holdbutton_5\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"error didn't detect where the click came from\");\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn false;\n\t}", "function clickHandler(e) {\r\n if (that.currentGameState.onClick) {\r\n that.currentGameState.onClick.call(this, that.currentGameState, e);\r\n }\r\n }", "function handleClick(event) {\n // Get the clicked chart element:\n let activeElement = chart.getElementAtEvent(event);\n // Do nothing if the click is not on a point on the chart:\n if (!activeElement[0]) {\n return;\n }\n // Get the index number of the clicked element:\n let elementID = activeElement[0]._index;\n // Get the post ID from the taskData.xLabels object array:\n let postID = taskData.xLabels[activeElement[0]._index];\n // Go to the selected task:\n window.location.href = \"/single.html?task=\" + postID;\n }", "handleClick(e) {\n this.props.changePanel(\"Kpi Management\");\n this.props.changeTrip(this.props.id, this.props.date);\n }", "clickHandler (event) {\n this.onClick ({\n node: this.node,\n target: this,\n event: event\n })\n }", "function cb_beforeClick(cb, pos) { }", "function auxClicked(ev) {\n clicked(ev, dificuldade, score);\n }", "function onClick( event ) {\n for( var i = 0; i < _buttons.length; i++ ) {\n var button = _buttons[i];\n \n if( button.contains( event.layerX, event.layerY ) ) {\n actionPerformed( button.getActionCommand() );\n return;\n }\n }\n \n if( event.which == 1 ) {\n location.href = linkHref;\n }\n }", "handleClick(event) {\n const { location, isSelectable, onClick } = this.props;\n\n if (!isSelectable || event.target.closest('.c-finder-tree-leaf__btn--toggle-selection')) {\n return;\n }\n\n onClick(location);\n }", "onClick(element) {\n\t\taction(`You have clicked on element ${element.name}`).call();\n\t}", "_buttonClickHandler() { }", "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateCourse\":\n onCreateCourse();\n break;\n case \"btnModifyCourse\":\n onModifyCourse();\n break;\n case \"btnDeleteCourse\":\n onDeleteCourse();\n break;\n case \"btnRefreshCourses\":\n onRefreshCourse();\n break;\n }\n }", "handleClick(articleToPlay) {\r\n // Asserting if an utterance is being played it gets canceled\r\n this.playing = 'LIST_PLAY';\r\n // Sending data to PlayerPage component changing state\r\n this.clickHandler(this.playing, true, articleToPlay.headline, articleToPlay.author, articleToPlay.content);\r\n }", "menuButtonClicked() {}", "function on_click(e) {\n cloud.on_click(e.clientX, e.clientY);\n}", "function clicked(d,i) {\n\n}", "function clicked(d,i) {\n\n}", "handleContextClick(args){\n if(this.shapeSelectionEnabled) {\n this.selectShape(args);\n }\n }", "handleButton() {}", "handleClick(e) {\n this.props.changeVehicle(this.props.id, this.props.image, this.props.model);\n this.props.changePanel(\"Vehicle Panel\");\n }", "function outterClick() {\n\n}", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "_click(e) {\n const type = this.cel.getAttribute('data-type');\n\n this[type](e);\n }", "function handleClick(e) {\n getData(e);\n changeClass();\n}", "function clickHandler(){\n console.log('I am clicked');\n}", "handle_click(e, item) {\n if (item.length > 0) {\n this.props.onclick_piechart(this.props.pie_chart_data[item[0]._index])\n }\n }", "visitElementClicked() {\r\n this.props.visitListClick(this.props.index);\r\n }", "function handleBtnClick(event) {\n handleEvent(event);\n}", "clickFunction(event) {\n try {\n const targets = event.composedPath();\n for (let target of targets) {\n if (this.checkIfElementIsActionMenuIcon(target)) {\n return;\n }\n }\n }\n catch (err) {\n if (this.checkIfElementIsActionMenuIcon(event.target)) {\n return;\n }\n }\n this.rowActionMenuOpened = null;\n }", "function clickAssess() {\n\t$.trigger(\"clickAssess\");\n}", "function the_click_callback(){\n\t\t\t\tif(typeof click_callback == 'function'){\n\t\t\t\t\tvar id = $container.attr('id');\n\t\t\t\t\tif(id==undefined || !id){\n\t\t\t\t\t\tid = '[no id]';\n\t\t\t\t\t}\n\t\t\t\t\tclick_callback(id, activenode);\n\t\t\t\t}\n\t\t\t}", "function clickHandler() {\n console.log(\"Button 2 Pressed\");\n }", "function onClick(link){\n \n}", "click() { // add click event\n app.quit();\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 // on click, go to single image page\n if (d.type==\"nii\"){\n document.location = \"neurovault.html?id=\" + d.name\n }\n }\n update(d);\n }", "clicked() {\n this.get('onOpen')();\n }", "handleClick(e)\n {\n this.props.changeVehicle(this.props.id, this.props.image, this.props.model)\n this.props.changePanel(\"Vehicle Panel\")\n }", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - element.offsetTop,\n button: 1\n }\n element.onclick(at);\n\n }", "function touchHandler(e)\n {\n // preventDefault also disables pinching and scrolling while touching\n // on qml application\n e.preventDefault();\n var at = {\n layerX: e.touches[0].pageX - element.offsetLeft,\n layerY: e.touches[0].pageY - element.offsetTop,\n button: 1\n }\n element.onclick(at);\n\n }", "function handleClick() {\n setInspecting(task);\n }", "function click_on() {\n console.log('called click function');\n}", "function _clickHandler(ev) {\n\tvar $this = $(ev.target).closest(\".hm-container\").parent();\n\tvar $cfg = $this.data('heatmap').config;\n\n\tif ($cfg.onReady.state != loadStates.READY) return true;\n\n\t// If there's an event handler registered for clicks, invoke it,\n\t// passing an object containing all the relevant info for the event.\n\tif (typeof $cfg.onClick.val == 'function') {\n\t var $$ctx = $this.data('ctx');\n\t var mouse_pos = _mouseAbs(ev, $$ctx);\n\t var ndxs = _getIndexes(mouse_pos, $$ctx);\n\n\t return $cfg.onClick.val ( { \"profile\": (ndxs.profile == null ? 'undefined' : $$ctx.profile_metadata[ndxs.profile]), \n\t\t\t\t\t\"sample\": (ndxs.sample == null ? 'undefined' : $$ctx.sample_metadata[ndxs.sample]), \n\t\t\t\t\t\"indexes\": ndxs, \n\t\t\t\t\t\"context\": $$ctx, \n\t\t\t\t\t\"event\": ev } );\n\t}\n\treturn true;\n }", "function handleClick(evt) {\n let x = evt.target.id;\n //console.log(x)\n let [clueId, catId] = x.split('-')\n let data = categories[catId].dataCat[clueId];\n let display;\n\n if (!data.showing) {\n $(`#${x}`).removeClass('cell');\n $(`#${x}`).addClass('clue');\n display = data.question;\n data.showing = 'question';\n }\n else if (data.showing === 'question') {\n $(`#${x}`).removeClass('clue');\n $(`#${x}`).removeClass('cell');\n $(`#${x}`).addClass('answer');\n display = data.answer;\n data.showing = 'answer'\n } else {\n // ignore click\n return;\n }\n $(`#${x}`).html(display);\n}", "function canvasClick(e) {\n\tblockus.mouseClicked();\n}", "function handleElementClickFtn(action, element, index) {\n if(action === 'selected' || action === 'deselected') {\n objInst.notesHeader.notify(action, { 'elem': element, 'idx' : index });\n } \n }", "function handleClick(e){\n switch (e.target.classList[0]){\n // For like and delete, I've loaded up the id in two different ways for funsies.\n case \"btn-success\": \n // In this case (like), I know the API is going to return the relevant quote object on a success, which has a quoteId. \n // When I pass through the callback function (quoteObject) => addLikeById(quote.quoteId)) and call it in the second .then, the response from the fetch is passed to it as an argument.\n adapter.likeQuote(parseInt(e.target.dataset.likeId), (quoteObject) => addLikeById(quoteObject.quoteId));\n break;\n case \"btn-danger\":\n // In this case (delete), the API doesn't send back anything, so I pulled the id from the dataset from the target of the event.\n adapter.deleteQuote(e.target.dataset.deleteId, () => removeQuoteById(e.target.dataset.deleteId))\n break;\n default:\n break;\n }\n }", "function Click() {\n}", "handleTap(){\n\n }", "click(x, y, _isLeftButton) {}", "function process_click(e) {\n if (e.toElement.className == 'delete')\n delete_tr(e.toElement);\n else if (e.toElement.className == 'edit')\n prepare_for_edit(e.toElement);\n}", "featureClickEventHandler(event) {\r\n this.featureEventResponse(event);\r\n }", "_click(event) {\n if (this.disabled) {\n event.preventDefault();\n }\n else {\n this._handleInteraction(event);\n event.stopPropagation();\n }\n }", "handleClick() {\n\t\tthis.setState( { clicked: true } );\n\t\tthis.props.addProductCallback( this.props.product.id );\n\t}", "handleButtonClick(){\n\t\tconsole.log(\"handleButtonClick\");\n\n\t\teventsActions.createEvent(this.state.event);\n\t}", "onParcelClick() {\n console.log('u clicked the lil parcel')\n }" ]
[ "0.78419244", "0.7819739", "0.7662472", "0.7662472", "0.7640959", "0.7323042", "0.7272677", "0.72681874", "0.7195996", "0.71852666", "0.717097", "0.71133804", "0.7078893", "0.70786047", "0.70736825", "0.70627207", "0.70618117", "0.70363545", "0.7021498", "0.6957247", "0.6941145", "0.69361144", "0.69191533", "0.6905414", "0.69025177", "0.6896675", "0.6896065", "0.68792945", "0.6863874", "0.685555", "0.68324625", "0.6830851", "0.6819354", "0.6817249", "0.6813807", "0.68030065", "0.6789017", "0.6783416", "0.678098", "0.6770896", "0.67628455", "0.67534184", "0.6749959", "0.67425305", "0.674037", "0.67346174", "0.6726298", "0.6718353", "0.67074984", "0.6694814", "0.66917145", "0.6690832", "0.66714185", "0.66643596", "0.6659954", "0.6659766", "0.6633779", "0.6625409", "0.6624384", "0.66089016", "0.66077656", "0.6594304", "0.6594304", "0.659203", "0.6587287", "0.6581661", "0.65809286", "0.65545076", "0.6552496", "0.6550729", "0.6549741", "0.65496826", "0.6549454", "0.65352786", "0.6525744", "0.6521618", "0.6521472", "0.6520462", "0.65187675", "0.65145683", "0.6513869", "0.6511271", "0.6511247", "0.6509342", "0.6509342", "0.65045136", "0.6498718", "0.6495568", "0.6494743", "0.6492289", "0.6489418", "0.64869714", "0.6485826", "0.64836407", "0.6467046", "0.6466904", "0.6464914", "0.6458326", "0.6455273", "0.64518076", "0.64477795" ]
0.0
-1
Constructs a new Participant.
constructor() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Participant(uri, name){\r\n\tthis.URI=uri;\r\n\tthis.name=name;\r\n}", "constructor() { \n \n ParticipantWithUserExternalId.initialize(this);\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 }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe6d83d7e;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.prevParticipant = args.prevParticipant;\n this.newParticipant = args.newParticipant;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe31c34d8;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.participant = args.participant;\n }", "function CreateParticipantBehavior(canvas, eventBus, modeling) {\n CommandInterceptor$3.call(this, eventBus);\n\n // fit participant\n eventBus.on([\n 'create.start',\n 'shape.move.start'\n ], HIGH_PRIORITY$9, function(event) {\n var context = event.context,\n shape = context.shape,\n rootElement = canvas.getRootElement();\n\n if (!is$6(shape, 'bpmn:Participant') ||\n !is$6(rootElement, 'bpmn:Process') ||\n !rootElement.children.length) {\n return;\n }\n\n // ignore connections, groups and labels\n var children = rootElement.children.filter(function(element) {\n return !is$6(element, 'bpmn:Group') &&\n !isLabel$4(element) &&\n !isConnection$8(element);\n });\n\n // ensure for available children to calculate bounds\n if (!children.length) {\n return;\n }\n\n var childrenBBox = getBBox(children);\n\n var participantBounds = getParticipantBounds(shape, childrenBBox);\n\n // assign width and height\n assign$1(shape, participantBounds);\n\n // assign create constraints\n context.createConstraints = getParticipantCreateConstraints(shape, childrenBBox);\n });\n\n // force hovering process when creating first participant\n eventBus.on('create.start', HIGH_PRIORITY$9, function(event) {\n var context = event.context,\n shape = context.shape,\n rootElement = canvas.getRootElement(),\n rootElementGfx = canvas.getGraphics(rootElement);\n\n function ensureHoveringProcess(event) {\n event.element = rootElement;\n event.gfx = rootElementGfx;\n }\n\n if (is$6(shape, 'bpmn:Participant') && is$6(rootElement, 'bpmn:Process')) {\n eventBus.on('element.hover', HIGH_PRIORITY$9, ensureHoveringProcess);\n\n eventBus.once('create.cleanup', function() {\n eventBus.off('element.hover', ensureHoveringProcess);\n });\n }\n });\n\n function ensureCollaboration(context) {\n var parent = context.parent,\n collaboration;\n\n var rootElement = canvas.getRootElement();\n\n if (is$6(rootElement, 'bpmn:Collaboration')) {\n collaboration = rootElement;\n } else {\n\n // update root element by making collaboration\n collaboration = modeling.makeCollaboration();\n\n // re-use process when creating first participant\n context.process = parent;\n }\n\n context.parent = collaboration;\n }\n\n // turn process into collaboration before adding participant\n this.preExecute('shape.create', function(context) {\n var parent = context.parent,\n shape = context.shape;\n\n if (is$6(shape, 'bpmn:Participant') && is$6(parent, 'bpmn:Process')) {\n ensureCollaboration(context);\n }\n }, true);\n\n this.execute('shape.create', function(context) {\n var process = context.process,\n shape = context.shape;\n\n if (process) {\n context.oldProcessRef = shape.businessObject.processRef;\n\n // re-use process when creating first participant\n shape.businessObject.processRef = process.businessObject;\n }\n }, true);\n\n this.revert('shape.create', function(context) {\n var process = context.process,\n shape = context.shape;\n\n if (process) {\n\n // re-use process when creating first participant\n shape.businessObject.processRef = context.oldProcessRef;\n }\n }, true);\n\n this.postExecute('shape.create', function(context) {\n var process = context.process,\n shape = context.shape;\n\n if (process) {\n\n // move children from process to participant\n var processChildren = process.children.slice();\n\n modeling.moveElements(processChildren, { x: 0, y: 0 }, shape);\n }\n\n }, true);\n\n // turn process into collaboration when creating participants\n this.preExecute('elements.create', HIGH_PRIORITY$9, function(context) {\n var elements = context.elements,\n parent = context.parent,\n participant;\n\n var hasParticipants = findParticipant(elements);\n\n if (hasParticipants && is$6(parent, 'bpmn:Process')) {\n ensureCollaboration(context);\n\n participant = findParticipant(elements);\n\n context.oldProcessRef = participant.businessObject.processRef;\n\n // re-use process when creating first participant\n participant.businessObject.processRef = parent.businessObject;\n }\n }, true);\n\n this.revert('elements.create', function(context) {\n var elements = context.elements,\n process = context.process,\n participant;\n\n if (process) {\n participant = findParticipant(elements);\n\n // re-use process when creating first participant\n participant.businessObject.processRef = context.oldProcessRef;\n }\n }, true);\n\n this.postExecute('elements.create', function(context) {\n var elements = context.elements,\n process = context.process,\n participant;\n\n if (process) {\n participant = findParticipant(elements);\n\n // move children from process to first participant\n var processChildren = process.children.slice();\n\n modeling.moveElements(processChildren, { x: 0, y: 0 }, participant);\n }\n\n }, true);\n\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x07761198;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.participants = args.participants;\n }", "function create(to) {\n\t\t\tconsole.warn(\"ppjs.RTC >> createOFFER >>> \", to);\n\t\t\t// 2. pc1.createOffer\n\t\t\tpeerConnection.createOffer(function(sessionDescription) {\n\t\t\t\tsetLocalAndSendMessage(sessionDescription, to);\n\t\t\t}, null, mediaConstraints);\n\t\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfc900c2b;\n this.SUBCLASS_OF_ID = 0x1fa89571;\n\n this.chatId = args.chatId;\n this.selfParticipant = args.selfParticipant || null;\n }", "function CreateParticipantBehavior(eventBus, modeling, elementFactory, bpmnFactory) {\n\n CommandInterceptor.call(this, eventBus);\n\n /**\n * morph process into collaboration before adding\n * participant onto collaboration\n */\n\n this.preExecute('shape.create', function(context) {\n\n var parent = context.parent,\n shape = context.shape,\n position = context.position;\n\n if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {\n\n // this is going to detach the process root\n // and set the returned collaboration element\n // as the new root element\n var collaborationElement = modeling.makeCollaboration();\n\n // monkey patch the create context\n // so that the participant is being dropped\n // onto the new collaboration root instead\n context.position = position;\n context.parent = collaborationElement;\n\n context.processRoot = parent;\n }\n }, true);\n\n\n this.execute('shape.create', function(context) {\n\n var processRoot = context.processRoot,\n shape = context.shape;\n\n if (processRoot) {\n context.oldProcessRef = shape.businessObject.processRef;\n\n // assign the participant processRef\n shape.businessObject.processRef = processRoot.businessObject;\n }\n }, true);\n\n\n this.revert('shape.create', function(context) {\n var processRoot = context.processRoot,\n shape = context.shape;\n\n if (processRoot) {\n // assign the participant processRef\n shape.businessObject.processRef = context.oldProcessRef;\n }\n }, true);\n\n\n this.postExecute('shape.create', function(context) {\n\n var processRoot = context.processRoot,\n shape = context.shape;\n\n if (processRoot) {\n // process root is already detached at this point\n var processChildren = processRoot.children.slice();\n modeling.moveElements(processChildren, { x: 0, y: 0 }, shape);\n }\n\n }, true);\n\n}", "function CreateParticipantBehavior(eventBus, modeling, elementFactory, bpmnFactory, canvas) {\n diagram_js_lib_command_CommandInterceptor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(this, eventBus);\n /**\n * morph process into collaboration before adding\n * participant onto collaboration\n */\n this.preExecute('shape.create', function (context) {\n var parent = context.parent, shape = context.shape, position = context.position;\n var rootElement = canvas.getRootElement();\n if (Object(_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__[\"is\"])(parent, 'bpmn:Process') &&\n Object(_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__[\"is\"])(shape, 'bpmn:Participant') &&\n !Object(_util_ModelUtil__WEBPACK_IMPORTED_MODULE_2__[\"is\"])(rootElement, 'bpmn:Collaboration')) {\n // this is going to detach the process root\n // and set the returned collaboration element\n // as the new root element\n var collaborationElement = modeling.makeCollaboration();\n // monkey patch the create context\n // so that the participant is being dropped\n // onto the new collaboration root instead\n context.position = position;\n context.parent = collaborationElement;\n context.processRoot = parent;\n }\n }, true);\n this.execute('shape.create', function (context) {\n var processRoot = context.processRoot, shape = context.shape;\n if (processRoot) {\n context.oldProcessRef = shape.businessObject.processRef;\n // assign the participant processRef\n shape.businessObject.processRef = processRoot.businessObject;\n }\n }, true);\n this.revert('shape.create', function (context) {\n var processRoot = context.processRoot, shape = context.shape;\n if (processRoot) {\n // assign the participant processRef\n shape.businessObject.processRef = context.oldProcessRef;\n }\n }, true);\n this.postExecute('shape.create', function (context) {\n var processRoot = context.processRoot, shape = context.shape;\n if (processRoot) {\n // process root is already detached at this point\n var processChildren = processRoot.children.slice();\n modeling.moveElements(processChildren, { x: 0, y: 0 }, shape);\n }\n }, true);\n}", "function createPeer(userID){\n const peer = new RTCPeerConnection({ //creates new RTCPeerConnection using constructor\n iceServers: [\n {//STUN \n urls: \"stun:stun.stunprotocol.org\"\n }, \n {//TURN \n urls: \"turn:numb.viagenie.ca\",\n credential: 'muazkh',\n username: 'webrtc@live.com'\n },\n ]\n })\n\n //when icecandidate is created, raises event \n peer.onicecandidate = handleICECandidateEvent;\n //when a proper connection is set, remote peer sends us stream and ontrack event fires, \n peer.ontrack = handleTrackEvent;\n\n //defines when negiotiation is fired\n peer.onnegotiationneeded = () => handleNegotiationNeededEvent(userID);\n\n return peer;\n }", "get participant() {\n\t\treturn this.__participant;\n\t}", "function ParticipantCtrl(participantId, Participants, Nudges) {\n var self = this;\n\n this._nudges = Nudges;\n Participants.getOne(participantId)\n .then(function(participant) {\n self.id = participant.id;\n self.username = participant.username;\n self.latestAction = participant.latestAction;\n })\n .catch(function(error) {\n window.console.log(error);\n });\n this.responses = [{ question: 'foo?', text: 'bar' }];\n }", "function NewPerson (name) {\n\tthis.name = name;\n\tthis.speak = function () {\n\t\tconsole.log(`my name is ${this.name}`);\n\t}\n}", "function party_create(){\n\n\t//log.error('party_create for '+this.tsid);\n\n\tthis.party = apiNewGroup('party');\n\n\tthis.party.init(this);\n}", "function TelephonyGroupNumberConferenceParticipant(participantOptionsParam) {\n let participantOptions = participantOptionsParam;\n\n // check for mandatory options\n if (!participantOptions) {\n participantOptions = {};\n }\n\n // check mandatory fields\n if (!participantOptions.billingAccount) {\n throw new Error(\n 'billingAccount option must be specified when creating a new TelephonyGroupNumberConferenceParticipant',\n );\n }\n\n if (!participantOptions.serviceName) {\n throw new Error(\n 'serviceName option must be specified when creating a new TelephonyGroupNumberConferenceParticipant',\n );\n }\n\n if (!participantOptions.id) {\n throw new Error(\n 'id option must be specified when creating a new TelephonyGroupNumberConferenceParticipant',\n );\n }\n\n // set mandatory attributes\n this.billingAccount = participantOptions.billingAccount;\n this.serviceName = participantOptions.serviceName;\n this.id = participantOptions.id;\n\n // custom attributes\n this.inEdition = false;\n this.saveForEdition = null;\n this.energyEquivalence = null;\n\n // set feature options\n this.setInfos(participantOptions).setEnergyEquivalent();\n }", "created() {\n\t\tthis.logger.info(\"Participation Service created!\");\n\t}", "static createPersonsofInterestQuestLine() {\n const personsofInterestQuestLine = new QuestLine('Persons of Interest', 'Some people want to talk to you.');\n const talktoBreeder = new TalkToNPCQuest(SaffronBreeder, 'Talk to the Breeder in Saffron City.', 250);\n personsofInterestQuestLine.addQuest(talktoBreeder);\n const talktoGemScientist = new TalkToNPCQuest(PewterScientist, 'Talk to the Gem Scientist in Pewter City.', 250);\n personsofInterestQuestLine.addQuest(talktoGemScientist);\n App.game.quests.questLines().push(personsofInterestQuestLine);\n }", "static create() {\n return new Prompter(readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n prompt: 'eric>'\n }));\n }", "get participant () {\n\t\treturn this._participant;\n\t}", "static create(person) {\n return new Person(person.id, person.name, person.age);\n }", "function createParticipantWithRole(roleId) {\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: JODA_ENGINE_ADRESS + '/api/identity/roles/' + roleId + '/participants',\n\t\tdata: generateParticipantname()\n\t});\n}", "function setupParticipantContainer(participant, room) {\n const { identity, sid } = participant;\n\n // Add a container for the Participant's media.\n const $container = $(`<div class=\"participant\" data-identity=\"${identity}\" id=\"${sid}\">\n <audio autoplay ${participant === room.localParticipant ? 'muted' : ''} style=\"opacity: 0\"></audio>\n <video autoplay muted playsinline style=\"opacity: 0\"></video>\n </div>`);\n\n // Toggle the pinning of the active Participant's video.\n $container.on('click', () => {\n if (activeParticipant === participant && isActiveParticipantPinned) {\n // Unpin the RemoteParticipant and update the current active Participant.\n setVideoPriority(participant, null);\n isActiveParticipantPinned = false;\n setCurrentActiveParticipant(room);\n } else {\n // Pin the RemoteParticipant as the active Participant.\n if (isActiveParticipantPinned) {\n setVideoPriority(activeParticipant, null);\n }\n setVideoPriority(participant, 'high');\n isActiveParticipantPinned = true;\n setActiveParticipant(participant);\n }\n });\n\n // Add the Participant's container to the DOM.\n $participants.append($container);\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3f460fed;\n this.SUBCLASS_OF_ID = 0x1fa89571;\n\n this.chatId = args.chatId;\n this.participants = args.participants;\n this.version = args.version;\n }", "function createTeamMember() {\n SGTeamMember.prototype = Object.create(Person.prototype);\n Object.defineProperty(SGTeamMember.prototype, 'constructor', {\n value: SGTeamMember,\n enumerable: false,\n writable: true });\n\n //Adding a SGTeamMember greeting\n SGTeamMember.prototype.greeting = function () {\n return \"Hi. My name is \" + this.rank + \" \" + this.name.first + \" \"\n + this.name.last + \". I am the \" + this.role + \" of this team.\";\n };\n\n //Instantiate the SGTeamMember object\n var teamMember = new SGTeamMember(document.getElementById(\"first\").value,\n document.getElementById(\"last\").value,\n document.getElementById(\"age\").value,\n document.getElementById(\"gender\").value,\n document.getElementById(\"rank\").value,\n document.getElementById(\"role\").value,\n document.getElementById(\"id\").value);\n\n //Display\n document.getElementById(\"OutputObjCreation\").innerHTML = teamMember.greeting();\n\n}", "function createPeerConnection() {\n\ttry {\n\t\tpc = new RTCPeerConnection(null);\n\t\tpc.onicecandidate = handleIceCandidate;\n\t\tpc.onaddstream = handleRemoteStreamAdded;\n\t\tpc.onremovestream = handleRemoteStreamRemoved;\n\t\tconsole.log('Created RTCPeerConnnection');\n\t} catch(e) {\n\t\tconsole.log('Failed to create PeerConnection, exception: ' + e.message);\n\t\talert('Cannot create RTCPeerConnection object.');\n\t\treturn;\n\t}\n}", "constructor(peerId, ourId = guid) {\n return super(ourId, peerId, RTC_CONFIGURATION);\n }", "function createPeer(userToSignal, callerID, stream) {\n const peer = new Peer({\n initiator: true,\n trickle: false,\n stream: stream.current,\n });\n\n peer.once(\"signal\", signal => {\n user.socket.current.emit(\"sendSignal\", { userToSignal, callerID, signal });\n });\n\n return peer;\n }", "function Persona(primerNombre) {\n this.primerNombre = primerNombre;\n}", "async participant(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in to do that!\");\n }\n // TODO check authorization (being an admin or a researcher of the study)\n\n const participant = await ctx.db.query.profile(\n {\n where: {\n id: args.participantId,\n },\n },\n info\n );\n\n return participant;\n }", "function createPeerConnection() {\n\t log(\"Setting up a connection...\");\n\n\t // Create an RTCPeerConnection which knows to use our chosen\n\t // STUN server.\n\n\t myPeerConnection = new RTCPeerConnection({\n\t iceServers: [ // Information about ICE servers - Use your own!\n\t {\n\t urls: \"turn:\" + myHostname, // A TURN server\n\t username: \"webrtc\",\n\t credential: \"turnserver\"\n\t }\n\t ]\n\t });\n\n\t // Set up event handlers for the ICE negotiation process.\n\n\t myPeerConnection.onicecandidate = handleICECandidateEvent;\n\t myPeerConnection.oniceconnectionstatechange = handleICEConnectionStateChangeEvent;\n\t myPeerConnection.onicegatheringstatechange = handleICEGatheringStateChangeEvent;\n\t myPeerConnection.onsignalingstatechange = handleSignalingStateChangeEvent;\n\t myPeerConnection.onnegotiationneeded = handleNegotiationNeededEvent;\n\t myPeerConnection.ontrack = handleTrackEvent;\n}", "function registerParticipant(id, args) {\n var UUID = args[0];\n\n if (DEBUG) {\n console.log(\"smartBoardZoneServer.js: \" + _this.entityID + \": `registerParticipant()`.\" +\n \"\\n`UUID`: \" + UUID + \"\\n`_this.currentBoardState`: \" +\n _this.currentBoardState + \"\\n`_this.activePresenterUUID`: \" + _this.activePresenterUUID);\n }\n\n _this.participants[UUID] = {\n displayName: AvatarList.getAvatar(UUID).displayName\n };\n\n // Eventually, we'll want to hook up the `Avatar.displayNameChanged()` signal to a handler that\n // changes the Display Name of the broadcaster that is shown to viewers on the Smartboard.\n // That's too advanced for now, so we'll not worry about it yet.\n\n Entities.callEntityClientMethod(UUID, _this.entityID, \"receiveBoardState\",\n [_this.currentBoardState, _this.activePresenterUUID]);\n }", "function createPeerConnection() {\n try {\n pc = new RTCPeerConnection(pcConfig);\n pc.onicecandidate = handleIceCandidate;\n pc.onaddstream = handleRemoteStreamAdded;\n pc.onremovestream = handleRemoteStreamRemoved;\n console.log('Created RTCPeerConnnection');\n } catch (e) {\n console.log('Failed to create PeerConnection, exception: ' + e.message);\n alert('Cannot create RTCPeerConnection object.');\n return;\n }\n}", "static initialize(obj, participants) { \n obj['participants'] = participants;\n }", "function Persona(nombre){\n const id = 5; //variable privada\n\n this.nombre = nombre; //propiedad pública\n this.tieneDni = true; //propiedad pública\n\n this.presentar = function(){ //método público\n return \"Hola, mi nombre es \" + this.nombre\n }\n}", "function Estudiante(primerNombre, asignatura) {\n // Llamamos al constructor padre, nos aseguramos (utilizando Function#call) que \"this\" se\n // ha establecido correctamente durante la llamada\n Persona.call(this, primerNombre);\n\n //Inicializamos las propiedades específicas de Estudiante\n this.asignatura = asignatura;\n}", "function createParticipants() {\n getRolesAndThen(createParticipantsFromRoles);\n}", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "function Person(name, email, phone) {\n this.name = name;\n this.email = email;\n this.phone = phone;\n}", "function Party() {\r\n this.name = '';\r\n this.phone = '';\r\n this.size = '';\r\n this.done = false;\r\n this.notified = false;\r\n }", "constructor() { \n ParticipantLeaveBodyUserId.initialize(this);ParticipantLeaveBodyUserExternalId.initialize(this);ParticipantLeaveBodyParticipantId.initialize(this);\n ParticipantLeaveBody.initialize(this);\n }", "function createInstance(){\n\t\tapp.debug(\"New presenter instance was created\");\n\n\t\t// Set latency to 100ms (Equal with streamer)\n\t\tpresenterInstance = new ScarletsMediaPresenter({\n\t\t\tmimeType: self.toServerSpeaker ? 'audio/wav' : undefined,\n\t\t audio:{\n\t\t channelCount:2,\n\t\t sampleRate:48000,\n\t\t echoCancellation: false\n\t\t },\n\t\t debug:true\n\t\t}, self.toServerSpeaker ? 1000 : 100);\n\n\t\tpresenterInstance.onRecordingReady = function(packet){\n\t\t app.debug(\"Recording started!\");\n\t\t app.debug(\"Header size:\", packet.data.size, 'bytes');\n\t\t app.debug('Mimetype:', presenterInstance.mediaRecorder.mimeType)\n\n\t\t self.bufferHeader = packet;\n\n\t\t\t// Immediately send to the server when presenter ready\n\t\t\tapp.debug(\"Sending bufferHeader to the server\");\n\t\t\tsocket.emit('bufferHeader', packet);\n\t\t}\n\n\t\tpresenterInstance.onBufferProcess = function(streamData){\n\t\t\tself.broadcastBytes = streamData[0].size;\n\n\t\t\tif(self.toServerSpeaker)\n\t\t\t socket.emit('bufferStream', streamData);\n\t\t\telse\n\t\t\t socket.emit('bufferToFile', streamData);\n\t\t}\n\t}", "function onNewParticipant(message) {\n receiveVideoFrom(message.new_user_id)\n}", "function Party() {\n this.name = '';\n this.phone = '';\n this.size = '';\n this.done = false;\n this.notified = false;\n }", "function NewPerson(value) {\r\n var _this = _super.call(this, \"Rodrigo\", value) || this;\r\n _this.ageProperty = 28;\r\n return _this;\r\n }", "constructor() {\n copy(this, create());\n }", "function Persona(nombre,apellido) {\r\n this.nombre = nombre\r\n this.apellido = apellido\r\n}", "function createPeer(userToSignal, callerID, stream) {\n const peer = new Peer({\n initiator: true,\n trickle: false,\n stream,\n });\n\n // sending the stream of current user to others\n peer.on(\"signal\", signal => {\n const username = myUsernameRef.current;\n socketRef.current.emit(\"sending signal\", { userToSignal, callerID, username, signal })\n })\n\n return peer;\n }", "static create () {}", "function Teacher(first, last, age, gender, interests, subject) {\n //this is context from wich Person constructor function is called\n //So here Person's this will be equal to this in Teacher\n Person.call(this, first, last, age, gender, interests);\n this.subject = subject;\n}", "function Person(name, profession) {\n\tthis.name = name;\n\tthis.profession = profession;\n}", "function newPerson(name, age, occupation, phrases){\n\t\t// Incrementing 'count' class variable\n\t\tcount ++\n\t\t///////////////\n\n\t\t// Instantiating instance variables\n\t\tlet personName = name\n\t\tlet personAge = age\n\t\tlet personOccupation = occupation\n\t\tlet personPhrases = [...phrases]\n\t\t///////////////\n\n\t\t// Instance methods\n function whoAmI(){\n return `My name is ${this.getName()}. I am ${this.getAge()}, and I work as a ${this.getOccupation()}`\n }\n function sayRandomPhrase(){\n \treturn personPhrases[Math.floor(Math.random()*personPhrases.length)]\n }\n function addPhrase(phrase){\n \tpersonPhrases.push(phrase)\n }\n function removePhrase(index){\n \tpersonPhrases = [...personPhrases.slice(0,index), ...personPhrases.slice(index+1)]\n }\n ///////////////\n\n // Getters\n function getName(){\n \treturn personName\n }\n function getAge(){\n \treturn personAge\n }\n function getOccupation(){\n \treturn personOccupation\n }\n function getPhrases(){\n \treturn [...personPhrases]\n }\n ///////////////\n\n\n // Setters\n function setName(name) {\n \tpersonName = name\n }\n function setAge(age) {\n \tpersonAge = age\n }\n function setOccupation(occupation) {\n \tpersonOccupation = occupation\n }\n ///////////////\n\n\n // Building the Person instance object\n\n let personInstance = { \n \tgetPhrases: getPhrases,\n \tgetName: getName,\n \tgetAge: getAge,\n \tgetOccupation: getOccupation,\n \tsetName: setName,\n \tsetAge: setAge,\n \tsetOccupation: setOccupation,\n \twhoAmI: whoAmI,\n \taddPhrase: addPhrase,\n \tremovePhrase: removePhrase,\n \tsayRandomPhrase: sayRandomPhrase\n }\n ///////////////\n\n // Adding Person instance object to 'all' class variable\n\t\tall.push(personInstance)\n\t\t///////////////\n\n\t\treturn personInstance\n }", "function createParticipantsFromRoles(roles) {\n var i;\n $.each(roles, function(i, role) {\n for (i = 0; i < PARTICIPANTS_PER_ROLE; i++) {\n createParticipantWithRole(role.id);\n }\n });\n}", "function Person(Nombre, Apellido) {\n this.Nombre = Nombre;\n this.Apellido = Apellido;\n}", "function Estudiante(primerNombre, asignatura) {\n // Llamamos al constructor padre, nos aseguramos (utilizando Function#call) que \"this\" se\n // ha establecido correctamente durante la llamada\n Persona.call(this, primerNombre);\n \n //Inicializamos las propiedades específicas de Estudiante\n this.asignatura = asignatura;\n }", "function setActiveParticipant(participant) {\n if (activeParticipant) {\n const $activeParticipant = $(`div#${activeParticipant.sid}`, $participants);\n $activeParticipant.removeClass('active');\n $activeParticipant.removeClass('pinned');\n\n // Detach any existing VideoTrack of the active Participant.\n const { track: activeTrack } = Array.from(activeParticipant.videoTracks.values())[0] || {};\n if (activeTrack) {\n activeTrack.detach($activeVideo.get(0));\n $activeVideo.css('opacity', '0');\n }\n }\n\n // Set the new active Participant.\n activeParticipant = participant;\n const { identity, sid } = participant;\n const $participant = $(`div#${sid}`, $participants);\n\n $participant.addClass('active');\n if (isActiveParticipantPinned) {\n $participant.addClass('pinned');\n }\n\n // Attach the new active Participant's video.\n const { track } = Array.from(participant.videoTracks.values())[0] || {};\n if (track) {\n track.attach($activeVideo.get(0));\n $activeVideo.css('opacity', '');\n }\n\n // Set the new active Participant's identity\n $activeParticipant.attr('data-identity', identity);\n}", "function ConversationBuilder() {\n\t /**\n\t * The conversation description\n\t */\n\t this.description = undefined;\n\t /**\n\t * The conversation roles\n\t */\n\t this.roles = {\n\t \"owner\": {\n\t \"canSend\": true,\n\t \"canAddParticipants\": true,\n\t \"canRemoveParticipants\": true\n\t },\n\t \"participant\": {\n\t \"canSend\": true,\n\t \"canAddParticipants\": true,\n\t \"canRemoveParticipants\": true\n\t }\n\t };\n\t /**\n\t * The isPublic field\n\t */\n\t this.isPublic = false;\n\t /**\n\t * The participants\n\t */\n\t this.participants = undefined;\n\t this.id = utils_1.Utils.uuid();\n\t }", "init(participants, pricing) {\n if(typeof participants !== 'undefined') this.participants = participants;\n if(typeof pricing !== undefined) this.pricing = pricing;\n }", "function Person(firstname, lastname, role){\n\tthis.firstname = firstname;\n\tthis.lastname = lastname;\n\tthis.role = role;\n}", "create (modulus, exponent = '10001') {\n const publicExponent = exponent || this.publicExponent\n this.RSA.setPublic(modulus, publicExponent)\n }", "invitePerson (person) {\n if (this.inInvited(person)) return\n var p = new People()\n logger.debug('event.js', 'invitePerson', 'The id of the person being added ' + person.id)\n p.id = person.id\n p.firstName = person.firstName\n p.lastName = person.lastName\n p.nickName = person.nickName\n p.phone = person.phone\n p.address = person.address\n p.email = person.email\n this.invited.push(p)\n }", "function Attendee (name, email) {\n this.name = name;\n this.email = email;\n this.id = Meteor.uuid();\n}", "constructur() {}", "function Recipient() {\n _classCallCheck(this, Recipient);\n\n Recipient.initialize(this);\n }", "function Person(name) {\n this.name = name // Se crea un constructor\n}", "constructor(message) {\n super(message.from).then(that => {\n console.info('Starting response to', that.peerId);\n that.constructor.instances[that.peerId] = that; // Keep track for existingInstance.\n that.trackHandler = event => that.channel && that.channel.send(event.track.kind);\n that.peer.addEventListener('track', that.trackHandler);\n that.peer.ondatachannel = event => {\n console.log('Got data channel for', that.peerId);\n const channel = event.channel;\n that.initDataChannel(channel);\n channel.onmessage = event => {\n const message = event.data,\n key = message.slice(0, 4);\n console.log('Got', key, 'from', that.peerId);\n switch (key) {\n case 'ping':\n // Server should not send other people's data, but the peer can.\n channel.send(browserData.ip);\n break;\n case 'data':\n channel.send(message);\n break;\n default:\n console.error('Unrecognized data', message, 'from', that.peerId);\n }\n };\n };\n that[message.type](message.data); // And now act on whatever triggered our creation (e.g., offer).\n return that;\n });\n }", "function createOffer() {\r\n\tinitconfig();\r\n\tconfig.onoffer = sendsdp;\r\n \r\n global.rtc = RTCPeerConnection(config);\r\n}", "function createPeer() {\n var peer = new Peer({key: 'klgy15uvondpwrk9'}),\n disconnectDatGui = new dat.GUI(),\n discon = disconnectDatGui.add(peer, 'disconnect');\n disconnectDatGui.add(peer, 'destroy');\n\n peer.on('disconnected', function() {\n console.log('peer disconnected');\n disconnectDatGui.remove(discon);\n });\n peer.on('close', function() {\n console.log('peer destroyed');\n disconnectDatGui.destroy();\n });\n\n return peer;\n }", "function Persona(){\n\n let persona2 = new Persona()\n\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xdfc2f58e;\n this.SUBCLASS_OF_ID = 0x4561736;\n\n this.channel = args.channel || null;\n this.broadcast = args.broadcast || null;\n this.public = args.public || null;\n this.megagroup = args.megagroup || null;\n this.title = args.title;\n this.photo = args.photo;\n this.participantsCount = args.participantsCount;\n this.participants = args.participants || null;\n }", "function Teacher(name, subject) {\n Person.call(this, name);\n this.subject = subject;\n}", "function NewFriend(){\n\t\tthis.name = '';\n\t\tthis.image = '';\n\t\tthis.selections = [];\n\t\tthis.photo = '';\n\t}", "function Participant(props) {\n return (\n <li>\n {props.name} {props.hasToken ? \"a un jeton\" : \"n'a pas de jeton\"}\n </li>\n );\n}", "constructor() {\r\n\t\t\r\n\t\t// Initialise properties\r\n\t\tthis.rooms = [];\r\n\t\tthis.users = [];\r\n\t\t\r\n\t\t// Create a first room, which is the special ID 0 room in which users cannot send messages\r\n\t\tthis.newRoom(0);\r\n\t\t\r\n\t}", "function onExistingParticipants(message) {\n // Standard constraints\n var constraints = {\n audio: true,\n video: {\n frameRate: {\n min: 1, ideal: 15, max: 30\n },\n width: {\n min: 32, ideal: 50, max: 320\n },\n height: {\n min: 32, ideal: 50, max: 320\n }\n }\n };\n\n // Temasys constraints\n /*var constraints = {\n audio: true,\n video: {\n mandatory: {\n minWidth: 32,\n maxWidth: 320,\n minHeight: 32,\n maxHeight: 320,\n maxFrameRate: 30,\n minFrameRate: 1\n }\n }\n };*/\n\n console.log(sessionId + \" register in room \" + message.roomName);\n\n // create video for current user to send to server\n var localParticipant = new Participant(sessionId);\n participants[sessionId] = localParticipant;\n localVideo = document.getElementById(\"local_video\");\n var video = localVideo;\n\n // bind function so that calling 'this' in that function will receive the current instance\n var options = {\n localVideo: video,\n mediaConstraints: constraints,\n onicecandidate: localParticipant.onIceCandidate.bind(localParticipant)\n };\n\n\n localParticipant.rtcPeer = new kurentoUtils.WebRtcPeer.WebRtcPeerSendonly(options, function (error) {\n if (error) {\n return console.error(error);\n }\n\n // Set localVideo to new object if on IE/Safari\n localVideo = document.getElementById(\"local_video\");\n\n // initial main video to local first\n localVideoCurrentId = sessionId;\n localVideo.src = localParticipant.rtcPeer.localVideo.src;\n localVideo.muted = true;\n\n console.log(\"local participant id : \" + sessionId);\n this.generateOffer(localParticipant.offerToReceiveVideo.bind(localParticipant));\n });\n\n // get access to video from all the participants\n console.log(message.data);\n for (var i in message.data) {\n receiveVideoFrom(message.data[i]);\n }\n}", "constructor ({personId, name, agent}) {\n super({personId, name}); // invoke Person constructor\n // assign additional properties\n if (agent) this.agent = agent;\n }", "function addPerson () {\n new Person(inputFirst, inputLast, inputPhone, inputEmail);\n\n}", "constructor() { \n \n Message.initialize(this);\n }", "create() {\n return this.new();\n }", "function LTEAttendee() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (this instanceof LTEAttendee) {\n this.params = Object.assign({}, DEFAULT_PARAMS, params);\n this.next = generateAttendee(this.params);\n this.toString = makeToStringForGenerator('LTEAttendee', this.params);\n } else {\n return new LTEAttendee(params);\n }\n}", "function Teacher(first, last, age, gender, interests, subject) {\n Person.call(this, first, last, age, gender, interests);\n\n this.subject = subject;\n}", "function CreateNewPatient(username, password, email, phone, firstname, lastname) {\r\n var patient = new Object();\r\n patient.username = username;\r\n patient.password = password;\r\n patient.email = email;\r\n patient.phone = phone;\r\n return patient;\r\n}", "constructor(send, roomName) {\n this._send = send; // \"send\" function for this user\n this.room = Room.get(roomName); // room user will be in\n this.name = null; // becomes the username of the visitor\n\n console.log(`created chat in ${this.room.name}`);\n }", "function construct() { }", "function persona(usr,contra,ip,puert) {\n this.usuario=usr;\n this.contraseña=contra;\n this.IP =ip;\n this.puerto=puert;\n}", "function Person(name, attitude, age, wine) {\n this.name = name;\n this.attitude = attitude;\n this.age = age;\n this.wine = wine;\n}", "function createPerson(name) {\n return {\n talk: function() {\n \tconsole.log(`Say my name ${name}`);\n },\n };\n}", "function Person(name, age, profession) {\n this.name = name;\n this.age = age;\n this.profession = profession;\n}", "buildNewThread(participants, messages, unreadCount, id, activate) {\r\n this.logger.log(`New thread initiated\\nParticipants: ${participants}\\nId: ${id}`);\r\n let thread = {\r\n messages: messages,\r\n participants: participants,\r\n unreadCount: unreadCount,\r\n id: id\r\n };\r\n let action = {\r\n type: Chat_State_Action_1.chatStateActionTypes.CREATE_THREAD,\r\n payload: {\r\n thread: thread\r\n }\r\n };\r\n this.storeAccess.dispatchAction(action);\r\n return thread;\r\n }", "function Teacher(firstName, lastName, age, gender, interests, subject) {\n Person.call(this, firstName, lastName, age, gender, interests);\n this.subject = subject;\n}", "create() {}", "create() {}", "function Person(name) {\n\t\t\t\tthis.name = name;\n\t\t\t\tthis.id;\n\t\t}", "function instantiate(Policy) {\n var policy = Object.create(new Policy());\n policy.message = Policy.message;\n return policy;\n }", "function Persona(nombre, apellido, altura) {\n //console.log('me ejecutaron');\n\n //para guardar los parametros que acabamos de crear usamos this\n\n this.nombre = nombre; //son dos variables distintos this es un atributo y nombre es el parametro qyue recibimos \n this.apellido = apellido;\n this.altura = altura;\n //return this; //no se pone esta implicito en js\n}", "function newMember() {\n\tinquirer\n\t\t.prompt([\n\t\t\t{\n\t\t\t\tname: 'empType',\n\t\t\t\ttype: 'list',\n\t\t\t\tmessage: 'Please select member role:',\n\t\t\t\tchoices: ['Engineer', 'Intern', '-- Finish Team --'],\n\t\t\t},\n\t\t])\n\t\t.then((res, err) => {\n\t\t\tif (err) console.error(err);\n\t\t\tswitch (res.empType) {\n\t\t\t\tcase 'Engineer':\n\t\t\t\t\taddEngineer();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Intern':\n\t\t\t\t\taddIntern();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-- Finish Team --':\n\t\t\t\t\trenderTeam();\n\t\t\t}\n\t\t});\n}", "function createPeer(){\n \n let turnServerUrls;\n let turnServerCredential;\n let turnServerUsername;\n\n if (USER_TYPE === 'Guest'){\n turnServerUrls = GUEST_TURN_SERVER_URLS;\n turnServerCredential = GUEST_TURN_SERVER_CREDENTIAL;\n turnServerUsername = GUEST_TURN_SERVER_USERNAME; \n } else{\n turnServerUrls = HOST_TURN_SERVER_URLS;\n turnServerCredential = HOST_TURN_SERVER_CREDENTIAL;\n turnServerUsername = HOST_TURN_SERVER_USERNAME;\n }\n\n const peer = new RTCPeerConnection({\n iceServers: [\n {\n urls: turnServerUrls,\n credential: turnServerCredential,\n username: turnServerUsername\n },\n {urls:'stun:stun.l.google.com:19302'},\n {urls:'stun:stunserver.org'},\n ]\n });\n\n peer.onnegotiationneeded = async () => {\n \n can_call_addIceCandidate = 0;\n \n const offer = await peer.createOffer();\n await peer.setLocalDescription(offer);\n \n const payload = {\n sdp: peer.localDescription,\n roomId: ROOM_ID\n }\n \n socket.emit('offer', payload);\n }\n\n peer.onconnectionstatechange = (e) => {\n switch (peer.connectionState){\n case 'connected':\n console.log('connection state: connected');\n break;\n case 'disconnected':\n \n console.log('conneciton state: disconnected');\n \n break;\n case 'closed':\n console.log('connection state: closed');\n break;\n case 'connecting':\n console.log('connection state: connecting');\n break;\n case 'failed':\n console.log('connection state: failed');\n break;\n case 'new':\n console.log('connection state: new');\n break;\n }\n }\n\n \n peer.ontrack = async (e) => {\n\n receivedStreamCount++;\n if (receivedStreamCount === 2){\n receivedStream = e.streams[0];\n }\n \n otherVideo.srcObject = e.streams[0];\n \n }\n\n peer.onicecandidate = (e) => {\n\n const payload = {\n candidate: e.candidate,\n roomId: ROOM_ID\n }\n \n \n if (e.candidate && can_call_addIceCandidate === 1){\n peer.addIceCandidate(new RTCIceCandidate(e.candidate));\n }\n \n if (e.candidate){\n console.log(e.candidate);\n socket.emit('candidate', payload);\n }\n \n }\n\n //when new data channel is created - code used only by guest\n peer.ondatachannel = (e) => {\n peer.dc = e.channel;\n peer.dc.onopen = () => console.log('connection open in Guest Side');\n peer.dc.onmessage = async (event) => {\n display_msg(HOST_NAME, event.data);\n if(!chat_window_open){\n new_message_notification.classList.add('show-new-message-notification');\n await new Promise(r => setTimeout(r, 3000));\n new_message_notification.classList.remove('show-new-message-notification');\n }\n }\n\n msg_data.addEventListener('keyup', (event) => {\n if(event.key === 'Enter'){\n event.preventDefault();\n const msg = display_my_message();\n if(msg !== '') {\n peer.dc.send(msg);\n }\n }\n });\n\n msg_send.onclick = () => {\n const msg = display_my_message();\n if(msg !== '') {\n peer.dc.send(msg);\n }\n }\n }\n\n peer.addEventListener('icegatheringstatechange', (e) => {\n switch(peer.iceGatheringState) {\n case 'new':\n console.log('iceGatheringState: new');\n break;\n case 'gathering':\n console.log('iceGatheringState: gathering');\n break;\n case 'complete':\n console.log('iceGatheringState: complete');\n break;\n }\n });\n\n return peer;\n\n}", "function createChat(user, el) {\n\tif (chat) {\n\t\tchat.destroy();\n\t}\n\tchat = new _chat2.default(el, {\n\t\tuser: user,\n\t\troom: ROOM,\n\t\thost: 'dev.livelyvideo.tv',\n\t\tauthUrl: '/access-token?username=' + user\n\t});\n}", "function Person(firstname, lastname, number, email){\n this.firstname = firstname,\n this.lastname = lastname,\n this.number = number,\n this.email = email\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xee2bb969;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.peer = args.peer;\n this.draft = args.draft;\n }" ]
[ "0.6924005", "0.6856601", "0.6320834", "0.6311694", "0.61680496", "0.6005148", "0.57533914", "0.5682655", "0.5521943", "0.55024356", "0.54400545", "0.53776824", "0.53630376", "0.5355724", "0.53435665", "0.5327128", "0.53213036", "0.53184325", "0.5307612", "0.5294493", "0.52872825", "0.5284479", "0.5219208", "0.5213048", "0.52128214", "0.520826", "0.5207619", "0.51675427", "0.5085737", "0.50664634", "0.50653535", "0.5065077", "0.50646746", "0.5061524", "0.50584304", "0.5052451", "0.50371635", "0.5018927", "0.5018558", "0.50147915", "0.50024515", "0.49958757", "0.49866584", "0.49834138", "0.49818948", "0.49708292", "0.49643016", "0.4957457", "0.4936002", "0.49352768", "0.49352208", "0.49249858", "0.49227777", "0.49226794", "0.49210647", "0.4920568", "0.49132204", "0.49126986", "0.49073103", "0.4887737", "0.48877266", "0.48820662", "0.48818183", "0.4881153", "0.48760933", "0.48661324", "0.4857327", "0.48554152", "0.4853714", "0.48478225", "0.48469687", "0.4839508", "0.48390064", "0.4828471", "0.48244733", "0.48221934", "0.4819314", "0.48188952", "0.48188797", "0.48144865", "0.4810064", "0.48072875", "0.4805998", "0.4797863", "0.47965187", "0.47944334", "0.47901577", "0.47844797", "0.47815248", "0.47815126", "0.4779304", "0.47765157", "0.47765157", "0.47695285", "0.47677594", "0.47670248", "0.4764874", "0.47604895", "0.4750247", "0.47473", "0.47436458" ]
0.0
-1
Avg. KB I/O time : 1000ms
async function eventSerializer(){ return new Promise(async (resolve, reject) =>{ port .on('open', async () =>{ process.stdout.write('\x07\x07\x07\x07');//Synchronized with 4 beep sound port.on('data', async (data) =>{ data = data.toString('utf8').replace(/[wkg]/gi, ''); if(isNaN(data)) return resolve(); data = Number(data); if(signalDebug) console.log(`${prev} ${curr} Rate : ${stable} Stable : ${isStable} Sent : ${isSent}`); curr = data; if(data == 0){ zero++ if(STABLE_THRESHOLD < zero) isSent = false, zero = 0; } else zero = 0; if(data == 0 || Math.abs(data) <= THRESHOLD){ return resolve(); } if(stable < STABLE_THRESHOLD) isStable = false; else isStable = true; if(curr == prev){ stable++; if(isStable && !isSent){ prev = curr, stable = 0, isStable = false, isSent = true; let buf = `${String(curr)}`; process.stdout.write('\x07');//Beep sound with "please wait" if(timeDebug) console.time('I/O');//Start KB I/O await robot.typeString(buf); if(timeDebug) console.timeLog('I/O'); await robot.keyTap('tab') process.stdout.write('\x07');//Beep sound with "good to go" if(timeDebug) console.timeLog('I/O');//End KB I/O if(timeDebug) console.timeEnd('I/O'); } } else prev = curr, curr = 0, stable = 0, isStable = false, isSent = false; resolve(); }); }) .on('error', async (error) =>{ console.log(error); }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_measureSpeed() {\n\t\tif(!this._socket) return;\n\t\tif(!this._connected) {\n\t\t\tthis._upspeed = 0;\n\t\t\tthis._downspeed = 0;\n\t\t}\n\t\tconst dt = new Date();\n\t\tconst dtime = (dt - this._measuretime) / 1000;\n\t\tif(dtime < 0.11) return;\n\t\tconst bup = this._socket.bytesWritten - this._bytesOut;\n\t\tconst bdown = this._socket.bytesRead - this._bytesIn;\n\n\t\tthis._upspeed = ~~((this._upspeed + (bup / dtime)) / 2);\n\t\tthis._downspeed = ~~((this._downspeed + (bdown / dtime)) / 2);\n\t\tif(this._upspeed < 1) this._upspeed = 0;\n\t\tif(this._downspeed < 1) this._downspeed = 0;\n\t\tthis._bytesOut = this._socket.bytesWritten;\n\t\tthis._bytesIn = this._socket.bytesRead;\n\t\tthis._totalBytesOut += bup;\n\t\tthis._totalBytesIn += bdown;\n\t\tthis._measuretime = dt;\n\n\t\tif(this.opts.lognetstat) {\n\t\t\tconst o = {\n\t\t\t\tupspeed: this._upspeed,\n\t\t\t\tdownspeed: this._downspeed,\n\t\t\t\tout: this._bytesOut,\n\t\t\t\tin: this._bytesIn,\n\t\t\t}\n\t\t\tif(this._upspeed || this._downspeed) console.error(o)\n\t\t}\n\t}", "function cpuAverage() {\n var totalIdle = 0, totalTick = 0;\n var cpus = os.cpus();\n for(var i = 0, len = cpus.length; i < len; i++) {\n var cpu = cpus[i];\n for(type in cpu.times) {\n totalTick += cpu.times[type];\n } \n totalIdle += cpu.times.idle;\n }\n return {idle: totalIdle / cpus.length, total: totalTick / cpus.length};\n}", "function kb(bytes) { return bytes / SIZE }", "function cpuAverage() {\n var totalIdle = 0, totalTick = 0;\n var cpus = os.cpus();\n for (var i = 0, len = cpus.length; i < len; i++) {\n var cpu = cpus[i];\n for(type in cpu.times) {\n totalTick += cpu.times[type];\n }\n totalIdle += cpu.times.idle;\n }\n return {idle: totalIdle / cpus.length, total: totalTick / cpus.length};\n}", "function _calculateDownloadTime(sizeInBytes) {\n return Math$floor(sizeInBytes / _throughput); \n }", "average() {\n return this.buffer.reduce((accum, current) => accum + current) / this.size;\n }", "function MeasureConnectionSpeed() {\n var startTime, endTime;\n var download = new Image();\n download.onload = function () {\n endTime = (new Date()).getTime();\n showResults();\n }\n \n download.onerror = function (err, msg) {\n ShowProgressMessage(\"Invalid image, or error downloading\");\n }\n \n startTime = (new Date()).getTime();\n var cacheBuster = \"?nnn=\" + startTime;\n download.src = imageURL + cacheBuster;\n \n function showResults() {\n var duration = (endTime - startTime) / 1000;\n var bitsLoaded = downloadSize * 8;\n var speedBps = (bitsLoaded / duration).toFixed(5);\n var speedbps = (downloadSize / duration).toFixed(5);\n var speedKbps = (speedBps / 1024).toFixed(5);\n var speedMbps = (speedKbps / 1024).toFixed(5);\n ShowProgressMessage([\n \"Your connection speed is:\", \n speedBps + \" bps\", \n speedbps+ \" Bps\", \n speedKbps + \" kbps\", \n speedMbps + \" Mbps\"\n ]);\n }\n getip();\n DBtest();\n}", "function cpuAverage() {\n const cpus = os.cpus();\n //get ms in each mode, but this number is since reboot\n //so get it now and get it in 100ms and compare\n let idleMs = 0;\n let totalMs = 0;\n\n //lope through each core\n cpus.forEach((core) => {\n for (type in core.times) {\n totalMs += core.times[type];\n }\n idleMs += core.times.idle;\n });\n\n return {\n idle: idleMs / cpus.length,\n total: totalMs / cpus.length,\n };\n}", "function cpuAverage() {\n\n //Initialise sum of idle and time of cores and fetch CPU info\n var totalIdle = 0, totalTick = 0;\n var cpus = os.cpus();\n\n //Loop through CPU cores\n for(var i = 0, len = cpus.length; i < len; i++) {\n\n //Select CPU core\n var cpu = cpus[i];\n\n //Total up the time in the cores tick\n for(type in cpu.times) {\n totalTick += cpu.times[type];\n }\n\n //Total up the idle time of the core\n totalIdle += cpu.times.idle;\n }\n\n //Return the average Idle and Tick times\n return {idle: totalIdle / cpus.length, total: totalTick / cpus.length};\n}", "async calculateCpuUsage() {\n this.__cpuUsage = await utils.getCpuUsage({ timeout: this.__cpuUsageInterval });\n }", "function spendSomeTime() {\n let total = 0;\n for (let i = 0; i < 10000; i++) {\n total += i;\n }\n}", "getCpuAvg() {\n const cpus = os.cpus();\n \n let totalIdle = 0;\n let totalTicks = 0;\n\n /**\n * For each CPUs we will loop though \n * and calculate the ticks and add them \n * together as totalTicks\n * \n * and add up all total idel times as totalIdel\n */\n\n for (let i = 0; i < cpus.length; i++) {\n let currentCPU = cpus[i];\n \n for (let t in currentCPU.times) {\n totalTicks += currentCPU.times[t];\n }\n\n totalIdle += currentCPU.times.idle;\n }\n\n return { \n idle: totalIdle / cpus.length, \n total: totalTicks / cpus.length \n }\n }", "function kb(bytes) {\n return bytes / SIZE;\n}", "function readTotalFileSize(path) {\n var r = 0, dir = obj.fs.readdirSync(path);\n for (var i in dir) {\n var stat = obj.fs.statSync(path + '/' + dir[i])\n if ((stat.mode & 0x004000) == 0) { r += stat.size; } else { r += readTotalFileSize(path + '/' + dir[i]); }\n }\n return r;\n }", "_getAverageSpeed()\r\n {\r\n let endTime = Date.now()\r\n // Get elapsed time in seconds.\r\n let elapsedTime = (endTime - this._startTime) / 1000;\r\n\r\n // Return average speed in m/s.\r\n return this._totalDistance / elapsedTime;\r\n }", "function statfs(cb) {\n\tcb(0, {\nbsize: 1000000,\nfrsize: 1000000,\nblocks: 1000000,\nbfree: 1000000,\nbavail: 1000000,\nfiles: 1000000,\nffree: 1000000,\nfavail: 1000000,\nfsid: 1000000,\nflag: 1000000,\nnamemax: 1000000\n});\n}", "function cpuAverage() {\n\n\t//Initialise sum of idle and time of cores and fetch CPU info\n\tvar totalIdle = 0, totalTick = 0;\n\tvar cpus = os.cpus();\n\n\t//Loop through CPU cores\n\tfor (var i = 0, len = cpus.length; i < len; i++) {\n\n\t\t//Select CPU core\n\t\tvar cpu = cpus[i];\n\n\t\t//Total up the time in the cores tick\n\t\tfor (type in cpu.times) {\n\t\t\ttotalTick += cpu.times[type];\n\t\t}\n\n\t\t//Total up the idle time of the core\n\t\ttotalIdle += cpu.times.idle;\n\t}\n\n\t//Return the average Idle and Tick times\n\treturn { idle: totalIdle / cpus.length, total: totalTick / cpus.length };\n}", "async function usedSpace(userID) {\n var size = 0;\n try {\n var error, result = await db.readDataPromise('file', { owner: userID });\n\n result.forEach(file => {\n size += file.fileSize\n })\n return parseFloat(size / 1000000).toFixed(2);\n } catch (error) {\n console.error(error.stack);\n }\n}", "function getCpuUsage() {\n return cpu.getCpuUsage();\n}", "function get_stats(callback){\n data = {\n \"time\": null,\n \"cpu\": null,\n \"tot_mem\": null,\n \"free_mem\": null\n }\n\n os.cpuUsage(function(cpu){\n cpu = Math.round(cpu * 100);\n\n data = {\n \"time\": curr_time(),\n \"cpu\": cpu,\n \"tot_mem\": os.totalmem(),\n \"free_mem\": os.freemem()\n }\n\n callback(data);\n })\n}", "function averageTime(total, numberOfElements) {\t\t\n\t\t\tvar avg = ( (total / 1000) / numberOfElements);\n\t\t\treturn avg;\n\t\t}", "function recordSegmentDownloadRate() {\r\n\ttotalEndTime = performance.now();\r\n\tvar totalTime = totalEndTime - totalStartTime;\r\n\tdocument.getElementById(\"result\").events_textarea.value += \"TotalTime:\" + totalTime + \"\\n\";\r\n}", "function getFilesizeInBytes(filename) {\n var stats = fs.statSync(filename)\n var fileSizeInBytes = stats[\"size\"]\n return fileSizeInBytes\n}", "function averageRunTime(logs){\n var hash = {};\n var totalTime = 0;\n var pairs = 0;\n var parts, time, operation, action;\n var str = readLine(logs);\n while(str){\n parts = str.split(' ');\n time = new Date(parts[0]).getTime();\n operation = parts[2];\n action = parts[3];\n hash[operation] = hash[operation] || {};\n hash[operation][action] = time;\n // only add when both start and end occur\n if(hash[operation].End && hash[operation].Start){\n totalTime += hash[operation].End - hash[operation].Start;\n // save space and incase operation occurs again in log\n delete hash[operation];\n pairs++;\n }\n str = readLine();\n }\n return totalTime / pairs;\n}", "function getFilesize(fileName) {\n stats = fs.statSync(fileName);\n fileSizeBytes = stats.size;\n console.log('Bytes written so far: %d', (fileSizeBytes));\n return fileSizeBytes\n}", "function sample_size() {\n return 5000\n}", "async function checkPerformance() {\r\n var latestBlock = await web3.eth.getBlockNumber();\r\n var block = await web3.eth.getBlock(latestBlock, true);\r\n if (block.transactions != null) {\r\n var minedTxTime = new Date().getTime();\r\n block.transactions.forEach(async function (tx) {\r\n try{\r\n var input = web3.utils.hexToUtf8(tx.input).split(\" \")[0]\r\n var writtenTxTime = parseInt(input)/100 //divide by 100 to get rid of extra 0s\r\n var latency = minedTxTime - writtenTxTime;\r\n fs.appendFileSync('./data/performance.txt', (latency.toString() + \"\\n\"), (err) => { //synchronously writes to ./data/performance.txt\r\n if (err) {return console.log(err);}\r\n });\r\n } catch (error) {\r\n console.log(\"Tx input not correctly formatted\");\r\n }\r\n }) \r\n }\r\n}", "function loopy() {\n var sum = 0;\n for (var i = 0; i < 1000000000; i++) {\n sum += i;\n }\n console.log(sum);\n}", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "function calcAvgActionTime() {\n\t\tif (!maxTime.actions) {\n\t\t\treturn 1;\n\t\t}\n\t\tavgActionTime = maxTime.time / maxTime.actions;\n\t}", "logMetrics() {\n logger.info(`# of files indexed: ${this._filesIndexed}`);\n logger.info(`# of directories indexed: ${this._directoriesIndexed}`);\n logger.info(`# of unknown files: ${this._unknownCount}`);\n\n const endTimer = process.hrtime(this._startTimer);\n logger.info(`Execution time: ${endTimer[0] + endTimer[1] / 1E9}s`);\n }", "function doWork(){\n let sum=0;\n for (let index = 0; index < 1000000000; index++) {\n sum+=index;\n }\n console.log('Sum: ',sum);\n return sum;\n}", "function mb(bytes) {\n return kb(bytes) / SIZE;\n}", "function calc_size(bsize) {\n\n var defs = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n var counter = 0;\n\n while(bsize > 1024) {\n bsize /= 1024;\n counter++;\n }\n\n console.log((Math.round(bsize * 100) / 100) + defs[counter]);\n\n}", "function _getMaxCushionSizeInMilliseconds() {\n var maxCushionSize = _maxBufferSizeMilliseconds * _maxCushionSizeInBufferPercentage/100 - _reservoirSizeMilliseconds - _outageProtectionMilliseconds;\n return maxCushionSize;\n }", "function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n sum = sum + times[i].duration;\n }\n console.log(\"Average time to generate last 10 frames: \" + sum / 10 + \"ms\");\n}", "function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n sum = sum + times[i].duration;\n }\n console.log('Average time to generate last 10 frames: ' + sum / 10 + 'ms');\n}", "function mainLoop()\r\n{\r\n\tvar startTime = performance.now();\r\n}", "averageSpeed(){\n var resultSpeed = this._distanceRan/this._timeTaken\n return resultSpeed.toFixed(2);\n }", "function _getMaxCushionSizeInMilliseconds(map) {\n var _bbconfig = config.bufferBased,\n reservoirSizeMilliseconds = map.reservoir,\n outageProtectionMilliseconds = map.outage,\n maxCushionSize = _bbconfig.maxBufferSizeMilliseconds * _bbconfig.maxCushionSizeInBufferPercentage/100 - reservoirSizeMilliseconds - outageProtectionMilliseconds;\n return maxCushionSize;\n}", "async function fileSize( path ) {\n const stats = await _stat( path );\n return stats.size;\n}", "function gb(bytes) {\n return mb(bytes) / SIZE;\n}", "fileSize () {\n if (this.isDirectory()) {\n // dirs don't have file size\n return 0\n }\n\n let sum = 0\n this.blockSizes.forEach((size) => {\n sum += size\n })\n\n if (this.data) {\n sum += this.data.length\n }\n\n return sum\n }", "function emitProgress (ev) {\n if (ev.lengthComputable) {\n let percent = ev.loaded / ev.total\n emitter.emit('progress', percent)\n }\n // else\n // emitter.emit('error', 'Unable to comptue progress - total filesize is unknown!')\n }", "async function getNetworkDownloadSpeed()\n{\n const baseUrl = \"https://pruebasbotanax.000webhostapp.com/videos/13-138039_4k-ultra-hd-dragon.jpg\";\n const fileSizeInBytes = 50000000;\n\n downloadSPeed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);\n\n console.log(\"Velocidad de bajada: \", downloadSPeed[\"mbps\"] + \" Mbps\");\n}", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "async function stress(fn, fun, runs = 100000) {\n\tconst fd = await openAsync(fn, 'r')\n\tconst stat = await fstatAsync(fd)\n\tconst b1 = new Buffer(2048)\n\tconst b2 = new Buffer(2048)\n\tconst b3 = new Buffer(2048)\n\tconst b4 = new Buffer(1801)\n\tawait readAsync(fd, b1, 0, 2048, 0)\n\tawait readAsync(fd, b2, 0, 2048, 2048)\n\tawait readAsync(fd, b3, 0, 2048, 4096)\n\tawait readAsync(fd, b4, 0, 1801, 6144)\n\tconst start = Date.now()\n\twhile (runs--) {\n\t\tassert(fun(b1) === 4025106459);\n\t\tassert(fun(b2) === 307646824);\n\t\tassert(fun(b3) === 977512073);\n\t\tassert(fun(b4) === 3918749721);\n\t}\n\tconsole.log(Date.now() - start)\n}", "function n(){if(!e.s_loadT){var t=(new Date).getTime(),n=e.performance?performance.timing:0,i=n?n.requestStart:e.inHeadTS||0;s_loadT=i?Math.round((t-i)/100):\"\"}return s_loadT}", "function getLoad(callback) {\n\tvar result = {};\n\tvar loads = os.loadavg().map(function(x) { return x / _cores; } );\n\tresult.avgload = parseFloat((Math.max.apply(Math, loads)).toFixed(2));\n\tresult.currentload = -1;\n\n\tvar cmd = (_darwin) ? \"ps -caxm -o pcpu\" : \"ps axo pcpu\";\n\texec(cmd, function(error, stdout) {\n\t\tif (!error) {\n\t\t\tvar lines = stdout.toString().replace(/,+/g, \".\").split('\\n');\n\t\t\tlines.shift();\n\t\t\tlines.pop();\n\t\t\tresult.currentload = parseFloat(((lines.reduce(function (pv, cv) {\n\t\t\t\treturn pv + parseFloat(cv.trim());\n\t\t\t}, 0)) / _cores).toFixed(2));\n\t\t}\n\t\tcallback(result)\n\t});\n}", "getUsageStats() {\n return `Buffer: ${bytes(this.recentBuffer.length)}, lrErrors: ${this.lrErrors}`;\n }", "function getCPULoadAVG(avgTime = 1000, delay = 100) {\n\n\treturn new Promise((resolve, reject) => {\n\n\t\tconst n = ~~(avgTime / delay);\n\t\tif (n <= 1) {\n\t\t\treject('Error: interval to small');\n\t\t}\n\n\t\tlet i = 0;\n\t\tlet samples = [];\n\t\tconst avg1 = cpuAverage();\n\n\t\tlet interval = setInterval(() => {\n\t\t\tconsole.debug('CPU Interval: ', i);\n\n\t\t\tif (i >= n) {\n\t\t\t\tclearInterval(interval);\n\t\t\t\tresolve(~~((arrAvg(samples) * 100)));\n\t\t\t}\n\n\t\t\tconst avg2 = cpuAverage();\n\t\t\tconst totalDiff = avg2.total - avg1.total;\n\t\t\tconst idleDiff = avg2.idle - avg1.idle;\n\n\t\t\tsamples[i] = (1 - idleDiff / totalDiff);\n\n\t\t\ti++;\n\n\t\t}, delay);\n\n\t});\n\n}", "async function getNetworkDownloadSpeed()\n{\n const baseUrl = 'https://pruebasbotanax.000webhostapp.com/videos/13-138039_4k-ultra-hd-dragon.jpg';\n const fileSizeInBytes = 50000000;\n\n const downloadSPeed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);\n\n console.log(downloadSPeed);\n}", "startCalcSpeed () {\n // calc rest time of backup\n this.lastTenData.length = 0\n this.startTime = new Date().getTime()\n let restTime = -1\n let lastRestTime = -1\n let beforeLastRestTime = -1\n clearInterval(this.timer)\n this.timer = setInterval(() => {\n const data = this.summary()\n this.lastTenData.unshift(data)\n\n // keep 10 data\n if (this.lastTenData.length > 10) this.lastTenData.length = 10\n\n const length = this.lastTenData.length\n // start calc restTime\n if (length > 1) {\n const deltaSize = this.lastTenData[0].transferSize - this.lastTenData[length - 1].transferSize\n const restTimeBySize = (data.size - data.completeSize) / deltaSize * (length - 1)\n\n const deltaCount = this.lastTenData[0].finishCount - this.lastTenData[length - 1].finishCount\n const restTimeByCount = (data.count - data.finishCount) / deltaCount * (length - 1)\n\n const usedTime = (new Date().getTime() - this.startTime) / 1000\n const restTimeByAllSize = (data.size - data.completeSize) * usedTime / data.transferSize\n const restTimeByAllCount = data.count * usedTime / data.finishCount - usedTime\n\n /* combine of restime by different method */\n restTime = Math.max(Math.min(restTimeBySize, restTimeByCount), Math.min(restTimeByAllSize, restTimeByAllCount))\n\n /* only use restTimeBySize */\n restTime = restTimeBySize\n // max restTime: 30 days\n restTime = Math.min(restTime, 2592000)\n /* average of the last 3 restTime */\n if (lastRestTime < 0 || beforeLastRestTime < 0) {\n lastRestTime = restTime\n beforeLastRestTime = restTime\n }\n restTime = (beforeLastRestTime + lastRestTime + restTime) / 3\n\n beforeLastRestTime = lastRestTime\n lastRestTime = restTime\n }\n\n const ltd = this.lastTenData\n const speed = ltd.length > 1 ? (ltd[0].transferSize - ltd[ltd.length - 1].transferSize) / ltd.length - 1 : 0\n\n const bProgress = data.count ? `${data.finishCount || 0}/${data.count}` : '--/--'\n\n const args = { speed, restTime: getLocaleRestTime(restTime), bProgress, ...data }\n webContents.getAllWebContents().forEach(contents => contents.send('BACKUP_MSG', args))\n }, 1000)\n }", "function calculateReadingTime(text) {\n // average reading speed is around 200-300 words per minute\n const wordsPerMinute = 250;\n // split the text into an array of words\n const wordCount = text.split(' ').length;\n // calculate the reading time in minutes\n const readingTime = wordCount / wordsPerMinute;\n return Math.ceil(readingTime);\n}", "function getFullLoad(callback) {\n\tif (_windows) {\n\t\tcallback(NOT_SUPPORTED);\n\t}\n\n\tvar result = {};\n if (_linux) {\n \tif (fs.existsSync('/proc/uptime')) {\n \t\tvar output = fs.readFileSync('/proc/uptime').toString();\n \t\toutput = output.replace(/ +/g, \" \").split(' ');\n \t\tvar uptime = parseFloat(output[0]);\n \t\tvar idletime = parseFloat(output[1]) / _cores;\n \t\tresult.fullload = (uptime - idletime) / uptime * 100.0;\n \t\tcallback(result);\n \t}\n }\n\tif (_darwin) {\n \tresult.fullload = 0;\n \tcallback(result);\n }\n}", "function CurrentGcMilliseconds() {\r\n}", "function fsSize(callback) {\n\tif (_windows) {\n\t\tcallback(NOT_SUPPORTED);\n\t}\n\n\texec(\"df -lk | grep ^/\", function(error, stdout) {\n\t\tvar data = [];\n\t\tif (!error) {\n\t\t\tvar lines = stdout.toString().split('\\n');\n\t\t\t//lines.splice(0, 1);\n\t\t\tlines.forEach(function (line) {\n\t\t\t\tif (line != '') {\n\t\t\t\t\tline = line.replace(/ +/g, \" \").split(' ');\n\t\t\t\t\tdata.push({\n\t\t\t\t\t\t'fs': line[0],\n\t\t\t\t\t\t'size': parseInt(line[1]) * 1024,\n\t\t\t\t\t\t'used': parseInt(line[2]) * 1024,\n\t\t\t\t\t\t'use': parseFloat((100.0 * line[2] / line[1]).toFixed(2)),\n\t\t\t\t\t\t'mount': line[line.length - 1]\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcallback(data)\n\t});\n}", "function getAverageLoadTime(data, key, count, endField, startField) {\n var sum = 0;\n\n for (var i = 1; i <= count; i++) {\n var index = key + \"_\" + i;\n\n //console.log(\"attempting to parse? \" + index )\n if (index in data) {\n var temp = JSON.parse(data[index]);\n var end = parseInt(temp[endField])\n var start = parseInt(temp[startField])\n sum += end - start;\n }\n }\n console.log(\"sum is \" + sum + \" avg is \" + (sum / count))\n return sum / count;\n}", "async function getAvgStats() {\n\n await dbConnection.collection(collection.log).aggregate([\n {\n $group :\n {\n _id : \"$conversation_id\",\n conversations: { $push: \"$$ROOT\" }\n }\n },\n {$unwind: \"$conversations\"},\n {$group: {\n _id: \"$_id\",\n firstItem: { $first: \"$conversations\"},\n lastItem: { $last: \"$conversations\"},\n countItem: { \"$sum\": 1 }\n }},\n\n { \"$project\": {\n \"minutes\": {\n \"$divide\": [{ \"$subtract\": [ \"$lastItem.date\", \"$firstItem.date\" ] }, 1000*60]\n },\n \"counter\": \"$lastItem.context.system.dialog_request_counter\"\n },\n },\n\n {\n \"$match\": { \"counter\": {$gt: 2} , \"minutes\": {$lt: 120} }\n },\n // then group as normal for the averaging\n {$group: {\n _id: 0,\n minutes: {$avg: \"$minutes\"},\n counter: {$avg: \"$counter\"},\n }}\n ],\n {\n cursor: {\n batchSize: 10000\n },\n allowDiskUse: true,\n explain: false\n }, null\n ).toArray()\n .then(stats => {\n return {minutes: stats.minutes, counter: stats.counter}\n })\n}", "getFilesizeInBytes(file) {\n try {\n return fs.statSync(file).size;\n }\n catch(err) {\n console.log(err);\n return 0;\n }\n }", "function totalBytes(results) {\n var result = 0;\n for(var j in results.pageStats) {\n if(j.match(/Bytes/g)) {\n result += Number(results.pageStats[j]); \n }\n }\n return result;\n}", "get averageSpeed()\r\n {\r\n // Return average speed in m/s.\r\n let speedValue = this._getAverageSpeed().toFixed(2);\r\n return speedValue.toString() + \" m/s\"\r\n }", "function timeToRead(array) {\n\t\tvar total = 0;\n\n\t\tarray.each(function() {\n\t\t\ttotal += Math.round(60*$(this).text().split(' ').length/200); // 200 = number of words per minute\n\t\t});\t\n\n\t\treturn total; \n\t}", "function updateProgress(oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n var now = new Date().getTime();\n var duration = now - startTime;\n printRecord(oEvent.loaded, oEvent.total, duration);\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "function updateProgress(oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n var now = new Date().getTime();\n var duration = now - startTime;\n printRecord(oEvent.loaded, oEvent.total, duration);\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "function timeToWait() {\n let timesList = list.filter(times => times.status == \"done\");\n let times = [];\n for (let i = 0; i < timesList.length; i++) {\n times.push(timesList[i].timeServiced);\n }\n if (times.length > 0) {\n let sum = times.reduce((previous, current) => current += previous);\n avg = sum / times.length;\n return avg;\n }\n}", "runDelta(){\n this.nowSec = parseInt(Date.now() / 1000);\n let output = [];\n let initialRun = false;\n let majorNumbers = cp.execSync(`lsblk | grep -Ev 'NAME|rom' | awk '{print $2}' | cut -d: -f 1 | sort -u`)\n .toString()\n .split(\"\\n\")\n .filter(a=>a)\n .map((a) => { return this.num(a);});\n let sensor = {\n \"time\": this.nowSec,\n \"disk\": this.readStat('/proc/diskstats'),\n \"stats\": this.readStat('/proc/stat'),\n \"net\": this.readStat('/proc/net/dev'),\n \"arp\": this.readStat('/proc/net/arp')\n };\n \n if(this.CACHE === null ){\n initialRun = true;\n this.CACHE = sensor;// if no cache ( cleared or first run, assume that current data is a cache data )\n }\n let cores = this.num(cp.execSync('nproc')); // get number of cores\n let netInterfaces = cp.execSync(`ls /sys/class/net/ | grep -v lo`).toString().split(\"\\n\").filter(a => a);\n let cacheTime = this.CACHE.time;\n let cacheTimeDiff = this.nowSec - cacheTime;\n cacheTimeDiff = cacheTimeDiff === 0 ? 1 : cacheTimeDiff; // prevent division by zero for intervals less than 1 sec.\n if(initialRun === false)\n {\n // Total CPU\n output.push([\"cpu.user\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 0 /* user */ )]);\n output.push([\"cpu.nice\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 1 /* nice */ )]);\n output.push([\"cpu.system\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 2 /* system */ )]);\n output.push([\"cpu.idle\", this.cpuCalc(this.CACHE.stats['cpu'][0], sensor.stats['cpu'][0], 3 /* idle */ )]);\n // each core load\n for (let i = 0; i < cores; i++){\n output.push(['cpu' + i + '.user', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 0 )]);\n output.push(['cpu' + i + '.nice', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 1 )]);\n output.push(['cpu' + i + '.system', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 2 )]);\n output.push(['cpu' + i + '.idle', this.cpuCalc(this.CACHE.stats['cpu' + i][0], sensor.stats['cpu' + i][0], 3 )]);\n }\n // Get network speed ( upload / download ) per sec.\n for (let i in netInterfaces) {\n let inet = netInterfaces[i]; // interface name\n output.push([\"net.\" + inet + \".rx\",this.netCalc(this.CACHE.net[inet + ':'][0][0] / cacheTimeDiff , sensor.net[inet + ':'][0][0] / cacheTimeDiff )]);\n output.push([\"net.\" + inet + \".tx\",this.netCalc(this.CACHE.net[inet + ':'][0][8] / cacheTimeDiff , sensor.net[inet + ':'][0][8] / cacheTimeDiff )]);\n }\n // Disks stats\n for(let i in majorNumbers){\n let sensorDriver = sensor.disk[majorNumbers[i]];\n let cacheDriver = this.CACHE.disk[majorNumbers[i]];\n for(let j in sensorDriver){\n output.push([\"disk.\" + sensorDriver[j][1] + '.writespeed',this.format((sensorDriver[j][8] - cacheDriver[j][8]) / 2 / cacheTimeDiff)]);\n }\n }\n\n }\n // ARP changes\n let arpNew = sensor.arp;\n for(let ip in arpNew){\n if(ip === 'ip') continue;\n output.push(['arp.' + this.addresToInt(ip,'.',10),this.addresToInt(arpNew[ip][0][2],':',16)]);\n }\n // Processes\n output.push([\"procs.running\",sensor.stats['procs_running'][0][0]]);\n output.push([\"procs.blocked\",sensor.stats['procs_blocked'][0][0]]);\n // build sensors output\n this.CACHE = sensor;\n this.out(this.prepare(output));\n }", "async fetchTotalSupply() {\n return Number(200000000);\n }", "static getTimeInMs() {\n let seconds;\n let nanoseconds;\n [seconds, nanoseconds] = process.hrtime();\n return seconds * 1000 + nanoseconds / 1000000;\n }", "static _getTimeInMs() {\n const [seconds, nanoseconds] = process.hrtime();\n return seconds * 1000 + nanoseconds / 1000000;\n }", "function timeRun() {\n return ((new Date()).getTime() - START_TIME)/1000;\n}", "function testFastReadableStream() {\n var stream = new FastReadableStream();\n stream.on('data', function (data) {\n console.log(data);\n });\n\n function printStats() {\n console.log({\n chunks: stream.chunksWritten,\n readable: stream.readable\n });\n setTimeout(printStats, 1000);\n }\n printStats();\n\n function pauseOrResume() {\n stream.paused ? stream.resume() : stream.pause();\n setTimeout(pauseOrResume, 3000);\n }\n pauseOrResume();\n\n setTimeout(function () {\n stream.destroy();\n }, 20000);\n}", "function howLongDidItTake() {\n\tvar end, start;\n\t\n\tstart = new Date();\n\t\n\t for(var i = 0; i < 10000; i++) {\n\t console.log(Math.sqrt(i));\n\t }\n\t\n\tend = new Date();\n \n var totalTime = end.getTime() - start.getTime();\n return 'This function took ' + totalTime + ' mseconds';\n\t\n\t// use date object's .getTime() method to get difference in milliseconds\n}", "function onUploadProgress(event) {\n var prog = Math.round(100 * (event[\"bytesLoaded\"] / event[\"bytesTotal\"]));\n $('#' + event[\"id\"]).html(prog + '%');\n}", "function getCpuLoad() {\n return new Promise((resolve, reject) => {\n const start = cpuAverage();\n setTimeout(() => {\n const end = cpuAverage();\n const idleDiff = end.idle - start.idle;\n const totalDiff = end.total - start.total;\n //calc % load\n const percentageLoad = 100 - Math.floor((100 * idleDiff) / totalDiff);\n resolve(percentageLoad);\n }, 100);\n });\n}", "function sendStats() {\n push('stats', {\n hits: hits,\n totalHits: totalHits,\n bytes: bytes,\n totalBytes: totalBytes,\n cost: cost,\n totalCost: totalCost,\n period: STATS_PERIOD,\n uptime: +(new Date) - startTime\n });\n\n hits = 0;\n bytes = 0;\n cost = 0;\n}", "async function benchmark({\n\tminifier,\n\tfilePath,\n\tsampleSize,\n\tonIterationStart,\n}) {\n\tconst results = [];\n\n\tfor (let i = 0; i < sampleSize; i += 1) {\n\t\tonIterationStart(i + 1, results[i - 1]);\n\t\tconst subprocess = execa(process.execPath, [path.join(`./lib/benchmark/minifiers/${minifier}`), filePath], {\n\t\t\ttimeout: 1000 * 60,\n\t\t});\n\n\t\tsubprocess.stdout.pipe(fs.createWriteStream(`logs/${Date.now()}-${minifier}-${path.basename(filePath, '.js')}.log`));\n\n\t\tlet jsonData;\n\t\ttry {\n\t\t\tconst result = await subprocess;\n\t\t\tjsonData = JSON.parse(result.stdout);\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t\tif (error.message.match('Command timed out')) {\n\t\t\t\tconsole.log('Retrying...');\n\t\t\t\ti -= 1; // Retry\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (results.length > 0) {\n\t\t\tassert(jsonData.size === results[0].size, 'Mismatching size');\n\t\t}\n\t\tresults.push(jsonData);\n\t}\n\n\t// eslint-disable-next-line unicorn/no-array-reduce\n\tconst avgSpeed = results.reduce((current, next) => current + next.ms, 0) / results.length;\n\n\treturn {\n\t\tms: avgSpeed,\n\t\tsize: results[0].size,\n\t\tgzipSize: results[0].gzipSize,\n\t};\n}", "function getFileSizeInBytes(filename) {\n var stats = fs.statSync(filename)\n var fileSizeInBytes = stats[\"size\"]\n return fileSizeInBytes\n}", "keskiarvo() {\n let sum = this.state.timer20.reduce((previous, current) => current += previous);\n let avg = sum / this.state.timer20.length;\n return avg\n }", "function stats()\r\n{\r\n\r\n\tvar sum = 0;\r\n\t// stole this from stachoverflow, thank and bug the guy there\r\n\tfor( var i = 0; i < incorrectTiming.length; i++ )\r\n\t{\r\n\t sum += parseInt( incorrectTiming[i], 10 );\r\n\t}\r\n\r\n\tavgIncorrect = sum/incorrectTiming.length;\r\n\r\n\tsum = 0;\r\n\tfor( var i = 0; i < correctTiming.length; i++ )\r\n\t{\r\n\t\t//console.log(correctTiming[i]);\r\n\t sum += parseInt( correctTiming[i], 10 ); \r\n\t}\r\n\r\n\tavgCorrect = sum/correctTiming.length;\r\n\r\n\tsum = 0;\r\n\tfor( var i = 0; i < controlTiming.length; i++ )\r\n\t{\r\n\t sum += parseInt( controlTiming[i], 10 );\r\n\t}\r\n\tavgControl = sum/controlTiming.length;\r\n\r\n\t//console.log(\"avgCorrect\" + avgCorrect);\r\n\t//console.log(\"avgIncorrect\" + avgIncorrect);\r\n\t//console.log(\"avgControl\" + avgControl);\r\n\r\n}", "loadFactor() {\n return this.elements / this.capacity;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "function getCpuCurrentSpeedSync() {\n\n let cpus = os.cpus();\n let minFreq = 999999999;\n let maxFreq = 0;\n let avgFreq = 0;\n\n if (cpus.length) {\n for (let i in cpus) {\n if (cpus.hasOwnProperty(i)) {\n avgFreq = avgFreq + cpus[i].speed;\n if (cpus[i].speed > maxFreq) maxFreq = cpus[i].speed;\n if (cpus[i].speed < minFreq) minFreq = cpus[i].speed;\n }\n }\n avgFreq = avgFreq / cpus.length;\n return {\n min: parseFloat((minFreq / 1000).toFixed(2)),\n max: parseFloat((maxFreq / 1000).toFixed(2)),\n avg: parseFloat((avgFreq / 1000).toFixed(2))\n }\n } else {\n return {\n min: 0,\n max: 0,\n avg: 0\n }\n }\n}", "function getDiskUsage(){\n $.get(SERVER_ADDRESS+'/diskusage',function(data){\n var diskData = JSON.parse(data);\n $('#disk_usage .bar').css('width',diskData.availablePerc + '%');\n $('#disk_usage .bar').html(diskData.availableGB+' GB free');\n $('#disk_usage .bar').attr('aria-valuenow',diskData.availablePerc);\n });\n}", "function _getMinCushionSizeInMilliseconds() {\n var lowestVideoStreamWithHeader = _videoStreamList.firstAbove(0, true),\n highestRateVideoDownloadable = _videoStreamList.firstBelow(Number.POSITIVE_INFINITY, true),\n maxChunkSizeInByte = _getMaxChunkSizeInByteFromStream(highestRateVideoDownloadable);\n\n return maxChunkSizeInByte * BYTEtoBITS / lowestVideoStreamWithHeader.bitrate;\n }", "function readablizebytes(bytes)\n {\n\tif (bytes > 1024*1024*1024)\n\t\tbytesdisplay = (Math.round(bytes * 100/(1024*1024*1024))/100).toString() + \" GB\";\n\telse if (bytes > 1024*1024)\n\t\tbytesdisplay = (Math.round(bytes * 100/(1024*1024))/100).toString() + \" MB\";\n\telse if (bytes > 1024)\n\t\tbytesdisplay = (Math.round(bytes * 100/1024)/100).toString() + \" kB\";\n\telse\n\t\tbytesdisplay = (Math.round(bytes * 100)/100).toString() + \" Bytes\";\n\treturn bytesdisplay;\n}", "function _getMinReservoirSizeInMilliseconds() {\n return Math.min(config.minDecoderBufferMilliseconds, _chunkMilliseconds * 2);\n }", "_start() {\n if (!this.ready) {\n return this.emit('error', new Error('Cannot start before being ready'));\n }\n this.hashing = true;\n this.stopped = false;\n\n // Create piece objects.\n const pieces = [];\n for (let i = 0; i < this.pieces; i++) {\n pieces[i] = {\n buffer: null,\n length: this.pieceLength,\n bytesWritten: 0,\n };\n }\n pieces[pieces.length - 1].length = this.lastPieceLength;\n \n // Keep track of progress.\n let totalRead = 0;\n\n // Keep track of reading speed.\n this.streamGroup = new StreamSpeed();\n let lastPercent = 0;\n let speed = 0;\n let avg = 0;\n\n this.streamGroup.on('speed', (s, a) => {\n speed = s;\n avg = a;\n });\n\n const filesqueue = queue((task, callback) => {\n if (this.err || this.stopped) return callback();\n\n // Keep track how much has been read.\n let readSoFar = 0;\n let pieceIndex = task.piece;\n\n // Open file for reading.\n const file = path.join(this.dir, ...task.path);\n const rs = fs.createReadStream(file);\n this.streamGroup.add(rs);\n\n rs.on('open', () => {\n this.emit('open', file);\n });\n\n rs.on('data', (data) => {\n // Recalculate the index of current piece based on `readSoFar`.\n pieceIndex = task.piece +\n Math.floor((task.offset + readSoFar) / this.pieceLength);\n\n // Write data to piece buffer.\n const targetStart = (task.offset + readSoFar) % this.pieceLength;\n let sourceWritten = this._writePiece(\n pieces, pieceIndex, targetStart,\n data, 0, data.length, file, readSoFar);\n\n while (sourceWritten < data.length) {\n pieceIndex += 1;\n sourceWritten += this._writePiece(\n pieces, pieceIndex, 0,\n data, sourceWritten, data.length, file, readSoFar);\n }\n\n // Update amount of bytes written to buffer.\n readSoFar += data.length;\n totalRead += data.length;\n\n // Emit hash event with piece info and progress.\n let percent =\n round(totalRead / this.totalSize * 100, 2);\n if (lastPercent !== percent) {\n this.emit('progress', percent, speed, avg);\n lastPercent = percent;\n }\n\n });\n\n // Close this file when there is an error or finished reading.\n rs.on('error', (err) => {\n this.emit('error', err);\n callback();\n });\n\n rs.on('end', () => {\n callback();\n });\n }, this.maxFiles);\n\n // When all file queues are finished, join all the pieces.\n filesqueue.drain = () => {\n this.hashing = false;\n this.emit('end');\n };\n\n // Start queueing jobs.\n this.filetasks.forEach((filetask) => {\n filesqueue.push(filetask);\n });\n }", "get loopAverageDuration() {\n\n let total = 0;\n for(let i in this._loopDurations) {\n total += this._loopDurations[i];\n }\n\n return Math.round((total / this._loopDurations.length) * 100) / 100;\n }", "function semaphore_report_sample_sizes() {\n const report_sample_sizes = [];\n for (const interval of config.SEMAPHORE_METRICS_AVERAGE_INTERVALS) {\n const interval_num = parseInt(interval, 10);\n // Convert the interval minute to seconds and divide it with semaphore delay seconds to get the sample size.\n const sample_size = interval_num * 60 * 1000 / config.SEMAPHORE_MONITOR_DELAY;\n report_sample_sizes.push(sample_size);\n }\n return report_sample_sizes;\n}", "function getFileSizeBytes(filepath){\n\tvar stats = fs.statSync(filepath);\n\treturn stats[\"size\"];\n}", "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\n\tif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\n\tif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\n\tif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "function getSumTotalBytes () {\n return getActiveDownloads().reduce((acc, item) => acc + item.getTotalBytes(), 0)\n}", "function getFileSystemPercentUse(callback) {\n getData('/api/2/fs', function(data) {\n var fs = data.find(function(item) {\n return item.mnt_point.startsWith('/etc');\n });\n return fs ? fs.percent : 'no data';\n }, callback);\n}", "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\n if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\n if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\n if(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "function bytesUsedPerSecond(point, config) {\n if (!canCalculateRate(point, config)) {\n return null;\n }\n\n var seconds = (point.end - point.start) / 1000;\n if (seconds === 0) {\n return null;\n }\n\n var bytesUsed = point.max - point.min;\n return bytesUsed / seconds;\n }", "addLoadingTime(time) {\n this.loadTimes.push(time.totalMilliseconds);\n if (this.loadTimes.length > 100) {\n this.loadTimes.pop();\n }\n let sum = 0;\n this.loadTimes.forEach((t) => sum += t);\n this.nextLoadTimePrediction = Math.round(sum / this.loadTimes.length);\n // log(sprintf(\"New Time: %s \\t Next Prediction: %s\", time.totalMilliseconds, this.nextLoadTimePrediction));\n }", "async function doTest(url, writeStream) {\n const results = await runLighthouse(url);\n const rawData = results.lhr;\n const userTimings = rawData.audits['user-timings']['details'];\n\n const logs = results.artifacts['devtoolsLogs']['defaultPass'];\n const harResult = await chromeHarCapturer.fromLog(url, logs);\n const harEntries = harResult['log']['entries'];\n\n let totaltransfersize = 0;\n let transfersizes = [];\n let times = [];\n for (entry in harEntries) {\n let time = 0;\n const request = harEntries[entry];\n const response = request['response'];\n const transfersize = response['_transferSize'];\n\n const timings = request['timings'];\n\n // add up all the timing components to get the request time\n for (key in request['timings']) {\n // null values are -1, we do not want those\n if (timings[key] >= 0) {\n time += timings[key];\n }\n }\n\n times.push(time);\n totaltransfersize += transfersize;\n transfersizes.push(transfersize);\n }\n\n const metrics = [\n rawData.audits['first-contentful-paint'].numericValue,\n rawData.audits['first-meaningful-paint'].numericValue,\n rawData.audits['speed-index'].numericValue,\n rawData.audits['total-blocking-time'].numericValue,\n rawData.audits['estimated-input-latency'].numericValue,\n rawData.audits['time-to-first-byte'].numericValue,\n rawData.audits['first-cpu-idle'].numericValue,\n rawData.audits['interactive'].numericValue,\n rawData.audits['network-rtt'].numericValue,\n rawData.audits['network-requests'].numericValue,\n rawData.audits['dom-size'].numericValue,\n totaltransfersize,\n avg(transfersizes),\n median(transfersizes),\n percentile(90, transfersizes),\n percentile(95, transfersizes),\n percentile(99, transfersizes),\n avg(times),\n median(times),\n percentile(90, times),\n percentile(95, times),\n percentile(99, times),\n times.length,\n getLowestTimeToWidget(userTimings),\n getMedianTimeToWidget(userTimings),\n ];\n\n let line = metrics.join(',');\n line += '\\n';\n\n writeStream.write(line);\n}", "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):'';s_loadT=s_loadT/10}return s_loadT}" ]
[ "0.6065693", "0.6013382", "0.59272915", "0.5873922", "0.5846815", "0.5826777", "0.58232254", "0.5792107", "0.575184", "0.5744504", "0.5737861", "0.57036823", "0.5680032", "0.5645027", "0.5633774", "0.5624554", "0.56168157", "0.55748755", "0.5535333", "0.5515816", "0.5464553", "0.53809816", "0.5362975", "0.5335014", "0.5331164", "0.5323409", "0.5305109", "0.5287591", "0.5272859", "0.5265716", "0.5239051", "0.5236966", "0.5213849", "0.520737", "0.52059543", "0.51788807", "0.5172426", "0.5172322", "0.5169494", "0.5154851", "0.51469", "0.51147217", "0.5102883", "0.5100801", "0.5076424", "0.5065345", "0.5061363", "0.5049619", "0.50437886", "0.50383717", "0.50336254", "0.5031071", "0.5031039", "0.5026876", "0.50191945", "0.50187325", "0.5007809", "0.50058377", "0.497373", "0.49723333", "0.4964177", "0.49520522", "0.49503917", "0.49472883", "0.49472883", "0.4941984", "0.49324334", "0.4929121", "0.49247545", "0.49245688", "0.49239746", "0.48994985", "0.48823804", "0.48770842", "0.4875689", "0.4873441", "0.48680982", "0.4866183", "0.48567635", "0.48515493", "0.4847995", "0.4847995", "0.484374", "0.48429522", "0.48411912", "0.48126298", "0.48065612", "0.48029417", "0.47968185", "0.4793015", "0.47863814", "0.47860074", "0.47744286", "0.4761218", "0.47575635", "0.4754467", "0.4754467", "0.47538307", "0.47522396", "0.47495434", "0.474135" ]
0.0
-1
VALIDACION DE LA EDAD
function validarAge(){ let age = document.getElementById("age"); if(age.value === ""){ alert("El Age no puede estar vacio"); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validarEdad(){\r\n\t\r\n\tvar valEdad = recopilarinfotextbox(\"txtEdad\");\r\n\t\r\n\tif (valEdad>=12){\r\n\t\t//alert(valEdad+\" edad mayor de 12\");\r\n\t\tdesactivarelementoFormulario(\"ceo\");\r\n\t\tdocument.getElementById(\"ceo\").value = \"no aplica\";\r\n\t}else{\r\n\t\t//alert(valEdad+\" edad menor de 12\");\r\n\t\tdesactivarelementoFormulario(\"cop\");\r\n\t\tdocument.getElementById(\"cop\").value = \"no aplica\";\r\n\t}\r\n\t\r\n}", "function validarEdad() {\n // Usaremos una expresion regular que solo permita digitos y la longitud sea de 1 a 3.\n var exp = /[0-9]{1,3}$/g;\n if (!exp.test(document.getElementById(\"edad\").value) || document.getElementById(\"edad\").value <0 || document.getElementById(\"edad\").value >105 ){\n // Cuando no se cumpla alguna de las condiciones, patron o limites de edad\n // facalizaremos el campo y mostraremos un error.\n document.getElementById(\"edad\").value = \"error!\";\n document.getElementById(\"edad\").focus();\n document.getElementById(\"edad\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error en la edad. <br/> Tiene que ser un numero entre 0 y 105\";\n return false;\n }\n else {\n // si el patron es correcto y la edad esta entre 0 y 105 la daremos por valida.\n document.getElementById(\"edad\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function validarEdad() {\r\n var result = true;\r\n var edad = document.getElementById('edad');\r\n\r\n if (edad.value == '') {\r\n result = false;\r\n edad.className = 'error';\r\n edad.focus();\r\n document.getElementById('errores').innerHTML = 'La edad no puede estar en blanco';\r\n } else if (isNaN(edad.value)) {\r\n result = false;\r\n edad.className = 'error';\r\n edad.focus();\r\n document.getElementById('errores').innerHTML = 'La edad tiene que ser un número';\r\n } else {\r\n if (parseInt(edad.value) < 0 || parseInt(edad.value) > 105) {\r\n result = false;\r\n edad.className = 'error';\r\n edad.focus();\r\n document.getElementById('errores').innerHTML = 'La edad debe estar entre 0 y 105';\r\n } else {\r\n edad.className = '';\r\n document.getElementById('errores').innerHTML = '';\r\n }\r\n }\r\n return result;\r\n}", "function Validar(Cadena){\n var Fecha= new String(Cadena) // Crea un string\n var RealFecha= new Date() // Para sacar la fecha de hoy\n //Cadena A�o\n var Ano= new String(Fecha.substring(Fecha.lastIndexOf(\"-\")+1,Fecha.length))\n // Cadena Mes\n var Mes= new String(Fecha.substring(Fecha.indexOf(\"-\")+1,Fecha.lastIndexOf(\"-\")))\n // Cadena D�a\n var Dia= new String(Fecha.substring(0,Fecha.indexOf(\"-\")))\n\n // Valido el a�o\n if (isNaN(Ano) || Ano.length<4 || parseFloat(Ano)<1900 || Ano.length>4 || parseFloat(Ano)>2015){\n alert('Gestion invalida')\n return false\n }\n // Valido el Mes\n if (isNaN(Mes) || parseFloat(Mes)<1 || parseFloat(Mes)>12){\n alert('Mes invalido')\n return false\n }\n // Valido el Dia\n if (isNaN(Dia) || parseInt(Dia, 10)<1 || parseInt(Dia, 10)>31){\n alert('Dia invalido')\n return false\n }\n if (Mes==4 || Mes==6 || Mes==9 || Mes==11 || Mes==2) {\n if (Mes==2 && Dia > 28 || Dia>30) {\n alert('Dia invalido')\n return false\n }\n }\n}", "function validaFormProvimento() {\n var ueid = document.getElementById(\"ueid\");\n var matricula = document.getElementById(\"Matricula\");\n var motivo = document.getElementById(\"inputMotivo\");\n var motivo_data_inicio = date(document.getElementById(\"DataInicio\"));\n var motivo_data_fim = date(document.getElementById(\"DataFim\"));\n var data_assuncao = date(document.getElementById(\"DataAssuncao\"));\n\n if (ueid == \"\" || (ueid = null)) {\n erro = \"Código empresa está vazio\";\n }\n\n if (ueid.length > 8) {\n erro = \"Código da escola não pode ter mais que 8 dígitos\";\n }\n\n if (motivo <= 0) {\n document.getElementById(\"erroMotivo\").value =\n \"Por favor, escolha um motivo de provimento.\";\n }\n\n if (motivo_data_fim <= motivo_data_inicio) {\n erro = \"Data final não pode ser menor ou igual a data início.\";\n }\n}", "validarDatos() {\n let errores = '';\n\n if (!moment($('#devolucion_venta-fecha').value).isValid()) {\n errores += '<br>Fecha inválida';\n }\n\n\n\n if (!$('#devolucion_venta-cliente').value) {\n errores += '<br>Falta seleccionar cliente';\n }\n\n if (!$('#devolucion_venta-venta').value) {\n errores += '<br>Falta seleccionar una venta';\n }\n\n if(this.tablaDevoluciones){\n let lineasDeVenta = this.tablaDevoluciones.getData();\n if (lineasDeVenta.length == 0) {\n errores += '<br>No se hallaron detalles de venta.';\n } else {\n let lineaIncompleta = false;\n lineasDeVenta.forEach((lineaVenta) => {\n if (!util.esNumero(lineaVenta.subtotal)) {\n lineaIncompleta = true;\n }\n });\n\n if (lineaIncompleta) {\n errores += '<br>Se encontró al menos un detalle de compra incompleto.';\n }\n }\n\n }\n \n\n return errores;\n }", "validarDadosC() {\n for (let i in this) {\n if (this[i] == undefined || this[i] == '' || this[i] == null) {\n return false;\n }\n }\n\n if (this.vencimento == 'e' || this.limite == 'e') {\n return false\n }\n else if (this.vecimento < 1 || this.limite < 1) {\n return false\n }\n else if (this.vencimento > 31) {\n return false\n }\n\n return true;\n }", "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formProcedimento.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formProcedimento.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formProcedimento.nome.value)).toLowerCase());\n document.formProcedimento.nome.value = primeirasLetrasMaiusculas(trim(document.formProcedimento.nome.value).toLowerCase());\n }\n \n if (trim(document.formProcedimento.valor.value) == \"\") {\n mensagem = mensagem + \"\\n- Valor(R$)\";\n }\n else {\n document.formProcedimento.valor.value = document.formProcedimento.valor.value.replace(\",\", \".\");\n }\n\n if (trim(document.formProcedimento.valorMinimo.value) == \"\") {\n mensagem = mensagem + \"\\n- Valor Minimo(R$)\";\n }\n else {\n document.formProcedimento.valorMinimo.value = document.formProcedimento.valorMinimo.value.replace(\",\", \".\");\n }\n\n if (parseFloat(trim(document.formProcedimento.valor.value.toString())) < parseFloat(trim(document.formProcedimento.valorMinimo.value.toString()))) {\n alert(\"Valor minimo Invalido!\");\n return false;\n }\n\n if (trim(document.formProcedimento.descricao.value) == \"\") {\n mensagem = mensagem + \"\\n- Descricao\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formProcedimento.descricao.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formProcedimento.descricao.value)).toLowerCase());\n document.formProcedimento.descricao.value = primeirasLetrasMaiusculas(trim(document.formProcedimento.descricao.value).toLowerCase());\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n goFocus('nome');\n return false;\n }\n}", "function validarEdad(){\r\n let edad = document.getElementById('edad').value;\r\n if (edad >= 18){\r\n console.log(\"Es mayor de edad\")\r\n } else {\r\n console.log(\"Es menor de edad\")\r\n }\r\n}", "validarCadena(propiedad, valor){ //validación para strings \n //recibirá la propiedad a evaluar (id, titulo...) y el valor\n if(!valor) return console.warn(`${propiedad} \"${valor}\" está vacío`)\n if(typeof valor !== \"string\") return console.error(`${propiedad} \"${valor}\" NO es un texto`)\n \n return true //si ninguna validación se ha activado, devulve un true\n }", "function validarFecha(){\n\tif(validarObligatorio(fecha.value)){\n\t\terrorFecha.innerHTML = \"La fecha debe ser elegida\";\n\t\treturn false;\n\t}\n\terrorFecha.innerHTML = \"\";\n\treturn true;\n}", "function validacionMoidficarUsuario() {\n let nombresusu = $(\"#nombreusu\").val();\n let direccionusu = $(\"#direccionusu\").val();\n let fechausu = $(\"#fechanacusu\").val();\n let telfonousu = $(\"#telefonousu\").val();\n if ($.trim(nombresusu) == \"\") {\n toastr.error(\"Ingrese sus nombres\", \"Aviso!\");\n $(\"#nombreusu\").focus();\n return false;\n } else if ($.trim(direccionusu) == \"\") {\n toastr.error(\"Ingrese su direccion\", \"Aviso!\");\n $(\"#direccionusu\").focus();\n return false;\n } else if ($.trim(fechausu) == \"\") {\n toastr.error(\"Ingrese su fecha nacimiento\", \"Aviso!\");\n $(\"#fechanacusu\").focus();\n return false;\n } else if ($.trim(telfonousu) == \"\") {\n toastr.error(\"Ingrese su telefono\", \"Aviso!\");\n $(\"#telefonousu\").focus();\n return false;\n } else if ($.trim(fechausu)!=\"\") {\n var edad = Edad(fechausu);\n if (edad<18) {\n //console.log(edad);\n toastr.warning(\"Fecha nacimiento erronea, Verifique!\", \"Aviso!\");\n $(\"#fechanacusu\").focus();\n return false;\n }else{\n console.log(edad);\n return true;\n }\n \n }\n}", "function validar(){\n\tvar valNom = valNombre(); \n\tvar valApe = valApellido();\n\tvar valTel = valNumero();\n\tvar valMayor = valEdad();\n\tvar email = valEmail();\n\tvar ident = identificador();\n}", "function validateDescripcionActualizada()\n{\n //verificar si el campo esta vacio\n if(checkIfEmpty(descripcionA)) return;\n if(!validateAlphanumeric(descripcionA)) return;\n return true;\n}", "function validarFormulario() {\n\n /*creo una variable de tipo booleana que en principio tendrá un valor true,\n y que retornaremos en false(falso) cuando nuestra condición no se cumpla*/\n var todo_correcto = true;\n\n /*El primer campo que comprobamos es el del nombre. Lo traemos por id y verificamos\n la condición, en este caso, por ejemplo, le decimos que tiene que tener más de 2 dígitos\n para que sea un nombre válido. Si no tiene más de dos dígitos, la variable todo_correcto\n devolverá false.*/\n\n //ELEMENTOS\n var nombre = document.getElementById('element_1_1');\n var apellido = document.getElementById('element_1_2');\n var direccion = document.getElementById('element_2_1');\n var ciudad = document.getElementById('element_2_3');\n var provincia = document.getElementById('element_2_4');\n var cp = document.getElementById('element_2_5');\n var pais = document.getElementById('element_2_6');\n var tel = document.getElementById('telefono');\n var web = document.getElementById('element_5');\n var email = document.getElementById('element_6');\n var month = document.getElementById('element_3_1');\n var day = document.getElementById('element_3_2');\n var year = document.getElementById('element_3_3');\n var dateFormulario = month.value + \"/\" + day.value + \"/\" + year.value;\n var hoy = new Date();\n var dd = hoy.getDate();\n var mm = hoy.getMonth()+1;\n var yyyy = hoy.getFullYear();\n if(dd<10) {\n dd='0'+dd\n }\n\n if(mm<10) {\n mm='0'+mm\n }\n var fechaActual = mm+'/'+dd+'/'+yyyy;\n\n var x=fecha2MayorFecha1(dateFormulario,fechaActual);\n\n\n\n\n\n\n\n //EXPRESIONES REGULARES\n var regexpGlobal = /^([a-z ??????]{2,60})$/i;\n var regexpDireccion = /^([a-zA-Z\\d\\s\\-\\,\\#\\.\\+])+/;\n var regexpCodigoPostal = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n var regexpTelefono = /(?:[+]?(?:[0-9]{1,5}|\\\\x28[0-9]{1,5}\\\\x29)[ ]?)?[0-9]{2}(?:[0-9][ ]?){6}[0-9]/;\n var regexpWeb = /^(http?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\?=.-]*)*\\/?$/;\n var regexpEmail = /^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/;\n\n\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR NOMBRE\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(nombre.value)) {\n nombre.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n nombre.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR APELLIDO\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(apellido.value)) {\n apellido.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n apellido.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR Direccion\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpDireccion.test(direccion.value)) {\n direccion.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n direccion.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR CIUDAD\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(ciudad.value)) {\n ciudad.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n ciudad.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR PROVINCIA\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpGlobal.test(provincia.value)) {\n provincia.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n provincia.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR CODIGO POSTAL\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpCodigoPostal.test(cp.value)) {\n cp.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n cp.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR PAIS\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (pais.value == \"\") {\n pais.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n pais.style.borderColor = \"black\";\n }\n /////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR TELEFONO\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpTelefono.test(tel.value)) {\n tel.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n tel.style.borderColor = \"black\";\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR WEB\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpWeb.test(web.value)) {\n web.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n web.style.borderColor = \"black\";\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR email\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!regexpEmail.test(email.value)) {\n email.style.borderColor = \"red\";\n todo_correcto = false;\n }else{\n email.style.borderColor = \"black\";\n }\n/////////////////////////////////////////////////////////////////////////////////////////////\n// VALIDAR fecha\n/////////////////////////////////////////////////////////////////////////////////////////////\n if (!validaFechaDDMMAAAA(dateFormulario)) {\n day.style.borderColor = \"red\";\n month.style.borderColor = \"red\";\n year.style.borderColor = \"red\";\n todo_correcto = false;\n\n\n }\n if(fecha2MayorFecha1(dateFormulario,fechaActual)){\n day.style.borderColor = \"red\";\n month.style.borderColor = \"red\";\n year.style.borderColor = \"red\";\n todo_correcto = false;\n\n }\n\n\n if (todo_correcto==false) {\n alert('Los campos en rojo no estan correctos, vuelva a revisarlos');\n }\n\n return todo_correcto;\n\n\n\n}", "function validarCampos5 () {\n\tsaveTransaccion();\n}", "function validarCampos5 () {\n\tsaveTransaccion();\n}", "validarCadena(propiedad, valor) {\n //Estas validaciones dentro de este metodo las invoco donde necesite validar que un valor es de tipo cadena\n if (!valor) return console.warn(`${propiedad} \"${valor}\" esta vacío`);\n if (!valor) return console.warn(`${propiedad} \"${valor}\" ingresado, NO es una cadena de texto`);\n return true;\n }", "function validar(f) \n\t\t{\n\t\t\tif (document.f.cod.value == '') \n\t\t\t{ \n\t\t\t\talert ('INGRESE CODIFICACION'); \n\t\t\t\tdocument.f.cod.focus();return false;\n\t\t\t}\n\t\t\tif (document.f.desc.value == '') \n\t\t\t{ \n\t\t\t\talert ('INGRESE DESCRIPCION');\n\t\t\t\tdocument.f.desc.focus();return false;\n\t\t\t} \n\t\t\tif (document.f.tp.value == '') \n\t\t\t{ \n\t\t\t\talert ('INGRESE TIPO DE PRODUCTO');\n\t\t\t\tdocument.f.tp.focus();return false;\n\t\t\t} \n\t\t\tif (document.f.pv.value == '') \n\t\t\t{ \n\t\t\t\talert ('INGRESE PRECIO VENTA');\n\t\t\t\tdocument.f.pv.focus();return false;\n\t\t\t} \n\t\t\tif (document.f.cant.value == '') \n\t\t\t{ \n\t\t\t\talert ('INGRESE CANTIDAD MINIMA DESEADA');\n\t\t\t\tdocument.f.cant.focus();return false; \n\t\t\t} \n\t\t\treturn true;\n\t\t}", "function validarCamposOrden(){\r\n /*if(document.getElementById(\"codigoOrden\").value == \"\"){\r\n alert(\"Falta el codigo de la orden de compra\");\r\n return false;\r\n }*/\r\n if(document.getElementById(\"Proveedor\").value == null){\r\n alert(\"Falta el proveedor\")\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaPedido\").value == \"\"){\r\n alert(\"Falta le fecha de pedido\");\r\n return false;\r\n }\r\n if(document.getElementById(\"FechaEntrega\").value == \"\"){\r\n alert(\"Falta la fecha de entrega\");\r\n return false;\r\n }\r\n return true;\r\n}", "function validarAgregarCliente(){\r\n var validacion=true;\r\n\r\n var dniCiente=document.getElementById('dniCliente').value.trim();\r\n var campoDniCiente=document.getElementById('dniCliente');\r\n\r\n var nombreCiente=document.getElementById('nombreCliente').value.trim();\r\n var campoNombreCiente=document.getElementById('nombreCliente');\r\n var telefonoCliente=document.getElementById('telefonoCliente').value.trim();\r\n var campoTelefonoCliente=document.getElementById('telefonoCliente');\r\n var emailCliente=document.getElementById('emailCliente').value.trim();\r\n var campoEmailCliente=document.getElementById('emailCliente');\r\n\r\n var error=\"\";\r\n var oExpReg=/^\\d{8}[a-zA-Z]$/;\r\n\r\n if(oExpReg.test(dniCiente)==false){\r\n\r\n error+=\"Error en el campo dni<br>\";\r\n campoDniCiente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoDniCiente.style.backgroundColor=\"white\";\r\n\r\n }\r\n\r\n var oExpReg=/^[A-Z][a-z]{3,40}$/;\r\n\r\n if(oExpReg.test(nombreCiente)==false){\r\n\r\n error+=\"Error en el campo nombre<br>\";\r\n campoNombreCiente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoNombreCiente.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg= /^[679]\\d{8}$/;\r\n\r\n if(oExpReg.test(telefonoCliente)==false){\r\n\r\n error+=\"Error en el campo telefono<br>\";\r\n campoTelefonoCliente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoTelefonoCliente.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg= /^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/;\r\n\r\n if(oExpReg.test(emailCliente)==false){\r\n\r\n error+=\"Error en el campo email<br>\";\r\n campoEmailCliente.style.backgroundColor=\"orange\";\r\n }else{\r\n campoEmailCliente.style.backgroundColor=\"white\";\r\n\r\n }\r\nif(document.getElementById('ClienteMiembro').checked){\r\n var fecha=document.getElementById('fechaAltaCliente').value.trim();\r\n var campoFecha=document.getElementById('fechaAltaCliente');\r\n if (fecha == \"\"){\r\n fecha = document.clienteM.fechaAltaCliente.getAttribute(\"placeholder\");\r\n }\r\n\r\n var oExpReg=/^([0-9]{1,2})[/]{1}([0-9]{1,2})[/]{1}([0-9]{4})$/;\r\n if (oExpReg.test(fecha)==false){\r\n\r\n error+=\"Error en el campo fecha <br>\";\r\n campoFecha.style.backgroundColor=\"orange\";\r\n\r\n }else{\r\n campoFecha.style.backgroundColor=\"white\";\r\n oFechaActual = new Date(fecha.split(\"/\")[2],(fecha.split(\"/\")[1]-1),fecha.split(\"/\")[0]);\r\n if (oFechaActual.getDate() !=fecha.split(\"/\")[0]){\r\n toastr.error(\"El dia es incorrecto\",\"Error en la fecha\");\r\n campoFecha.style.backgroundColor=\"orange\";\r\n }else if ((oFechaActual.getMonth()+1) !=fecha.split(\"/\")[1]){\r\n toastr.error(\"El mes es incorrecto\",\"Error en la fecha\");\r\n campoFecha.style.backgroundColor=\"orange\";\r\n }\r\n }\r\n}\r\n\r\nif(error!=\"\"){\r\n toastr.error(error,\"Fallo en la Validacion\");\r\n validacion=false;\r\n}\r\n\r\n return validacion;\r\n\r\n}", "function validarAgregarAbogado(){\r\n var validacion=true;\r\n var nombre=document.getElementById('nombreAbogado').value.trim();\r\n var campoNombre=document.getElementById('nombreAbogado');\r\n var dni=document.getElementById('dniAbogado').value.trim();\r\n var campoDni=document.getElementById('dniAbogado');\r\n var sueldo=document.getElementById('sueldo').value.trim();\r\n var campoSueldo=document.getElementById('sueldo');\r\n var error=\"\";\r\n\r\n var oExpReg=/^[A-Z][a-z]{3,40}$/;\r\n\r\n if(oExpReg.test(nombre)==false){\r\n\r\n error+=\"Error en el campo nombre<br>\";\r\n campoNombre.style.backgroundColor=\"orange\";\r\n }else{\r\n campoNombre.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg=/^\\d{8}[a-zA-Z]$/;\r\n\r\n if(oExpReg.test(dni)==false){\r\n\r\n error+=\"Error en el campo dni<br>\";\r\n campoDni.style.backgroundColor=\"orange\";\r\n }else{\r\n campoDni.style.backgroundColor=\"white\";\r\n\r\n }\r\n var oExpReg=/^\\d{3,4},\\d{2}$/;\r\n\r\n if(oExpReg.test(sueldo)==false){\r\n\r\n error+=\"Error en el campo sueldo<br>\";\r\n campoSueldo.style.backgroundColor=\"orange\";\r\n }else{\r\n campoSueldo.style.backgroundColor=\"white\";\r\n\r\n }\r\n\r\n if(error!=\"\"){\r\n toastr.error(error,\"Fallo en la Validacion\");\r\n validacion=false;\r\n }\r\n\r\n\r\n\r\n return validacion;\r\n\r\n}", "validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n this.showError();\n console.log(\"niet valide\");\n }\n else\n this.hideError();\n }", "function validarApellido(){\n val = in_apellido.value;\n if(val.length < 4){\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_enabled\";\n element.innerHTML = \"<strong>Mínimo 03 caracteres.</strong>\"; \n validator_apellido = false;\n }else{\n if(expRegCadena.test(val)){\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_disabled\";\n btn_registrar.disabled = false;\n validator_apellido = true;\n }else{\n element = document.getElementById(\"div_error_apellido\");\n element.className = \"error_enabled\";\n element.innerHTML = \"<strong>Apellido no válido, solo letras.</strong>\"; \n validator_apellido = false;\n }\n }\n checkValidator();\n}", "function validar_regla_descarga(){\n verifi_time_dowload = true;\n}", "function validation()\r\n{\r\n\tvar reference = new String(document.getElementById(\"reference\").value);\r\n\tif (reference.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(referenceNonRenseignee);\r\n\t}\r\n\r\n\tif (!verifier(reference))\r\n\t{\r\n\t\treturn afficheErreur(referenceLettreRequise);\t\t\r\n\t}\r\n\t\r\n\tvar titre = new String(document.getElementById(\"titre\").value);\r\n\tif (titre.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(titreNonRenseigne);\r\n\t}\r\n\t\r\n\tvar auteurs = new String(document.getElementById(\"auteurs\").value);\r\n\tif (auteurs.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(auteursNonRenseignes);\r\n\t}\r\n\r\n\tvar editeur = new String(document.getElementById(\"editeur\").value);\r\n\tif (editeur.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editeurNonRenseigne);\r\n\t}\r\n\t\r\n\tvar edition = new String(document.getElementById(\"edition\").value);\r\n\tif (edition.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editionNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(edition))\r\n\t{\r\n\t\treturn afficheErreur(editionDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar annee = new String(document.getElementById(\"annee\").value);\r\n\tif (annee.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(anneeNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(annee) || annee.length != 4)\r\n\t{\r\n\t\treturn afficheErreur(anneeDoitEtreNombre4Chiffres);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar isbn = new String(document.getElementById(\"isbn\").value);\r\n\tif (isbn.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(isbnNonRenseigne);\r\n\t}\r\n\tif (isNaN(isbn))\r\n\t{\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar nombreExemplaires = new String(document.getElementById(\"nombreExemplaires\").value);\r\n\tif (nombreExemplaires.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(nombreExemplairesNonRenseigne);\r\n\t\t\r\n\t}\r\n\tif (isNaN(nombreExemplaires))\r\n\t{\r\n\t\t// Afficher Erreur Correspondante\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\r\n\tvar disponibilite = document.getElementById(\"Disponibilite\").checked;\r\n\tvar excluPret = document.getElementById(\"excluPret\").checked;\r\n\tvar commentaires = new String(document.getElementById(\"Commentaires\").value);\r\n\t// crŽation d'un ouvrage \r\n\t\r\n\tvar ouvrage = new Array();\r\n\touvrage[indiceReference] = reference;\r\n\t// Completer l'ouvrage\r\n\touvrage[indiceTitre] = titre;\r\n\touvrage[indiceAuteurs] = auteurs;\r\n\touvrage[indiceEditeur] = editeur;\r\n\touvrage[indiceEdition] = edition;\r\n\touvrage[indiceAnnee] = annee;\r\n\touvrage[indiceIsbn] = isbn;\r\n\touvrage[indiceNombreExemplaires] = nombreExemplaires;\r\n\touvrage[indiceDisponibilite] = disponibilite;\r\n\touvrage[indiceExcluPret] = excluPret;\r\n\touvrage[indiceCommentaires] = commentaires;\r\n\touvrages[nombreOuvrages] = ouvrage;\r\n\tnombreOuvrages++;\r\n\t\r\n\tafficherResume(ouvrage);\r\n\treset_validation()\r\n\t\r\n}", "function validFecha(id, valor, AnioActual, MesActual, DiaActual){\r\n var id= document.getElementById(id).value; \r\n var cantidad= id.length;\r\n\r\n var valor2 = id.split('-'); \r\n var Dia = valor2[0]; \r\n var Mes = valor2[1]; \r\n var Anio = valor2[2];\r\n\r\n\r\n\r\n if(cantidad<10) alert('Formato fecha Incorrecta en '+valor+ '!!!');\r\n else if(Dia>'31') alert('Corrija el Día de fecha introducida en '+valor+ '!!!');\r\n else if(Mes>'12') alert('Corrija el Mes de fecha introducida en '+valor+ '!!!');\r\n else if(Anio>AnioActual) alert('Corrija Año de fecha introducida en '+valor+ '!!!');\r\n\r\n\r\n /* else if(Anio<1990 || Anio>AnioActual) alert('Corrija Año de fecha introducida en '+valor+ '!!!');\r\n else if(Mes<01 || Mes>'12') alert('Corrija Mes de fecha introducida en '+valor+ '!!!');\r\n else if(Anio==AnioActual && Mes>MesActual) alert('Corrija Mes de fecha introducida en '+valor+ '!!!');\r\n else if(Anio==AnioActual && Mes==MesActual && Dia>DiaActual) alert('Corrija Dia de fecha introducida en '+valor+ '!!!');\r\n else if(Dia<01 || Dia>'31') alert('Corrija Mes de fecha introducida en '+valor+ '!!!');*/\r\n}", "function valid(){return validated}", "function validaciones() {\r\n \tvalidacionColumna();\r\n \tvalidafila();\r\n \t// Si hay dulces que borrar\r\n \tif ($('img.delete').length !== 0) {\r\n \t\teliminadulces();\r\n \t}\r\n }", "function validarLetras(elemento){\n if(elemento.value.length > 0){\n var codigA = elemento.value.charCodeAt(elemento.value.length-1)\n if((codigA >= 97 && codigA <= 122)||(codigA >=65 && codigA <= 90)||(codigA == 32)){ \n if ((elemento.id=='nombres')||(elemento.id=='apellidos')) {\n //console.log(\"Entra para irse\");\n return validarDosOMasCampos(elemento);\n }\n }else {\n console.log(\"Es una letra invalida\")\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n return false\n }\n }\n}", "function validaCampoTextoInSave(Nombre, _G_ID_) {\n var cValue = $(_G_ID_ + '_txt_' + Nombre).val();\n var TextErr = false;\n if (cValue !== null && cValue !== '') {\n if (Nombre.toUpperCase().includes('RFC')) {\n if (!(/^([A-ZÑ&]{3,4}) ?(?:- ?)?(\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])) ?(?:- ?)?([A-Z\\d]{2})([A\\d])$/.test(cValue))) {\n redLabel_Space(Nombre, 'Formato de RFC Incorrecto', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n TextErr = true;\n }\n }\n _regEx = new RegExp(\"^([0-9]|[a-zA-Z]|\\.)+$\");\n if (!_regEx.test(cValue)) {\n redLabel_Space(Nombre, 'Solo se permiten caracteres alfanumericos', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n TextErr = true;\n }\n if (TextErr) {\n errorIs[Nombre] = true;\n } else {\n errorIs[Nombre] = false;\n }\n }\n}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function validar_crear_escuela(formulario)\r\n {\r\n\r\n if(formulario.rbd.value.length==0) { \r\n formulario.rbd.focus();\r\n alert('Por favor ingrese el RBD del establecimiento');\r\n return false;\r\n }\r\n \r\n if(formulario.nombre.value.length==0) { \r\n formulario.nombre.focus();\r\n alert('Por favor ingrese nombre de la escuela');\r\n return false;\r\n\t}\r\n \r\n if(formulario.direccion.value.length==0) { \r\n formulario.direccion.focus();\r\n alert('Por favor ingrese la direccion');\r\n return false;\r\n }\r\n\treturn true;\r\n }", "function validarFecha() {\n // usaremos una expresion regular para que la fecha tenga un patron:\n // podemos teclear el día desde 01 a 31 (0[1-9]|1[0-9]|2[0-9]|3[0-1]|[1-9])\n\t// esta parte de la expresion nos permite teclear dias como 02, 14, 30, etc\n\t// [/|-] seguido de / o -\n\t// para terminar $, 4 digitos para indicar el año: (\\d{4})\n var exp = /(0[1-9]|1[0-9]|2[0-9]|3[0-1]|[1-9])[/|-](0[0-9]|1[0-2]|[1-9])[/|-](\\d{4})$/;\n if (!exp.test(document.getElementById(\"fecha\").value)){\n document.getElementById(\"fecha\").value = \"error!\";\n document.getElementById(\"fecha\").focus();\n document.getElementById(\"fecha\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error en la fecha de nacimiento. <br/> Debe ser en lo siguientes formatos 00/00/0000 0 11/11/1111\";\n return false;\n }\n else {\n document.getElementById(\"fecha\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function validarFormulario() {\n //limpiar los avisos anteriores!!\n emptySpans();\n let camposAValidar = document.getElementsByTagName(\"input\");\n let valido = true;\n //comprobar que cumpla todo lo que dice cada campo input text y date\n for (let i = 0; i < camposAValidar.length; i++) {\n if (camposAValidar[i].type ==\"text\" || camposAValidar[i].type ==\"date\") {\n //si no se validan se cambia el color a rojo y se añade el mensaje de ayuda\n if (!validarInputText(camposAValidar[i].id, camposAValidar[i].getAttribute(\"regexp\"), camposAValidar[i].getAttribute(\"obligatorio\"))) {\n let span = document.createElement(\"span\");\n camposAValidar[i].style.borderColor = \"red\";\n span.innerHTML = camposAValidar[i].title;\n span.style.color = \"red\";\n camposAValidar[i].parentNode.insertBefore(span, camposAValidar[i]);\n valido = false;\n }else{\n //si esta bien quitamos el atributo style\n camposAValidar[i].removeAttribute(\"style\");\n }\n }\n }\n //devuelve si es valido o no\n return valido;\n\n}", "function validar()\r\n\t{\r\n\r\n\t\t // incio de validaci�n de espacios nulos\r\n\t\tif(document.registro.nombre.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El nombre necesario\");\r\n\t\t\tdocument.registro.nombre.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.apellido.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El apellido es necesario\");\r\n\t\t\tdocument.registro.apellido.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.ci.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El CI es necesario\");\r\n\t\t\tdocument.registro.ci.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.telfdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio es necesario\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.celular.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Celular es necesario\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio es necesario\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mail.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Mail es necesario\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.usuario.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"El nombre de usuario esta vacio\");\r\n\t\t\tdocument.registro.usuario.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.pass.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"No coloco una contrase�a\");\r\n\t\t\tdocument.registro.pass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.conpass.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Debe validar su contrase�a\");\r\n\t\t\tdocument.registro.conpass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t var RegExPattern = /(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$/;\t\t\t\r\n\t\t var errorMessage = 'Password No seguro.';\r\n\t\t if ((document.registro.pass.value.match(RegExPattern)) && (document.registro.pass.value!=\"\")) {\r\n\t\t alert('Password Seguro');\r\n\t\t } else {\r\n\t\t alert(errorMessage);\r\n\t\t document.registro.pass.focus();\r\n\t\t\treturn 0;\r\n \t\t\t} \r\n\t\t//Fin de validacion de espacios nulos \r\n\t\t//-------------------------------------------\r\n\t\t// Incio de validacion de tamanio \t\r\n\t\tif(document.registro.nombre.value.length<=3 || document.registro.nombre.value.length>=100)\r\n\t\t{\r\n\t\t\talert(\"El nombre es muy largo o muy corto\");\r\n\t\t\tdocument.registro.nombre.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.apellido.value.length<=3 || document.registro.apellido.value.length>=100)\r\n\t\t{\r\n\t\t\talert(\"El apellidoes muy largo o muy corto\");\r\n\t\t\tdocument.registro.apellido.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.ci.value.length<=5 || document.registro.ci.value.length>=10)\r\n\t\t{\r\n\t\t\talert(\"El CI invalido\");\r\n\t\t\tdocument.registro.ci.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.telfdom.value.length<7 || document.registro.telfdom.value.length>7)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio incorrecto\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.celular.value.length!=8)\r\n\t\t{\r\n\t\t\talert(\"Celular es incorrecto\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirdom.value.length<=5 || document.registro.dirdom.value.length>=200)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio incorrecto\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mail.value.length<=10 || document.registro.mail.value.length>=100 )\r\n\t\t{\r\n\t\t\talert(\"El mail es incorrecto\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.usuario.value.length<=5 || document.registro.usuario.value.length>=10 )\r\n\t\t{\r\n\t\t\talert(\"El nombre de usuario debe estar entre 6 y 10 caracteres\");\r\n\t\t\tdocument.registro.usuario.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.pass.value.length<=7 || document.registro.pass.value.length>=15 )\r\n\t\t{\r\n\t\t\talert(\"La contrase�a debe estar entre 8 y 15 caracteres\");\r\n\t\t\tdocument.registro.pass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// fin de validacion de tamanio \r\n\t\t// --------------------------------\r\n\t\t// incio validaciones especiales\r\n\t\tif(isNaN(document.registro.ci.value))\r\n\t\t{\r\n\t\t\talert(\"El carnet de indentidad tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.ci.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfdom.value))\r\n\t\t{\r\n\t\t\talert(\"El telefono de domicilio tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfofi.value)&& document.registro.telfofi.value.length!=0)\r\n\t\t{\r\n\t\t\talert(\"El telefono de oficina tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.telfofi.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.celular.value))\r\n\t\t{\r\n\t\t\talert(\"El celular tiene que ser un n�mero\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\"@\"))<3)\r\n\t\t{\r\n\t\t\talert(\"Lo siento,la cuenta de correo parece err�nea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\".com\")<5)&&(document.registro.mail.value.indexOf(\".org\")<5)&&(document.registro.mail.value.indexOf(\".gov\")<5)&&(document.registro.mail.value.indexOf(\".net\")<5)&&(document.registro.mail.value.indexOf(\".mil\")<5)&&(document.registro.mail.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece err�nea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminaci�n como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\tdocument.registro.email.focus() ;\r\n\t\t\treturn 0;\r\n\t\t} \r\n\t\tif(document.registro.pass.value !=document.registro.conpass.value )\r\n\t\t{\r\n\t\t\talert(\"Las contrase�as no coinciden\");\r\n\t\t\tdocument.registro.conpass.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.tipo.value ==0)\r\n\t\t{\r\n\t\t\talert(\"Debes escoger que tipo de usuario eres\");\r\n\t\t\tdocument.registro.tipo.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.tipo.value >=3 && document.registro.ingreso.value ==0)\r\n\t\t{\r\n\t\t\talert(\"Debes escoger el a�o que entraste a la camara\");\r\n\t\t\tdocument.registro.ingreso.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// fin validaciones especiales\r\n\t\tdocument.registro.submit();\r\n\t}", "function validarCedula(elemento)\n{ \n if(elemento.value.length > 0 && elemento.value.length < 11){\n var codigA = elemento.value.charCodeAt(elemento.value.length-1)\n if((codigA >= 48 && codigA <= 57)){\n }else {\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n }\n }else{\n elemento.value = elemento.value.substring(0, elemento.value.length-1)\n }\n if (elemento.value.length == 10) {\n if((elemento.value.substring(0,2)>=1)||(elemento.value.substring(0,2)<=24)){\n //Suma impares\n var pares = 0;\n var numero =0;\n for (var i = 0; i< 4; i++) {\n numero = elemento.value.substring(((i*2)+1),(i*2)+2);\n numero = (numero * 1);\n if( numero > 9 ){ var numero = (numero - 9); }\n pares = pares + numero; \n }\n var imp=0;\n numero = 0\n for (var i = 0; i< 5; i++) {\n var numero = elemento.value.substring((i*2),((i*2)+1));\n var numero = (numero * 2);\n if( numero > 9 ){ var numero = (numero - 9); }\n imp = imp + numero; \n }\n var sum = pares + imp;\n aux = (''+sum)[0];\n var di = aux.substring(0,1);\n di++;\n di = di *10;\n numero = (di - sum);\n if (numero == (elemento.value.substring(9,10))) {\n document.getElementById('mensaje1').innerHTML='' ; \n elemento.style.border = '2px greenyellow solid';\n return true;\n }else{\n document.getElementById('mensaje1').innerHTML = 'Cedula es Incorrecta'; \n elemento.style.border = '2px red solid';\n return false;\n }\n }\n }else{\n document.getElementById('mensaje1').innerHTML = 'Cedula es Incorrecta'; \n elemento.style.border = '2px red solid';\n return false;\n }\n}", "function curpValidaEdit(curp) {\n var re = /^([A-Z][AEIOUX][A-Z]{2}\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])[HM](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\\d])(\\d)$/,\n validado = curp.match(re);\n \n if (!validado) //Coincide con el formato general?\n return false;\n \n //Validar que coincida el dígito verificador\n function digitoVerificador(curp17) {\n //Fuente https://consultas.curp.gob.mx/CurpSP/\n var diccionario = \"0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZ\",\n lngSuma = 0.0,\n lngDigito = 0.0;\n for(var i=0; i<17; i++)\n lngSuma = lngSuma + diccionario.indexOf(curp17.charAt(i)) * (18 - i);\n lngDigito = 10 - lngSuma % 10;\n if (lngDigito == 10) return 0;\n return lngDigito;\n }\n \n if (validado[2] != digitoVerificador(validado[1])) \n return false;\n \n return true; //Validado\n}", "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formPaciente.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nome.value)).toLowerCase());\n document.formPaciente.nome.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nome.value).toLowerCase());\n }\n\n if (!document.formPaciente.sexo[0].checked && !document.formPaciente.sexo[1].checked) {\n mensagem = mensagem + \"\\n- Sexo\";\n }\n\n if (trim(document.formPaciente.dataNascimento.value) == \"\") {\n mensagem = mensagem + \"\\n- Data de Nascimento\";\n }\n\n // Nome do pai sem acentos e/ou cedilhas\n if (trim(document.formPaciente.nomePai.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomePai.value)).toLowerCase());\n document.formPaciente.nomePai.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomePai.value).toLowerCase());\n }\n\n // Nome da mae sem acentos e/ou cedilhas\n if (trim(document.formPaciente.nomeMae.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.nomeMae.value)).toLowerCase());\n document.formPaciente.nomeMae.value = primeirasLetrasMaiusculas(trim(document.formPaciente.nomeMae.value).toLowerCase());\n }\n\n if (trim(document.formPaciente.logradouro.value) == \"\") {\n mensagem = mensagem + \"\\n- Logradouro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.logradouro.value)).toLowerCase());\n document.formPaciente.logradouro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.logradouro.value).toLowerCase());\n }\n\n // Numero sem acentos e/ou cedilhas\n if (trim(document.formPaciente.numero.value) != \"\") {\n document.formPaciente.numero.value = retirarAcentos(trim(document.formPaciente.numero.value)).toUpperCase();\n }\n\n /* Numero deixa de ser obrigatorio\n if (trim(document.formPaciente.numero.value) == \"\") {\n mensagem = mensagem + \"\\n- Numero\";\n }\n */\n\n if (trim(document.formPaciente.bairro.value) == \"\") {\n mensagem = mensagem + \"\\n- Bairro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.bairro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.bairro.value)).toLowerCase());\n document.formPaciente.bairro.value = primeirasLetrasMaiusculas(trim(document.formPaciente.bairro.value).toLowerCase());\n }\n \n // Complemento sem acentos e/ou cedilhas\n if (trim(document.formPaciente.complemento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.complemento.value = retirarAcentos(trim(document.formPaciente.complemento.value)).toUpperCase();\n document.formPaciente.complemento.value = trim(document.formPaciente.complemento.value).toUpperCase();\n }\n\n if (trim(document.formPaciente.cidade.value) == \"\") {\n mensagem = mensagem + \"\\n- Cidade\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.cidade.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.cidade.value)).toLowerCase());\n document.formPaciente.cidade.value = primeirasLetrasMaiusculas(trim(document.formPaciente.cidade.value).toLowerCase());\n }\n\n if (trim(document.formPaciente.estado.value) == \"\") {\n mensagem = mensagem + \"\\n- Estado\";\n }\n\n if (trim(document.formPaciente.indicacao.value) == \"\") {\n mensagem = mensagem + \"\\n- Indicacao\";\n }\n\n if (document.formPaciente.indicacao.value == \"selected\") {\n if (trim(document.formPaciente.indicacaoOutra.value) == \"\") {\n mensagem = mensagem + \"\\n- Indicacao - Outra\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formPaciente.indicacaoOutra.value)).toLowerCase());\n document.formPaciente.indicacaoOutra.value = primeirasLetrasMaiusculas(trim(document.formPaciente.indicacaoOutra.value).toLowerCase());\n }\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n goFocus('nome');\n return false;\n }\n}", "function validarFormulario(){\n var txtNombre = document.getElementById('provNombre').value;\n var txtRut = document.getElementById('provRut').value;\n //Test campo obligatorio\n if(txtNombre == null || txtNombre.length == 0 || /^\\s+$/.test(txtNombre)){\n alert('ERROR: El campo nombre no debe ir vacío o con espacios en blanco');\n document.getElementById('provNombre').focus();\n return false;\n }\n if(txtRut == null || txtRut.length == 0 || /^\\s+$/.test(txtRut)){\n alert('ERROR: El campo Rut no debe ir vacío o con espacios en blanco');\n document.getElementById('provRut').focus();\n return false;\n } \n return true;\n }", "function validarFormulario(nombre, apellidos, telefono, fecha) {\n\n var expresion_regular_nombre = /^[A-z]+$/; //Caulquier letra desde la A mayuscula a la z minuscula\n var expresion_regular_apellidos = /^[A-z]+$/; //Caulquier letra desde la A mayuscula a la z minuscula\n var expresion_regular_telefono = /^[0-9]{2,3}-? ?[0-9]{6,7}$/; // 3 primeros numeros - opcional o espacio 6 numeros mas\n var expresion_regular_fecha = /^(?:(?:(?:0?[1-9]|1\\d|2[0-8])[/](?:0?[1-9]|1[0-2])|(?:29|30)[/](?:0?[13-9]|1[0-2])|31[/](?:0?[13578]|1[02]))[/](?:0{2,3}[1-9]|0{1,2}[1-9]\\d|0?[1-9]\\d{2}|[1-9]\\d{3})|29[/]0?2[/](?:\\d{1,2}(?:0[48]|[2468][048]|[13579][26])|(?:0?[48]|[13579][26]|[2468][048])00))$/;\n\n /*\n Entero: ^(?:\\+|-)?\\d+$\n Correo: /[\\w-\\.]{3,}@([\\w-]{2,}\\.)*([\\w-]{2,}\\.)[\\w-]{2,4}/\n URL: ^(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)( [a-zA-Z0-9\\-\\.\\?\\,\\'\\/\\\\\\+&%\\$#_]*)?$\n Contraseña segura: (?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$\n (Entre 8 y 10 caracteres, por lo menos un digito y un alfanumérico, y no puede contener caracteres espaciales)\n Fecha: ^\\d{1,2}\\/\\d{1,2}\\/\\d{2,4}$\n (Por ejemplo 01/01/2007)\n Hora: ^(0[1-9]|1\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$\n (Por ejemplo 10:45:23)\n Numero de Telefono: ^[0-9]{2,3}-? ?[0-9]{6,7}$\n Codigo Postal: ^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$\n */\n\n //var expresion_regular_email = /^(.+\\@.+\\..+)$/;\n\n\n // Usaremos el método \"test\" de las expresiones regulares:\n if (expresion_regular_nombre.test(nombre) == false) {\n return false;\n }\n if (expresion_regular_apellidos.test(apellidos) == false) {\n return false;\n }\n if (expresion_regular_telefono.test(telefono) == false) {\n return false;\n }\n if (expresion_regular_fecha.test(fecha) == false) {\n return false;\n }\n return true;\n}", "validation() {\r\n let verifieNom = document.getElementById('name');\r\n let verifiePrenom = document.getElementById('firstname');\r\n let lack = document.getElementById('lack_name');\r\n let encart = document.getElementById('info_station');\r\n let regex = /^[a-zA-ZéèîïÉÈÎÏ][a-zéèêçîï]+([-'\\s][a-zA-ZéèîïÉÈÎÏ][a-zéèêçîï]+)?/;\r\n this.stocker.addEventListener('click', (e) => {\r\n e.preventDefault();\r\n if (verifieNom.validity.valueMissing || verifiePrenom.validity.valueMissing) {\r\n e.preventDefault();\r\n lack.style.display = 'block';\r\n lack.textContent = 'veuillez remplir les champs';\r\n lack.style.backgroundColor = '#FF0000';\r\n lack.style.color = '#ffffff';\r\n this.canvas.style.visibility = 'hidden';\r\n this.validCanvas.style.visibility = 'hidden';\r\n }else if (regex.test(verifieNom.value) == false) {\r\n e.preventDefault();\r\n lack.style.display = 'block';\r\n lack.textContent = 'Format invalide';\r\n lack.style.backgroundColor = '#FF0000';\r\n lack.style.color = '#ffffff';\r\n this.canvas.style.visibility = 'hidden';\r\n this.validCanvas.style.visibility = 'hidden';\r\n }else if (regex.test(verifiePrenom.value) == false) {\r\n e.preventDefault();\r\n lack.style.display = 'block';\r\n lack.textContent = 'Format invalide';\r\n lack.style.backgroundColor = '#FF0000';\r\n lack.style.color = '#ffffff';\r\n this.canvas.style.visibility = 'hidden';\r\n this.validCanvas.style.visibility = 'hidden';\r\n }else { \r\n lack.style.display = 'none';\r\n encart.style.display = 'none';\r\n this.info_carte.innerHTML = 'Signez et validez votre réservation';\r\n this.info_carte.style.backgroundColor = \"#FFA500\";\r\n this.canvas.style.visibility = 'visible';\r\n this.validCanvas.style.visibility = 'visible';\r\n this.clearCanvas();\r\n }\r\n });\r\n }", "function validarDados() {\n var mensagem = \"Preencha corretamente os seguintes campos:\";\n\n if (trim(document.formFuncionario.nome.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.nome.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.nome.value)).toLowerCase());\n document.formFuncionario.nome.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.nome.value).toLowerCase());\n }\n\n if (!document.formFuncionario.sexo[0].checked && !document.formFuncionario.sexo[1].checked) {\n mensagem = mensagem + \"\\n- Sexo\";\n }\n\n if (trim(document.formFuncionario.dataNascimento.value) == \"\") {\n mensagem = mensagem + \"\\n- Data de Nascimento\";\n }\n\n if (trim(document.formFuncionario.cargo.value) == \"\") {\n mensagem = mensagem + \"\\n- Cargo\";\n }\n\n if (trim(document.formFuncionario.cpf.value) == \"\") {\n mensagem = mensagem + \"\\n- CPF\";\n }\n\n if (trim(document.formFuncionario.logradouro.value) == \"\") {\n mensagem = mensagem + \"\\n- Logradouro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.logradouro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.logradouro.value)).toLowerCase());\n document.formFuncionario.logradouro.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.logradouro.value).toLowerCase());\n }\n\n // Numero sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.numero.value) != \"\") {\n document.formFuncionario.numero.value = retirarAcentos(trim(document.formFuncionario.numero.value)).toUpperCase();\n }\n\n /* Numero deixa de ser obrigatorio\n if (trim(document.formFuncionario.numero.value) == \"\") {\n mensagem = mensagem + \"\\n- Numero\";\n }\n */\n\n if (trim(document.formFuncionario.bairro.value) == \"\") {\n mensagem = mensagem + \"\\n- Bairro\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.bairro.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.bairro.value)).toLowerCase());\n document.formFuncionario.bairro.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.bairro.value).toLowerCase());\n }\n \n // Complemento sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.complemento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.complemento.value = retirarAcentos(trim(document.formFuncionario.complemento.value)).toUpperCase();\n document.formFuncionario.complemento.value = trim(document.formFuncionario.complemento.value).toUpperCase();\n }\n\n if (trim(document.formFuncionario.cidade.value) == \"\") {\n mensagem = mensagem + \"\\n- Cidade\";\n }\n else {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.cidade.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.cidade.value)).toLowerCase());\n document.formFuncionario.cidade.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.cidade.value).toLowerCase());\n }\n\n if (trim(document.formFuncionario.estado.value) == \"\") {\n mensagem = mensagem + \"\\n- Estado\";\n }\n\n if (trim(document.formFuncionario.nomeDeUsuario.value) == \"\") {\n mensagem = mensagem + \"\\n- Nome de usuario\";\n }\n else {\n // remove 1 espaco em branco que existir\n document.formFuncionario.nomeDeUsuario.value = document.formFuncionario.nomeDeUsuario.value.replace(\" \", \"\");\n }\n\n if ((trim(document.formFuncionario.senha.value) == \"\") && (trim(document.formFuncionario.senha2.value) == \"\")) {\n mensagem = mensagem + \"\\n- Senha\";\n }\n else {\n // remove 1 espaco em branco que existir\n document.formFuncionario.senha.value = document.formFuncionario.senha.value.replace(\" \", \"\");\n }\n\n if (document.formFuncionario.senha.value != document.formFuncionario.senha2.value) {\n mensagem = mensagem + \"\\n- As senhas digitadas nao sao iguais!\";\n }\n\n // Frase \"Esqueci Minha Senha\" sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.fraseEsqueciMinhaSenha.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.fraseEsqueciMinhaSenha.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.fraseEsqueciMinhaSenha.value)).toLowerCase());\n document.formFuncionario.fraseEsqueciMinhaSenha.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.fraseEsqueciMinhaSenha.value).toLowerCase());\n }\n\n if (!validarCheckBoxes(document.formFuncionario.grupoAcessoAdministrador.name)) {\n mensagem = mensagem + \"\\n- Grupo de acesso\";\n }\n\n if (document.formFuncionario.cargo.value == \"Dentista-Tratamento\") {\n if (trim(document.formFuncionario.comissaoTratamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(%)\";\n }\n else {\n document.formFuncionario.comissaoTratamento.value = document.formFuncionario.comissaoTratamento.value.replace(\",\", \".\");\n }\n }\n\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento\") {\n if (trim(document.formFuncionario.comissaoOrcamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(R$)\";\n }\n else {\n document.formFuncionario.comissaoOrcamento.value = document.formFuncionario.comissaoOrcamento.value.replace(\",\", \".\");\n }\n }\n\n if (document.formFuncionario.cargo.value == \"Dentista-Orcamento-Tratamento\") {\n if (trim(document.formFuncionario.comissaoOrcamentoTratamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(R$)\";\n }\n else {\n document.formFuncionario.comissaoOrcamentoTratamento.value = document.formFuncionario.comissaoOrcamentoTratamento.value.replace(\",\", \".\");\n }\n if (trim(document.formFuncionario.comissaoTratamentoOrcamento.value) == \"\") {\n mensagem = mensagem + \"\\n- Comissao(%)\";\n }\n else {\n document.formFuncionario.comissaoTratamentoOrcamento.value = document.formFuncionario.comissaoTratamentoOrcamento.value.replace(\",\", \".\");\n }\n }\n\n // Especialidade com primeiras letras maiusculas e sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.especialidadeTratamento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.especialidadeTratamento.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.especialidadeTratamento.value)).toLowerCase());\n document.formFuncionario.especialidadeTratamento.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.especialidadeTratamento.value).toLowerCase());\n }\n\n // Especialidade com primeiras letras maiusculas e sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.especialidadeOrcamento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.especialidadeOrcamento.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.especialidadeOrcamento.value)).toLowerCase());\n document.formFuncionario.especialidadeOrcamento.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.especialidadeOrcamento.value).toLowerCase());\n }\n\n // Especialidade com primeiras letras maiusculas e sem acentos e/ou cedilhas\n if (trim(document.formFuncionario.especialidadeOrcamentoTratamento.value) != \"\") {\n // Linha abaixo comentada para manter acentos\n //document.formFuncionario.especialidadeOrcamentoTratamento.value = primeirasLetrasMaiusculas(retirarAcentos(trim(document.formFuncionario.especialidadeOrcamentoTratamento.value)).toLowerCase());\n document.formFuncionario.especialidadeOrcamentoTratamento.value = primeirasLetrasMaiusculas(trim(document.formFuncionario.especialidadeOrcamentoTratamento.value).toLowerCase());\n }\n\n if (mensagem == \"Preencha corretamente os seguintes campos:\") {\n return true;\n }\n else {\n alert(mensagem);\n goFocus('nome');\n return false;\n }\n}", "function validar_add_despliegue_nombre(){\r\n\r\n\tif(document.getElementById('txt_despliegue').value==''){\r\n\t\tmostrarDiv('error_despliegue');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_programada').value=='' || document.getElementById('txt_fecha_programada').value=='0000-00-00'){\r\n\t\tmostrarDiv('error_fecha_programada');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_produccion').value=='' || document.getElementById('txt_fecha_produccion').value=='0000-00-00'){\r\n\t\tmostrarDiv('error_fecha_produccion');\r\n\t\treturn false;\r\n\t}\r\n\tdocument.getElementById('frm_add_despliegue').action='?mod=despliegues&niv=1&task=saveAdd';\r\n\tdocument.getElementById('frm_add_despliegue').submit();\r\n}", "validaFormulario() {\n //Se comprueba el nombre\n var x = document.forms[\"formularioProyecto\"][\"archivoPlanProyecto\"].value;\n if (x === '') {\n alert(\"Cargue un plan de proyecto\");\n return false;\n }\n\n //Se comprueba la fecha de comienzo\n //Si se introduce una fecha que no existe el formulario devuelve '' también\n x = document.forms[\"formularioProyecto\"][\"fechaComienzo\"].value;\n if (x === '') {\n alert(\"Introduzca una fecha válida\");\n return false;\n }\n //Se comprueba que la fecha sea posterior o igual a la actual\n var today = new Date();\n var fechaIntroducida = new Date(x);\n if(fechaIntroducida<=today){\n alert(\"Introduzca una posterior a la actual\");\n return false;\n }\n\n //Se comprueba el presupuesto\n x = document.forms[\"formularioProyecto\"][\"presupuesto\"].value;\n //console.log(\"Ahi va: \" + Number(x));\n if (x === '') {\n alert(\"Introduzca un presupuesto\");\n return false;\n } else if (isNaN(Number(x))) {\n alert(\"Introduzca un presupuesto válido\");\n return false;\n } else if (x < 1) {\n alert(\"Introduzca un presupuesto mayor que 0\");\n return false;\n }\n\n return true;\n }", "validarCadena(propiedad, valor){\n if(!valor) return console.warn(`${propiedad} ${valor} está vacío`);\n\n if(typeof valor !== \"string\") return console.error(`${propiedad} ${valor} ingresado, NO es una cadena de texto`);\n\n return true;\n }", "function edad(valor) {\r\n var ano = valor.substr(0, 4);\r\n var mes = valor.substr(5, 2);\r\n var dia = valor.substr(8, 2);\r\n\r\n var fecha = new Date();\r\n var ano_actual = fecha.getFullYear();\r\n var mes_actual = fecha.getMonth() + 1;\r\n var dia_actual = fecha.getDate();\r\n\t\r\n var ed = ano_actual - ano;\r\n var m = mes_actual - mes;\r\n var d = dia_actual - dia;\r\n\r\n if (ano == \"\" || ed>80) {\r\n return false;\r\n } else {\r\n if (ed >= 18) {\r\n return true;\r\n }\r\n if (ed == 17 && m >= 0 && d >= 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n}", "function validamaquna()\n{\n\nfunction fechacantidadservicio(z){\t\nvar id=document.getElementById('id').value;\ntecla=(document.all) ? z.keyCode : z.which;\nif(tecla==13){\n if(fecha!=''){\n document.fmaquina.id.className=\"correcto \";\t\t \n document.fmaquina.contador.focus(); \t\n}\n \nif(fecha==\"\") \n {\n alert(\"Valor invalido\"); \n document.trabajo.id.value=\"\";\n }\n \n}\n}\n\n\n}", "function validanombreEmpresa(){\r\n\t\tvar nombreem = document.getElementById('nombreempresa');\r\n\t\tlimpiarError(nombreem);\r\n\t\tif (nombreem.value ==''){\r\n\t\t\talert ('Completa el campo nombre');\r\n\t\t\terror(nombreem);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(!isNaN(nombreem.value)){\r\n\t\t\talert('Formato del nombre debe ser letras');\r\n\t\t\terror(nombreem);\r\n\t\t\treturn false;\t\r\n\t\t}return true\r\n\t}", "function Valida_Rut(Objeto)\n\n{\n\n var tmpstr = \"\";\n\n var intlargo = Objeto.value;\n\n if (intlargo.length > 0)\n\n {\n\n crut = Objeto.value;\n\n largo = crut.length;\n\n if (largo < 2)\n\n {\n\n sweetAlert(\"ERROR\", \"RUN INVALIDO!\", \"error\");\n\n //Objeto.focus();\n\n return false;\n\n }\n\n for (i = 0; i < crut.length; i++)\n if (crut.charAt(i) !== ' ' && crut.charAt(i) !== '.' && crut.charAt(i) !== '-')\n\n {\n\n tmpstr = tmpstr + crut.charAt(i);\n\n }\n\n rut = tmpstr;\n\n crut = tmpstr;\n\n largo = crut.length;\n\n\n\n if (largo > 2)\n rut = crut.substring(0, largo - 1);\n\n else\n rut = crut.charAt(0);\n\n\n\n dv = crut.charAt(largo - 1);\n\n\n\n if (rut === null || dv === null)\n return 0;\n\n\n\n var dvr = '0';\n\n suma = 0;\n\n mul = 2;\n\n\n\n for (i = rut.length - 1; i >= 0; i--)\n\n {\n\n suma = suma + rut.charAt(i) * mul;\n\n if (mul === 7) {\n\n mul = 2;\n\n } else {\n\n mul++;\n }\n\n }\n\n\n\n res = suma % 11;\n\n if (res === 1) {\n dvr = 'k';\n\n } else if (res === 0) {\n dvr = '0';\n\n } else {\n\n {\n\n dvi = 11 - res;\n\n dvr = dvi + \"\";\n\n }\n }\n\n\n\n if (dvr !== dv.toLowerCase())\n\n {\n\n\n sweetAlert(\"ERROR!!!\", \"RUN INCORRECTO!\", \"error\");\n }\n //Objeto.focus();\n\n return false;\n\n }\n\n\n\n // Objeto.focus();\n\n return true;\n\n}", "function validarDNI() {\r\n var result = true;\r\n var dni = document.getElementById('nif');\r\n\r\n if (dni.value == '') {\r\n result = false;\r\n dni.className = 'error';\r\n dni.focus();\r\n document.getElementById('errores').innerHTML = 'el DNI no puede estar en blanco';\r\n } else {\r\n var condicion = /\\d{8}-[A-Z]/;\r\n\r\n if (!condicion.test(dni.value)) {\r\n result = false;\r\n dni.className = 'error';\r\n dni.focus();\r\n document.getElementById('errores').innerHTML = 'el DNI indicado tiene una estructura incorrecta';\r\n } else {\r\n var numeros = dni.value.substring(0, 8);\r\n var letra = dni.value.substring(9, 10)\r\n\r\n if (!comprobarLetraDNI(parseInt(numeros), letra)) {\r\n result = false;\r\n dni.className = 'error';\r\n dni.focus();\r\n document.getElementById('errores').innerHTML = 'la letra del DNI no corresponde con ese numero';\r\n } else {\r\n dni.className = '';\r\n document.getElementById('errores').innerHTML = '';\r\n }\r\n }\r\n }\r\n return result;\r\n}", "function isValidCodeForm()\n {\n if($scope.codiceVerifica.$invalid)\n {\n $ionicPopup.alert({\n title: 'ListenCheck',\n template: \"Il codice di verifica deve essere di 6 cifre\"\n });\n return false;\n }\n else return true;\n }", "function validaFechaExistente(fecha, idMsg) {\n\t$(\"#\" + idMsg).text(\"\");\n\tif (fecha.length > 0 && fecha.length < 10) {\n\t\t$(\"#\" + idMsg).text(\"- Debe ingresar la fecha con formato dd/mm/aaaa.\");\n\t\tvalidacionesOk = false;\n\t\treturn false;\n\t}\n\tvar datePat = /^(\\d{1,2})(\\/|-)(\\d{1,2})(\\/|-)(\\d{4})$/;\n\tvar fechaCompleta = fecha.match(datePat);\n\tif (fechaCompleta == null) {\n\t\treturn false;\n\t}\n\tvar dia = fechaCompleta[1];\n\tvar mes = fechaCompleta[3];\n\tvar anio = fechaCompleta[5];\n\tif (dia < 1 || dia > 31) {\n\t\t$(\"#\" + idMsg).text(\"- El valor del día debe estar comprendido entre 1 y 31.\");\n\t\tvalidacionesOk = false;\n\t\treturn false;\n\t}\n\tif (mes < 1 || mes > 12) {\n\t\t$(\"#\" + idMsg).text(\"- El valor del mes debe estar comprendido entre 1 y 12.\");\n\t\tvalidacionesOk = false;\n\t\treturn false;\n\t}\n\tif ((mes == 4 || mes == 6 || mes == 9 || mes == 11) && dia == 31) {\n\t\t$(\"#\" + idMsg).text(\"- El mes \" + mes + \" no tiene 31 días!\");\n\t\tvalidacionesOk = false;\n\t\treturn false;\n\t}\nif (mes == 2) { // bisiesto\n\tvar bisiesto = (anio % 4 == 0 && (anio % 100 != 0 || anio % 400 == 0));\n\tif (dia > 29 || (dia == 29 && !bisiesto)) {\n\t\t$(\"#\" + idMsg).text(\"- Febrero del \" + anio + \" no contiene \" + dia + \" dias!\");\n\t\tvalidacionesOk = false;\n\t\treturn false;\n\t}\n}\n}", "function validacionfecFinValifecInicVali(){\n\t\t\tif ((get('calGuiasFrm.fecFinVali','T').toString()==\"\") || \n\t\t\t(get('calGuiasFrm.fecInicVali','T').toString()==\"\"))\n\t\t\t\t//en este caso no hay alguno de los valores introducidos y no se puede realizar la verificaci?n.\n\t\t\t\treturn 'OK';\n\t\t\t\n\t\t\t\tvar errorLevel = EsFechaValida(get('calGuiasFrm.fecInicVali','T') ,get('calGuiasFrm.fecFinVali','T') , \"calGuiasFrm\", \"N\");\n\t\t\t\t\n\t\t\t\n\t\t\tif ( errorLevel == 3){\n\t\t\t return GestionarMensaje(\"CalGuias.fecFinValifecInicVali.message\");\n\t\t\t}else\n\t\t\t return 'OK';\n\t\t}", "function valida_rede_komerci_transparente() { \r\n\r\n \t// DADOS ENDERECO\r\n var portador_nome = $('#rede_portador_nome').val();\r\n if(portador_nome == \"\"){ \r\n\t\t$('#rede_portador_nome').focus();\r\n\t\t$('#rede_portador_nome').css({\"border\":\"#F00 solid 1px\"});\r\n\t\treturn 'Por favor preencha seu o Nome impresso no cartão!';\r\n }\r\n\r\n var portador_bandeira = $('#rede_portador_bandeira').val();\r\n if(portador_bandeira == \"\"){ \r\n\t\t$('#rede_portador_bandeira').focus();\r\n\t\t$('#rede_portador_bandeira').css({\"border\":\"#F00 solid 1px\"});\r\n\t\treturn 'Por favor escolha a Bandeira do cartão!';\r\n }\r\n\r\n var portador_parcelas = $('#rede_portador_parcelas').val();\r\n if(portador_parcelas == \"\"){ \r\n\t\t$('#rede_portador_parcelas').focus();\r\n\t\t$('#rede_portador_parcelas').css({\"border\":\"#F00 solid 1px\"});\r\n\t\treturn 'Por favor escolha o Parcelamento!';\r\n }\r\n\r\n var portador_numero_cartao = $('#rede_portador_numero_cartao').val();\r\n if(portador_numero_cartao == \"\"){\r\n\t\t$('#rede_portador_numero_cartao').focus();\r\n\t\t$('#rede_portador_numero_cartao').css({\"border\":\"#F00 solid 1px\"});\r\n\t\treturn 'Por favor preencha o Número do cartão!';\r\n }\r\n\r\n var portador_cvc = $('#rede_portador_cvc').val();\r\n if(portador_cvc == \"\"){\r\n\t\t$('#rede_portador_cvc').focus();\r\n\t\t$('#rede_portador_cvc').css({\"border\":\"#F00 solid 1px\"});\r\n\t\treturn 'Por favor preencha o CVC 3/4 Últimos Dígitos!';\r\n }\r\n\r\n var portador_validade = $('#rede_portador_validade').val();\r\n if(portador_validade == \"\"){ \r\n\t\t$('#rede_portador_validade').focus();\r\n\t\t$('#rede_portador_validade').css({\"border\":\"#F00 solid 1px\"});\r\n\t\treturn 'Por favor preencha a Validade do cartão!';\r\n }\r\n\r\n return 1;\r\n\r\n}", "function validaClave() { /*Valida la clave*/\n var valor = document.getElementById(\"clave\").value;\n\n if (!(/^\\d{1}[a-zA-Z]{3}\\W{1}\\d{1}$/.test(valor))) {\n alert(\"La clave no es correcta. Ejemplo:7aHf$8\");\n document.getElementById(\"clave\").value = \"\"; /*Deja el Campo vacio*/\n document.getElementById(\"envio\").disabled = true; /*Deshabilita el boton envio*/\n return false;\n }\n else {\n\n return true;\n }\n}", "function valida_envia() {\n\t\t\t\n\t//nombre del concurso\n\tif(document.addConcurso.nombreConcurso.value.length ==' ' || !/([a-zA-Z0-9]\\w*){5,20}/.test(document.addConcurso.nombreConcurso.value) || (/\\<|\\>|\\\"|\\?|\\\\|\\\\||\\/|\\*|\\;/.test(document.addConcurso.nombreConcurso.value))){\n\t\tmuestraEtiqueta('adv_nombre');\n\t\t\n\t}\n\telse{\n\t\tocultaEtiqueta('adv_nombre');\n\t}\n\t\n\t\n\t//hashtag twitter\n\tif(document.addConcurso.hashTwitter.value.length == 0 || !/#{1}([a-zA-Z0-9_]\\w*){5,15}/.test(document.addConcurso.hashTwitter.value)){\n\t\tmuestraEtiqueta('adv_hashtag');\n\t}\n\telse{\n\t\tocultaEtiqueta('adv_hashtag');\n\t}\n\n\t//radios dificultad\n\tvar opciones = document.getElementsByName(\"dificultad\");\n\tvar seleccionado = false;\n\tfor(var i=0; i<opciones.length; i++) {\t\n\t if(opciones[i].checked) {\n\t seleccionado = true;\n\t ocultaEtiqueta('adv_radio');\n\t break;\n\t }\n\t}\n \n\tif(!seleccionado) {\n\t muestraEtiqueta('adv_radio');\n\t}\n\n\n\t//select categoria\n\tif (document.getElementById(\"categoria\").selectedIndex == 0 ) {\n\t\tmuestraEtiqueta(\"adv_categoria\");\n\t} \n\telse\n\t ocultaEtiqueta(\"adv_categoria\");\n\n\n\n\n\t//CALENDARIOS\n\n\t\n\t// fecha de inicio\n\tif ($(\"#datepicker\").datepicker(\"getDate\") == null) {\n\t\tmuestraEtiqueta('adv_fechaInicio');\n\t} else {\n\t\tocultaEtiqueta('adv_fechaInicio');\n\t\tvar fechaArr = $(\"#datepicker\").val().split('-');\n\t\tvar dia = fechaArr[0];\n\t\tvar mes = fechaArr[1] - 1;//mes = 0 -->enero\n\t\tvar anio = fechaArr[2];\n\t\tvar fecha = new Date();\n\t\tfecha.setFullYear(anio, mes, dia);\n\t\tvar fechaActual = new Date();\n\n\t\tvar milisegFecha1 = fecha.getTime();\n\t\tvar milisegFecha2 = fechaActual.getTime();\n\t\tvar difMiliseg = milisegFecha1 - milisegFecha2;\n\t\tvar numero_dias = (((difMiliseg / 1000) / 60) / 60) / 24;\n\t\t\n\t\t//si numero_dias < 0 --> se selecciono una fecha anterior como inicio\n\t\t//si numero_dias = 0 --> se selecciono la fecha actual como inicio\n\t\t//si numero_dias > 0 --> se selecciono una fecha posterior como inicio\t\n\t\tconsole.log(numero_dias);\n\t\t if (numero_dias>0) {\n\t\t\tocultaEtiqueta(\"adv_fechaInicioMal\");\n\t\t} else {\n\t\t\tmuestraEtiqueta(\"adv_fechaInicioMal\");\n\t\t}\n\t}\t\n\n\t\n\n\t// fecha de fin \t\n\tif ($(\"#datepicker2\").datepicker(\"getDate\") == null) {\n\t\tmuestraEtiqueta('adv_fechaFin');\n\n\t} else {\n\t\t\n\t\tocultaEtiqueta('adv_fechaFin');\n\t\t\n\t\tvar fechaArr = $(\"#datepicker2\").val().split('-');\n\t\tvar dia = fechaArr[0];\n\t\tvar mes = fechaArr[1]-1;//mes = 0 -->enero\n\t\tvar anio = fechaArr[2];\n\t\tvar fecha = new Date();\n\t\tfecha.setFullYear(anio, mes, dia);\n\t\tvar fechaActual = new Date();\n\n\t\tvar milisegFecha1 = fecha.getTime();\n\t\tvar milisegFecha2 = fechaActual.getTime();\n\t\tvar difMiliseg = milisegFecha1 - milisegFecha2;\n\t\tvar numero_dias = (((difMiliseg / 1000) / 60) / 60) / 24;\n\t\t\n\t\t//si numero_dias < 0 --> se selecciono una fecha anterior como fin\n\t\t//si numero_dias = 0 --> se selecciono la fecha actual como fin\n\t\t//si numero_dias > 0 --> se selecciono una fecha posterior como fin\t\n\t\tconsole.log(numero_dias);\n\t\t if (numero_dias>0) {\n\t\t\tocultaEtiqueta(\"adv_fechaFinMal\");\n\t\t\t\n\t\t} else {\n\t\t\tmuestraEtiqueta(\"adv_fechaFinMal\");\n\t\t}\n\t}\n\n\t//Asignar fecha de creacion\n\t\n\tdocument.getElementById('datepicker3').value = new Date();\n\t\n\t\n\t\n\t\n\t//input file\n\t\n\tvar extensiones_permitidas = new Array(\".gif\", \".jpg\", \".png\", \".bmp\",\".dib\",\".tga\",\".tif\",\".tiff\",\".pcx\",\".pic\",\".emf\",\".ico\",\".raw\",\".xcf\",\".eps\",\".pcx\",\".wmp\",\".jp2\");\n\n//validar todos los campos de imagen generados\n\t\n\tvar inputsImage = document.getElementsByTagName(\"input\");\n\tvar extension;\n\tvar imgPermitida = false;\n\tvar numero_para_etiqueta = 0;\n\tvar cont = 1;\n\t\tfor(elemento in inputsImage){\n\t\t\tif(inputsImage[elemento].type == \"file\" && inputsImage[elemento].value != 0){\n\t\t\t\tnumero_para_etiqueta =inputsImage[elemento].id.substring(8,inputsImage[elemento].length);\n\t\t\t\textension = (inputsImage[elemento].value.substring(inputsImage[elemento].value.lastIndexOf(\".\"))).toLowerCase();\n\t\t\t\tfor(var i=0; i<extensiones_permitidas.length; i++){\n\t\t\t\t\tif(extensiones_permitidas[i] == extension){\n\t\t\t\t\t\timgPermitida = true;\n\t\t\t\t\t\tcont++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(imgPermitida == false){\n\t\t\t\t\tmuestraEtiqueta(\"adv_imagen\"+numero_para_etiqueta);\n\t\t\t\t\treturn 0;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\timgPermitida = false;\n\t\t\t\t\tocultaEtiqueta(\"adv_imagen\"+numero_para_etiqueta);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\n\t//validar editor\n\t\tdocument.getElementById('guardarRT').click();\n\t\tif (document.RTEDemo.rte1.value.length == 0) {\n\t\t\tmuestraEtiqueta(\"adv_rteEditor\");\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tocultaEtiqueta(\"adv_rteEditor\");\n\t\t\t/*Para guardarlo en un input oculto para el submit*/\n\t\t\tdocument.getElementById(\"valorRTE\").value = document.RTEDemo.rte1.value;\n\t\t\tdocument.addConcurso.submit();\n\t\t}\n\n\n}", "function validamos(){\r\n\r\n documento = $(\"#numdoc\").val();\r\n pnombre = $(\"#pnombre\").val();\r\n papellido = $(\"#papellido\").val();\r\n direccion = $(\"#direccion\").val();\r\n correo = $(\"#correo\").val();\r\n celular = $(\"#celular\").val();\r\n esp = $(\"#esp\").val();\r\n\r\n\r\n if (documento.length <2) {\r\n alert(\"Ingrese un numero documento por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (pnombre.length <2) {\r\n alert(\"Ingrese un numero Nombre por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (papellido.length <2) {\r\n alert(\"Ingrese un numero Apellido por favor.\")\r\n return false;\r\n\r\n }\r\n if (direccion.length <2) {\r\n alert(\"Ingrese un numero direccion por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (correo.length <2) {\r\n alert(\"Ingrese un numero correo por favor.\")\r\n return false;\r\n\r\n }\r\n if (celular.length <2) {\r\n alert(\"Ingrese un numero celular por favor.\")\r\n return false;\r\n\r\n }\r\n\r\n if (esp.length <2) {\r\n alert(\"Ingrese especializacion.\")\r\n return false;\r\n\r\n }\r\n \r\n\r\n\r\n\r\n\r\n }", "function validarCedula(cedula){\t\n\tcadena=/^[0-9]{10}$/;\n\tsumaprod=0;\n\tcoef='212121212';\n if(cadena.test(cedula)){\t\t\n\t\ti=0;\n\t\twhile(i<9){\t\t\t\t\n\t\t\tif(i==0){\n\t\t\t numruc=cedula.substr(0,1);\t\t\n\t\t\t numcoef=coef.substr(0,1);\t \t\t \n\t\t\t}\n\t\t\telse{\n\t\t\t numruc=cedula.substr(i,1);\t\t\n\t\t\t numcoef=coef.substr(i,1);\t \n\t\t\t}\t\t\n\t\t\tproduct=numruc*numcoef;\t\t\n\t\t\tif (product>=10){\t\t\t\n\t\t\t product1=String(product);\t \t\t\t\n\t\t\t num1=product1.substr(0,1);\t\t \n\t\t\t num2=product1.substr(1,1);\t\t\t\n\t\t\t product=Number(num1)+Number(num2);\t \n\t\t\t}\n\t\t\t sumaprod=sumaprod+product;\t\t\t\t \t\t \n\t\t\t i=i+1;\t\t\n\t\t}\t\t\n\t\tresid=sumaprod%10;\t\n\t\tif(resid==0)\n\t\t digverf=0;\n\t\telse\n\t\tdigverf=10-resid;\n\t\tdigverfced=cedula.substr(9,1);\n\t\tif(Number(digverfced)==Number(digverf)) {\n\t\t return 1;\t \n\t\t }\n\t\telse {\n\t\t return 0;\t \n\t\t} \n\t}\n\telse {\n\t return 0;\t \n\t }\n}", "function mostrar()\n{\n\t//tomo la edad \n\tvar edadIngresada;\n\tedadIngresada=txtIdEdad.value;\n\tedadIngresada=parseInt(edadIngresada);\n\n\tif(edadIngresada>17)\n\t{\n\t\talert(\"es mayor de edad\");\n\t}\n}//FIN DE LA FUNCIÓN", "function validarFecha(){\n\tvar mensaje=\"\";\n\tvar fechaTur = document.getElementById(\"Fecha\");\n\tvar fechaTurno = new Date(Date.parse(fechaTur.value)).setHours(0,0,0,0);\n\tvar fechaActual = new Date();\n\tfechaActual.setHours(0,0,0,0);\n\tvar valid = true;\n \n valid = valid && fechaTurno >= fechaActual;\n\t\n\tif(!valid){\n\t\tmensaje = \"La fecha de un turno no puede ser anterior a la fecha actual\";\n\t}\n fechaTur.setCustomValidity(mensaje);\n\treturn mensaje;\n}", "function validarCedula(inCedula)\n{\n var array = inCedula.split(\"\") ;\n var num = array.length;\n var total;\n var digito;\n var mult;\n var decena;\n var end;\n\n if(num == 10)\n {\n total = 0;\n digito = (array[9]*1);\n for( var i = 0; i<(num-1);i++)\n {\n mult = 0;\n if((i%2) != 0)\n {\n total = total + (array[i]*1);\n }\n else\n {\n mult = array[i]*2;\n if( mult > 9)\n {\n total = total + (mult - 9);\n }\n else\n {\n total = total + mult;\n }\n }\n\n }\n decena = total/10;\n decena = Math.floor(decena);\n decena = ( decena + 1 ) * 10;\n end = ( decena - total ) ;\n if((end == 10 && digito == 0)|| end == digito)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n}", "function fValidModificacion()\n{\n\tif($('#txtPrimerNombre').val() == Datos.primernombre && $('#txtSegundoNombre').val() == Datos.segundonombre.replace(/\\+/g,\" \") && $('#txtPrimerApellido').val() == Datos.primerapellido && $('#txtSegundoApellido').val() == Datos.segundoapellido.replace(/\\+/g,\" \") && $('#txtEmail').val() == Datos.email && $('#cmbIdTelefono').val() == Datos.idtelefono && $('#txtTelefonoMovil').val() == Datos.telefonomovil && $('#cmbIdCodArea').val() == Datos.idcodarea && $('#txtTelefonoFijo').val() == Datos.telefonofijo && $('#cmbIdDepartamento').val() == Datos.iddepartamento && $('#cmbIdCargo').val() == Datos.idcargo && $('#txtFechaIngreso').val() == Datos.fechaingreso && $('#txtDireccion').val() == Datos.direccion.replace(/\\+/g,\" \") )\t{\n\t\treturn 0;\n\t}\n\telse {\n\t\treturn 1;\n\t}\n}", "function validarFrmActualizar(){\n\n $('#div-error-edit').html('');\n $('.form-control').removeClass(\"is-invalid\");\n $('.form-control').removeClass(\"is-valid\");\n\n var fechas=valFechas($('#fechaInicio-edt'),$('#fechafin-edt'));\n var titulo=isTextoT($('#nombre-edt'));\n var desc=isTextoD($('#textarea-edt'));\n\n if(fechas && titulo && desc){\n return true;\n }else{\n $('#div-error-edit').append(\n '<div class=\" alert alert-danger\">'+\n '<i class=\"fas fa-exclamation-triangle\">&nbsp;&nbsp;</i>' + 'El formulario contiene errores !' +\n '</div>'\n );\n return false;\n }\n}", "function validaMenEmpresa(){\r\n\t\tvar menEmpresa = document.getElementById('menEmpresa');\r\n\t\tlimpiarError(menEmpresa);\r\n\t\tif (menEmpresa.value ==''){\r\n\t\t\talert ('El campo mensaje es obligatorio');\r\n\t\t\terror(menEmpresa);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(!isNaN(menEmpresa.value)){\r\n\t\t\talert('Formato mensaje debe ser Letras');\r\n\t\t\terror(menEmpresa);\r\n\t\t\treturn false;\t\r\n\t\t}return true\r\n\t}", "function validarLetras(e) { // 1\n tecla = (document.all) ? e.keyCode : e.which;\n if (tecla == 8)\n return true; // backspace\n if (tecla == 32)\n return true; // espacio\n// if (tecla == 35)\n// return true; // Inicio\n// if (tecla == 36)\n// return true; // Fin\n// if (tecla == 37)\n// return true; // Flecha izquierda\n// if (tecla == 0)\n// return true; // Felcha Derecha\n if (tecla == 192)\n return true; // letra ñ\n\n patron = /[a-zA-Z\\ñ\\Ñ\\s\\Á\\á\\É\\é\\Í\\í\\Ó\\ó\\Ú\\ú]/; //patron\n te = String.fromCharCode(tecla);\n return patron.test(te); // prueba de patron\n //codigo de letras http://help.adobe.com/es_ES/AS2LCR/Flash_10.0/help.html?content=00000525.html\n}", "function validarFormModifyDates() {\n const cuTorre = document.forms[\"modifyDatePosition\"][\"torreCU\"];\n const serialTorre = document.forms[\"modifyDatePosition\"][\"torreSerial\"];\n const cuMoni = document.forms[\"modifyDatePosition\"][\"moniCU\"];\n const serialMoni = document.forms[\"modifyDatePosition\"][\"moniSerial\"];\n\n // Los campos no pueden ser vaciós.\n if (cuTorre.value == \"\" || cuTorre.value.length <= 3 || serialTorre.value == \"\" || serialTorre.value.length <= 3 || cuMoni.value == \"\" || cuMoni.value.length <= 3 || serialMoni.value == \"\" || serialMoni.value.length <= 3) {\n snackbar(\"Los campos no deben ser vacios y no deden ser inferiores a 4 caracteres.\");\n return false;\n }else {\n console.log(\"Datos correctos (por ahora)\");\n saveChanges(cuTorre.value, serialTorre.value, cuMoni.value, serialMoni.value, buttonSave.value);\n }\n}", "validate() { }", "function isValidCurso(formname){\n \n var varCurso = document.forms[formname][\"curso\"].value; //Obtenemos los datos introducidos en el input curso\n \n if(varCurso.length == 0){\n var x= document.getElementById(\"curso\");\n x.innerHTML=\"Campo vacio\";\n return false;\n }\n varCurso=varCurso.trim();//quitamos los posibles espacios en blancos de los <--extremos-->\n varCurso= varCurso.replace(/ /g,' ');//sustituimos los posibles múltiples espacios entre palabras por solamente uno\n \n var x= document.getElementById(\"curso\");\n if(!/^[1-4][a-hA-H]$/.test(varCurso)){//Si los datos introducidos no cumplmen \"nl\", siendo \"n\" un número entre 1 y 4 y \"l\" una letra en a-h o A-H\n x.innerHTML=\"Error: nº curso debe estar entre 1 y 4, letra entre A y H\";\n return false; \n }\n \n x.innerHTML=\"\"; //Si no hay fallo en el parrafo anexo al input no se pone nada\n document.forms[formname][\"curso\"].value=varCurso; //refrescamos los datos introducimos en el campo curso pero ahora sin espacios en blanco inválidos.\n return true;\n}", "function validarFormulario(){\n var flagValidar = true;\n var flagValidarRequisito = true;\n\n if(txtCrben_num_doc_identific.getValue() == null || txtCrben_num_doc_identific.getValue().trim().length ==0){\n txtCrben_num_doc_identific.markInvalid('Establezca el numero de documento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(txtCrben_nombres.getValue() == null || txtCrben_nombres.getValue().trim().length ==0){\n txtCrben_nombres.markInvalid('Establezca el nombre, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(cbxCrecv_codigo.getValue() == null || cbxCrecv_codigo.getValue().trim().length ==0){\n cbxCrecv_codigo.markInvalid('Establezca el estado civil, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(txtCrben_apellido_paterno.getValue() == null || txtCrben_apellido_paterno.getValue().trim().length ==0){\n txtCrben_apellido_paterno.markInvalid('Establezca el apellido, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(cbxCpais_nombre_nacimiento.getValue() == null || cbxCpais_nombre_nacimiento.getValue().trim().length ==0){\n cbxCpais_nombre_nacimiento.markInvalid('Establezca el pais de nacimiento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n if(dtCrper_fecha_nacimiento.isValid()==false){\n dtCrper_fecha_nacimiento.markInvalid('Establezca la fecha de nacimiento, por favor.');\n flagValidar = false;\n return flagValidar;\n }\n\n for (var i = 0; i < gsCgg_res_solicitud_requisito.getCount(); i++) {\n var rRequisito = gsCgg_res_solicitud_requisito.getAt(i);\n if (rRequisito.get('CRSRQ_REQUERIDO') == true) {\n if (rRequisito.get('CRRQT_CUMPLE') == false) {\n flagValidarRequisito = false;\n }\n }\n }\n\n if (flagValidarRequisito == false) {\n Ext.Msg.show({\n title: tituloCgg_res_beneficiario,\n msg: 'Uno de los requisitos necesita cumplirse, por favor verifiquelos.',\n buttons: Ext.Msg.OK,\n icon: Ext.MessageBox.WARNING\n }); \n grdCgg_res_solicitud_requisito.focus();\n flagValidar = false;\n }\n return flagValidar;\n }", "function validarform(e) {\n let personaNueva = {\n nombre : nombreDom.value;\n apellido : apellidoDom.value;\n numeroTarjeta : numeroTarjetaDom.value;\n fechaVence : fechaDom.value;\n pin : valorPinDom.value;\n }", "function validar_formu() {\n\tvar valido = true;\n\tvar campo1 = document.getElementById(\"cod_cliente\");\n\tvar campo2 = document.getElementById(\"nombre_cliente\");\n\tif (campo_vacio(campo1) && campo_vacio(campo2)) {\n\t\tvalido = false;\n\t\talert(\"Uno de los dos campos son obligatorios para realizar la consulta de los datos del cliente.\");\n\t}\n\treturn valido;\n}", "function validar(datos) {\n if (typeof datos !== \"object\") return false;\n //console.log(Object.keys(datos));\n /**esto lo haremos para poder validar los formularios concada uno de las keys que seria los de los datos cuando el formulario este vacio pues retornara el is invalid\n * y el id es la llave por eso se le poen document by id porque la llave es los datos que contiene cada una de las llaves o mejor ducho cada uno de los datos del formulario\n */\n let respuesta = true;\n for (let llave in datos) {\n // console.log(llave);\n if (datos[llave].length === 0) {\n document.getElementById(llave).classList.add(\"is-invalid\");\n respuesta = false;\n } else {\n /**remover la clase anteriorde is invalid del formulario para cuando ya esten lleno los campos se remueva el ootro y entre a cuando este valido el relleno del formulario */\n document.getElementById(llave).classList.remove(\"is-invalid\");\n document.getElementById(llave).classList.add(\"is-valid\");\n }\n }\n if (respuesta === true ) $(\".alert-warning\").hide();\n return respuesta;\n}", "function validar(e){\r\n borrarError();\r\n if(validaEdad && validaTelefono && ValidaNombre && confirm(\"pulsar aceptar si deseas enviar este formulario\")){\r\n return true;\r\n }else {\r\n e.preventDefault();\r\n return false;\r\n }\r\n}", "function validarcliente(){\r\n // body...\r\n var exp = /^(([^<>()\\[\\]\\\\.,;:\\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 var telClien = /^\\d{10}$/;\r\n var contra = /^(?=\\w*\\d)(?=\\w*[A-Z])(?=\\w*[a-z])\\S{8,16}$/;\r\n var nombre_Clien = document.getElementById('nombreclien').value;\r\n var apellidos_Clien = document.getElementById('apellidoclien').value;\r\n var correo_Clien = document.getElementById('correoclien').value;\r\n var contraseña_Clien = document.getElementById('contraseñaclien').value;\r\n var telefono_Clien = document.getElementById('telefonoclien').value;\r\n var direccion_Clien = document.getElementById('direccionclien').value;\r\n\r\n if (nombre_Clien === \"\" || apellidos_Clien === \"\" || correo_Clien === \"\" || contraseña_Clien === \"\" || telefono_Clien === \"\" || direccion_Clien ===\"\") {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'Todos los campos son obligatorios',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n return false;\r\n }\r\n\r\n else if (nombre_Clien.length>30) {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'El nombre es muy largo maximo 30 caracteres',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n document.getElementById(\"nombreclien\").focus();\r\n document.getElementById(\"nombreclien\").value=\"\";\r\n return false;\r\n\r\n\r\n\r\n }\r\n\r\n else if (apellidos_Clien.length>30) {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'Apellidos muy largo maximo 30 caracteres',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n document.getElementById(\"apellidoclien\").focus();\r\n document.getElementById(\"apellidoclien\").value=\"\";\r\n return false;\r\n\r\n }\r\n\r\n else if (!exp.test(correo_Clien)) {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'El correo ingresado no es valido',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n document.getElementById(\"correoclien\").focus();\r\n document.getElementById(\"correoclien\").value=\"\";\r\n return false;\r\n\r\n\r\n\r\n }\r\n\r\n else if (!contra.test(contraseña_Clien)) {\r\n Swal.fire({\r\n icon: 'warning',\r\n title: 'Contraseña invalidad',\r\n text: 'La contraseña debe tener entre 8 y 16 caracteres, al menos un número, una minúscula y mayúscula. \\n EJEMPLO: Geniio12345',\r\n position: 'top',\r\n toast: true,\r\n timer: 20000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n title: 'title-class',\r\n },\r\n\r\n });\r\n document.getElementById(\"contraseñaclien\").focus();\r\n document.getElementById(\"contraseñaclien\").value=\"\";\r\n return false;\r\n\r\n\r\n\r\n }\r\n\r\n else if (!telClien.test(telefono_Clien)) {\r\n Swal.fire({\r\n icon: 'warning',\r\n text: 'Ingrese un numero de teléfono valido',\r\n position: 'top',\r\n toast: true,\r\n timer: 5000,\r\n allowQutsidClick: false,\r\n customClass:{\r\n content: 'content-class',\r\n },\r\n\r\n });\r\n document.getElementById(\"telefonoclien\").focus();\r\n document.getElementById(\"telefonoclien\").value=\"\";\r\n return false;\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n}", "function validarAnoBusca()\r\n{\r\n\tif ((document.check.ano.value.length==4) && (document.check.ano.value != blank))\r\n\t\tif(!isNumberString(document.check.ano.value))\r\n\t\t{\r\n\t\t\talert(\"Valor inválido para ano, digite somente números.\");\r\n\t\t\tanoValido = false;\r\n\t\t\tdocument.check.ano.focus();\r\n\t\t\tdocument.check.ano.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tanoValido = true;\r\n\t\t\treturn true;\r\n\t\t}\r\n}", "validate(){\n\t\t//on met dans t la valeur du titre\n\t\tlet t = document.querySelector('#form_add_note_title').value;\n\t\t//on met dans c la valeur du contenu\n\t\tlet c = document.querySelector('#form_add_note_text').value;\n\n\t\tif (noteFormView.isEdit){\n\t\t\tlet note = noteList.list.filter(e => e.id == noteListView.note.id);\n\t\t\tnote[0].titre = t;\n\t\t\tnote[0].contenu = c;\n\t\t\t//update date\n\t\t\tnote[0].date_creation = new Date();\n\t\t\tnoteFormView.isEdit = false;\n\t\t} else {\n\t\t\tlet n = new Note(t,c);\n\t\t\t//ajoute la note au tableau\n\t\t\tnoteList.add(n);\n\t\t}\n\n\n\t\t//save to localstorage\n\t\tnoteList.save();\n\t\t//vide la section et load le tableau avec les infos à jour\n\t\tnoteList.load();\n\t\t//hide le formulaire\n\t\tnoteFormView.hide();\n\t}", "function validaCampoTexto(Nombre, longitud, ActualLement) {\n //errorIs = Array();\n LimitaTamCampo(Nombre, Number(longitud), '#' + ActualLement);\n $('#' + ActualLement + '_txt_' + Nombre).change(function () {\n resetCampo(Nombre, '#' + ActualLement);\n validaCampoTextoInSave(Nombre, '#' + ActualLement);\n });\n}", "function validaCampoNumeroInSave(Nombre, ActualLement, rango, decimal) {\n var cValue = $('#' + ActualLement + '_txt_' + Nombre).val();\n var TextErr = false;\n\n if (cValue !== null && cValue !== '') {\n\n if (!decimal) {\n _regEx = new RegExp(\"^[0-9]+$\");\n if (!_regEx.test(cValue)) {\n redLabel_Space(Nombre, 'Solo se permiten caracteres numéricos', '#' + ActualLement);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n } else {\n if (!cValue.includes('.')) {\n redLabel_Space(Nombre, 'Solo se permiten decimales', '#' + ActualLement);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n }\n\n if (rango !== undefined && Array.isArray(rango)) {\n if (cValue < rango[0]) {\n redLabel_Space(Nombre, 'El rango mínimo deber se de ' + rango[0], _G_ID_);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n } else {\n if (cValue > rango[1]) {\n redLabel_Space(Nombre, 'El rango máximo deber se de ' + rango[1], _G_ID_);\n ShowAlertM('#' + ActualLement, null, null, true);\n TextErr = true;\n }\n }\n }\n\n\n if (TextErr) {\n errorIs[Nombre] = true;\n } else {\n errorIs[Nombre] = false;\n }\n }\n}", "function validaceldalugar(){\n\tvar sitio=document.getElementById(\"lugar\").value ;\n if(sitio==\"\")\n\t{\n\tdocument.trabajo.lugar.className=\"error\";\t\n\tdocument.trabajo.lugar.focus();\n\t}\n\telse{ document.trabajo.lugar.className=\"correcto\";\n\t}\n }", "function validForm() {\n // si el nombre es igual a vacio\n // entonces muestrame que es invalido\n if ($('#titulo').val() == \"\") {\n $('#titulo').removeClass(\"is-valid\")\n $('#titulo').addClass(\"is-invalid\")\n } else {\n $('#titulo').removeClass(\"is-invalid\")\n $('#titulo').addClass(\"is-valid\")\n }\n if ($('#descripcion').val() == \"\") {\n $('#descripcion').removeClass(\"is-valid\")\n $('#descripcion').addClass(\"is-invalid\")\n } else {\n $('#descripcion').removeClass(\"is-invalid\")\n $('#descripcion').addClass(\"is-valid\")\n } \n if ($('#categorias').val() == \"\") {\n $('#categorias').removeClass(\"is-valid\")\n $('#categorias').addClass(\"is-invalid\")\n } else {\n $('#categorias').removeClass(\"is-invalid\")\n $('#categorias').addClass(\"is-valid\")\n }\n if ($('#contenido').val() == \"\") {\n $('#contenido').removeClass(\"is-valid\")\n $('#contenido').addClass(\"is-invalid\")\n } else {\n $('#contenido').removeClass(\"is-invalid\")\n $('#contenido').addClass(\"is-valid\")\n }\n if ($('#fecha_publ').val() == \"\") {\n $('#fecha_publ').removeClass(\"is-valid\")\n $('#fecha_publ').addClass(\"is-invalid\")\n } else {\n $('#fecha_publ').removeClass(\"is-invalid\")\n $('#fecha_publ').addClass(\"is-valid\")\n }\n if ($('#fecha_fin').val() == \"\") {\n $('#fecha_fin').removeClass(\"is-valid\")\n $('#fecha_fin').addClass(\"is-invalid\")\n } else {\n $('#fecha_fin').removeClass(\"is-invalid\")\n $('#fecha_fin').addClass(\"is-valid\")\n }\n if ($('#titulo').val() != \"\" && $('#categoria').val() != 0 && $('#descripcion').val() != \"\" && $('#contenido').val() != \"\" && $('#fecha_publ').val() != \"\" && $('#fecha_fin').val() >= \"\") {\n CrearOActualizar()\n }\n}", "function ValidadoresDatosGenerales() {\r\n\tjQuery.validator.addMethod(\"alphanumeric\", function(value, element) {\r\n\t\treturn this.optional(element) || /^\\w+$/i.test(value);\r\n\t}, \"Letters, numbers, and underscores only please\");\r\n\r\n\t$.validator.addMethod(\"ValidaVacios\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaSoloLetras\", function(value, element) {\r\n\t\tvar objRegExp = /^[a-z\\u00C0-\\u00ff]+$/;\r\n\t\tif (!objRegExp.test(value)) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumento\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cboDocumento').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumentoProp\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cbdoTipoDocRA').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumentoRRLL\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cboTipoDocRRLL').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaDocumentoRA\", function(value, element) {\r\n\t\tif (value === '') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch ($('#cboDocIdenRAS').val()) {\r\n\t\tcase \"1\":\r\n\t\t\tif (value.length !== 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"0\":\r\n\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaRUCPJ\", function(value, element) {\r\n\t\tif($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() === ''){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() !== '') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif ($('#txtRucRA').val() !== '' && $('#txtRucPJRA').val() === '') {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaRUCPN\", function(value, element) {\r\n\t\tif($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() === ''){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ($('#txtRucRA').val() === '' && $('#txtRucPJRA').val() !== '') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif ($('#txtRucRA').val() !== '' && $('#txtRucPJRA').val() === '') {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}, '');\r\n\r\n\t$.validator.addMethod(\"ValidaRZPJ\", function(value, element) {\r\n\t\tif ($('#txtRucPJRA').val() !== '') {\r\n\t\t\tif ($('#txtRSocialPJRA').val() === '') {\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t} \r\n\t}, '');\r\n\r\n\t// validacion de formulario inscripcion IPRESS\r\n\t$('#frmDatosPropietario').validate({\r\n\t\tignore : [],\r\n\t\trules : {\r\n\t\t\t// PN\r\n\t\t\ttxtRucRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t\t//minlength : 11,\r\n\t\t\t\t//number : true\r\n\r\n\t\t\t},\r\n\t\t\tcbdoTipoDocRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\ttxtNroDocRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t\t//ValidaDocumentoProp : true\r\n\t\t\t},\r\n\t\t\tcboPaisRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\ttxtFecNacRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\tcboSexoRA : {\r\n\t\t\t\tValidaRUCPN : true\r\n\t\t\t},\r\n\t\t\ttxtAPaternoRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\t\t\ttxtAMaternoRA : {\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\t\t\ttxtACasadaRA : {\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\t\t\ttxtNombresRA : {\r\n\t\t\t\tValidaRUCPN : true,\r\n\t\t\t// alphanumeric : true\r\n\t\t\t},\r\n\r\n\t\t\t// PJ\r\n\t\t\ttxtRucPJRA : {\r\n\t\t\t\t//minlength : 11,\r\n\t\t\t\tValidaRUCPJ : true,\r\n\t\t\t\t//number : true\r\n\t\t\t},\r\n\t\t\ttxtRSocialPJRA : {\r\n\t\t\t\tValidaRZPJ : true\r\n\t\t\t// required : true\r\n\t\t\t},\r\n\r\n\t\t\t// DIRECCION\r\n\t\t\tcboDepRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\tcboProRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\tcboDisRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\r\n\t\t\t// DATOS COMPLEMENTARIOS\r\n\t\t\ttxtTelRA : {\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\ttxtEmailRA : {\r\n\t\t\t\temail : true,\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\ttxtReEmailRA : {\r\n\t\t\t\temail : true,\r\n\t\t\t\trequired : true\r\n\t\t\t},\r\n\t\t\ttxtNroRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\ttxtNroPisoRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\ttxtNroDptoRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\ttxtInteriorRA : {\r\n\t\t\t\tnumber : true\r\n\t\t\t},\r\n\t\t\tcboViaRA : {\r\n\t\t\t\tValidaVia1 : true\r\n\t\t\t},\r\n\t\t},\r\n\t\thighlight : function(element) {\r\n\t\t\t$(element).closest('.form-group').addClass('has-error');\r\n\t\t},\r\n\t\tunhighlight : function(element) {\r\n\t\t\t$(element).closest('.form-group').removeClass('has-error');\r\n\t\t},\r\n\t\terrorElement : 'span',\r\n\t\terrorClass : 'help-block',\r\n\t\terrorPlacement : function(error, element) {\r\n\t\t\tif (element.parent('.input-group').length) {\r\n\t\t\t\terror.insertAfter(element.parent());\r\n\t\t\t} else {\r\n\t\t\t\terror.insertAfter(element);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n}", "function verificarDT(atrib, mens, id){\n var bandera = true;\n if(atrib.value.length > 0){\n if(mens=='mtelefono' && atrib.value.length<9){\n error(atrib, mens, '<br>El numero de telefono no tiene los digitos necesarios')\n bandera = false;\n vgeneral[id]=bandera;\n }else{\n arreglo(atrib, mens);\n bandera = true;\n vgeneral[id]=bandera;\n }\n \n }else{\n error(atrib, mens, '<br>El campo esta vacio')\n bandera = false;\n vgeneral[id]=bandera;\n }\n return bandera;\n}", "function validarCampos(objeto){\n var formulario = objeto.form;\n emailRegex = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i; //Comprueba el formato del correo electronico\n passRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&.,])[A-Za-z\\d$@$!%*?&.,]{8,15}/; //comprueba el formato de la password\n\n //comprueba cada campo y si no cumple los requisitos muestra un aviso\n for (var i=0; i<formulario.elements.length; i++){\n\tif (formulario.elements[i].id==\"nombre\"){\n if(formulario.elements[i].id==\"nombre\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelnombre\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelnombre\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else {\n document.getElementById(\"labelnombre\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelnombre\").style.color=\"GREEN\";\n }\n\t}else if(formulario.elements[i].id==\"apellidos\"){\n if(formulario.elements[i].id==\"apellidos\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelapellidos\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelapellidos\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else {\n document.getElementById(\"labelapellidos\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelapellidos\").style.color=\"GREEN\";\n }\n }else if(formulario.elements[i].id==\"correo\"){\n if(formulario.elements[i].id==\"correo\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelcorreo\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelcorreo\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(emailRegex.test(document.getElementById(\"correo\").value)) {\n document.getElementById(\"labelcorreo\").innerHTML=\" *Correo valido\";\n document.getElementById(\"labelcorreo\").style.color=\"GREEN\";\n }else if(emailRegex.test(document.getElementById(\"correo\").value)==false){\n document.getElementById(\"labelcorreo\").innerHTML=\" *Correo no valido\";\n document.getElementById(\"labelcorreo\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }\n }else if(formulario.elements[i].id==\"password\"){\n if(formulario.elements[i].id==\"password\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelpassword\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelpassword\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(passRegex.test(document.getElementById(\"password\").value)){\n document.getElementById(\"labelpassword\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelpassword\").style.color=\"GREEN\";\n }else if(passRegex.test(document.getElementById(\"password\").value)==false){\n document.getElementById(\"labelpassword\").innerHTML=\" *No es segura debe tener al menos un caracter especial, un digito, una minuscula y una mayuscula\";\n document.getElementById(\"labelpassword\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(passRegex.test(document.getElementById(\"password\").value)){\n document.getElementById(\"labelpassword\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelpassword\").style.color=\"GREEN\";\n }\n }else if(formulario.elements[i].id==\"password2\"){\n if(formulario.elements[i].id==\"password2\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelpassword2\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelpassword2\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(document.getElementById(\"password2\").value != document.getElementById(\"password\").value){\n document.getElementById(\"labelpassword2\").innerHTML=\" *Las contraseñas son diferentes\";\n document.getElementById(\"labelpassword2\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else {\n document.getElementById(\"labelpassword2\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelpassword2\").style.color=\"GREEN\";\n formulario.elements[i].focus();\n }\n }\n \n }\n return true;\t // Si sale de la función es que todos los campos obligatorios son validos.\n}", "function validar1()\r\n\t{\r\n\t\t// incio de validación de espacios nulos\r\n\t\tif(document.registro.telfdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio es necesario\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.celular.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Celular es necesario\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.dirdom.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio es necesario\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.mail.value.length==0)\r\n\t\t{\r\n\t\t\talert(\"Mail es necesario\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t//Fin de validacion de espacios nulos \r\n\t\t//-------------------------------------------\r\n\t\t// Incio de validacion de tamanio \t\r\n\t\tif(document.registro.telfdom.value.length<7 || document.registro.telfdom.value.length>7)\r\n\t\t{\r\n\t\t\talert(\"Telfono de Domicilio incorrecto\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.celular.value.length!=8)\r\n\t\t{\r\n\t\t\talert(\"Celular es incorrecto\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.dirdom.value.length<=5 || document.registro.dirdom.value.length>=200)\r\n\t\t{\r\n\t\t\talert(\"Direccion de domicilio incorrecto\");\r\n\t\t\tdocument.registro.dirdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.registro.mail.value.length<=10 || document.registro.mail.value.length>=100 )\r\n\t\t{\r\n\t\t\talert(\"El mail es incorrecto\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// fin de validacion de tamanio \r\n\t\t// --------------------------------\r\n\t\t// incio validaciones especiales\r\n\t\tif(isNaN(document.registro.telfdom.value))\r\n\t\t{\r\n\t\t\talert(\"El telefono de domicilio tiene que ser un número\");\r\n\t\t\tdocument.registro.telfdom.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.dirOf.value.length!=0){\r\n\t\t\tif(document.registro.dirOf.value.length>=200 || document.registro.dirOf.value.length<10)\r\n\t\t\t{\r\n\t\t\t\talert(\"Esta Direccion parece incorrecta\");\r\n\t\t\t\tdocument.registro.dirOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(document.registro.telfOf.value.length!=0){\r\n\t\t\tif(document.registro.telfOf.value.length!=7)\r\n\t\t\t{\r\n\t\t\t\talert(\"Este Telefono no parece correcto\");\r\n\t\t\t\tdocument.registro.telfOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(isNaN(document.registro.telfOf.value)&& document.registro.telfOf.value.length!=0)\r\n\t\t{\r\n\t\t\talert(\"El telefono de oficina tiene que ser un número\");\r\n\t\t\tdocument.registro.telfOf.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(isNaN(document.registro.celular.value))\r\n\t\t{\r\n\t\t\talert(\"El celular tiene que ser un número\");\r\n\t\t\tdocument.registro.celular.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\"@\"))<3)\r\n\t\t{\r\n\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\tdocument.registro.mail.focus();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((document.registro.mail.value.indexOf(\".com\")<5)&&(document.registro.mail.value.indexOf(\".org\")<5)&&(document.registro.mail.value.indexOf(\".gov\")<5)&&(document.registro.mail.value.indexOf(\".net\")<5)&&(document.registro.mail.value.indexOf(\".mil\")<5)&&(document.registro.mail.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\tdocument.registro.email.focus() ;\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(document.registro.mailOf.value.length!=0)\r\n\t\t{\r\n\t\t\tif ((document.registro.mailOf.value.indexOf(\"@\"))<3)\r\n\t\t\t{\r\n\t\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\t\tdocument.registro.mailOf.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((document.registro.mailOf.value.indexOf(\".com\")<5)&&(document.registro.mailOf.value.indexOf(\".org\")<5)&&(document.registro.mailOf.value.indexOf(\".gov\")<5)&&(document.registro.mailOf.value.indexOf(\".net\")<5)&&(document.registro.mailOf.value.indexOf(\".mil\")<5)&&(document.registro.mailOf.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\t\tdocument.registro.mailOf.focus() ;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(document.registro.msn.value.length!=0)\r\n\t\t{\r\n\t\t\tif ((document.registro.msn.value.indexOf(\"@\"))<3)\r\n\t\t\t{\r\n\t\t\t\talert(\"Lo siento,la cuenta de correo parece errónea. Por favor, comprueba el prefijo y el signo '@'.\");\r\n\t\t\t\tdocument.registro.msn.focus();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((document.registro.msn.value.indexOf(\".com\")<5)&&(document.registro.msn.value.indexOf(\".org\")<5)&&(document.registro.msn.value.indexOf(\".gov\")<5)&&(document.registro.msn.value.indexOf(\".net\")<5)&&(document.registro.msn.value.indexOf(\".mil\")<5)&&(document.registro.msn.value.indexOf(\".edu\")<5))\r\n\t\t{\r\n\t\t\t\talert(\"Lo siento. Pero esa cuenta de correo parece errónea. Por favor,\"+\" comprueba el sufijo (que debe incluir alguna terminación como: .com, .edu, .net, .org, .gov o .mil)\");\r\n\t\t\t\tdocument.registro.msn.focus() ;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// fin validaciones especiales\r\n\t\tdocument.registro.submit();\r\n\t}", "function validarFecha(){\n\tvar mensaje=\"\";\n\tvar fechaI = document.getElementById(\"Fecha\");\n\tvar fechaItv = new Date(Date.parse(fechaI.value)).setHours(0,0,0,0);\n\tvar fechaActual = new Date();\n\tfechaActual.setHours(0,0,0,0);\n\tvar valid = true;\n \n valid = valid && fechaItv <= fechaActual;\n\t\n\tif(!valid){\n\t\tmensaje = \"La fecha de la ITV de un vehículo no puede ser posterior a la fecha actual\";\n\t}\n fechaI.setCustomValidity(mensaje);\n\treturn mensaje;\n}", "function validarDosOMasCampos(elemento)\n{ \n if(elemento.value.length > 0){\n for (var i = 0; i < elemento.value.length; i++) {\n if (((elemento.value.charCodeAt(i)==32))) {\n if ((elemento.value.charCodeAt(i-1)!=32)&&(elemento.value.charCodeAt(i+1)>=65)&&(elemento.value.charCodeAt(i+1)<=122)){\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML =''; \n }else{\n \n document.getElementById('mensaje3').innerHTML=\"\" ;\n }\n elemento.style.border = '2px greenyellow solid';\n return true;\n }else{\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML = 'Nombres Incorrecto'; \n }else{\n document.getElementById('mensaje3').innerHTML = 'Apellidos Incorrecto';\n }\n elemento.style.border = '2px red solid';\n return false;\n }\n }else{\n if (elemento.id=='nombres') {\n document.getElementById('mensaje2').innerHTML = 'Nombres Incorrecto';\n console.log(\"Es nombre\"); \n }else{\n document.getElementById('mensaje3').innerHTML = 'Apellidos Incorrecto';\n }\n elemento.style.border = '2px red solid';\n }\n \n }\n }\n}", "function validaForm(){\t\n\tif($('#tipo_evento').val() == -1){\n\t\tmensagem(\"Por favor, preencha o campo tipo do evento!\",\"OK\",\"bt_ok\",\"erro\");\n\t\t$('#tipo_evento').focus();\n\t\treturn false\n\t}\n\tif($('#dataInicio').val() == \"\"){\n\t\tmensagem(\"Por favor, preencha o campo data início!\",\"OK\",\"bt_ok\",\"erro\");\n\t\t$('#dataInicio').focus();\n\t\treturn false\n\t}\n\tvar dataAtual = new Date;\n\tvar novaDataInicio = $('#dataInicio').val();\n\tif (novaDataInicio.toString().substring(0,4) < dataAtual.getFullYear() ||\n\t\tnovaDataInicio.toString().substring(0,4) == dataAtual.getFullYear() &&\n\t\t\tnovaDataInicio.toString().substring(5,7) < dataAtual.getMonth() + 1 ||\n\t\tnovaDataInicio.toString().substring(0,4) == dataAtual.getFullYear() &&\n\t\t\tnovaDataInicio.toString().substring(5,7) == dataAtual.getMonth() + 1 &&\n\t\t\tnovaDataInicio.toString().substring(8,10) < dataAtual.getDate())\n\t{\n\t\tmensagem(\"Data de início não pode ser anterior a data atual!\",\"OK\",\"bt_ok\",\"erro\");\n\t\treturn false;\n\t}\n\tif($('#titulo').val() == \"\"){\n\t\tmensagem(\"Por favor, preencha o título!\",\"OK\",\"bt_ok\",\"erro\");\n\t\t$('#titulo').focus();\n\t\treturn false\n\t}\n\tif(typeof $(\"#L10L .clicado\").next().attr(\"value\") == \"undefined\"){\n\t\tmensagem(\"Por favor, preencha o campo feriado!\",\"OK\",\"bt_ok\",\"erro\");\n\t\treturn false\n\t}\n\tif(typeof $(\"#L10A .clicado\").next().attr(\"value\") == \"undefined\"){\n\t\tmensagem(\"Por favor, preencha o campo aula!\",\"OK\",\"bt_ok\",\"erro\");\n\t\treturn false\n\t}\n}", "function validaPesquisaFaixaLote(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.quadraOrigemID.value != form.quadraDestinoID.value){\r\n\t\tif(form.loteOrigem.value != form.loteDestino.value){\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Lotes as Localidade, os Setores Comerciais e as Quadras iniciais e finais devem ser iguais.\");\r\n\t\t\tform.loteDestino.focus();\r\n\t\t\tretorno = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((form.loteOrigem.value != \"\" )\r\n\t\t&& (form.loteOrigem.value > form.loteDestino.value)){\r\n\t\talert(\"O n?mero do Lote Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.loteDestino.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function validoEntrada(apellido, dni, nombre){\r\n if(dni && apellido){\r\n //expresion regular para comprobar que lo ingresado corresponda a una cadena\r\n let cad = new RegExp(\"^[A-Za-z]+$\");\r\n if(!cad.test(apellido) || (nombre && !cad.test(nombre))){\r\n return false;\r\n }\r\n\r\n let dniString = dni.toString();\r\n //me aseguro que el dni no tenga mas de 10 caracteres.\r\n if(dniString.length > 10){\r\n return false;\r\n }\r\n \r\n return true;\r\n }\r\n else\r\n return false;\r\n}", "function validateAnagrafica(formId){\n\tvar result=true;\n\t$('.error').detach();\n\tif($('#'+formId+' #ragioneSociale1').is('input')){ //Esiste il campo ragione sociale 1 e\n\t\tif($('#'+formId+' #ragioneSociale1').val()==\"\"){ //tale campo &egrave; non vuoto\n\t\t\tresult = false;\n\t\t\t$('#'+formId+' #ragioneSociale1').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t}\n\t}\n\t\n\tif($('#'+formId+' #nome').is(\"input\") && //Esiste il campo \"nome\"\n\t $('#'+formId+' #cognome').is('input')){//Esiste il campo \"Cognome\"\n\t\t \n\t\tif($('#'+formId+' #nome').val()==\"\"){//Se il campo nome è vuoto va in errore\n\t\t\tresult = false;\n\t\t\t$('#'+formId+' #nome').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t}\n\t\tif($('#'+formId+' #cognome').val()==\"\"){//Se il campo cognome è vuoto va in errore\n\t\t\tresult = false;\n\t\t\t$('#'+formId+' #cognome').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t}\n\t}\t\n\t\t\t\tif ( $('#'+formId+' #ncivico').val()==\"\" ) {\n\t\t\t\tresult = false;\n\t\t\t\tconsole.log(result );\n\t\t\t\t$('#'+formId+' #ncivico').after(\"<p class='error'>\"+errMsg+\"</p>\");//Messaggio di errore\n\t\t\t\t\n\t\t}\n\t\t\n\t\n\n\tif(result){\n\t\tdocument.forms[formId].submit();\n\t}\n\treturn result;\n}", "function ValidarDatosObligatorios() {\n\tvar respuesta = true;\n\n\t$(\"#validacionComentario\").hide();\n\n\tif ($(\"#txtComentarioNuevo\").val().trim() == \"\") {\n\t\t$(\"#validacionComentario\").show();\n\t\trespuesta = false;\n\t}\n\n\tif ($(\"#txtSolicitudId\").val() == \"\" ) {\n\t\trepuesta = false;\n\t}\n\n\treturn respuesta;\n}", "function validar2(formulario){\n\n\t\t//comprobamos la longitud de los nombres\n\t\tif (formulario.nombreform.value.length==0){\n\t\t\talert (\"El campos nombre es obligatorio\");\n\t\t\treturn false;\n\t\t}\n\t\t//esta lista de caracteres lo que hace es comprobar que se le introduce caracteres validos seguidos de un \"@\" con más texto para terminar con un \".com\" por\n\t\t//ejemplo \"[a-z]\" significa de la \"a\" a la \"Z\" y {2,3} la longitud de esta palabra final. \n\t\tlistacar=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/\n\t\tif (!listacar.test(document.getElementById('mailform').value)){\n\t\t\talert (\"Debe indicar un email valido\");\n\t\t\treturn false;\n\t\t}\n\t\t//comprobamos si se envía información del proyecto\n\t\tif (formulario.telefonoform.value.toString().length<6){\n\t\t\talert (\"Indique un numero de teléfono valido\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar input = document.getElementById(\"fechareunion\").value;\n\t\tvar fechaintroducida = new Date(input);\n\t\tvar fechaminima = new Date().getTime() + (24 * 60 * 60 * 1000);\n\t\tvar fechamaxima = new Date().getTime() + (365 * 24 * 60 * 60 * 1000);\n\t\t\n\t\t//Comprobamos que se ha introducido una fecha\n\t\tif (isNaN(fechaintroducida)) {\n\t\t\talert(\"Introduzca una fecha para la reunión por favor.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t//Comprobamos que la fecha esta entre mañana y dentro de un año\n\t\tif (fechaintroducida > fechamaxima) {\n\t\t\talert (\"Plazo máximo para la reunión de un año\");\n\t\t\treturn false;\n\t\t}else if (fechaintroducida < fechaminima) {\n\t\t\talert (\"Plazo mínimo para la reunión a partir de mañana\");\n\t\t\treturn false;\n\t\t}else {\n\t\t\talert(\"Fecha valida\");\n\t\t}\n\t\t\n\t\t//comprobamos si se envía información del proyecto\n\t\tif (formulario.motivoreunion.value.length<5){\n\t\t\talert (\"Indique el motivo de la reunión\");\n\t\t\treturn false;\n\t\t}\n\t\t//comprueba se aceptan las políticas de privacidad\n\t\tif (!formulario.politicasform.checked){\n\t\t\talert (\"Debe aceptar la política de privacidad.\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\talert (\"Privacidad marcada\");\n\t\t}\n}", "function validarCampos() {\n var resultado = {\n zValidacion: true,\n sMensaje: 'Correcto',\n zErrorOcurrido: false\n };\n if (resultado.zErrorOcurrido == false && document.querySelector('#nomEvento').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"El nombre no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#precioEntradas').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"El precio no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#fechaInicio').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"La fecha no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && isValidEmail(document.querySelector('#lugarTorneo').value) == false) {\n resultado.zValidacion = false;\n resultado.sMensaje = \"La fecha no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#orgTorneo').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"la sOrganizacion no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#patrocinadorTorneo').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"el patrocinador no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n return resultado;\n}", "function validaPesquisaFaixaQuadra(){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tretorno = true;\r\n\t\r\n\tif(form.quadraOrigemID.value != form.quadraDestinoID.value){\r\n\t\tif(form.setorComercialOrigemCD.value != setorComercialDestinoCD.value){\r\n\t\t\tretorno = false;\r\n\t\t\talert(\"Para realizar a pesquisa por faixa de Quadras as Localidade e os Setores Comerciais iniciais e finais devem ser iguais.\");\r\n\t\t\tform.quadraDestinoID.focus();\r\n\t\t}\r\n\t}\r\n\t\r\n\tif((form.quadraOrigemID.value != \"\" )\r\n\t\t&& (form.quadraOrigemID.value > form.quadraDestinoID.value)){\r\n\t\talert(\"O n?mero da Quadra Final deve ser maior ou igual ao Inicial.\");\r\n\t\t\tform.quadraDestinoID.focus();\r\n\t\t\tretorno = false;\r\n\t}\r\n\t\r\n\treturn retorno;\r\n}", "function validarLetras1(e){ \n \n tecla = e.keyCode || e.which;\n var telefono = window.document.getElementById(\"telefono\");\n telefono.style.borderColor = \"none\";\n \n //verifica que no se ingrese una letra en el campo \n if((tecla>64&& tecla<91) || tecla==194){ \n telefono.style.borderColor = \"red\";\n valTel=false;\n var aux = telefono.value.substring(telefono.value.length-1);\n var rempla = telefono.value.replace(aux,\"\");\n telefono.value=rempla;\n \n } else{\n telefono.style.borderColor = \"blue\";\n valtele=true;\n \n }\n \n }", "function ValidarFields() {\r\n\r\n\tif(document.getElementById('codigo').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el código del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.getElementById('nombre').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el nombre del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif(document.getElementById('precio').value == \"\"){\r\n\t\talert(' ¡ ERROR ! Debes ingresar el precio del producto.');\r\n\t\treturn false;\r\n\t}\r\n\r\n}", "function validar(){\n var idComboPelo = document.getElementById('pelo');\n var idComboSexo = document.getElementById('sexo');\n var idComboGafas = document.getElementById('gafas');\n var idValidacion = document.getElementById('validacion');\n document.getElementById('iconoRojo').style.visibility = \"hidden\";\n document.getElementById('iconoVerde').style.visibility = \"hidden\";\n if(idComboPelo.value != \"null\" && idComboSexo.value != \"null\" || idComboPelo.value != \"null\" && idComboGafas.value != \"null\" || idComboSexo.value != \"null\" && idComboGafas.value != \"null\"){\n idValidacion.innerHTML = \"Error: estas haciendo 2 o más preguntas a la vez.\";\n idValidacion.style.color = \"red\";\n idComboPelo.value = \"null\";\n idComboSexo.value = \"null\";\n idComboGafas.value = \"null\";\n }else if(idComboPelo.value == \"null\" && idComboSexo.value == \"null\" && idComboGafas.value == \"null\"){\n idValidacion.innerHTML = \"No estas haciendo ninguna pregunta.\";\n idValidacion.style.color = \"red\";\n }else{\n idValidacion.innerHTML = preguntaServidor();\n idValidacion.style.color = \"white\";\n contadorPregunta++;\n document.getElementById('contadorPreguntas').innerHTML = contadorPregunta;\n document.form.contadorPregunta.value = contadorPregunta;\n }\n if(document.getElementById('easyButon').disabled == false){\n document.getElementById('easyButon').style.visibility = \"hidden\";\n }\n\n}", "function validarCamposDetalle(){\r\n if(document.getElementById(\"Cantidad\").value == \"\"){\r\n alert(\"falta la cantidad\");\r\n return false;\r\n }\r\n if(document.getElementById(\"Precio\").value == \"\"){\r\n alert(\"falta el precio\");\r\n return false;\r\n }\r\n return true;\r\n}", "function validarFecha(e, id) {\n\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \"/0123456789\";\n especiales = \"8-37-39-46\";\n\n tecla_especial = false\n for (var i in especiales) {\n if (key == especiales[i]) {\n tecla_especial = true;\n break;\n }\n }\n\n if (letras.indexOf(tecla) == -1 && !tecla_especial) {\n $(document.getElementById(id)).notify(\"Formato: 01/12/2017\", { position: \"right\" });\n return false;\n }\n\n}", "validate() {}" ]
[ "0.72957057", "0.7217632", "0.71872914", "0.6970653", "0.6840598", "0.67997086", "0.6774233", "0.6762697", "0.66613096", "0.6641357", "0.6601899", "0.6595761", "0.6582559", "0.65773374", "0.6541997", "0.65368026", "0.65368026", "0.65216374", "0.65166956", "0.6516406", "0.6503052", "0.64968175", "0.64709544", "0.6458916", "0.6441572", "0.64068353", "0.63974494", "0.63921416", "0.63917506", "0.6386992", "0.63849795", "0.6383202", "0.6350105", "0.6340684", "0.6337391", "0.6320004", "0.6316445", "0.6313219", "0.6286995", "0.6286905", "0.62846255", "0.62815666", "0.62803763", "0.6280227", "0.62787807", "0.6278706", "0.6278285", "0.6273929", "0.62587994", "0.6257367", "0.6255821", "0.6249387", "0.6248492", "0.6248281", "0.6239224", "0.6235775", "0.62233675", "0.6223177", "0.6223136", "0.62213844", "0.6220349", "0.621966", "0.62171197", "0.6215153", "0.62115186", "0.6209468", "0.6205847", "0.6203073", "0.6192206", "0.6185449", "0.61851215", "0.61826956", "0.6178976", "0.6173567", "0.61706334", "0.6164756", "0.6158799", "0.61563885", "0.61500365", "0.6147755", "0.6147605", "0.61465216", "0.6143314", "0.61359423", "0.6134177", "0.61294305", "0.61201364", "0.6107042", "0.61010504", "0.61003494", "0.6095092", "0.60938644", "0.60876656", "0.6087265", "0.608521", "0.6083916", "0.6074582", "0.6073935", "0.6062371", "0.6057861", "0.6054677" ]
0.0
-1
punycode.decode(string) It is used to convert a Punycode string of ASCII symbols to a string of Unicode symbols.
function test1() { punycode = require('punycode'); console.log(punycode.decode('maana-pta')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode(string){\n\n}", "function decode_utf8(string) {\n\t\treturn decodeURIComponent(escape(string));\n\t}", "function decode_utf8(s) {\r\n if ((s.length > 0) && (s.charCodeAt(0) == 0x9D)) {\r\n return utf8_to_unicode(s.substring(1));\r\n }\r\n return s;\r\n}", "function decode(strToDecode)\n{\n var encoded = strToDecode;\n return unescape(encoded.replace(/\\+/g, \" \"));\n}", "function decode(strToDecode) {\n var encoded = strToDecode;\n if (encoded == null) return \"\";\n return unescape(encoded.replace(/\\+/g, \" \"));\n}", "static utf8Decode(str) {\n try {\n return new TextEncoder().decode(str, 'utf-8').reduce((prev, curr) => prev + String.fromCharCode(curr), '');\n } catch (e) { // no TextEncoder available?\n return decodeURIComponent(escape(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html\n }\n }", "static utf8Decode(str) {\n try {\n return new TextEncoder().decode(str, 'utf-8').reduce((prev, curr) => prev + String.fromCharCode(curr), '');\n } catch (e) { // no TextEncoder available?\n return decodeURIComponent(escape(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html\n }\n }", "function decodeUtf8(str) {\n\t return decodeURIComponent(escape(str));\n\t}", "function decode(text) {\n return utf8.decode(text)\n}", "function decode(strToDecode)\n {\n var encoded = strToDecode;\n return unescape(encoded.replace(/\\+/g, \" \"));\n }", "function decode(strToDecode) {\n\tvar encoded = strToDecode; \n\tif (encoded==null)\n\t\treturn \"\";\n\treturn unescape(encoded.replace(/\\+/g, \" \"));\n}", "function decodeUTF8 (str) {\n return decodeURIComponent(escape(str));\n}", "function decode(string) {\n\treturn decodeURIComponent(escape(atob(unescape(string).replace(/-/g, \"+\").replace(/_/g, \"/\"))));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(escape(str));\n}", "function _utf8Decode(utf8str) {\n var str = new Array();\n var code,\n code2,\n code3,\n code4,\n j = 0;\n for (var i = 0; i < utf8str.length; ) {\n code = utf8str.charCodeAt(i++);\n if (code > 127) code2 = utf8str.charCodeAt(i++);\n if (code > 223) code3 = utf8str.charCodeAt(i++);\n if (code > 239) code4 = utf8str.charCodeAt(i++);\n\n if (code < 128) str[j++] = chr(code);\n else if (code < 224) str[j++] = chr(((code - 192) << 6) + (code2 - 128));\n else if (code < 240)\n str[j++] = chr(\n ((code - 224) << 12) + ((code2 - 128) << 6) + (code3 - 128)\n );\n else\n str[j++] = chr(\n ((code - 240) << 18) +\n ((code2 - 128) << 12) +\n ((code3 - 128) << 6) +\n (code4 - 128)\n );\n }\n return str.join(\"\");\n}", "function decodeUTF8(str){\n if(!str) str = \"\";\n str = str.replace(\n /[\\u00c0-\\u00df][\\u0080-\\u00bf]/g, // 2-byte chars\n function(c) { // (note parentheses for precence)\n var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;\n return String.fromCharCode(cc); }\n );\n str = str.replace(\n /[\\u00e0-\\u00ef][\\u0080-\\u00bf][\\u0080-\\u00bf]/g, // 3-byte chars\n function(c) { // (note parentheses for precence)\n var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f);\n return String.fromCharCode(cc); }\n );\n return str;\n}", "function ucs2decode(string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n\n while (counter < length) {\n var value = string.charCodeAt(counter++);\n\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n var extra = string.charCodeAt(counter++);\n\n if ((extra & 0xFC00) == 0xDC00) {\n // eslint-disable-line eqeqeq\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n\n return output;\n}", "function decode_utf8( s ) \n{\n\t return decodeURIComponent( escape( s ) );\n}", "function utf8_decode(utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c =0, c1=0, c2 = 0;\n\n\t\twhile ( i < utftext.length ) {\n\n\t\t\tc = utftext.charCodeAt(i);\n\t\n\t\t\tif (c < 128) {\n\t\t\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if((c > 191) && (c < 224)) {\n\t\t\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\t\t\ti += 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decodeUtf8(str) {\n return decodeURIComponent(window.escape(str));\n}", "function decode(stringToDecode) {\n let decodedString = constructStringToCodeAndEncode(stringToDecode);\n return decodedString;\n}", "function _utf8_decode(utftext) {\n\t\t\t\t\tvar string = \"\";\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tvar c = c1 = c2 = 0;\n\t\t\t\t\twhile(i < utftext.length) {\n\t\t\t\t\t\tc = utftext.charCodeAt(i);\n\t\t\t\t\t\tif(c < 128) {\n\t\t\t\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if((c > 191) && (c < 224)) {\n\t\t\t\t\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\t\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\t\t\t\ti += 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\t\t\t\t\tc3 = utftext.charCodeAt(i + 2);\n\t\t\t\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\t\t\t\ti += 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn string;\n\t\t\t\t}", "function decode(s) {\n var dict = {};\n var data = (s + \"\").split(\"\");\n var currChar = data[0];\n var oldPhrase = currChar;\n var out = [currChar];\n var code = 256;\n var phrase;\n for (var i = 1; i < data.length; i++) {\n var currCode = data[i].charCodeAt(0);\n if (currCode < 256) {\n phrase = data[i];\n }\n else {\n phrase = dict[currCode] ? dict[currCode] : (oldPhrase + currChar);\n }\n out.push(phrase);\n currChar = phrase.charAt(0);\n dict[code] = oldPhrase + currChar;\n code++;\n oldPhrase = phrase;\n }\n return out.join(\"\");\n }", "function utf8Decode(utf8str) {\n var str = new Array();\n var pos = 0;\n var tmpStr = \"\";\n var j = 0;\n while ((pos = utf8str.search(/[^\\x00-\\x7F]/)) != -1) {\n tmpStr = utf8str.match(/([^\\x00-\\x7F]+[\\x00-\\x7F]{0,10})+/)[0];\n str[j++] = utf8str.substr(0, pos) + _utf8Decode(tmpStr);\n utf8str = utf8str.substr(pos + tmpStr.length);\n }\n\n str[j++] = utf8str;\n return str.join(\"\");\n}", "function decode_utf8(utftext) {\n\tvar string = \"\";\n\tvar i = 0;\n\tvar c = c1 = c2 = 0;\n\n\twhile (i < utftext.length) {\n\t\tc = utftext.charCodeAt(i);\n\t\tif (c < 128) {\n\t\t\tstring += String.fromCharCode(c);\n\t\t\ti++;\n\t\t} else if ((c > 191) && (c < 224)) {\n\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\ti += 2;\n\t\t} else {\n\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\tc3 = utftext.charCodeAt(i + 2);\n\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\ti += 3;\n\t\t}\n\t\t///ultimos toques\n\t\tstring = string.replace('�', '�');\n\t}\n\n\treturn string;\n}", "_utf8_decode (utftext) {\r\n var string = \"\";\r\n var i = 0,\r\n c =0,\r\n c1 = 0,\r\n c2 = 0,\r\n c3 = 0;\r\n while (i < utftext.length) {\r\n c = utftext.charCodeAt(i);\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n } else if ((c > 191) && (c < 224)) {\r\n c2 = utftext.charCodeAt(i + 1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n } else {\r\n c2 = utftext.charCodeAt(i + 1);\r\n c3 = utftext.charCodeAt(i + 2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n }\r\n return string;\r\n }", "function mydecode(str)\n{\n // first, replace all plus signs with spaces\n var mystr = str.replace(/\\+/g, \" \");\n\n // next, use decodeURIComponent to replace all of the remaining\n // encoded characers with their actual values\n mystr = decodeURIComponent(mystr);\n\n return mystr;\n}", "function decode(str)\n{\n var s0, i, j, s, ss, u, n, f;\n \n s0 = \"\"; // decoded str\n\n for (i = 0; i < str.length; i++)\n { \n // scan the source str\n s = str.charAt(i);\n\n if (s == \"+\") \n {\n // \"+\" should be changed to SP\n s0 += \" \";\n } \n else \n {\n if (s != \"%\") \n {\n // add an unescaped char\n s0 += s;\n } \n else\n { \n // escape sequence decoding\n u = 0; // unicode of the character\n\n f = 1; // escape flag, zero means end of this sequence\n\n while (true) \n {\n ss = \"\"; // local str to parse as int\n for (j = 0; j < 2; j++ ) \n { \n // get two maximum hex characters for parse\n sss = str.charAt(++i);\n\n if (((sss >= \"0\") && (sss <= \"9\")) || ((sss >= \"a\") && (sss <= \"f\")) || ((sss >= \"A\") && (sss <= \"F\"))) \n {\n ss += sss; // if hex, add the hex character\n } \n else \n {\n // not a hex char., exit the loop\n --i; \n break;\n } \n }\n\n // parse the hex str as byte\n n = parseInt(ss, 16);\n\n // single byte format\n if (n <= 0x7f) { u = n; f = 1; }\n\n // double byte format\n if ((n >= 0xc0) && (n <= 0xdf)) { u = n & 0x1f; f = 2; }\n\n // triple byte format\n if ((n >= 0xe0) && (n <= 0xef)) { u = n & 0x0f; f = 3; }\n\n // quaternary byte format (extended)\n if ((n >= 0xf0) && (n <= 0xf7)) { u = n & 0x07; f = 4; }\n\n // not a first, shift and add 6 lower bits\n if ((n >= 0x80) && (n <= 0xbf)) { u = (u << 6) + (n & 0x3f); --f; }\n\n // end of the utf byte sequence\n if (f <= 1) { break; } \n\n if (str.charAt(i + 1) == \"%\") \n { \n // test for the next shift byte\n i++ ; \n } \n else \n {\n // abnormal, format error\n break;\n } \n }\n\n // add the escaped character\n s0 += String.fromCharCode(u);\n\n }\n }\n }\n\n return s0;\n\n}", "function prepareUnicodeDecode(str) {\n return decodeURIComponent(\n str\n .split('')\n .map(function(c) {\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)\n })\n .join('')\n )\n}", "function unescapeUnicode(str) {\r\n // unescape unicode codes\r\n var codes = [];\r\n var code = parseInt(str.substr(2), 16);\r\n if (code >= 0 && code < Math.pow(2, 16)) {\r\n codes.push(code);\r\n }\r\n // convert codes to text\r\n var unescaped = '';\r\n for (var i = 0; i < codes.length; ++i) {\r\n unescaped += String.fromCharCode(codes[i]);\r\n }\r\n return unescaped;\r\n}", "function _decode(encodedText){\n var decodedText = \"\";\n for(i=0 ; i<encodedText.length ; i++){\n decodedText += String.fromCharCode(encodedText[i]);\n }\n return decodedText;\n}", "function utf8_decode (str_data){\n\t\n\tvar tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0;\t\n\tstr_data += '';\n\t\n\twhile(i < str_data.length){\n\t\tc1 = str_data.charCodeAt(i);\n\t\tif(c1 < 128){\n\t\t\ttmp_arr[ac++] = String.fromCharCode(c1);\n\t\t\ti++;\n\t\t}else if (c1 > 191 && c1 < 224){\n\t\t\tc2 = str_data.charCodeAt(i + 1);\n\t\t\ttmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n\t\t\ti += 2;\n\t\t}else{\n\t\t\tc2 = str_data.charCodeAt(i + 1);\n\t\t\tc3 = str_data.charCodeAt(i + 2);\n\t\t\ttmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn tmp_arr.join('');\n}", "function utf8_decode(str_data) {\n\n\tvar tmp_arr = [],\n\ti = 0,\n\tac = 0,\n\tc1 = 0,\n\tc2 = 0,\n\tc3 = 0;\n\n\tstr_data += '';\n\n\twhile (i < str_data.length) {\n\t\tc1 = str_data.charCodeAt(i);\n\t\tif (c1 < 128) {\n\t\t\ttmp_arr[ac++] = String.fromCharCode(c1);\n\t\t\ti++;\n\t\t} else if (c1 > 191 && c1 < 224) {\n\t\t\tc2 = str_data.charCodeAt(i + 1);\n\t\t\ttmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n\t\t\ti += 2;\n\t\t} else {\n\t\t\tc2 = str_data.charCodeAt(i + 1);\n\t\t\tc3 = str_data.charCodeAt(i + 2);\n\t\t\ttmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn tmp_arr.join('');\n}", "function _utf8_decode(utftext) {\n var string = \"\";\n var i = 0;\n var c = 0; var c1 = 0; var c2 = 0;var c3= 0;\n\n while (i < utftext.length) {\n\n c = utftext.charCodeAt(i);\n\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n }\n else if ((c > 191) && (c < 224)) {\n c2 = utftext.charCodeAt(i + 1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n }\n else {\n c2 = utftext.charCodeAt(i + 1);\n c3 = utftext.charCodeAt(i + 2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n\n }\n\n return string;\n }", "function decodeUtf8( s ) {\n try {\n if (decodeURIComponent)\n return decodeURIComponent( escape(s) );\n else\n return s;\n } catch (e) {\n return s;\n }\n}", "function decodeString(s) {\n var index = 0\n return decodeHelper(s, index)\n}", "function utf8_decode(str_data){\n\t\n\tvar tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0;\t\n\tstr_data += '';\n\t\n\twhile(i < str_data.length){\n\t\tc1 = str_data.charCodeAt(i);\n\t\tif(c1 < 128){\n\t\t\ttmp_arr[ac++] = String.fromCharCode(c1);\n\t\t\ti++;\n\t\t}else if (c1 > 191 && c1 < 224){\n\t\t\tc2 = str_data.charCodeAt(i + 1);\n\t\t\ttmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n\t\t\ti += 2;\n\t\t}else{\n\t\t\tc2 = str_data.charCodeAt(i + 1);\n\t\t\tc3 = str_data.charCodeAt(i + 2);\n\t\t\ttmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn tmp_arr.join('');\n}", "function unescapeUnicode(str) {\n // unescape unicode codes\n var codes = [];\n var code = parseInt(str.substr(2), 16);\n if (code >= 0 && code < Math.pow(2, 16)) {\n codes.push(code);\n }\n // convert codes to text\n var unescaped = '';\n for (var i = 0; i < codes.length; ++i) {\n unescaped += String.fromCharCode(codes[i]);\n }\n return unescaped;\n}", "function unescapeUnicode(str) {\n // unescape unicode codes\n var codes = [];\n var code = parseInt(str.substr(2), 16);\n if (code >= 0 && code < Math.pow(2, 16)) {\n codes.push(code);\n }\n // convert codes to text\n var unescaped = '';\n for (var i = 0; i < codes.length; ++i) {\n unescaped += String.fromCharCode(codes[i]);\n }\n return unescaped;\n}", "function utf8Decode(utftext) {\n var string = '';\n var i = 0;\n var c = 0;\n var c1 = 0;\n var c2 = 0;\n var c3 = 0;\n while (i < utftext.length) {\n c = utftext.charCodeAt(i);\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n } else if ((c > 191) && (c < 224)) {\n c2 = utftext.charCodeAt(i + 1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n } else {\n c2 = utftext.charCodeAt(i + 1);\n c3 = utftext.charCodeAt(i + 2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n }\n return string;\n }", "function Utf8_decode(utftext) {\r\n var string = \"\";\r\n var i = 0;\r\n var c = c1 = c2 = 0;\r\n while ( i < utftext.length ) {\r\n c = utftext.charCodeAt(i);\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n } else if((c > 191) && (c < 224)) {\r\n c2 = utftext.charCodeAt(i+1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n } else {\r\n c2 = utftext.charCodeAt(i+1);\r\n c3 = utftext.charCodeAt(i+2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n }\r\n return string;\r\n}", "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "function unescapeUnicode(str){\n\t str = toString(str);\n\t return str.replace(/\\\\u[0-9a-f]{4}/g, function(ch){\n\t var code = parseInt(ch.slice(2), 16);\n\t return String.fromCharCode(code);\n\t });\n\t }", "function decode( str ) {\n\t\t\ttry {\n\t\t\t\treturn(decodeURI(str.replace(/%25/g, \"\\x00\")).replace(/\\x00/g, \"%25\"));\n\t\t\t} catch (e) {\n\t\t\t\treturn(str);\n\t\t\t}\n\t\t}", "function unescape(str){\n return decodeURIComponent(str.replace(/\\~0/,'~').replace(/\\~1/,'/'));\n}", "function utf8Decode(utf8String) {\n if (typeof utf8String != 'string') throw new TypeError('parameter ‘utf8String’ is not a string');\n const unicodeString = utf8String.replace(\n /[\\u00e0-\\u00ef][\\u0080-\\u00bf][\\u0080-\\u00bf]/g, // 3-byte chars\n function(c) { // (note parentheses for precedence)\n var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f);\n return String.fromCharCode(cc); }\n ).replace(\n /[\\u00c0-\\u00df][\\u0080-\\u00bf]/g, // 2-byte chars\n function(c) { // (note parentheses for precedence)\n var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;\n return String.fromCharCode(cc); }\n );\n return unicodeString;\n}", "function urldecode(string) {\n return decodeURIComponent(string.replace(/\\+/g, ' '));\n}", "decodeString(string) {\n\t\tconst parser = new DOMParser();\n\t\tconst dom = parser.parseFromString(\n\t\t\t'<!doctype html><body>' + string,\n\t\t\t'text/html');\n\t\treturn dom.body.textContent;\n\t}", "function utf8Decode(utftext) {\n let string = \"\";\n let i = 0;\n let c = c1 = c2 = 0;\n while (i < utftext.length) {\n c = utftext.charCodeAt(i);\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n } else if ((c > 191) && (c < 224)) {\n c2 = utftext.charCodeAt(i + 1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n } else {\n c2 = utftext.charCodeAt(i + 1);\n c3 = utftext.charCodeAt(i + 2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n }\n return string;\n}", "function decode(str) {\n if (typeof str != \"string\" ) {\n return \"Input is not a string\";\n }\n var alphabet = \"abcdefghijklmnopqrstuvwxyz\".split(\"\");\n var alphabetReversed = [];\n var phrase = [];\n var punctuation = \"'!.,$£%^&*()@:{}[];#~?\";\n for (var i=0; i<alphabet.length; i++) {\n alphabetReversed.unshift(alphabet[i]);\n }\n for (var i=0; i<str.length; i++) {\n if (punctuation.indexOf(str[i]) > -1 || !isNaN(str[i]) ) {\n phrase += str[i];\n } else {\n var letter = alphabetReversed[alphabet.indexOf(str[i].toLowerCase())];\n if ( str[i] == str[i].toUpperCase() ) {\n phrase += letter.toUpperCase();\n } else {\n phrase += letter;\n }\n }\n }\n return phrase;\n}", "function decodeString(string) {\n var elem = document.createElement(\"textarea\");\n elem.innerHTML = string;\n return elem.value;\n }", "function urldecode(s) {\n return decodeURIComponent(s);\n}", "function htmlDecode(s) {\n\treturn s.toString().replace(/&lt;/mg,\"<\").replace(/&nbsp;/mg,\"\\xA0\").replace(/&gt;/mg,\">\").replace(/&quot;/mg,\"\\\"\").replace(/&amp;/mg,\"&\");\n}", "function decode(input) {\n if (input === 'undefined' || input === null || undefined === '' || input === '0') {\n return input;\n }\n var output = '';\n var chr1;\n var chr2;\n var chr3;\n var enc1;\n var enc2;\n var enc3;\n var enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n while (i < input.length) {\n enc1 = keyStr.indexOf(input.charAt(i++));\n enc2 = keyStr.indexOf(input.charAt(i++));\n enc3 = keyStr.indexOf(input.charAt(i++));\n enc4 = keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output = output + String.fromCharCode(chr1);\n if (enc3 !== 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 !== 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = utf8Decode(output);\n return output;\n }", "function decode(str) {\r\n return decodeURIComponent((str+'').replace(/\\+/g, '%20'));\r\n //return unescape(str.replace(/\\+/g, \" \"));\r\n}", "function decodeText(text)\n {\n try\n {\n return decodeURIComponent(text);\n }\n catch (e)\n {\n return decodeURIComponent(unescape(text));\n }\n }", "function rawurldecode(str) {\r\n return decodeURIComponent(str);\r\n}", "_decodeString(_str) {\n console.warn('WARNING: _decodeString shouldn\\'t be called, but was called using: ' + _str);\n try {\n return decodeURIComponent(escape(_str));\n }\n catch (e) {\n console.log('_decodeString failed for _str: ', _str);\n return null;\n }\n }", "function decode(str){\n var decodedMessage = \"\";\n let strArr = str.split(\",\");\n\n // Convert to letters\n for (let i = 0; i < strArr.length; i++) {\n decodedMessage+= String.fromCharCode(parseInt(strArr[i], 16));\n }\n return decodedMessage;\n}", "function decodeUtf8SurrogatePair( b1, b2, b3, b4 ) {\n var codepoint = ((b1 & 0x07) << 18) + ((b2 & 0x3f) << 12) + ((b3 & 0x3f) << 6) + (b4 & 0x3f);\n return String.fromCharCode(0xD800 + ((codepoint - 0x10000) >> 10))\n + String.fromCharCode(0xDC00 + ((codepoint - 0x10000) & 0x3FF));\n}", "function decodeStr(s, decoder) {\r\n try {\r\n return decoder(s);\r\n } catch (e) {\r\n return QueryString.unescape(s, true);\r\n }\r\n}", "function dec(str) {\n var result = [];\n\n for (var i = 0; i < str.length; i++) {\n result.push(1 << +str[i]);\n }\n\n return result;\n} // Character types for codepoints 0 to 0xf8", "function decodeStr(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, true);\n }\n}", "function decodeStr(s, decoder) {\n try {\n return decoder(s);\n } catch (e) {\n return QueryString.unescape(s, true);\n }\n}", "function decode(string) {\n var div = document.createElement(\"div\");\n div.innerHTML = string; \n return typeof div.textContent !== 'undefined' ? div.textContent : div.innerText;\n}", "function decode(str) {\n //object representing the cipher\n const codeObj = {\n 'a': 1,\n 'b': 2,\n 'c': 3,\n 'd': 4\n };\n //create a vairable that is the first letter \n let decodedIndex = codeObj[str.charAt(0)];\n return str.charAt(decodedIndex);\n}", "function decode(text) {\r\n try {\r\n return decodeURIComponent('' + text);\r\n }\r\n catch (err) {\r\n ( false) && false;\r\n }\r\n return '' + text;\r\n}", "function decode2(string){\n return string.replace(/[1-5]/g, function (x) { return '_aeiou'.charAt(x) });\n}", "function decode(symbols, code) {\n\n\tvar arrayCode = code.split(',');\n\n\tvar textUncompressed = \"\";\n\n\tvar arraySymbols = [\"\"];\n\tfor (var i = 1; i < symbols.length; i++) {\n\t\tarraySymbols[i] = symbols.charAt(i);\n\t}\n\n\tfor (var i = 0; i < arrayCode.length-1; i++) {\n\t\t\n\t\tvar currentChar = arraySymbols[arrayCode[i]];\n\n\t\tif(currentChar == \"\"){\n\t\t\tbreak;\n\t\t}\n\n\t\tif(arraySymbols[arrayCode[i+1]] == undefined){\n\t\t\tbreak;\n\t\t}\n\n\t\tvar nextChar = arraySymbols[arrayCode[i+1]].charAt(0);\n\t\ttextUncompressed += currentChar;\n\t\tarraySymbols[arraySymbols.length] = currentChar+nextChar;\n\t}\t\n\n\tconsole.log(textUncompressed+symbols.charAt(0));\n\n}", "function decodeText(TextToDcode) {\n try {\n return TextToDcode\n .replace(/&gt;/g, \">\")\n .replace(/&lt;/g, \"<\")\n .replace(/%3F/g, \"?\")\n .replace(/%20/g, \" \")\n .replace(/%3D/g, \"=\")\n .replace(/%26/g, \"&\")\n .replace(/%40/g, \"@\")\n .replace(/%2B/g, \"+\")\n .replace(/%26/g, \"&\")\n .replace(/%2C/g, \",\")\n .replace(/&amp;/g, \"&\")\n .replace(/%5E/g, \"^\")\n .replace(/&amp;/g, '&')\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&quot;/g, '\"')\n .replace(/%20/g, ' ')\n .replace(/%23/g, '#')\n .replace(/%5B/g, '[')\n .replace(/%5D/g, ']')\n .replace(/%2c/g, \",\")\n .replace(/%28/g, \"(\")\n .replace(/%29/g, \")\")\n .replace(/%2F/g, \"/\")\n .replace(/&#039/g, \"'\")\n .replace(/%2f/g, \"/\")\n .replace(/%3a/g, \":\")\n .replace(/%27/g, \"'\")\n .replace(/&#39;/g, \"'\")\n .replace(/&#92;/g, \"\\\\\");\n }\n catch (ex) {\n ExceptionHandling(ex);\n }\n}", "function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }", "decode([...chars]) {\n return String.fromCharCode(...chars.map((char, i) =>\n ((char.charCodeAt(0) - ASCII_START) - (this.#keyShift[i % this.#keyShift.length]) + ASCII_LENGTH)\n % ASCII_LENGTH + ASCII_START))\n }", "function test2() {\n punycode = require('punycode');\n console.log(punycode.encode('☃-⌘'));\n}", "function decode(a, b) {\r\n if (a == null || typeof a == \"undefined\")\r\n return a;\r\n else\r\n return unescape(a);\r\n }", "function decodeString(str) {\n const textArea = document.createElement('textarea')\n textArea.innerHTML = str\n return textArea.value\n}", "function decodeHtml(str) {\n var doc = new DOMParser().parseFromString(str, \"text/html\");\n str = doc.documentElement.textContent;\n return str.replace(/&#(\\d+);/g, function(match, dec) {\n return String.fromCharCode(dec);\n });\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decodeString(str){\n var textArea=document.createElement('textarea')\n textArea.innerHTML=str\n return textArea.value\n }", "function urldecode(str) {\r\n\treturn decodeURIComponent((str + '').replace(/\\+/g, '%20'));\r\n}", "function decode(text) {\r\n try {\r\n return decodeURIComponent('' + text);\r\n }\r\n catch (err) {\r\n ( true) && warn(`Error decoding \"${text}\". Using original value`);\r\n }\r\n return '' + text;\r\n}", "function decodeUnsafe(string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }", "function decode (input) {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n while (i < input.length) {\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output = output + String.fromCharCode(chr1);\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = _utf8_decode(output);\n return output;\n }", "function decodeEntity(string){\r\n\t\treturn string.replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&apos;/g,\"'\").replace(/&quot;/g,\"\\\"\").replace(/&amp;/g, \"&\");\r\n\t}", "function decode(data) {\n let built = \"\"\n for (let i = 0; i < data.length; i++) {\n built += String.fromCharCode(data[i])\n }\n return built\n }" ]
[ "0.73295796", "0.7266751", "0.7171343", "0.71384007", "0.7037509", "0.7025843", "0.7025843", "0.7003679", "0.698886", "0.6915208", "0.6913451", "0.6899496", "0.6884492", "0.68683946", "0.68683946", "0.68683946", "0.68683946", "0.68683946", "0.68683946", "0.68683946", "0.6822371", "0.68197215", "0.6773637", "0.6712398", "0.6684859", "0.66794765", "0.66794765", "0.66794765", "0.66722226", "0.66136914", "0.6593669", "0.6550671", "0.6548647", "0.6543435", "0.6509463", "0.6506063", "0.6500485", "0.64823365", "0.6480647", "0.64474505", "0.6447192", "0.6442212", "0.6430054", "0.6411662", "0.6408659", "0.6372316", "0.6372316", "0.6370023", "0.6368219", "0.63503325", "0.63503325", "0.63503325", "0.63494605", "0.6318815", "0.63181716", "0.62710434", "0.6242535", "0.6238333", "0.6217178", "0.62164", "0.6216157", "0.6209333", "0.62031335", "0.61760587", "0.61702824", "0.6133384", "0.6100766", "0.60292894", "0.6015805", "0.60117626", "0.60067236", "0.60054326", "0.59966564", "0.59966564", "0.59799874", "0.59797615", "0.59486055", "0.59347695", "0.5903023", "0.5885367", "0.58702093", "0.58630687", "0.58462906", "0.58356714", "0.58322686", "0.5827676", "0.5821738", "0.5821738", "0.5821738", "0.5821738", "0.5821738", "0.5821738", "0.5821738", "0.58200556", "0.581711", "0.5816111", "0.58144677", "0.5814199", "0.58141416", "0.5789253" ]
0.58875865
79
punycode.encode(string) It is used to convert a string of Unicode symbols to a Punycode string of ASCII symbols.
function test2() { punycode = require('punycode'); console.log(punycode.encode('☃-⌘')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _utf8_encode (string) {\n \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 }", "function stringEncode(str) {}", "function _utf8_encode(string) {\n string = string.replace(/\\r\\n/g, \"\\n\");\n var utftext = \"\";\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if ((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\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 return utftext;\n }", "function encode(s)\r\n{\r\n\ts = new String(s);\r\n\tvar sbuf = new String(\"\");\r\n\r\n\tvar len = s.length;\r\n\tfor (var i = 0; i < len; i++)\r\n\t{\r\n\t\tvar ch = s.charAt(i);\r\n\t\tvar chCode = s.charCodeAt(i);\r\n\t\tif ('A' <= ch && ch <= 'Z')\r\n\t\t{\t\t// 'A'..'Z'\r\n\t\t\tsbuf+=ch;\r\n\t\t}\r\n\t\telse if ('a' <= ch && ch <= 'z')\t// 'a'..'z'\r\n\t\t{\r\n\t\t\tsbuf+=ch;\r\n\t\t}\r\n\t\telse if ('0' <= ch && ch <= '9')\t// '0'..'9'\r\n\t\t{\r\n\t\t\tsbuf+=ch;\r\n\t\t}\r\n\t\telse if (chCode <= 0x007f)\t// other ASCII\r\n\t\t{\r\n\t\t\tsbuf+=hex[chCode];\r\n\t\t}\r\n\t\telse if (chCode <= 0x07FF)\t\t// non-ASCII <= 0x7FF\r\n\t\t{\r\n\t\t\tsbuf+=(hex[0xc0 | (chCode >> 6)]);\r\n\t\t\tsbuf+=(hex[0x80 | (chCode & 0x3F)]);\r\n\t\t}\r\n\t\telse\t\t\t\t\t// 0x7FF < ch <= 0xFFFF\r\n\t\t{\r\n\t\t\tsbuf+=(hex[0xe0 | (chCode >> 12)]);\r\n\t\t\tsbuf+=(hex[0x80 | ((chCode >> 6) & 0x3F)]);\r\n\t\t\tsbuf+=(hex[0x80 | (chCode & 0x3F)]);\r\n\t\t}\r\n\t}\r\n\treturn sbuf;\r\n}", "function encode(string){\n\n}", "function _utf8Encode(str) {\n var utf8str = new Array();\n for (var i = 0; i < str.length; i++) {\n utf8str[i] = code2utf(str.charCodeAt(i));\n }\n return utf8str.join(\"\");\n}", "_utf8_encode(string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n for (var n = 0; n < string.length; n++) {\r\n var c = string.charCodeAt(n);\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n } else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n } else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n\r\n }\r\n return utftext;\r\n }", "function utf8Encode(string) {\n\t\tstring = string.replace(/\\r\\n/g, \"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t}\n\t\t\telse if ((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\t\t}\n\t\treturn utftext;\n\t}", "function encode_utf8(s) {\n\t return encode_latin1(unescape(encodeURIComponent(s)));\n\t }", "function encode_utf8(s) {\r\n\treturn unescape(encodeURIComponent(s));\r\n }", "function utf8Encode(string) {\n string = string.replace(/\\\\r\\\\n/g,\"\\\\n\");\n var utftext = \"\";\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(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 return utftext;\n }", "function utf8Encode(string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n for (var n = 0; n < string.length; n++) {\r\n var c = string.charCodeAt(n);\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n }\r\n return utftext;\r\n }", "function utfEncode(string) {\n\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\tvar utftext = \"\";\n\n\tfor (var n = 0; n < string.length; n++) {\n\t\tvar c = string.charCodeAt(n);\n\t\tif (c < 128) {\n\t\t\tutftext += String.fromCharCode(c);\n\t\t}\n\t\telse if((c > 127) && (c < 2048)) {\n\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t}\n\t\telse {\n\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t}\n\t}\n\treturn utftext;\n}", "function utf8Encode(string) {\n string = string.replace(/\\r\\n/g,\"\\n\");\n var utftext = \"\";\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(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 return utftext;\n }", "function utf8Encode(string) {\n\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\tvar utftext = \"\";\n\tfor (var n = 0; n < string.length; n++) {\n\t\tvar c = string.charCodeAt(n);\n\t\tif (c < 128) {\n\t\t\tutftext += String.fromCharCode(c);\n\t\t}\n\t\telse if((c > 127) && (c < 2048)) {\n\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t}\n\t\telse {\n\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t}\n\t}\n\treturn utftext;\n}", "function encode_utf8(s) {\n return unescape(encodeURIComponent(s));\n}", "function utf8Encode(string) {\n string = string.replace(/\\r\\n/g, '\\n');\n var utftext = '';\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if ((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\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 return utftext;\n }", "function encode_utf8( s )\n{\n \n return unescape( encodeURIComponent( s ) );\n}", "function utf8Encode(string) {\n string = string.replace(/\\r\\n/g, \"\\n\");\n let utftext = \"\";\n for (let n = 0; n < string.length; n++) {\n let c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if ((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\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 return utftext;\n}", "function encode (str, encoded) {\n table[encoded = str.split('').map(function (s) {\n if (s.charCodeAt(0) > 127) { return s }\n return String.fromCharCode(s.charCodeAt(0) + 0x2800);\n }).join('')] = str;\n return encoded;\n}", "function encodeUTF8(input) {\n\t var output = \"\";\n\t\n\t for (var i = 0; i < input.length; i++) {\n\t var c = input.charCodeAt(i);\n\t\n\t if (c < 0x80) {\n\t // One byte\n\t output += fromCharCode(c);\n\t } else if (c < 0x800) {\n\t // Two bytes\n\t output += fromCharCode(0xC0 | (c >>> 6));\n\t output += fromCharCode(0x80 | (c & 0x3f));\n\t } else if (c < 0x10000) {\n\t // Three bytes\n\t output += fromCharCode(0xE0 | (c >>> 12));\n\t output += fromCharCode(0x80 | (c >>> 6 & 0x3f));\n\t output += fromCharCode(0x80 | (c & 0x3f));\n\t }\n\t }\n\t\n\t return output;\n\t}", "function windows1252_encode(s) {\n var ret = new Uint8Array(s.length);\n for (var i = 0; i < s.length; i++) {\n ret[i] = s.charCodeAt(i);\n }\n return ret;\n}", "function utf8Encode(str) {\n var utf8str = new Array();\n var pos,\n j = 0;\n var tmpStr = \"\";\n\n while ((pos = str.search(/[^\\x00-\\x7F]/)) != -1) {\n tmpStr = str.match(/([^\\x00-\\x7F]+[\\x00-\\x7F]{0,10})+/)[0];\n utf8str[j++] = str.substr(0, pos);\n utf8str[j++] = _utf8Encode(tmpStr);\n str = str.substr(pos + tmpStr.length);\n }\n\n utf8str[j++] = str;\n return utf8str.join(\"\");\n}", "encode(chars) {\n const bytes = [];\n for (let i = 0; i < chars.length; i += 1) {\n const char = chars[i];\n if (char === 96) {\n bytes.push(char);\n bytes.push(char);\n } else if (char === 10) {\n bytes.push(char);\n } else if (char >= 32 && char <= 126) {\n bytes.push(char);\n } else {\n let str = '';\n if (char >= 0 && char <= 31) {\n str += `\\`x${ascii[char]}`;\n } else if (char >= 127 && char <= 255) {\n str += `\\`x${ascii[char]}`;\n } else if (char >= 0x100 && char <= 0xffff) {\n str += `\\`u${ascii[(char >> 8) & mask[8]]}${ascii[char & mask[8]]}`;\n } else if (char >= 0x10000 && char <= 0xffffffff) {\n str += '`u{';\n const digit = (char >> 24) & mask[8];\n if (digit > 0) {\n str += ascii[digit];\n }\n str += `${ascii[(char >> 16) & mask[8]] + ascii[(char >> 8) & mask[8]] + ascii[char & mask[8]]}}`;\n } else {\n throw new Error('escape.encode(char): char > 0xffffffff not allowed');\n }\n const buf = Buffer.from(str);\n buf.forEach((b) => {\n bytes.push(b);\n });\n }\n }\n return Buffer.from(bytes);\n }", "function prepareUnicodeEncode(str) {\n return encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {\n return String.fromCharCode(`0x${p1}`)\n })\n}", "function html_encode(string) {\n\treturn string.replace(/&/g, \"&amp;\").replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\").replace(/\"/g, \"&quot;\");\n}", "function encode(str)\n{\n out = '';\n\n for (a = 0; a < str.length; a++)\n {\n c = str.charAt(a);\n\n if (c == \"'\")\n {\n out += '\\\\';\n }\n\n out += c;\n }\n\n return out;\n}", "function encodeUTF8( str ){\n if(!str) str = \"\";\n // use regular expressions & String.replace callback function for better efficiency\n // than procedural approaches\n str = str.replace(\n /[\\u0080-\\u07ff]/g, // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz\n function(c) {\n var cc = c.charCodeAt(0);\n return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }\n );\n str = str.replace(\n /[\\u0800-\\uffff]/g, // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz\n function(c) {\n var cc = c.charCodeAt(0);\n return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }\n );\n return str;\n}", "function encode(word) {\n //somewhere to store the converted caracters\n let result = [];\n //next we loop over each character in the string.\n for (let position = 0; position < word.length; position++) {\n //and save the charcode to the array\n result.push(word.charCodeAt(position));\n }\n // and return that list of codes, separated by colons\n return result.join(':');\n}", "function h$encodeUtf8(str) {\n var i, low;\n var n = 0;\n for(i=0;i<str.length;i++) {\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n var c = str.charCodeAt(i);\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n if(c <= 0x7F) {\n n++;\n } else if(c <= 0x7FF) {\n n+=2;\n } else if(c <= 0xFFFF) {\n n+=3;\n } else if(c <= 0x1FFFFF) {\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n n+=5;\n } else {\n n+=6;\n }\n }\n var v = h$newByteArray(n+1);\n var u8 = v.u8;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n// h$log(\"### encoding char \" + c + \" to UTF-8: \" + String.fromCodePoint(c));\n if(c <= 0x7F) {\n u8[n] = c;\n n++;\n } else if(c <= 0x7FF) {\n u8[n] = (c >> 6) | 0xC0;\n u8[n+1] = (c & 0x3F) | 0x80;\n n+=2;\n } else if(c <= 0xFFFF) {\n u8[n] = (c >> 12) | 0xE0;\n u8[n+1] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+2] = (c & 0x3F) | 0x80;\n n+=3;\n } else if(c <= 0x1FFFFF) {\n u8[n] = (c >> 18) | 0xF0;\n u8[n+1] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+3] = (c & 0x3F) | 0x80;\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n u8[n] = (c >> 24) | 0xF8;\n u8[n+1] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+4] = (c & 0x3F) | 0x80;\n n+=5;\n } else {\n u8[n] = (c >>> 30) | 0xFC;\n u8[n+1] = ((c >> 24) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+4] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+5] = (c & 0x3F) | 0x80;\n n+=6;\n }\n }\n u8[v.len-1] = 0; // terminator\n// h$log(\"### encodeUtf8: \" + str);\n// h$log(v);\n return v;\n}", "function h$encodeUtf8(str) {\n var i, low;\n var n = 0;\n for(i=0;i<str.length;i++) {\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n var c = str.charCodeAt(i);\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n if(c <= 0x7F) {\n n++;\n } else if(c <= 0x7FF) {\n n+=2;\n } else if(c <= 0xFFFF) {\n n+=3;\n } else if(c <= 0x1FFFFF) {\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n n+=5;\n } else {\n n+=6;\n }\n }\n var v = h$newByteArray(n+1);\n var u8 = v.u8;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n// h$log(\"### encoding char \" + c + \" to UTF-8: \" + String.fromCodePoint(c));\n if(c <= 0x7F) {\n u8[n] = c;\n n++;\n } else if(c <= 0x7FF) {\n u8[n] = (c >> 6) | 0xC0;\n u8[n+1] = (c & 0x3F) | 0x80;\n n+=2;\n } else if(c <= 0xFFFF) {\n u8[n] = (c >> 12) | 0xE0;\n u8[n+1] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+2] = (c & 0x3F) | 0x80;\n n+=3;\n } else if(c <= 0x1FFFFF) {\n u8[n] = (c >> 18) | 0xF0;\n u8[n+1] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+3] = (c & 0x3F) | 0x80;\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n u8[n] = (c >> 24) | 0xF8;\n u8[n+1] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+4] = (c & 0x3F) | 0x80;\n n+=5;\n } else {\n u8[n] = (c >>> 30) | 0xFC;\n u8[n+1] = ((c >> 24) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+4] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+5] = (c & 0x3F) | 0x80;\n n+=6;\n }\n }\n u8[v.len-1] = 0; // terminator\n// h$log(\"### encodeUtf8: \" + str);\n// h$log(v);\n return v;\n}", "function h$encodeUtf8(str) {\n var i, low;\n var n = 0;\n for(i=0;i<str.length;i++) {\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n var c = str.charCodeAt(i);\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n if(c <= 0x7F) {\n n++;\n } else if(c <= 0x7FF) {\n n+=2;\n } else if(c <= 0xFFFF) {\n n+=3;\n } else if(c <= 0x1FFFFF) {\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n n+=5;\n } else {\n n+=6;\n }\n }\n var v = h$newByteArray(n+1);\n var u8 = v.u8;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n// h$log(\"### encoding char \" + c + \" to UTF-8: \" + String.fromCodePoint(c));\n if(c <= 0x7F) {\n u8[n] = c;\n n++;\n } else if(c <= 0x7FF) {\n u8[n] = (c >> 6) | 0xC0;\n u8[n+1] = (c & 0x3F) | 0x80;\n n+=2;\n } else if(c <= 0xFFFF) {\n u8[n] = (c >> 12) | 0xE0;\n u8[n+1] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+2] = (c & 0x3F) | 0x80;\n n+=3;\n } else if(c <= 0x1FFFFF) {\n u8[n] = (c >> 18) | 0xF0;\n u8[n+1] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+3] = (c & 0x3F) | 0x80;\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n u8[n] = (c >> 24) | 0xF8;\n u8[n+1] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+4] = (c & 0x3F) | 0x80;\n n+=5;\n } else {\n u8[n] = (c >>> 30) | 0xFC;\n u8[n+1] = ((c >> 24) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+4] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+5] = (c & 0x3F) | 0x80;\n n+=6;\n }\n }\n u8[v.len-1] = 0; // terminator\n// h$log(\"### encodeUtf8: \" + str);\n// h$log(v);\n return v;\n}", "function h$encodeUtf8(str) {\n var i, low;\n var n = 0;\n for(i=0;i<str.length;i++) {\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n var c = str.charCodeAt(i);\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n if(c <= 0x7F) {\n n++;\n } else if(c <= 0x7FF) {\n n+=2;\n } else if(c <= 0xFFFF) {\n n+=3;\n } else if(c <= 0x1FFFFF) {\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n n+=5;\n } else {\n n+=6;\n }\n }\n var v = h$newByteArray(n+1);\n var u8 = v.u8;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n // non-BMP encoded as surrogate pair in JavaScript string, get actual codepoint\n if (0xD800 <= c && c <= 0xDBFF) {\n low = str.charCodeAt(i+1);\n c = ((c - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\n i++;\n }\n// h$log(\"### encoding char \" + c + \" to UTF-8: \" + String.fromCodePoint(c));\n if(c <= 0x7F) {\n u8[n] = c;\n n++;\n } else if(c <= 0x7FF) {\n u8[n] = (c >> 6) | 0xC0;\n u8[n+1] = (c & 0x3F) | 0x80;\n n+=2;\n } else if(c <= 0xFFFF) {\n u8[n] = (c >> 12) | 0xE0;\n u8[n+1] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+2] = (c & 0x3F) | 0x80;\n n+=3;\n } else if(c <= 0x1FFFFF) {\n u8[n] = (c >> 18) | 0xF0;\n u8[n+1] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+3] = (c & 0x3F) | 0x80;\n n+=4;\n } else if(c <= 0x3FFFFFF) {\n u8[n] = (c >> 24) | 0xF8;\n u8[n+1] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+4] = (c & 0x3F) | 0x80;\n n+=5;\n } else {\n u8[n] = (c >>> 30) | 0xFC;\n u8[n+1] = ((c >> 24) & 0x3F) | 0x80;\n u8[n+2] = ((c >> 18) & 0x3F) | 0x80;\n u8[n+3] = ((c >> 12) & 0x3F) | 0x80;\n u8[n+4] = ((c >> 6) & 0x3F) | 0x80;\n u8[n+5] = (c & 0x3F) | 0x80;\n n+=6;\n }\n }\n u8[v.len-1] = 0; // terminator\n// h$log(\"### encodeUtf8: \" + str);\n// h$log(v);\n return v;\n}", "function encode_utf8(s) {\r\n var i, necessary = false;\r\n\r\n for (i = 0; i < s.length; i++) {\r\n if ((s.charCodeAt(i) == 0x9D) ||\r\n\t \t(s.charCodeAt(i) > 0xFF)) {\r\n necessary = true;\r\n break;\r\n }\r\n }\r\n if (!necessary) {\r\n return s;\r\n }\r\n return String.fromCharCode(0x9D) + unicode_to_utf8(s);\r\n}", "function encode(stringToEncode) {\n let encodedString = constructStringToCodeAndEncode(stringToEncode);\n return encodedString;\n}", "_encodeString(_str) {\n console.warn('WARNING: _encodeString shouldn\\'t be called, but was called using: ' + _str);\n return unescape(encodeURIComponent(_str));\n }", "function strEncode(s) {\n s = s.replace(/&/g, \"&amp;\");\n s = s.replace(/\"/g, '&quot;');\n return s;\n }", "unicodeEncode(input) {\n let tempInput = input.replace(/\\r\\n/g, '\\n');\n let utftext = '';\n for (let n = 0; n < tempInput.length; n++) {\n let c = tempInput.charCodeAt(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 return utftext;\n }", "function encode (s) {\n return encodeURIComponent(s);\n}", "function str2rawstr_utf8(input) {\n\treturn unescape(encodeURIComponent(input));\n}", "function stringToUTF8 ( input ) {\n return new TextEncoder(\"utf-8\").encode(input);\n}", "function encode(str) {\n\t\t\t\t\tisEncoded = true;\n\n\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t}", "function encode(str) {\n\t\t\t\t\tisEncoded = true;\n\n\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t}", "function encode(str) {\n\t\t\t\t\tisEncoded = true;\n\n\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}", "function encodeHTMLEntities(string) {\n return string.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "function encodeUtf8$1(input) {\r\n var encoder = \r\n // tslint:disable-next-line\r\n typeof TextEncoder === 'undefined'\r\n ? // @ts-ignore\r\n new (require('util')).TextEncoder('utf-8') // Node.\r\n : new TextEncoder(); // Browser.\r\n // @ts-ignore\r\n return encoder.encode(input);\r\n}", "function encodeUtf8(input) {\r\n var encoder = \r\n // tslint:disable-next-line\r\n typeof TextEncoder === 'undefined'\r\n ? // @ts-ignore\r\n new (require('util')).TextEncoder('utf-8') // Node.\r\n : new TextEncoder(); // Browser.\r\n // @ts-ignore\r\n return encoder.encode(input);\r\n}", "function escapeString(string) {\n\t var result = '';\n\t var char;\n\t var escapeSeq;\n\n\t for (var i = 0; i < string.length; i++) {\n\t char = string.charCodeAt(i);\n\t escapeSeq = ESCAPE_SEQUENCES[char];\n\t result += !escapeSeq && isPrintable(char)\n\t ? string[i]\n\t : escapeSeq || encodeHex(char);\n\t }\n\n\t return result;\n\t}", "function escapeString(string) {\n\t var result = '';\n\t var char;\n\t var escapeSeq;\n\n\t for (var i = 0; i < string.length; i++) {\n\t char = string.charCodeAt(i);\n\t escapeSeq = ESCAPE_SEQUENCES[char];\n\t result += !escapeSeq && isPrintable(char)\n\t ? string[i]\n\t : escapeSeq || encodeHex(char);\n\t }\n\n\t return result;\n\t}", "function escapeString(string) {\n\t var result = '';\n\t var char;\n\t var escapeSeq;\n\n\t for (var i = 0; i < string.length; i++) {\n\t char = string.charCodeAt(i);\n\t escapeSeq = ESCAPE_SEQUENCES[char];\n\t result += !escapeSeq && isPrintable(char)\n\t ? string[i]\n\t : escapeSeq || encodeHex(char);\n\t }\n\n\t return result;\n\t}", "function encodeHTMLEntities(str) {\n const result = [];\n for (const word of str) {\n if (word.length) {\n result.push(`&#x${word.codePointAt(0).toString(16)};`);\n }\n }\n return result.join('');\n}", "function stringToUTF8Bytes(string) {\r\n return new TextEncoder().encode(string);\r\n}", "function encodeEntities(str) {\n return str.replace(/[\\u00A0-\\u9999<>\\&]/gim, char => {\n return \"&#\" + char.charCodeAt(0) + \";\";\n });\n}", "function escapeString$1(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex$1((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES$1[char];\n result += !escapeSeq && isPrintable$1(char)\n ? string[i]\n : escapeSeq || encodeHex$1(char);\n }\n\n return result;\n}", "function encodeUTF16BE(input) {\n\t var output = '';\n\t\n\t for (var i = 0; i < input.length; i++) {\n\t var c = input.charCodeAt(i);\n\t\n\t if (c < 0xFFFF) {\n\t output += encodeUnit(c);\n\t } else {\n\t var lead = ((c - 0x10000) >> 10) + 0xD800;\n\t var trail = ((c - 0x10000) & 0x3FF) + 0xDC00;\n\t output += encodeUnit(lead);\n\t output += encodeUnit(trail);\n\t }\n\t }\n\t\n\t return output;\n\t}", "function encodeApos (input)\n{\n\n var encoded = input.replace(/'/g, \"&apos\");\n return encoded;\n}", "function encode(stringLetras) {\n let resultado = stringLetras.replace(/a/gi, 1);\n resultado = resultado.replace(/e/gi, 2);\n resultado = resultado.replace(/i/gi, 3);\n resultado = resultado.replace(/o/gi, 4);\n resultado = resultado.replace(/u/gi, 5);\n return resultado;\n}", "toStr(str){\n str = str.replace(/(\\\\u)(\\w{1,4})/gi,function(v){\n return (String.fromCharCode(parseInt((escape(v).replace(/(%5Cu)(\\w{1,4})/g,\"$2\")),16)));\n });\n str = str.replace(/(&#x)(\\w{1,4});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23x)(\\w{1,4})(%3B)/g,\"$2\"),16));\n });\n str = str.replace(/(&#)(\\d{1,6});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23)(\\d{1,6})(%3B)/g,\"$2\")));\n });\n\n return str;\n }", "function htmlEncode(str) {\n var buf = [];\n\t\t\t\n for (var i=str.length-1;i>=0;i--) {\n buf.unshift(['&#', str[i].charCodeAt(), ';'].join(''));\n }\n\t\t\t\n return buf.join('');\n}", "function URLencode(str) {\n var re;\n\n /* ibiencodeURIComponent */\n str=escape(str);\n str=str.replace(/%u/g,'%25u').replace(/%([89A-F])/g,'%25u00$1');\n str=unescape(str);\n str=encodeURIComponent(str);\n re = new RegExp(\"'\",\"g\");\n str = str.replace(re,'%27');\n return str;\n}", "function escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\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}", "function utf8_encode(argString) {\n // discuss at: http://phpjs.org/functions/utf8_encode/\n // original by: Webtoolkit.info (http://www.webtoolkit.info/)\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: sowberry\n // improved by: Jack\n // improved by: Yves Sucaet\n // improved by: kirilloid\n // bugfixed by: Onno Marsman\n // bugfixed by: Onno Marsman\n // bugfixed by: Ulrich\n // bugfixed by: Rafal Kukawski\n // bugfixed by: kirilloid\n // example 1: utf8_encode('Kevin van Zonneveld');\n // returns 1: 'Kevin van Zonneveld'\n\n if (argString === null || typeof argString === 'undefined') {\n return '';\n }\n\n // .replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\");\n var string = (argString + '');\n var utftext = '',\n start, end, stringl = 0;\n\n start = end = 0;\n stringl = string.length;\n for (var n = 0; n < stringl; n++) {\n var c1 = string.charCodeAt(n);\n var enc = null;\n\n if (c1 < 128) {\n end++;\n } else if (c1 > 127 && c1 < 2048) {\n enc = String.fromCharCode(\n (c1 >> 6) | 192, (c1 & 63) | 128\n );\n } else if ((c1 & 0xF800) != 0xD800) {\n enc = String.fromCharCode(\n (c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n );\n } else {\n // surrogate pairs\n if ((c1 & 0xFC00) != 0xD800) {\n throw new RangeError('Unmatched trail surrogate at ' + n);\n }\n var c2 = string.charCodeAt(++n);\n if ((c2 & 0xFC00) != 0xDC00) {\n throw new RangeError('Unmatched lead surrogate at ' + (n - 1));\n }\n c1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;\n enc = String.fromCharCode(\n (c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n );\n }\n if (enc !== null) {\n if (end > start) {\n utftext += string.slice(start, end);\n }\n utftext += enc;\n start = end = n + 1;\n }\n }\n\n if (end > start) {\n utftext += string.slice(start, stringl);\n }\n\n return utftext;\n }", "function podPressencodeSource(str) {\r\n\t\tvar str = unescape(str);\r\n\t\tvar str = encodeURIComponent(str);\r\n\t\tvar str = unescape(str);\r\n\t\tvar ntexto = '';\r\n\t\tvar codekey = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-';\r\n\t\tfor ( var i = 0; i < String(str).length; i++ ) {\r\n\t\t\tvar tmpstr = \"0000\" + Number(str.charCodeAt(i)).toString(2);\r\n\t\t\tntexto += tmpstr.substr(tmpstr.length-8, 8);\r\n\t\t}\r\n\t\tntexto += \"00000\".substr( 0, 6-(ntexto).length % 6);\r\n\t\tstr = \"\";\r\n\t\tfor ( var i = 0; i < (ntexto).length-1; i += 6 ) {\r\n\t\t\tstr += codekey.substr( parseInt(ntexto.substr( i, 6), 2), 1 );\r\n\t\t}\r\n\t\treturn str;\r\n\t}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function escapeString(string) {\n var result = '';\n var char, nextChar;\n var escapeSeq;\n\n for (var i = 0; i < string.length; i++) {\n char = string.charCodeAt(i);\n // Check for surrogate pairs (reference Unicode 3.0 section \"3.7 Surrogates\").\n if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {\n nextChar = string.charCodeAt(i + 1);\n if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {\n // Combine the surrogate pair and store it escaped.\n result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);\n // Advance index one extra since we already used that char here.\n i++; continue;\n }\n }\n escapeSeq = ESCAPE_SEQUENCES[char];\n result += !escapeSeq && isPrintable(char)\n ? string[i]\n : escapeSeq || encodeHex(char);\n }\n\n return result;\n}", "function EncodeText(TextToDcode) {\n try {\n return TextToDcode\n .replace(/#/g, '%23')\n .replace(/&/g, \"&amp;\")\n .replace(/>/g, \"&gt;\")\n .replace(/</g, \"&lt;\")\n .replace(/\\\\/g, \"&92;\")\n .replace(/\\?/g, \"%3F\")\n .replace(/ /g, \"%20\")\n .replace(/=/g, \"%3D\")\n // .replace(/&/g, \"%26\")\n .replace(/@/g, \"%40\")\n .replace(/\\+/g, \"%2B\")\n //.replace(/&/g, \"%26\")\n .replace(/,/g, \"%2C\")\n\n .replace(/\\^/g, \"%5E\")\n // .replace(/&/g, '&amp;')\n // .replace(/</g, '&lt;')\n // .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/ /g, '%20')\n\n .replace(/\\[/g, '%5B')\n .replace(/]/g, '%5D')\n .replace(/,/g, \"%2c\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\//g, \"%2F\")\n .replace(/'/g, \"&039\")\n .replace(/\\//g, \"%2f\")\n .replace(/:/g, \"%3a\")\n .replace(/'/g, \"%27\")\n .replace(/'/g, \"&39;\")\n }\n catch (ex) {\n ExceptionHandling(ex);\n }\n}", "function encCodePoint(x, forced_len) {\n var len;\n var initial;\n var i;\n var nybbles = \"0123456789ABCDEF\";\n var initial_bytes = [ null, 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe ];\n var t;\n var res;\n\n // Supports extended UTF-8 up to 36 bits\n if (x < 0x80) { len = 1; }\n else if (x < 0x800) { len = 2; }\n else if (x < 0x10000) { len = 3; }\n else if (x < 0x200000) { len = 4; }\n else if (x < 0x4000000) { len = 5; }\n else if (x < 0x80000000) { len = 6; }\n else { len = 7; }\n\n if (typeof forced_len === 'number') {\n len = forced_len;\n }\n initial = initial_bytes[len];\n\n t = [];\n for (i = len - 1; i >= 0; i--) {\n if (i === 0) {\n t[i] = initial + x;\n } else {\n t[i] = (x & 0x3f) + 0x80;\n }\n x = x >>> 6;\n }\n\n res = [];\n for (i = 0; i < len; i++) {\n res.push('%' + nybbles.charAt((t[i] >>> 4) & 0x0f) +\n nybbles.charAt(t[i] & 0x0f));\n }\n\n return res.join('');\n}", "function encodeSingleQuote( str )\n{\n\treturn str.replace( /'/g, \"&apos;\" );\n}", "function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n }", "function convertStr(str) {\n var out = '';\n\n for (var i = 0; i < str.length; i++) {\n var charcode = str.charCodeAt(i);\n\n if (charcode < 0x0080) {\n out += String.fromCharCode(charcode);\n } else if (charcode < 0x0800) {\n out += String.fromCharCode(0xc0 | charcode >> 6);\n out += String.fromCharCode(0x80 | charcode & 0x3f);\n } else if (charcode < 0xd800 || charcode >= 0xe000) {\n out += String.fromCharCode(0xe0 | charcode >> 12);\n out += String.fromCharCode(0x80 | charcode >> 6 & 0x3f);\n out += String.fromCharCode(0x80 | charcode & 0x3f);\n } else {\n // This is a surrogate pair, so we'll reconsitute the pieces and work\n // from that\n i++;\n charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);\n out += String.fromCharCode(0xf0 | charcode >> 18);\n out += String.fromCharCode(0x80 | charcode >> 12 & 0x3f);\n out += String.fromCharCode(0x80 | charcode >> 6 & 0x3f);\n out += String.fromCharCode(0x80 | charcode & 0x3f);\n }\n }\n\n return out;\n}", "function convertStr(str) {\n var out = '';\n\n for (var i = 0; i < str.length; i++) {\n var charcode = str.charCodeAt(i);\n\n if (charcode < 0x0080) {\n out += String.fromCharCode(charcode);\n } else if (charcode < 0x0800) {\n out += String.fromCharCode(0xc0 | charcode >> 6);\n out += String.fromCharCode(0x80 | charcode & 0x3f);\n } else if (charcode < 0xd800 || charcode >= 0xe000) {\n out += String.fromCharCode(0xe0 | charcode >> 12);\n out += String.fromCharCode(0x80 | charcode >> 6 & 0x3f);\n out += String.fromCharCode(0x80 | charcode & 0x3f);\n } else {\n // This is a surrogate pair, so we'll reconsitute the pieces and work\n // from that\n i++;\n charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);\n out += String.fromCharCode(0xf0 | charcode >> 18);\n out += String.fromCharCode(0x80 | charcode >> 12 & 0x3f);\n out += String.fromCharCode(0x80 | charcode >> 6 & 0x3f);\n out += String.fromCharCode(0x80 | charcode & 0x3f);\n }\n }\n\n return out;\n}" ]
[ "0.7070263", "0.69961494", "0.69674325", "0.6890897", "0.6821374", "0.68053967", "0.6766335", "0.67479444", "0.67127615", "0.6686134", "0.6672746", "0.6656438", "0.6649787", "0.6644739", "0.66405827", "0.66018146", "0.6573514", "0.6568753", "0.653048", "0.6414546", "0.6380298", "0.6378194", "0.6369563", "0.6344491", "0.634036", "0.6299427", "0.62459415", "0.6231879", "0.61915445", "0.6181169", "0.6181169", "0.6181169", "0.6181169", "0.61737585", "0.61681944", "0.6148305", "0.6146833", "0.61289847", "0.60965955", "0.6074973", "0.6044548", "0.6044154", "0.6044154", "0.6044154", "0.60343045", "0.60343045", "0.60343045", "0.60343045", "0.60343045", "0.60343045", "0.60343045", "0.6005773", "0.59934783", "0.5951449", "0.5935238", "0.5935238", "0.5935238", "0.593373", "0.59314907", "0.59287834", "0.58921003", "0.58699113", "0.5866062", "0.5860407", "0.584785", "0.58403414", "0.58285874", "0.58269274", "0.58269274", "0.58269274", "0.58269274", "0.58031", "0.5796336", "0.57907444", "0.57784384", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.57531637", "0.5743421", "0.5741526", "0.57412213", "0.57142174", "0.5712099", "0.5712099" ]
0.60592884
40
punycode.toASCII(domain) It is used to convert a Unicode string representing a domain name to Punycode. Only the nonASCII part of the domain name is converted.
function test3() { punycode = require('punycode'); console.log(punycode.toASCII('mañana.com')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, ''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n if (IP_V6_REGEX_OBJECT.test(str)) {\n str = str.replace(\"[\", \"\").replace(\"]\", \"\");\n }\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function convertToASCII (string) {\n string.toLowerCase();\n\n string.replace(\"à\", \"a\");\n string.replace(\"á\", \"a\");\n string.replace(\"â\", \"a\");\n string.replace(\"ã\", \"a\");\n string.replace(\"ä\", \"a\");\n string.replace(\"å\", \"a\");\n string.replace(\"ă\", \"a\");\n string.replace(\"ā\", \"a\");\n\n string.replace(\"æ\", \"e\");\n string.replace(\"è\", \"e\");\n string.replace(\"é\", \"e\");\n string.replace(\"ê\", \"e\");\n string.replace(\"ë\", \"e\");\n\n string.replace(\"ì\", \"i\");\n string.replace(\"í\", \"i\");\n string.replace(\"î\", \"i\");\n string.replace(\"ï\", \"i\");\n\n string.replace(\"ò\", \"o\");\n string.replace(\"ó\", \"o\");\n string.replace(\"ö\", \"o\");\n\n string.replace(\"ù\", \"u\");\n string.replace(\"ú\", \"u\");\n string.replace(\"û\", \"u\");\n string.replace(\"ü\", \"u\");\n\n string.replace(\"ÿ\", \"y\");\n string.replace(\"ý\", \"y\");\n\n string.replace(\".\", \"\");\n string.replace(\",\", \"\");\n string.replace(\";\", \"\");\n \n return (string);\n}", "function native2ascii(){var character=document.getElementById(\"characterTa\").value.split(\"\");var ascii=\"\";for(var i=0;i<character.length;i++){var code=Number(character[i].charCodeAt(0));if(!document.getElementById(\"ignoreLetter\").checked||code>127){var charAscii=code.toString(16);charAscii=new String(\"0000\").substring(charAscii.length,4)+charAscii;ascii+=\"\\\\u\"+charAscii}else{ascii+=character[i];}};document.getElementById(\"asciiTa\").value=ascii;}", "function stringToASCII(str) {\n let output = ''\n for (var i = 0; i < str.length; i++) {\n output += str[i].charCodeAt(0) + ' '\n }\n return output\n}", "sanitize (domain) {\r\n return domain.replace(/[^a-zA-Z0-9.-]/g, '')\r\n }", "function test4() {\n punycode = require('punycode');\n console.log(punycode.toUnicode('xn--maana-pta.com'));\n}", "function myLetterToAscii(str) {\r\n\tvar result = \"\";\r\n\tif (!isNaN(str))\r\n\t\tresult = str;\r\n\tif (isNaN(str))\r\n\t\tresult = str.charCodeAt(0);\r\n\treturn result;\r\n}", "function convertPCname(name)\n\t{\n\t\t// Edit\n\t\tname = name.replace(/ /gi, '.');\n\t\tname = name.replace(/[^a-zA-Z0-9\\.]/g, '');\n\t\tname = name.toLowerCase();\n\n\t\treturn name;\n\t}", "function omn_renameDomain(domain){\n var array_domain= domain.split(\".\");\n if(array_domain.length == 3){//have un domain like los40.com.co or los40.com.ar\n domain= array_domain[0] + array_domain[2];\n }\n else{\n domain= array_domain[0] + array_domain[1];\n }\n return domain;\n}", "function stringToAscii(str, outPtr) {\nreturn writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\r\n return writeAsciiToMemory(str, outPtr, false);\r\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n}", "function codify(name) {\n if (!name) return '';\n // return name.toLowerCase().replace(/[\\&\\[\\]\\(\\)\\{\\}\\.\\?\\/# \\-_:'`~\\\\@\"']/g, '');\n return latinise(name).toLowerCase().replace(/[^a-zA-Z0-9]/g, '');\n }", "function stripNonAscii(str) {\n return str.replace(/[^\\x00-\\x7F]/ig, ' ');\n }", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n }", "canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n }", "canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n }", "function normalize (str) {\n let from = \"ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç\",\n to = \"AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuuNnCc\",\n mapping = {};\n\n for (let i = 0, j = from.length; i < j; i++)\n mapping[from.charAt(i)] = to.charAt(i);\n\n let ret = [];\n for (let i = 0, j = str.length; i < j; i++) {\n let c = str.charAt(i);\n if (mapping.hasOwnProperty(str.charAt(i))) ret.push(mapping[ c ]);\n else ret.push(c);\n }\n\n return ret.join(\"\");\n }", "normalizeString(name) {\n return name.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }", "function removeNonASCII(str){\n\t str = toString(str);\n\n\t // Matches non-printable ASCII chars -\n\t // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters\n\t return str.replace(/[^\\x20-\\x7E]/g, '');\n\t }", "function encode(s)\r\n{\r\n\ts = new String(s);\r\n\tvar sbuf = new String(\"\");\r\n\r\n\tvar len = s.length;\r\n\tfor (var i = 0; i < len; i++)\r\n\t{\r\n\t\tvar ch = s.charAt(i);\r\n\t\tvar chCode = s.charCodeAt(i);\r\n\t\tif ('A' <= ch && ch <= 'Z')\r\n\t\t{\t\t// 'A'..'Z'\r\n\t\t\tsbuf+=ch;\r\n\t\t}\r\n\t\telse if ('a' <= ch && ch <= 'z')\t// 'a'..'z'\r\n\t\t{\r\n\t\t\tsbuf+=ch;\r\n\t\t}\r\n\t\telse if ('0' <= ch && ch <= '9')\t// '0'..'9'\r\n\t\t{\r\n\t\t\tsbuf+=ch;\r\n\t\t}\r\n\t\telse if (chCode <= 0x007f)\t// other ASCII\r\n\t\t{\r\n\t\t\tsbuf+=hex[chCode];\r\n\t\t}\r\n\t\telse if (chCode <= 0x07FF)\t\t// non-ASCII <= 0x7FF\r\n\t\t{\r\n\t\t\tsbuf+=(hex[0xc0 | (chCode >> 6)]);\r\n\t\t\tsbuf+=(hex[0x80 | (chCode & 0x3F)]);\r\n\t\t}\r\n\t\telse\t\t\t\t\t// 0x7FF < ch <= 0xFFFF\r\n\t\t{\r\n\t\t\tsbuf+=(hex[0xe0 | (chCode >> 12)]);\r\n\t\t\tsbuf+=(hex[0x80 | ((chCode >> 6) & 0x3F)]);\r\n\t\t\tsbuf+=(hex[0x80 | (chCode & 0x3F)]);\r\n\t\t}\r\n\t}\r\n\treturn sbuf;\r\n}", "function remove_non_ascii(str) {\n if ((str === null) || (str === ''))\n return false;\n else\n str = str.toString();\n return str.replace(/[^\\x20-\\x7E\\uC00-\\u0C7F]/g, '');\n}", "function strLowerNormalize (str) {\r\n return(str.toLowerCase().normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\"));\r\n}", "function strNormalize (str) {\r\n return(str.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\"));\r\n}", "static stringToTrytes(str) {\n const encoded = TextHelper.encodeNonASCII(str);\n return encoded ? TrytesHelper.fromAscii(encoded) : \"\";\n }", "function UNICODEToEUCJP(data) {\n return UTF8ToEUCJP(UNICODEToUTF8(data));\n}", "function UNICODEToEUCJP(data) {\n return UTF8ToEUCJP(UNICODEToUTF8(data));\n}", "function str2rawstr_utf8(input) {\n\treturn unescape(encodeURIComponent(input));\n}", "function UNICODEToEUCJP (data) {\n return UTF8ToEUCJP(UNICODEToUTF8(data))\n }", "toStr(str){\n str = str.replace(/(\\\\u)(\\w{1,4})/gi,function(v){\n return (String.fromCharCode(parseInt((escape(v).replace(/(%5Cu)(\\w{1,4})/g,\"$2\")),16)));\n });\n str = str.replace(/(&#x)(\\w{1,4});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23x)(\\w{1,4})(%3B)/g,\"$2\"),16));\n });\n str = str.replace(/(&#)(\\d{1,6});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23)(\\d{1,6})(%3B)/g,\"$2\")));\n });\n\n return str;\n }", "getEmailDomain(emailAddress) {\n\t return capitalizeFirstLetter(emailAddress.split('@')[1].split('.')[0]);\n\t}", "function ascii_to_hex() {\r\n\tvar outResult = '';\r\n\tvar inValue = input.value;\r\n\tfor (var i = 0; i < inValue.length; i++) {\r\n\t\toutResult += inValue.charCodeAt(i).toString(16).toUpperCase();\r\n\t}\r\n\toutput.value = outResult;\r\n}", "static normalize(input){\n // https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization\n // http://www.unicode.org/reports/tr15/\n\n // normalize codepoints (split diacritics) and remove diacritics\n let value = input.normalize('NFKD').replace(/[\\u0300-\\u036f]/g, '')\n // remove/replace some special chars, just to be sure\n .replace(/['\"!?]/g, '')\n .replace(/[/\\\\]/g, '-')\n // replace a lot of special chars. Redondant with line above, but also handles non-diacritics special chars (e.g. ligatures)\n return undiacritics.removeAll(value)\n }", "function atou(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function atou(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function str2rstrUTF8(input){return unescape(encodeURIComponent(input));}", "function encode_utf8(s) {\n\t return encode_latin1(unescape(encodeURIComponent(s)));\n\t }", "function encode(word) {\n //somewhere to store the converted caracters\n let result = [];\n //next we loop over each character in the string.\n for (let position = 0; position < word.length; position++) {\n //and save the charcode to the array\n result.push(word.charCodeAt(position));\n }\n // and return that list of codes, separated by colons\n return result.join(':');\n}", "function latinize(str) { // 3 // 11\n return str.replace(/[^A-Za-z0-9]/g, function(x) { return latin_map[x] || x; }); // 4 // 12\n}", "function isValidDomain(str){\r\n flag_dot = 0\r\n hiphen = 0\r\n var len = str.length;\r\n if ( len > 0 )\r\n {\r\n \t// Can't start with a dot or an underscore\r\n\t\tif ( str[0]!='.' && str[0]!='_' && str[len-1]!= '.')\r\n\t\t\t{\r\n\t\t\t// Everything else should be alphabet, number or '.' or '_'\r\n\t\t\tvar ctr=0;\r\n\t\t\twhile (ctr < len && ( (str[ctr] >= 'A' && str[ctr] <= 'Z') || (str[ctr] >= 'a' && str[ctr] <= 'z') || ( str[ctr] >= '0' && str[ctr] <= '9') || str[ctr] == '.' || str[ctr] == '-' ))\r\n\t\t\t\t{\r\n if(str[ctr] == '.') flag_dot += 1\r\n if(str[ctr] == '-') hiphen += 1\r\n\t\t\t\tctr++;\r\n\t\t\t\t}\r\n\t\t\tif (ctr==len && flag_dot == 1 && hiphen <= 1)\r\n\t\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\treturn false;\r\n}", "function stringEncode(str) {}", "function encode(string){\n\n}", "function replaceAccents(str){\n\t str = toString(str);\n\n\t // verifies if the String has accents and replace them\n\t if (str.search(/[\\xC0-\\xFF]/g) > -1) {\n\t str = str\n\t .replace(/[\\xC0-\\xC5]/g, \"A\")\n\t .replace(/[\\xC6]/g, \"AE\")\n\t .replace(/[\\xC7]/g, \"C\")\n\t .replace(/[\\xC8-\\xCB]/g, \"E\")\n\t .replace(/[\\xCC-\\xCF]/g, \"I\")\n\t .replace(/[\\xD0]/g, \"D\")\n\t .replace(/[\\xD1]/g, \"N\")\n\t .replace(/[\\xD2-\\xD6\\xD8]/g, \"O\")\n\t .replace(/[\\xD9-\\xDC]/g, \"U\")\n\t .replace(/[\\xDD]/g, \"Y\")\n\t .replace(/[\\xDE]/g, \"P\")\n\t .replace(/[\\xE0-\\xE5]/g, \"a\")\n\t .replace(/[\\xE6]/g, \"ae\")\n\t .replace(/[\\xE7]/g, \"c\")\n\t .replace(/[\\xE8-\\xEB]/g, \"e\")\n\t .replace(/[\\xEC-\\xEF]/g, \"i\")\n\t .replace(/[\\xF1]/g, \"n\")\n\t .replace(/[\\xF2-\\xF6\\xF8]/g, \"o\")\n\t .replace(/[\\xF9-\\xFC]/g, \"u\")\n\t .replace(/[\\xFE]/g, \"p\")\n\t .replace(/[\\xFD\\xFF]/g, \"y\");\n\t }\n\t return str;\n\t }", "function invertirUnaPalabra(String){\n\n}", "function encode_utf8(s) {\r\n\treturn unescape(encodeURIComponent(s));\r\n }", "function basicTest() {\n print('AbCd'.toLowerCase());\n print('\\u00c4'.toLowerCase().charCodeAt(0)); // U+00C4 (A with dots) -> U+00E4 (a with dots) = 228\n}", "function convertString(s) {\n var asc = [];\n\n //convert string into array of characters\n var strAr = s.split('');\n\n //loop through array and convert to ascii\n for (var i in strAr) {\n asc[i] = strAr[i].charCodeAt();\n }\n return asc;\n }", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function bin2ascii(bin) {\n return String.fromCharCode(parseInt(bin, 2));\n}", "function encode(arg) {\n return arg.split('').map(x => (x.charCodeAt(0) / 255));\n}", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result && result.semantic && result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function EUCJPToUNICODE (data) {\n return UTF8ToUNICODE(EUCJPToUTF8(data))\n }", "function convertAddress(s) {\n var chars = [];\n for (var i = 0; i < s.length; i += 1) {\n var code = s.charCodeAt(i);\n if (code >= 0x2400) {\n code -= 0x2400;\n }\n chars.push(String.fromCharCode(code));\n }\n return chars.join('');\n}", "function extractMainDomain(domain) {\n\t//Return the domain if it is an ip address\n\tlet reIP = new RegExp('[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+');\n\tif(reIP.test(domain)) {\n\t\treturn domain;\n\t}\n\t//Delete a '.' if domain contains it at the end\n\tif(domain.charAt(domain.length - 1) === \".\") {\n\t\tdomain = domain.slice(0, domain.length - 1);\n\t}\n\tlet re = new RegExp('[a-z0-9|-]+\\.[a-z]+$');\n\treturn re.exec(domain)[0];\n}", "function GetThirdPartyDomain(domain) {\r\n var match = domain.match(/[^.]+\\.(co\\.)?[^.]+$/) || [ domain ];\r\n return match[0].toLowerCase();\r\n }", "function normalize(val) {\n if (typeof val !== 'string') {\n return val;\n }\n return unicode.fold(unicode.normalize(val)).toLowerCase();\n }", "function encode_utf8(s) {\n return unescape(encodeURIComponent(s));\n}", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }" ]
[ "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.659847", "0.6583978", "0.65777093", "0.6319884", "0.5646425", "0.5623975", "0.5598679", "0.5580069", "0.55487365", "0.54310036", "0.5273294", "0.5267583", "0.52603805", "0.5216739", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5171347", "0.5165129", "0.5156273", "0.5111188", "0.50573826", "0.50573826", "0.5002343", "0.5000655", "0.4995102", "0.49836946", "0.4978105", "0.49696583", "0.4963079", "0.48993066", "0.48770976", "0.48770976", "0.4871279", "0.48619387", "0.48550236", "0.48328814", "0.48310804", "0.48170984", "0.48066357", "0.48066357", "0.47753745", "0.47624207", "0.47583994", "0.47539687", "0.4752714", "0.47454387", "0.47339168", "0.47321633", "0.47263885", "0.47181094", "0.4708913", "0.46950552", "0.46787012", "0.46787012", "0.46787012", "0.4675777", "0.46679452", "0.46597075", "0.46523464", "0.46459308", "0.46445385", "0.46428776", "0.46421954", "0.4640598", "0.46404183", "0.46404183", "0.46404183", "0.46404183" ]
0.5811806
17
punycode.toUnicode(domain) It is used to convert a Punycode string representing a domain name to Unicode. Only the Punycoded part of the domain name is converted.
function test4() { punycode = require('punycode'); console.log(punycode.toUnicode('xn--maana-pta.com')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unescapeUnicode(str){\n\t str = toString(str);\n\t return str.replace(/\\\\u[0-9a-f]{4}/g, function(ch){\n\t var code = parseInt(ch.slice(2), 16);\n\t return String.fromCharCode(code);\n\t });\n\t }", "toUnicode(str) {\n var res = [];\n for ( var i=0; i<str.length; i++ ) {\n res[i] = ( \"00\" + str.charCodeAt(i).toString(16) ).slice(-4);\n }\n return \"\\\\u\" + res.join(\"\\\\u\");\n }", "function EUCJPToUNICODE (data) {\n return UTF8ToUNICODE(EUCJPToUTF8(data))\n }", "function EUCJPToUNICODE(data) {\n return UTF8ToUNICODE(EUCJPToUTF8(data));\n}", "function EUCJPToUNICODE(data) {\n return UTF8ToUNICODE(EUCJPToUTF8(data));\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, ''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function convertUTF8ToUnicode(u)\n{\n\treturn config.browser.isOpera || !window.netscape ? manualConvertUTF8ToUnicode(u) : mozConvertUTF8ToUnicode(u);\n}", "function omn_renameDomain(domain){\n var array_domain= domain.split(\".\");\n if(array_domain.length == 3){//have un domain like los40.com.co or los40.com.ar\n domain= array_domain[0] + array_domain[2];\n }\n else{\n domain= array_domain[0] + array_domain[1];\n }\n return domain;\n}", "function unescapeUnicode(str) {\r\n // unescape unicode codes\r\n var codes = [];\r\n var code = parseInt(str.substr(2), 16);\r\n if (code >= 0 && code < Math.pow(2, 16)) {\r\n codes.push(code);\r\n }\r\n // convert codes to text\r\n var unescaped = '';\r\n for (var i = 0; i < codes.length; ++i) {\r\n unescaped += String.fromCharCode(codes[i]);\r\n }\r\n return unescaped;\r\n}", "function unescapeUnicode(str) {\n // unescape unicode codes\n var codes = [];\n var code = parseInt(str.substr(2), 16);\n if (code >= 0 && code < Math.pow(2, 16)) {\n codes.push(code);\n }\n // convert codes to text\n var unescaped = '';\n for (var i = 0; i < codes.length; ++i) {\n unescaped += String.fromCharCode(codes[i]);\n }\n return unescaped;\n}", "function unescapeUnicode(str) {\n // unescape unicode codes\n var codes = [];\n var code = parseInt(str.substr(2), 16);\n if (code >= 0 && code < Math.pow(2, 16)) {\n codes.push(code);\n }\n // convert codes to text\n var unescaped = '';\n for (var i = 0; i < codes.length; ++i) {\n unescaped += String.fromCharCode(codes[i]);\n }\n return unescaped;\n}", "sanitize (domain) {\r\n return domain.replace(/[^a-zA-Z0-9.-]/g, '')\r\n }", "function utf8_to_unicode(utf8) {\r\n var s = \"\", i = 0, b1, b2, b2;\r\n\r\n while (i < utf8.length) {\r\n b1 = utf8.charCodeAt(i);\r\n if (b1 < 0x80) {\t // One byte code: 0x00 0x7F\r\n s += String.fromCharCode(b1);\r\n i++;\r\n } else if ((b1 >= 0xC0) && (b1 < 0xE0)) {\t// Two byte code: 0x80 - 0x7FF\r\n b2 = utf8.charCodeAt(i + 1);\r\n s += String.fromCharCode(((b1 & 0x1F) << 6) | (b2 & 0x3F));\r\n i += 2;\r\n } else {\t \t // Three byte code: 0x800 - 0xFFFF\r\n b2 = utf8.charCodeAt(i + 1);\r\n b3 = utf8.charCodeAt(i + 2);\r\n s += String.fromCharCode(((b1 & 0xF) << 12) |\r\n\t\t \t \t \t ((b2 & 0x3F) << 6) |\r\n\t\t\t\t\t (b3 & 0x3F));\r\n i += 3;\r\n }\r\n }\r\n return s;\r\n}", "function canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./, \"\"); // S4.1.2.3 & S5.2.3: ignore leading .\n\n if (IP_V6_REGEX_OBJECT.test(str)) {\n str = str.replace(\"[\", \"\").replace(\"]\", \"\");\n }\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}", "function _uDomain() {\n if (!_udn || _udn==\"\" || _udn==\"none\") { _udn=\"\"; return 1; }\n if (_udn==\"auto\") {\n var d=_ubd.domain;\n if (d.substring(0,4)==\"www.\") {\n d=d.substring(4,d.length);\n }\n _udn=d;\n }\n \n if (_uhash==\"off\") return 1;\n return _uHash(_udn); \n}", "function UNICODEToEUCJP(data) {\n return UTF8ToEUCJP(UNICODEToUTF8(data));\n}", "function UNICODEToEUCJP(data) {\n return UTF8ToEUCJP(UNICODEToUTF8(data));\n}", "function UNICODEToEUCJP (data) {\n return UTF8ToEUCJP(UNICODEToUTF8(data))\n }", "function convertUTF8ToUnicode(u)\n{\n\tvar s = \"\";\n\tvar t = 0;\n\tvar b1, b2, b3;\n\twhile(t < u.length)\n\t\t{\n\t\tb1 = u.charCodeAt(t++);\n\t\tif(b1 < 0x80)\n\t\t\ts += String.fromCharCode(b1);\n\t\telse if(b1 < 0xE0)\n\t\t\t{\n\t\t\tb2 = u.charCodeAt(t++);\n\t\t\ts += String.fromCharCode(((b1 & 0x1F) << 6) | (b2 & 0x3F));\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tb2 = u.charCodeAt(t++);\n\t\t\tb3 = u.charCodeAt(t++);\n\t\t\ts += String.fromCharCode(((b1 & 0xF) << 12) | ((b2 & 0x3F) << 6) | (b3 & 0x3F));\n\t\t\t}\n\t}\n\treturn(s);\n}", "function getTLD(fqdn) {\n fqdn = fqdn.toLowerCase(); // force lowercase for parsing\n var labels = fqdn.split('.');\n if (labels.length >= 3) {\n var www = labels[0] == 'www' ? 1 : 0;\n // assume that any domain having at least 3 labels ending with a 2 byte label, also contains a country code for its last two labels\n labels.splice(www, (labels.slice(-1).toString().length == 2 ? labels.length - 3 - www : labels.length - 2 - www)); // chop subdomains\n }\n return labels.join('.');\n}", "function deuni(input){\n\toutput= unescape(input.replace(/\\]/g,\"\").replace(/\\[U\\+/g,\"%u\"));\n return output;\n}", "function convertUnicodeToFileFormat(s)\n{\n\treturn config.browser.isOpera || !window.netscape ? (config.browser.isIE ? convertUnicodeToHtmlEntities(s) : s) : mozConvertUnicodeToUTF8(s);\n}", "function stringToUnicode(str) {\n\n if (!str || typeof str !== \"string\") {\n return null;\n }\n\n var result = [];\n\n for (var i = 0; i < str.length; i++) {\n result.push(str.codePointAt(i));\n }\n\n return result;\n }", "function getUnicodeConverter () {\n let className = \"@mozilla.org/intl/scriptableunicodeconverter\";\n let converter = Cc[className].createInstance(Ci.nsIScriptableUnicodeConverter);\n converter.charset = \"UTF-8\";\n return converter;\n}", "getEmailDomain(emailAddress) {\n\t return capitalizeFirstLetter(emailAddress.split('@')[1].split('.')[0]);\n\t}", "function getUnicodeConverter() {\n let className = \"@mozilla.org/intl/scriptableunicodeconverter\";\n let converter = Cc[className].createInstance(Ci.nsIScriptableUnicodeConverter);\n converter.charset = \"UTF-8\";\n return converter;\n}", "function GetThirdPartyDomain(domain) {\r\n var match = domain.match(/[^.]+\\.(co\\.)?[^.]+$/) || [ domain ];\r\n return match[0].toLowerCase();\r\n }", "function URL2Domain(url) {\n return url.replace('http://', '').replace('https://', '').split(/[/?#]/)[0];\n}", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function cleanUpUrlable(input) {\n let cleaned = Object(utils_latinise__WEBPACK_IMPORTED_MODULE_3__[\"latinise\"])(input);\n cleaned = cleaned.trim().replace(/-/g, ' ').replace(/[^\\w\\s]/gi, '').toLowerCase().replace(/\\s/g, '-');\n cleaned = cleaned.replace(/^-+/, '');\n cleaned = cleaned.replace(/-+$/, '');\n return cleaned;\n}", "function extractMainDomain(domain) {\n\t//Return the domain if it is an ip address\n\tlet reIP = new RegExp('[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+');\n\tif(reIP.test(domain)) {\n\t\treturn domain;\n\t}\n\t//Delete a '.' if domain contains it at the end\n\tif(domain.charAt(domain.length - 1) === \".\") {\n\t\tdomain = domain.slice(0, domain.length - 1);\n\t}\n\tlet re = new RegExp('[a-z0-9|-]+\\.[a-z]+$');\n\treturn re.exec(domain)[0];\n}", "function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result && result.semantic && result.semantic.indexOf('.') < 0) {\n return null;\n }\n }\n // strip all whitespace from domains\n if (result) {\n result.semantic = result.semantic.replace(/\\s+/g, '');\n }\n return result;\n }());\n }", "function decode_utf8(s) {\r\n if ((s.length > 0) && (s.charCodeAt(0) == 0x9D)) {\r\n return utf8_to_unicode(s.substring(1));\r\n }\r\n return s;\r\n}", "function getTopLevelDomain(domain)\r\n{\t\r\n\tif(domain != null)\r\n\t{\r\n\t\tvar domainArray = domain.split(\".\");\t\r\n\t\tif(domainArray[domainArray.length - 1].length == 2)\r\n\t\t{\r\n\t\t\treturn \".\" + domainArray[domainArray.length - 3] + \".\" + domainArray[domainArray.length - 2] + \".\" + domainArray[domainArray.length - 1];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn \".\" + domainArray[domainArray.length - 2] + \".\" + domainArray[domainArray.length - 1];\r\n\t\t}\r\n\t}\t\r\n}", "function setDomain(d) {\n domain = d;\n }", "function JISToUNICODE (data) {\n return UTF8ToUNICODE(JISToUTF8(data))\n }", "static normalize(input){\n // https://en.wikipedia.org/wiki/Unicode_equivalence#Normalization\n // http://www.unicode.org/reports/tr15/\n\n // normalize codepoints (split diacritics) and remove diacritics\n let value = input.normalize('NFKD').replace(/[\\u0300-\\u036f]/g, '')\n // remove/replace some special chars, just to be sure\n .replace(/['\"!?]/g, '')\n .replace(/[/\\\\]/g, '-')\n // replace a lot of special chars. Redondant with line above, but also handles non-diacritics special chars (e.g. ligatures)\n return undiacritics.removeAll(value)\n }", "function JISToUNICODE(data) {\n return UTF8ToUNICODE(JISToUTF8(data));\n}", "function JISToUNICODE(data) {\n return UTF8ToUNICODE(JISToUTF8(data));\n}", "normalizeString(name) {\n return name.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }", "function utf8ToString(u) {\n return utf8.decode(hexToString(u))\n}", "function str2rstrUTF8(input){return unescape(encodeURIComponent(input));}", "function UTF8ToUNICODE (data) {\n var results = []\n var i = 0\n var len = data && data.length\n var n, c, c2, c3, c4, code\n\n while (i < len) {\n c = data[i++]\n n = c >> 4\n if (n >= 0 && n <= 7) {\n // 0xxx xxxx\n code = c\n } else if (n === 12 || n === 13) {\n // 110x xxxx\n // 10xx xxxx\n c2 = data[i++]\n code = ((c & 0x1F) << 6) | (c2 & 0x3F)\n } else if (n === 14) {\n // 1110 xxxx\n // 10xx xxxx\n // 10xx xxxx\n c2 = data[i++]\n c3 = data[i++]\n code = ((c & 0x0F) << 12) |\n ((c2 & 0x3F) << 6) |\n (c3 & 0x3F)\n } else if (n === 15) {\n // 1111 0xxx\n // 10xx xxxx\n // 10xx xxxx\n // 10xx xxxx\n c2 = data[i++]\n c3 = data[i++]\n c4 = data[i++]\n code = ((c & 0x7) << 18) |\n ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) |\n (c4 & 0x3F)\n }\n\n if (code <= 0xFFFF) {\n results[results.length] = code\n } else {\n // Split in surrogate halves\n code -= 0x10000\n results[results.length] = (code >> 10) + 0xD800 // High surrogate\n results[results.length] = (code % 0x400) + 0xDC00 // Low surrogate\n }\n }\n\n return results\n }", "toStr(str){\n str = str.replace(/(\\\\u)(\\w{1,4})/gi,function(v){\n return (String.fromCharCode(parseInt((escape(v).replace(/(%5Cu)(\\w{1,4})/g,\"$2\")),16)));\n });\n str = str.replace(/(&#x)(\\w{1,4});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23x)(\\w{1,4})(%3B)/g,\"$2\"),16));\n });\n str = str.replace(/(&#)(\\d{1,6});/gi,function(v){\n return String.fromCharCode(parseInt(escape(v).replace(/(%26%23)(\\d{1,6})(%3B)/g,\"$2\")));\n });\n\n return str;\n }", "function str2rawstr_utf8(input) {\n\treturn unescape(encodeURIComponent(input));\n}", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function str2rstr_utf8 (input) {\n\t return unescape(encodeURIComponent(input))\n\t }", "function unicode_to_utf8(s) {\r\n var utf8 = \"\";\r\n\r\n for (var n = 0; n < s.length; n++) {\r\n var c = s.charCodeAt(n);\r\n\r\n if (c <= 0x7F) {\r\n // 0x00 - 0x7F: Emit as single byte, unchanged\r\n utf8 += String.fromCharCode(c);\r\n } else if ((c >= 0x80) && (c <= 0x7FF)) {\r\n // 0x80 - 0x7FF: Output as two byte code, 0xC0 in first byte\r\n // \t \t \t \t \t 0x80 in second byte\r\n utf8 += String.fromCharCode((c >> 6) | 0xC0);\r\n utf8 += String.fromCharCode((c & 0x3F) | 0x80);\r\n } else {\r\n // 0x800 - 0xFFFF: Output as three bytes, 0xE0 in first byte\r\n // \t \t \t \t \t 0x80 in second byte\r\n // \t \t \t \t \t 0x80 in third byte\r\n utf8 += String.fromCharCode((c >> 12) | 0xE0);\r\n utf8 += String.fromCharCode(((c >> 6) & 0x3F) | 0x80);\r\n utf8 += String.fromCharCode((c & 0x3F) | 0x80);\r\n }\r\n }\r\n return utf8;\r\n}", "function test3() {\n punycode = require('punycode');\n console.log(punycode.toASCII('mañana.com'));\n}", "function UTF8ToUNICODE(data) {\n var results = [];\n var i = 0;\n var len = data && data.length;\n var n, c, c2, c3, c4, code;\n\n while (i < len) {\n c = data[i++];\n n = c >> 4;\n if (n >= 0 && n <= 7) {\n // 0xxx xxxx\n code = c;\n } else if (n === 12 || n === 13) {\n // 110x xxxx\n // 10xx xxxx\n c2 = data[i++];\n code = ((c & 0x1F) << 6) | (c2 & 0x3F);\n } else if (n === 14) {\n // 1110 xxxx\n // 10xx xxxx\n // 10xx xxxx\n c2 = data[i++];\n c3 = data[i++];\n code = ((c & 0x0F) << 12) |\n ((c2 & 0x3F) << 6) |\n (c3 & 0x3F);\n } else if (n === 15) {\n // 1111 0xxx\n // 10xx xxxx\n // 10xx xxxx\n // 10xx xxxx\n c2 = data[i++];\n c3 = data[i++];\n c4 = data[i++];\n code = ((c & 0x7) << 18) |\n ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) |\n (c4 & 0x3F);\n }\n\n if (code <= 0xFFFF) {\n results[results.length] = code;\n } else {\n // Split in surrogate halves\n code -= 0x10000;\n results[results.length] = (code >> 10) + 0xD800; // High surrogate\n results[results.length] = (code % 0x400) + 0xDC00; // Low surrogate\n }\n }\n\n return results;\n}", "function UTF8ToUNICODE(data) {\n var results = [];\n var i = 0;\n var len = data && data.length;\n var n, c, c2, c3, c4, code;\n\n while (i < len) {\n c = data[i++];\n n = c >> 4;\n if (n >= 0 && n <= 7) {\n // 0xxx xxxx\n code = c;\n } else if (n === 12 || n === 13) {\n // 110x xxxx\n // 10xx xxxx\n c2 = data[i++];\n code = ((c & 0x1F) << 6) | (c2 & 0x3F);\n } else if (n === 14) {\n // 1110 xxxx\n // 10xx xxxx\n // 10xx xxxx\n c2 = data[i++];\n c3 = data[i++];\n code = ((c & 0x0F) << 12) |\n ((c2 & 0x3F) << 6) |\n (c3 & 0x3F);\n } else if (n === 15) {\n // 1111 0xxx\n // 10xx xxxx\n // 10xx xxxx\n // 10xx xxxx\n c2 = data[i++];\n c3 = data[i++];\n c4 = data[i++];\n code = ((c & 0x7) << 18) |\n ((c2 & 0x3F) << 12) |\n ((c3 & 0x3F) << 6) |\n (c4 & 0x3F);\n }\n\n if (code <= 0xFFFF) {\n results[results.length] = code;\n } else {\n // Split in surrogate halves\n code -= 0x10000;\n results[results.length] = (code >> 10) + 0xD800; // High surrogate\n results[results.length] = (code % 0x400) + 0xDC00; // Low surrogate\n }\n }\n\n return results;\n}", "function extractDomain(url){\n var psl = torpedo.publicSuffixList.getDomain(url);\n // psl empty -> url is already a valid domain\n return psl != \"\"? psl : url;\n}", "function mapFromTxLangCode(str) {\n return str.replace(\"_\", \"-\").replace(\"@\", \"-\").replace(\"latin\", \"latn\");\n }", "function str2rstr_utf8(input) {\n\t return unescape(encodeURIComponent(input));\n\t }", "parseDomain(url) {\n if(url) {\n if (url.indexOf(\"://\") > -1) {\n url = url.split('/')[2];\n } else {\n url = url.split('/')[0];\n }\n }\n\n return url;\n }", "canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n }", "canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n }", "function convertPCname(name)\n\t{\n\t\t// Edit\n\t\tname = name.replace(/ /gi, '.');\n\t\tname = name.replace(/[^a-zA-Z0-9\\.]/g, '');\n\t\tname = name.toLowerCase();\n\n\t\treturn name;\n\t}", "function _checkDomain (domain) {\r\n if (_checkIsBlank(domain))\r\n {\r\n return false;\r\n }\r\n\r\n for (var i=0;i<_domainWhiteList.length;i++)\r\n {\r\n if (_domainWhiteList[i].toLowerCase() == domain.toLowerCase())\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "function str2rstrUTF8 (input) {\r\n return unescape(encodeURIComponent(input))\r\n }", "function permuteDomain(domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}", "function normalize (str) {\n let from = \"ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç\",\n to = \"AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuuNnCc\",\n mapping = {};\n\n for (let i = 0, j = from.length; i < j; i++)\n mapping[from.charAt(i)] = to.charAt(i);\n\n let ret = [];\n for (let i = 0, j = str.length; i < j; i++) {\n let c = str.charAt(i);\n if (mapping.hasOwnProperty(str.charAt(i))) ret.push(mapping[ c ]);\n else ret.push(c);\n }\n\n return ret.join(\"\");\n }", "function str2rstr_utf8(input) {\r\n\t\t return unescape(encodeURIComponent(input));\r\n\t\t }", "function getDomainPart(s){\r\n var domparts = domainname.split(\".\");\r\n domparts.reverse();\r\n // for ccTLD - overkill, just for completeness\r\n if((domparts[2]) && (domparts[0].length == 2 && domparts[1].length <= 3)){\r\n // ccTLD TLD - not sure of all valid ones\r\n var re = /(com|org|edu|sch|gov|mod)/;\r\n if(re.test(domparts[1]) || domparts[1].length == 2){\r\n domparts[1] = domparts[1] + \".\" + domparts[0];\r\n domparts.shift();\r\n }\r\n }\r\n while(domparts[3]){\r\n domparts[2] = domparts[3] + \".\" + domparts[2];\r\n domparts.splice(3,1);\r\n }\r\n return domparts[s-1];\r\n}", "function str2rstr_utf8(input) {\r\n return unescape(encodeURIComponent(input));\r\n }", "function str2rstrUTF8(input) {\n return unescape(encodeURIComponent(input))\n}", "function str2rstr_utf8 (input) {\n return unescape(encodeURIComponent(input))\n }" ]
[ "0.5947256", "0.57460964", "0.57254046", "0.57163864", "0.57163864", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5599307", "0.5590663", "0.55892944", "0.5578274", "0.54804736", "0.5480213", "0.53878707", "0.53878707", "0.53594863", "0.53422105", "0.5312733", "0.5247371", "0.5168694", "0.5168694", "0.51557803", "0.5144279", "0.51124567", "0.50035393", "0.4972624", "0.49514195", "0.49314308", "0.49147582", "0.4911185", "0.48692554", "0.48212874", "0.47795567", "0.47795567", "0.47795567", "0.47777635", "0.47757718", "0.47691622", "0.47505268", "0.47138858", "0.46896946", "0.4685514", "0.46854952", "0.46837306", "0.46837306", "0.46669126", "0.46584862", "0.4650529", "0.46436965", "0.46426225", "0.46140236", "0.45983642", "0.45983642", "0.45983642", "0.45983642", "0.45844835", "0.45817325", "0.45761365", "0.45761365", "0.45722538", "0.45391786", "0.45350593", "0.4527775", "0.45244706", "0.45244706", "0.451074", "0.45083624", "0.45062208", "0.45031014", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.4492399", "0.44921222", "0.4483976", "0.4477446", "0.44742927", "0.44734666", "0.44707638" ]
0.55509436
22
Compresses sourceDirectoryPath into a tar.gz
compressSourceDirectory(sourceDirectoryPath) { return __awaiter(this, void 0, void 0, function* () { const fileName = `${(0, uuid_1.v4)()}.tar.gz`; console.log('CompressingSourceDirectory', sourceDirectoryPath, fileName); yield tar.c({ gzip: true, file: fileName, sync: true, cwd: sourceDirectoryPath, onWarn: warning => { console.warn(warning); } }, ['.']); return fileName; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gunzip(src){\n fs.createReadStream(src)\n .pipe(zlib.createGunzip())\n .pipe(fs.createWriteStream(path.join(__dirname,path.basename(src,'.gz'))));\n}", "convertApkToZip (source, target){\n let cond = true;\n fs.rename(source, target, function(err) {\n if(err) {\n console.log('No such file or directory to be converted from APK to ZIP');\n cond=false;\n } // Set isExtracted to True\n });\n this.setterIsExtracted(cond);\n }", "function gzipStart () {\n return src([`${helpers.dist()}/**/*`, `!${helpers.dist()}/**/*.gz`])\n .pipe(gzip(gzipConfig))\n .pipe(dest(helpers.dist()))\n}", "function recompress_the_content_of_the_extraced_folder(container)\n{\n\treturn new Promise(function(resolve, reject) {\n\n\t\t//\n\t\t//\t1.\tOptions for the compression.\n\t\t//\n\t\tlet options = {\n\t\t\tgzip: true,\n\t\t\tfile: \"/tmp/\" + container.repo_name + \".tgz\",\n\t\t\tcwd: \"/tmp/extracted/\" + container.folder_to_go\n\t\t};\n\n\t\t//\n\t\t//\t2.\tRead the content of the extracted folder so we can compress\n\t\t//\t\tit again.\n\t\t//\n\t\tlet path = fs.readdirSync(\"/tmp/extracted/\" + container.folder_to_go);\n\n\t\t//\n\t\t//\t3.\tCompress mechanism.\n\t\t//\n\t\ttar.c(options, path, function() {\n\n\t\t\t//\n\t\t\t// -> Move to the next chain.\n\t\t\t//\n\t\t\treturn resolve(container);\n\n\t\t});\n\n\t});\n}", "function zipTarget() {\n return src(['target/dist/**/*.*'], {dot: true})\n .pipe(zip('front_v' + appVersion + '.zip'))\n .pipe(dest('target'));\n}", "function archiveDirectory(directoryToZip, zipFileName, callback) {\n var outputDestination = path.join(localArchiveCacheFolder, zipFileName);\n console.log(\"Creating new archive of \" + directoryToZip + \" at location \" + outputDestination);\n\n var output = filesystem.createWriteStream(outputDestination);\n var archive = archiver('zip', {\n store: true\n });\n\n output.on('close', function () {\n console.log(archive.pointer() + ' total bytes');\n console.log('Archiver has been finalized and the output file descriptor has closed');\n callback(outputDestination);\n });\n\n archive.on('error', function (err) {\n throw err;\n });\n\n archive.pipe(output);\n archive.directory(directoryToZip);\n archive.finalize();\n}", "function mash(sources, destination)\n{\n var out = sources.map\n (\n function (filePath)\n {\n return fileSystem.readFileSync(filePath, settings.encoding);\n }\n );\n\n fileSystem.writeFileSync(destination, out.join(settings.eol), settings.encoding);\n log(colors.cyan + 'Built: ' + colors.white + destination);\n}", "function compress() {\n if (compressJs) {\n return streamCombiner(\n tars.require('gulp-terser')(tars.pluginsConfig['gulp-terser']),\n rename({ suffix: '.min' }),\n gulp.dest(destFolder),\n );\n }\n\n return tars.packages.gutil.noop();\n}", "function zipFiles(cb) {\n\tlet task = srcFolders.map(function(folder) {\n\t\tlet _src = path.join(dir.src, folder),// Path source files\n\t\t\t\t_dist = path.join(dir.dist, folder),// Path to production files\n\t\t\t\t_dest = dir.dist+'/zips';\n\n\t\tlet _final = gulp.src([_dist+'/**/*'],{base:_dist})\n\t\t\t.pipe(zip('_final.zip'))\n\t\t\t.pipe(rename(function(file){file.basename = folder + file.basename;}))\n\t\t\t.pipe(gulp.dest(_dest));\n\n\t\tlet _source = gulp.src([_src+'/**/*'],{base:_src})\n\t\t\t.pipe(zip('_source.zip'))\n\t\t\t.pipe(rename(function(file){file.basename = folder + file.basename;}))\n\t\t\t.pipe(gulp.dest(_dest));\n\n\t\tlet _html = gulp.src(_dist+'/'+folder+'.html').pipe(gulp.dest(_dest));\n\n\t\treturn merge(_final, _source, _html);\n\t});\n\treturn task[task.length-1];\n}", "build() {\n const inputPath = first(this.inputPaths);\n this.exporters.forEach(([fileName, exporter]) => {\n const srcPath = path.join(inputPath, fileName);\n if (fs.existsSync(srcPath)) {\n const sourceCode = exporter.processSourceCode(fs.readFileSync(srcPath, 'utf8'));\n const destPath = path.join(this.outputPath, fileName);\n\n // Make sure the directory exists before writing it.\n mkdirpSync(path.dirname(destPath));\n fs.writeFileSync(destPath, sourceCode);\n }\n });\n }", "function zipDir(dirName){\n return new Promise((resolve, reject) => {\n //grab date/time\n getDateTime().then((dateString) => {\n var outputPath = \"C:\\\\Windows\\\\Temp\\\\\" + \"export-\" + dateString + '.zip'\n var output = fs.createWriteStream(outputPath);\n var archive = archiver('zip');\n \n output.on('close', () => {\n resolve([outputPath, \"Final size: \" + (archive.pointer()/1024).toFixed(2) + ' KB']); //file size calculated to KB, 2 decimals.\n });\n \n archive.on('error', (error) => {\n reject(error);\n });\n \n archive.pipe(output);\n \n archive\n .directory(dirName, false)\n //.directory(__dirname + dirName, dirName)\n .finalize();\n });\n });\n}", "static install(lname, srcBasePath, distBasePath) {\n let p = new LambdaPacker(lname, srcBasePath, distBasePath); \n return gulp.series(p.copy, p.build, p.package, p.cleanup); \n }", "function tar(opts, tarFile, ...rest) {\n throw new Error(`implement tar!`);\n}", "function zipTarget() {\n return src('target/dist/**/*.*')\n .pipe(zip('app_v' + appVersion + '.zip'))\n .pipe(dest('target'));\n}", "function archive() {\r\n\tvar time = dateFormat(new Date(), \"yyyy-mm-dd_HH-MM\");\r\n\tvar pkg = JSON.parse(fs.readFileSync('./package.json'));\r\n\tvar title = pkg.name + '_' + time + '.zip';\r\n\r\n\treturn gulp.src(CONF.PATHS.package)\r\n\t\t.pipe($.zip(title))\r\n\t\t.pipe(gulp.dest('packaged'));\r\n}", "function _zip(){\n\treturn gulp.src([\n\t\t'./assets/**/*'\n\t])\n\t\t.pipe(zip('release.zip'))\n\t\t.pipe(gulp.dest('./build'))\n\t\t.pipe(filesize( filesize_opt ))\n\t\t.on('error', debug)\n\t;\n}", "function zipdirectory(zipfile, directory, notopdir, prefixpath) {\n \"use strict\";\n var fs = require('fs'),\n path = require('path'),\n stat,\n list;\n function listFiles(directory, basename, list) {\n var l = fs.readdirSync(directory),\n i;\n l.forEach(function (f) {\n var abspath = path.join(directory, f),\n relpath = path.join(basename, f),\n stat = fs.lstatSync(abspath);\n if (stat.isDirectory(abspath)) {\n listFiles(abspath, relpath, list);\n } else {\n list.push(relpath);\n }\n });\n }\n function zipFile(zip, abspath, relpath) {\n var entry = {}, data;\n entry.path = relpath;\n entry.date = new Date();\n runtime.log(abspath);\n data = runtime.readFileSync(abspath, \"binary\");\n runtime.log(\"[\" + zipfile + \"] << \\\"\" + entry.path + \"\\\"\");\n zip.save(entry.path, data, false, entry.date);\n }\n function zipList(base, zipfilepath, list) {\n var zip = new core.Zip(zipfilepath, null),\n i;\n for (i = 0; i < list.length; i += 1) {\n zipFile(zip, path.join(base, list[i]), path.join(prefixpath, list[i]));\n }\n zip.write(function (err) {\n if (err) {\n runtime.log(err);\n }\n });\n }\n\n if (!fs.existsSync(directory)) {\n throw \"Directory \" + directory + \" does not exist.\";\n }\n stat = fs.lstatSync(directory);\n if (!stat.isDirectory()) {\n throw directory + \" is not a directory.\";\n }\n list = [];\n if (notopdir) {\n listFiles(directory, \"\", list);\n } else {\n listFiles(directory, path.basename(directory), list);\n }\n runtime.log(list);\n if (list.length === 0) {\n throw \"Directory \" + directory + \" is empty.\";\n }\n if (fs.existsSync(zipfile)) {\n runtime.log(\"Deleting \" + zipfile);\n fs.unlinkSync(zipfile);\n }\n if (notopdir) {\n zipList(directory, zipfile, list);\n } else {\n zipList(path.dirname(directory), zipfile, list);\n }\n runtime.log(\"Created \" + zipfile);\n}", "static moveDirectoryContent (strSourcePath, strTargetPath) {\n // create target directory if not exists:\n if (!this.isDirectory(strTargetPath)) {\n this.createDirectory(strTargetPath);\n }\n\n // No migration, just setup:\n fs.readdirSync(strSourcePath).forEach((strFileName) => {\n fs.renameSync(path.join(strSourcePath, strFileName), path.join(strTargetPath, strFileName))\n });\n\n return true;\n }", "function copy() {\n src([\n source + '/**/*',\n '!' + source + '/node_modules',\n '!' + source + '/node_modules/**/*'\n ], { base: source })\n .pipe( zip('anthem-copy.zip') )\n .pipe( dest(distribution) )\n done();\n}", "compressFiles_() {\n this.fileIndex_ = 0;\n zip.createWriter(new zip.BlobWriter(), this.writeNextFile_.bind(this), this.reportError.bind(this));\n }", "async function compressFolder(path, folderID) {\n\n var archive = archiver('zip', { gzip: true, zlib: { level: 9 } });\n var files = await getFolderContent(folderID);\n var folder = await getFile(folderID);\n var outputPath = `${path}/${folder.name}.zip`;\n var output = fs.createWriteStream(outputPath);\n\n archive.on('error', function (err) {\n throw err;\n });\n\n archive.pipe(output);\n\n\n for (var i = 0; i < files.length; i++) {\n const file = files[i];\n archive.file(path + file.name, { name: file.name });\n }\n\n await archive.finalize();\n return outputPath;\n}", "function copySourceFilesToTempDir() {\n getSourceFilesFromRunfiles().forEach(({realPath, relativeFilePath}) => {\n const tmpFilePath = path.join(tmpDir, relativeFilePath);\n\n shx.mkdir('-p', path.dirname(tmpFilePath));\n shx.cp(realPath, tmpFilePath);\n });\n}", "function createSourceDirectories(destDir, packageName) {\n\n var newPathChunk = getNewFilePath(packageName);\n\n var newSourceDirectory = destDir + \"/app/src/main/java/\" + newPathChunk; \n console.log(\"Creating new source directory at: \" + newSourceDirectory);\n wrench.mkdirSyncRecursive(newSourceDirectory); \n\n var newUnitTestDirectory = destDir + \"/app/src/test/java/\" + newPathChunk; \n console.log(\"Creating new source directory at: \" + newUnitTestDirectory);\n wrench.mkdirSyncRecursive(newUnitTestDirectory); \n\n var newIntegrationTestDirectory = destDir + \"/integration-tests/src/main/java/\" + newPathChunk; \n console.log(\"Creating new integration tests directory at: \" + newIntegrationTestDirectory);\n wrench.mkdirSyncRecursive(newIntegrationTestDirectory); \n}", "function zipBuild() {\n\treturn src(build.base.dest + '**/**/*')\n\t\t\t.pipe(zip(build.out))\n\t\t\t.pipe(dest(build.dest));\n}", "function zipGithub() {\n return gulp.src(`${paths.dist}*`, {base: 'dist'})\n .pipe($.zip(paths.zip))\n .pipe(gulp.dest(paths.dist));\n}", "download(url, { treeish = 'master', format = 'zip', extract = true, path } = {}) {\n\t\treturn new Promise((resolve) => {\n\n\t\t\tgetPath({ url, treeish, format, extract, path }).then((_finalPath) => {\n\t\t\t\tconst finalPath = slash(_finalPath);\n\t\t\t\tconst method = `ssh-add && git archive --remote=${url} ${treeish}`;\n\t\t\t\tconst options = { stdio: 'inherit' };\n\n\t\t\t\tif (extract) {\n\t\t\t\t\tconst fileName = `${finalPath}/archive`;\n\t\t\t\t\texecSync(`${method} --format tar.gz --output ${fileName}`, options);\n\t\t\t\t\tconst tarFileName = `${isWindowsShell() ? fileName : fileName.replace(/(?<drive>[A-Z]):\\//u, '/$<drive>/')}`;\n\t\t\t\t\texecSync(`tar -xf ${tarFileName} -C ${finalPath}`, { stdio: 'ignore' });\n\t\t\t\t\tfs.unlinkSync(fileName);\n\t\t\t\t} else {\n\t\t\t\t\texecSync(`${method} --format ${format} --output ${finalPath}`, options);\n\t\t\t\t}\n\n\t\t\t\tresolve(finalPath);\n\t\t\t});\n\n\t\t});\n\t}", "function xar () {\n return src('build/**/*', {base: 'build'})\n .pipe(zip(packageName()))\n .pipe(dest('.'))\n}", "function extractTar(file, dest, flags = 'xz') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!file) {\n throw new Error(\"parameter 'file' is required\");\n }\n // Create dest\n dest = yield _createExtractFolder(dest);\n // Determine whether GNU tar\n core.debug('Checking tar --version');\n let versionOutput = '';\n yield exec_1.exec('tar --version', [], {\n ignoreReturnCode: true,\n silent: true,\n listeners: {\n stdout: (data) => (versionOutput += data.toString()),\n stderr: (data) => (versionOutput += data.toString())\n }\n });\n core.debug(versionOutput.trim());\n const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');\n // Initialize args\n let args;\n if (flags instanceof Array) {\n args = flags;\n }\n else {\n args = [flags];\n }\n if (core.isDebug() && !flags.includes('v')) {\n args.push('-v');\n }\n let destArg = dest;\n let fileArg = file;\n if (IS_WINDOWS && isGnuTar) {\n args.push('--force-local');\n destArg = dest.replace(/\\\\/g, '/');\n // Technically only the dest needs to have `/` but for aesthetic consistency\n // convert slashes in the file arg too.\n fileArg = file.replace(/\\\\/g, '/');\n }\n if (isGnuTar) {\n // Suppress warnings when using GNU tar to extract archives created by BSD tar\n args.push('--warning=no-unknown-keyword');\n }\n args.push('-C', destArg, '-f', fileArg);\n yield exec_1.exec(`tar`, args);\n return dest;\n });\n}", "function buildCompressed(cb) {\n const defines = 'Blockly.VERSION=\"' + packageJson.version + '\"';\n return gulp.src(maybeAddClosureLibrary(['core/**/**/*.js']), {base: './'})\n // Directories in Blockly are used to group similar files together\n // but are not used to limit access with @package, instead the\n // method means something is internal to Blockly and not a public\n // API.\n // Flatten all files so they're in the same directory, but ensure that\n // files with the same name don't conflict.\n .pipe(gulp.rename(function (p) {\n var dirname = p.dirname.replace(new RegExp(path.sep, \"g\"), \"-\");\n p.dirname = \"\";\n p.basename = dirname + \"-\" + p.basename;\n }))\n .pipe(stripApacheLicense())\n .pipe(compile({\n dependency_mode: 'PRUNE',\n entry_point: './core-requires.js',\n js_output_file: 'blockly_compressed.js',\n externs: ['./externs/svg-externs.js', './externs/goog-externs.js'],\n define: defines,\n language_in:\n argv.closureLibrary ? 'ECMASCRIPT_2015' : 'ECMASCRIPT6_STRICT'\n }, argv.verbose, argv.strict))\n .pipe(prependHeader())\n .pipe(gulp.dest('./'));\n}", "function unpackTgz (package_tgz, Target) {\n return Q.promise(function (resolve, reject) {\n const extractOpts = { type: 'Directory', path: Target, strip: 1 };\n\n fs.createReadStream(package_tgz)\n .on('error', function (err) {\n events.emit('warn', 'Unable to open tarball ' + package_tgz + ': ' + err);\n reject(err);\n })\n .pipe(zlib.createUnzip())\n .on('error', function (err) {\n events.emit('warn', 'Error during unzip for ' + package_tgz + ': ' + err);\n reject(err);\n })\n .pipe(tar.Extract(extractOpts))\n .on('error', function (err) {\n events.emit('warn', 'Error during untar for ' + package_tgz + ': ' + err);\n reject(err);\n })\n .on('end', resolve);\n })\n .then(function () {\n return unpackTarget;\n });\n}", "function xar () {\n return src('build/**/*', { base: 'build' })\n .pipe(zip(packageName()))\n .pipe(dest('.'))\n}", "function srcPath(src) {\n return path.join(snowpackOutDir, 'src', src);\n}", "function compressZip() {\r\n\treturn gulp\r\n\t\t.src( paths.zip.src )\r\n\t\t.pipe( zip( info.slug + '.zip' ) )\r\n\t\t.pipe( gulp.dest( paths.zip.dest ) )\r\n\t\t.on( 'error', notify.onError() )\r\n\t\t.pipe( notify( {\r\n\t\t\tmessage: 'Great! Package is ready',\r\n\t\t\ttitle: 'Build successful'\r\n\t\t}\r\n\t\t) );\r\n}", "function zipExamples(sourceDirName, outputDirName) {\n var gpath = path.join(sourceDirName, '**/*zipconfig.json');\n var configFileNames = globby.sync([gpath], { ignore: ['**/node_modules/**'] });\n configFileNames.forEach(function(configFileName) {\n zipExample(configFileName, sourceDirName, outputDirName);\n });\n}", "function gzip( src ) {\n\n if ( zlib.Deflate ) {\n return zlib.gzip( src, function( err, buffer ) {\n ok( \"Compressed size: \" + (buffer.length + \"\").yellow + \" bytes gzipped (\" + ( src.length + \"\" ).yellow + \" bytes minified).\" );\n });\n } else {\n ok( \"Compressed size: \" + (zlib.deflate( new Buffer(src) ).length + \"\").yellow + \" bytes gzipped (\" + ( src.length + \"\" ).yellow + \" bytes minified).\" );\n }\n}", "function compress(path) {\n return __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __awaiter */](this, void 0, void 0, function () {\n var compressor, before;\n return __WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __generator */](this, function (_a) {\n switch (_a.label) {\n case 0:\n if (path.length <= 1) {\n return [2 /*return*/, path]; //can't compress single one\n }\n return [4 /*yield*/, createCompressor(path)];\n case 1:\n compressor = _a.sent();\n do {\n before = path.length;\n path = compressor(path);\n } while (before > path.length);\n //console.log('after', path.map((path) => path.toString()));\n return [2 /*return*/, path];\n }\n });\n });\n}", "function cacheDir(sourceDir, tool, version, arch) {\n return __awaiter(this, void 0, void 0, function* () {\n version = semver.clean(version) || version;\n arch = arch || os.arch();\n core.debug(`Caching tool ${tool} ${version} ${arch}`);\n core.debug(`source dir: ${sourceDir}`);\n if (!fs.statSync(sourceDir).isDirectory()) {\n throw new Error('sourceDir is not a directory');\n }\n // Create the tool dir\n const destPath = yield _createToolPath(tool, version, arch);\n // copy each child item. do not move. move can fail on Windows\n // due to anti-virus software having an open handle on a file.\n for (const itemName of fs.readdirSync(sourceDir)) {\n const s = path.join(sourceDir, itemName);\n yield io.cp(s, destPath, { recursive: true });\n }\n // write .complete\n _completeToolPath(tool, version, arch);\n return destPath;\n });\n}", "function cacheDir(sourceDir, tool, version, arch) {\n return __awaiter(this, void 0, void 0, function* () {\n version = semver.clean(version) || version;\n arch = arch || os.arch();\n core.debug(`Caching tool ${tool} ${version} ${arch}`);\n core.debug(`source dir: ${sourceDir}`);\n if (!fs.statSync(sourceDir).isDirectory()) {\n throw new Error('sourceDir is not a directory');\n }\n // Create the tool dir\n const destPath = yield _createToolPath(tool, version, arch);\n // copy each child item. do not move. move can fail on Windows\n // due to anti-virus software having an open handle on a file.\n for (const itemName of fs.readdirSync(sourceDir)) {\n const s = path.join(sourceDir, itemName);\n yield io.cp(s, destPath, { recursive: true });\n }\n // write .complete\n _completeToolPath(tool, version, arch);\n return destPath;\n });\n}", "function cacheDir(sourceDir, tool, version, arch) {\n return __awaiter(this, void 0, void 0, function* () {\n version = semver.clean(version) || version;\n arch = arch || os.arch();\n core.debug(`Caching tool ${tool} ${version} ${arch}`);\n core.debug(`source dir: ${sourceDir}`);\n if (!fs.statSync(sourceDir).isDirectory()) {\n throw new Error('sourceDir is not a directory');\n }\n // Create the tool dir\n const destPath = yield _createToolPath(tool, version, arch);\n // copy each child item. do not move. move can fail on Windows\n // due to anti-virus software having an open handle on a file.\n for (const itemName of fs.readdirSync(sourceDir)) {\n const s = path.join(sourceDir, itemName);\n yield io.cp(s, destPath, { recursive: true });\n }\n // write .complete\n _completeToolPath(tool, version, arch);\n return destPath;\n });\n}", "compress() {\n\n }", "function addMediaToZip(dirPath, mediaType, zip) {\n //get the full path to the media directory in the st project \n const pathToImageMedia = path.join(dirPath, '.storyteller', 'comments', 'media', mediaType);\n //get all of the media files in the directory\n const allFiles = fs.readdirSync(pathToImageMedia);\n \n //go through the contents of the dir\n for (let i = 0; i < allFiles.length; i++) {\n const fileName = allFiles[i];\n //get the full path to the file or directory\n const fullPathToFile = path.join(pathToImageMedia, fileName);\n //read the file and store it in the zip\n const fileBuffer = fs.readFileSync(fullPathToFile);\n zip.file(`media/${mediaType}/${fileName}`, fileBuffer);\n }\n}", "function copyAssetDir (dir) {\n mkpath(settings.assetDest + dir, function (err) {\n if (err)\n throw err;\n fs.readdir(__dirname + '/../dist/assets' + dir, function (err, filenames) {\n if (err)\n throw err;\n\n filenames.forEach(function (f) {\n fs.createReadStream(__dirname + '/../dist/assets' + dir + '/' + f)\n .pipe(fs.createWriteStream(settings.assetDest + dir +'/' + f));\n });\n });\n });\n }", "function shipSrc(source, destination, ignore) {\n var glob = require('glob');\n var files = glob.sync(source, { silent: true, ignore: ignore });\n for (var i = 0; i < files.length; i++) {\n var file = files[i].split('src/')[1];\n var target = destination + file;\n if (!fs.existsSync(path.dirname(target))) {\n shelljs.mkdir('-p', path.dirname(target));\n }\n fs.writeFileSync(target, fs.readFileSync(files[i]));\n }\n}", "function compressFile(path) {\n \n console.log(`Starting the file compression for ${path}`);\n\n return new Promise(function (resolve, reject) {\n setTimeout(() => {\n const compressedPath = path.split('.')[0] + '.zip';\n resolve(compressedPath);\n },3000)\n }) \n}", "function transpileSource(bundler) {\r\n var timer = duration('Time Taken To Bundle');\r\n\r\n return bundler.bundle()\r\n .on('error', function (err) {\r\n browserSync.notify(\"Error\");\r\n gutil.log(err);\r\n })\r\n .pipe(source(config.js.srcName))\r\n .pipe(buffer())\r\n .pipe(rename(config.js.outputName))\r\n .pipe(gulp.dest(config.js.outputDir))\r\n .pipe(timer)\r\n .pipe(reload({\r\n stream: true\r\n }));\r\n}", "rollup(config) {\n const outputDir = process.cwd() + '/dist/';\n\n const [, inputFilename] = config.input.match(filenameMatcher);\n\n config.plugins = [\n postcss({\n config: {\n path: path.resolve(__dirname, './tools/postcss.config.js'),\n },\n minimize: true,\n modules: true,\n extract: 'styles.css',\n }),\n url(),\n svgr({\n ref: true,\n }),\n ...config.plugins,\n ];\n\n // Manual name changes. Not great...\n if (inputFilename === 'alpha') {\n const outputFile = config.output.file;\n const outputSubDir = `${outputDir}${inputFilename}/`;\n config.output.file = outputFile.replace(outputDir, outputSubDir);\n }\n\n return config;\n }", "async function zipDir( dataDirectory ) {\n const zip = new Zip();\n const zipDirectories = {}\n\n walker = walk( dataDirectory )\n walker.on( \"directories\", ( root, statsArr, next ) => {\n statsArr.forEach( stat => {\n const dirName = stat.name;\n zipDirectories[dirName] = zip.folder( dirName );\n } )\n next();\n } );\n\n walker.on( \"file\", async ( directoryRoot, stats, next ) => {\n const fileName = stats.name;\n const filePath = path.resolve( directoryRoot, fileName );\n const fileBuffer = await fs.readFile( filePath, { encoding: \"base64\" } );\n\n const directoryRootArray = directoryRoot.split( \"/\" );\n const directory = directoryRootArray[directoryRootArray.length - 1];\n\n if ( dataDirectory !== directoryRoot ) { // Add file to the correstponding directory within the zip file\n zipDirectories[ directory ].file( fileName, fileBuffer, { base64: true } );\n }\n else { // File in zip root\n zip.file( fileName, fileBuffer, { base64: true } );\n }\n next();\n } )\n\n\n const zipBuffer = await new Promise( resolve => {\n walker.on( \"end\", async () => {\n const zipBuffer = await zip.generateAsync( { type: \"base64\" } );\n\n resolve( zipBuffer );\n } )\n } )\n return zipBuffer;\n}", "async function transpileSourcePath({ source, destination, basePath }) {\n // relative to root.\n if (!path.isAbsolute(source)) source = path.join(basePath, source)\n\n let fileStat = await filesystem.lstat(source).catch(error => (error.code == 'ENOENT' ? false : console.error(error)))\n // destination should include directory\n if (fileStat) {\n if (fileStat.isFile()) destination = destination\n else if (fileStat.isDirectory()) destination = path.join(destination, path.relative(basePath, source))\n } else return // return if source doesn't exist\n\n await recursivelySyncFile({ source: source, destination: destination, copyContentOnly: true })\n\n // execute babel cli\n let cp = childProcess.spawnSync(\n 'yarn',\n [\n 'run',\n 'babel',\n '--out-dir',\n `\"${destination}\"`,\n '--config-file',\n '\"./configuration/babel.config.js\"',\n '--ignore',\n '\"**/node_modules/**/*\"',\n // Note: a separate rsync step should be used if copying other files is required, as the functionality provided with the babel commandline is limited.\n // '--copy-files --include-dotfiles --no-copy-ignored', // Note: this will ignore only .js files, regardless of the regex including other types. Apply ignore regex to the copy-files functionality, this will cause ignore flag to affect babel and also non transpiled copied files.\n `\"${path.relative(basePath, source)}\"`,\n ],\n {\n cwd: basePath,\n shell: true,\n stdio: ['inherit', 'inherit', 'inherit'],\n },\n )\n}", "function buildLatestZip(image_dir) {\n if (fs.existsSync(LATESTZIP)) fs.unlinkSync(LATESTZIP);\n if (getFileNamesAt(image_dir).length > 0) {\n jlog(`buildLatestZip`, `(${bl}wait${rs}) Compressing contents of ${image_dir} to ${LATESTZIP}`);\n try { syscallSync(`zip -urj ${LATESTZIP} ${image_dir}/*`); }\n catch (e) { elog(`buildLatestZip`, e);}\n if (fs.existsSync(LATESTZIP)) {\n archiveLatestZip(LATESTZIP); // Timestamp and cp to HISTDIR\n pruneHistoryDir(fs.readdirSync(HISTDIR)); // Prune the zip history when we add a new one\n } else {\n elog(`buildLatestZip`, `Failed to verify ${LATESTZIP} existence for archival!`);\n }\n jlog(`buildLatestZip`, `(${gr}COMPLETE${rs}) ${LATESTZIP} is ready.`);\n } else {\n elog(`buildLatestZip`, `The directory ${image_dir} was empty! Cannot zip! Aborting.`);\n }\n}", "function generateCommand(bundle, directory) {\n let extract;\n // check if we have lbzip2 installed\n if (commandExistsSync('lbzip2')) {\n extract = `tar -x --use-compress-program=lbzip2`;\n } else {\n extract = `tar -xj`;\n }\n\n const csvFilename = bundle\n .replace(/-\\d{8}T\\d{6}-/, '-latest-') // support timestamped downloads\n .replace('.tar.bz2', '.csv');\n\n return `curl -s ${wofDataHost}/bundles/${bundle} | ${extract} --strip-components=1 --exclude=README.txt -C ` +\n `${directory} && mv ${path.join(directory, csvFilename)} ${path.join(directory, 'meta')}`;\n }", "async function prepareInputDirectory(givenPath) {\n let inputPath = givenPath;\n\n // Fetch input from S3 if required\n if (givenPath.startsWith(\"s3://\")) {\n inputPath = await fetchInputFromS3(inputPath);\n }\n\n // Fetch URL if required\n if (givenPath.startsWith(\"https://\")) {\n inputPath = await fetchInputFromURL(inputPath);\n }\n\n // Untar tarball, if required\n if (inputPath.endsWith(\".gz\")) {\n inputPath = await extractGzipToTmpdir(inputPath);\n }\n\n return normalizeDirectory(inputPath);\n}", "_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 }", "async build() {\n const entry = path.resolve(process.cwd(), this._options.entry);\n const distPath = path.resolve(process.cwd(), this._options.distPath);\n logger.log(`Building ${entry} to ${distPath}`);\n const { code, map, assets } = await ncc(entry);\n const filename = path.basename(entry);\n await makeDir(distPath);\n fs.writeFileSync(`${distPath}/${filename}`, code);\n for (let asset in assets) {\n fs.writeFileSync(`${distPath}/${asset}`, assets[asset].source);\n }\n const finalAssets = [`${distPath}/${filename}`, ...Object.keys(assets).map(asset => `${distPath}/${asset}`)];\n logger.log('Building success!');\n finalAssets.forEach(asset => logger.log('=> ' + asset));\n return {\n success: true,\n assets: finalAssets\n };\n }", "function files_merger_generic(sourceDir){\n let dir_path = path.join(__dirname, sourceDir),\n files = fs.readdirSync(dir_path).filter(extension_validator),\n combinedFilesArray = [];\n files.forEach(file => {\n fileData = readFileToJson(path.join(__dirname, sourceDir, file));\n combinedFilesArray = combinedFilesArray.concat(fileData);\n })\n let reducedFilesArray = data_consolidator(combinedFilesArray);\n return reducedFilesArray;\n}", "async prepareModPackTempDir(packTempPath) {\n\t\tconst archiveRootPath = `${packTempPath}/Valheim`;\n\n\t\tawait fse.copy(\n\t\t\tpath.join(__dirname, `../../../game-setups/${game}/modpack-base`),\n\t\t\tarchiveRootPath\n\t\t);\n\t\tawait fse.copy(\n\t\t\tpath.join(gameDir, \"server/BepInEx/config\"),\n\t\t\tpath.join(archiveRootPath, \"BepInEx/config\")\n\t\t);\n\t\tawait fse.copy(\n\t\t\tpath.join(gameDir, \"server/BepInEx/plugins\"),\n\t\t\tpath.join(archiveRootPath, \"BepInEx/plugins\")\n\t\t);\n\t\treturn archiveRootPath;\n\t}", "downloadCompressedFile(payload) {\n return this.request.post(`/download-compressed-file/tenant`, payload, {\n responseType: 'arraybuffer'\n });\n }", "srcFiles(cb) {\n if (!fs.existsSync(srcDir)) {\n return cb(new Error(col.error(\n `Template directory \"${col.bold(srcDir)}\" does not exist.`)));\n }\n return dstate(srcDir, (err, files) => cb(err, files));\n }", "function copyFiles(dirname) {\n var srcDir = dirName + \"template/\";\n \n createDir(dirName);\n\n if (dirname != undefined) {\n srcDir += dirname + \"/\";\n }\n for (var i in files) {\n fs.createReadStream(srcDir + files[i]).pipe(fs.createWriteStream(dirName + files[i]));\n }\n }", "function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {\n return __awaiter(this, void 0, void 0, function* () {\n const args = [`\"${tarPath.path}\"`];\n const cacheFileName = utils.getCacheFileName(compressionMethod);\n const tarFile = 'cache.tar';\n const workingDirectory = getWorkingDirectory();\n // Speficic args for BSD tar on windows for workaround\n const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&\n compressionMethod !== constants_1.CompressionMethod.Gzip &&\n IS_WINDOWS;\n // Method specific args\n switch (type) {\n case 'create':\n args.push('--posix', '-cf', BSD_TAR_ZSTD\n ? tarFile\n : cacheFileName.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '--exclude', BSD_TAR_ZSTD\n ? tarFile\n : cacheFileName.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '-P', '-C', workingDirectory.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '--files-from', constants_1.ManifestFilename);\n break;\n case 'extract':\n args.push('-xf', BSD_TAR_ZSTD\n ? tarFile\n : archivePath.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '-P', '-C', workingDirectory.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'));\n break;\n case 'list':\n args.push('-tf', BSD_TAR_ZSTD\n ? tarFile\n : archivePath.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '-P');\n break;\n }\n // Platform specific args\n if (tarPath.type === constants_1.ArchiveToolType.GNU) {\n switch (process.platform) {\n case 'win32':\n args.push('--force-local');\n break;\n case 'darwin':\n args.push('--delay-directory-restore');\n break;\n }\n }\n return args;\n });\n}", "function combine() {\n utils.richlog(`vendor modules to combine: `, utils.LOGTYPE.INFO)\n console.log(entry)\n\n for (let entry_name in entry) {\n let code = {}\n let temp = [].concat(entry[entry_name])\n\n temp.forEach(function (v) {\n let module_path = '',\n mini = {}\n\n try {\n if (DOT_RE.test(v)) { // for vendor modules under src/vendor\n module_path = path.resolve(rootPath, v)\n } else { // for vendor modules under node_modules\n module_path = handleNodeMudulesPath(v)\n }\n\n mini = handleMini(module_path)\n code[mini.suffix] = (code[mini.suffix] || '') + mini.code\n } catch (err) {\n utils.log(`cannot find vendor: `, `${v}`, 'red')\n }\n\n })\n\n for (let entry_type in code) {\n mkdirSync(outputPath, function () {\n let file = path.join(outputPath, entry_name + '.' + entry_type)\n utils.richlog(`generated compressed vendor file: ${file}`, utils.LOGTYPE.SUCCESSFUL)\n fs.writeFileSync(file, code[entry_type])\n })\n }\n }\n}", "function extract_zip(sSourceFullPath, sTargetDir) {\r\n if (! fso.FileExists(sSourceFullPath)) {\r\n WScript.Echo(sSourceFullPath + \" not found\");\r\n WScript.Quit(1);\r\n }\r\n // Create the required Shell objects\r\n var sa = WScript.CreateObject(\"Shell.Application\");\r\n\r\n // Create a reference to the files and folders in the ZIP file\r\n var objSource = sa.NameSpace(sSourceFullPath).Items();\r\n\r\n // Create a reference to the target folder\r\n var objTarget = sa.NameSpace(sTargetDir);\r\n\r\n /* These are the available CopyHere options, according to MSDN\r\n (http://msdn2.microsoft.com/en-us/library/ms723207.aspx).\r\n On my test systems, however, the options were completely ignored.\r\n 4: Do not display a progress dialog box.\r\n 8: Give the file a new name in a move, copy, or rename\r\n operation if a file with the target name already exists.\r\n 16: Click \"Yes to All\" in any dialog box that is displayed.\r\n 64: Preserve undo information, if possible.\r\n 128: Perform the operation on files only if a wildcard file\r\n name (*.*) is specified.\r\n 256: Display a progress dialog box but do not show the file\r\n names.\r\n 512: Do not confirm the creation of a new directory if the\r\n operation requires one to be created.\r\n 1024: Do not display a user interface if an error occurs.\r\n 4096: Only operate in the local directory.\r\n Don't operate recursively into subdirectories.\r\n 8192: Do not copy connected files as a group.\r\n Only copy the specified files.\r\n */\r\n // UnZIP the files\r\n objTarget.CopyHere(objSource, 256); \r\n}", "function serverlessZip(args) {\n const { artifactFilePath, directory, files } = args;\n\n const zip = archiver.create('zip');\n const output = fs.createWriteStream(artifactFilePath);\n\n return new BbPromise((resolve, reject) => {\n output.on('close', () => resolve(artifactFilePath));\n output.on('error', err => reject(err));\n zip.on('error', err => reject(err));\n\n output.on('open', () => {\n zip.pipe(output);\n\n // normalize both maps to avoid problems with e.g. Path Separators in different shells\n const normalizedFiles = _.uniq(_.map(files, file => path.normalize(file)));\n\n BbPromise.all(_.map(normalizedFiles, file => getFileContentAndStat.call(this, directory, file)))\n .then(contents => {\n _.forEach(\n contents.sort((content1, content2) => content1.filePath.localeCompare(content2.filePath)),\n file => {\n const name = file.filePath;\n // Ensure file is executable if it is locally executable or\n // we force it to be executable if platform is windows\n const mode = file.stat.mode & 0o100 || process.platform === 'win32' ? 0o755 : 0o644;\n zip.append(file.data, {\n name,\n mode,\n // necessary to get the same hash when zipping the same content\n // as well as `contents.sort` few lines above\n date: new Date(0)\n });\n }\n );\n\n return zip.finalize();\n })\n .catch(reject);\n });\n });\n}", "function copyTempToDist() {\n return src(['.temp/dist/**/*', '!.temp/dist/package-lock.json'])\n .pipe(dest('target/dist'));\n}", "function unpack( seedPath, callback ) {\n var dir= path.dirname( seedPath ); \n log( \"unpack\", seedPath );\n sys.exec(\"tar -xzvf \"+seedPath+ \" -C \"+ dir +\" 2> /dev/null\", function (err, stdout, stderr) {\n var nextStep= function(err) {\n log( \"remove\", seedPath );\n fs.unlink(seedPath, function() { callback(err); });\n };\n if (err) {\n log( \"remove\", dir );\n abort( \"failed to unpack. Seed is invalid or corrupt.\");\n recursiveRmDir(dir,function(error) {\n nextStep(err);\n });\n }\n else {\n nextStep();\n }\n });\n}", "function moveAssets() {\r\n return src([source.etc.files], { base: source.etc.path })\r\n .pipe(dest(getAssetsPath()));\r\n}", "function createGZipFileInBuffer(originalFilePath) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a;\n const inputStream = fs.createReadStream(originalFilePath);\n const gzip = zlib.createGzip();\n inputStream.pipe(gzip);\n // read stream into buffer, using experimental async iterators see https://github.com/nodejs/readable-stream/issues/403#issuecomment-479069043\n const chunks = [];\n try {\n for (var gzip_1 = __asyncValues(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), !gzip_1_1.done;) {\n const chunk = gzip_1_1.value;\n chunks.push(chunk);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (gzip_1_1 && !gzip_1_1.done && (_a = gzip_1.return)) yield _a.call(gzip_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n resolve(Buffer.concat(chunks));\n }));\n });\n}", "function createGZipFileInBuffer(originalFilePath) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a;\n const inputStream = fs.createReadStream(originalFilePath);\n const gzip = zlib.createGzip();\n inputStream.pipe(gzip);\n // read stream into buffer, using experimental async iterators see https://github.com/nodejs/readable-stream/issues/403#issuecomment-479069043\n const chunks = [];\n try {\n for (var gzip_1 = __asyncValues(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), !gzip_1_1.done;) {\n const chunk = gzip_1_1.value;\n chunks.push(chunk);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (gzip_1_1 && !gzip_1_1.done && (_a = gzip_1.return)) yield _a.call(gzip_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n resolve(Buffer.concat(chunks));\n }));\n });\n}", "function afterTarball () {\n if (badDownload) return\n if (extractCount === 0) {\n return cb(new Error('There was a fatal problem while downloading/extracting the tarball'))\n }\n log.verbose('tarball', 'done parsing tarball')\n var async = 0\n\n if (isLegacy) {\n // copy over the files from the `legacy` dir\n async++\n copyLegacy(deref)\n }\n\n if (win) {\n // need to download node.lib\n async++\n downloadNodeLib(deref)\n }\n\n // write the \"installVersion\" file\n async++\n var installVersionPath = path.resolve(devDir, 'installVersion')\n fs.writeFile(installVersionPath, gyp.package.installVersion + '\\n', deref)\n\n if (async === 0) {\n // no async tasks required\n cb()\n }\n\n function deref (err) {\n if (err) return cb(err)\n --async || cb()\n }\n }", "function updateBinary(response) {\n response.pipe(\n extractTarGz({\n cwd: CWD,\n filter: (path, stat) => (path === \"bin/index.node\" ? true : false)\n })\n );\n}", "_getTarballFilePath(project) {\n return path.join(this._rushConfiguration.commonTempFolder, RushConstants_1.RushConstants.rushTempProjectsFolderName, `${project.unscopedTempProjectName}.tgz`);\n }", "function compress() {\n return src(['dist/math.js'])\n .pipe(minify({\n ext:{\n min:'.min.js'\n }\n }))\n .pipe(dest('./dist'));\n}", "static zip_folder(path_to_folder_to_zip){\n let zip = new AdmZip();\n zip.addLocalFolder(path_to_folder_to_zip)\n zip.writeZip(path_to_folder_to_zip + \".zip\")\n out(path_to_folder_to_zip + \".zip created.\")\n }", "function makeReleaseCopies( Release ) {\n\tshell.mkdir( \"-p\", cdnFolder );\n\n\tObject.keys( releaseFiles ).forEach( function( key ) {\n\t\tvar text,\n\t\t\tbuiltFile = releaseFiles[ key ],\n\t\t\tunpathedFile = key.replace( /VER/g, Release.newVersion ),\n\t\t\treleaseFile = cdnFolder + \"/\" + unpathedFile;\n\n\t\tif ( /\\.map$/.test( releaseFile ) ) {\n\n\t\t\t// Map files need to reference the new uncompressed name;\n\t\t\t// assume that all files reside in the same directory.\n\t\t\t// \"file\":\"jquery.min.js\",\"sources\":[\"jquery.js\"]\n\t\t\ttext = fs.readFileSync( builtFile, \"utf8\" )\n\t\t\t\t.replace( /\"file\":\"([^\"]+)\",\"sources\":\\[\"([^\"]+)\"\\]/,\n\t\t\t\t\t\"\\\"file\\\":\\\"\" + unpathedFile.replace( /\\.min\\.map/, \".min.js\" ) +\n\t\t\t\t\t\"\\\",\\\"sources\\\":[\\\"\" + unpathedFile.replace( /\\.min\\.map/, \".js\" ) + \"\\\"]\" );\n\t\t\tfs.writeFileSync( releaseFile, text );\n\t\t} else if ( builtFile !== releaseFile ) {\n\t\t\tshell.cp( \"-f\", builtFile, releaseFile );\n\t\t}\n\t} );\n}", "function createFromDirectory(folder, archive, wwwRoot, callback) {\r\n var fn = loadFunction(wwwRoot, 'CreateFromDirectory');\r\n fn({\r\n folder: folder,\r\n archive: archive\r\n }, function (error, errorMessage) {\r\n callback(error || errorMessage ? new Error(errorMessage) : null);\r\n });\r\n }", "function BinaryPacker() {\n}", "static async loadDirectory(source, entries) {\n const files = await Helper_1.readDirectory(source.path);\n for (const file of files) {\n const path = Path.join(source.path, file);\n const stat = Fs.statSync(path);\n if (stat.isDirectory()) {\n await Helper_1.loadDirectory({ name: `${source.name}/${file}`, path: path }, entries);\n }\n else if (stat.isFile()) {\n await Helper_1.loadFile({ name: `${source.name}/${file.substr(0, file.length - 3)}`, path: path }, entries);\n }\n }\n }", "function copyTreeSeq(srcdir, destdir, callback) {\n fs.mkdir(destdir, function (err) {\n if (err) throw new Error(err);\n fs.readdir(srcdir, function (err, files) {\n if (err) throw new Error(err);\n (function loop(i) {\n function next(err) {\n if (err) throw new Error(err);\n loop(i + 1);\n }\n\n if (i < files.length) {\n const f = files[i];\n const fullname = path.join(srcdir, f);\n const dest = path.join(destdir, f);\n fs.lstat(fullname, function (err, stat) {\n if (err) throw new Error(err);\n if (stat.isSymbolicLink()) {\n fs.readlink(fullname, function (err, target) {\n if (err) throw new Error(err);\n fs.symlink(target, dest, next);\n });\n } else if (stat.isDirectory()) {\n copyTreeSeq(fullname, dest, next);\n } else if (stat.isFile()) {\n fs.readFile(fullname, function (err, data) {\n if (err) throw new Error(err);\n fs.writeFile(dest, data, next);\n });\n } else {\n next();\n }\n });\n } else {\n callback();\n }\n })(0);\n });\n });\n}", "fuseTo(filepath, dstdir, opts) {\n if (opts == null) { opts = {}; }\n filepath = path.resolve(filepath);\n\n const moduleName = bna.generateModuleName(opts.dstfile || filepath);\n const [content, binaryunits, sourcemap, warnings, units] = Array.from(bna._fuse(filepath, dstdir, moduleName, opts));\n for (let warning of Array.from(bna.prettyWarnings(warnings))) { bna.warn(warning); }\n wrench.mkdirSyncRecursive(dstdir);\n const dstfile = path.resolve(dstdir, opts.dstfile || (path.basename(filepath, \".js\") + \".fused.js\"));\n const smFile = dstfile + \".map\";\n\n log(`Generating ${path.relative('.', dstfile)}`);\n fs.writeFileSync(dstfile, content);\n if (sourcemap) {\n log(`Generating ${path.relative('.', smFile)}`);\n sourcemap.file = path.basename(dstfile);\n fs.writeFileSync(smFile, JSON.stringify(sourcemap, null, 2));\n fs.appendFileSync(dstfile, `\\n//# sourceMappingURL=${path.basename(smFile)}`);\n }\n\n // copy binary units\n for (let bunit of Array.from(binaryunits)) {\n const dfile = path.resolve(dstdir, bunit.binName);\n if (fs.existsSync(dfile)) {\n bna.warn(`Skipped copying ${dfile}, already exists.`);\n } else {\n wrench.mkdirSyncRecursive(path.dirname(dfile));\n fs.createReadStream(bunit.fpath).pipe(fs.createWriteStream(dfile));\n }\n }\n return units;\n }", "async function cloneDirectory(source, target) {\n await shell(['rm', '-rf', target]);\n await shell(['mkdir', '-p', target]);\n await shell(['cp', '-R', source + '/*', target]);\n}", "function encode (obj) {\n if (!obj && !(this instanceof TarHeader)) throw new Error(\n \"encode must be called on a TarHeader, or supplied an object\")\n\n obj = obj || this\n var block = obj.block = new Buffer(512)\n\n // if the object has a \"prefix\", then that's actually an extension of\n // the path field.\n if (obj.prefix) {\n // console.error(\"%% header encoding, got a prefix\", obj.prefix)\n obj.path = obj.prefix + \"/\" + obj.path\n // console.error(\"%% header encoding, prefixed path\", obj.path)\n obj.prefix = \"\"\n }\n\n obj.needExtended = false\n\n if (obj.mode) {\n if (typeof obj.mode === \"string\") obj.mode = parseInt(obj.mode, 8)\n obj.mode = obj.mode & 0777\n }\n\n for (var f = 0; fields[f] !== null; f ++) {\n var field = fields[f]\n , off = fieldOffs[f]\n , end = fieldEnds[f]\n , ret\n\n switch (field) {\n case \"cksum\":\n // special, done below, after all the others\n break\n\n case \"prefix\":\n // special, this is an extension of the \"path\" field.\n // console.error(\"%% header encoding, skip prefix later\")\n break\n\n case \"type\":\n // convert from long name to a single char.\n var type = obj.type || \"0\"\n if (type.length > 1) {\n type = tar.types[obj.type]\n if (!type) type = \"0\"\n }\n writeText(block, off, end, type)\n break\n\n case \"path\":\n // uses the \"prefix\" field if > 100 bytes, but <= 255\n var pathLen = Buffer.byteLength(obj.path)\n , pathFSize = fieldSize[fields.path]\n , prefFSize = fieldSize[fields.prefix]\n\n // paths between 100 and 255 should use the prefix field.\n // longer than 255\n if (pathLen > pathFSize &&\n pathLen <= pathFSize + prefFSize) {\n // need to find a slash somewhere in the middle so that\n // path and prefix both fit in their respective fields\n var searchStart = pathLen - 1 - pathFSize\n , searchEnd = prefFSize\n , found = false\n , pathBuf = new Buffer(obj.path)\n\n for ( var s = searchStart\n ; (s <= searchEnd)\n ; s ++ ) {\n if (pathBuf[s] === slash || pathBuf[s] === bslash) {\n found = s\n break\n }\n }\n\n if (found !== false) {\n prefix = pathBuf.slice(0, found).toString(\"utf8\")\n path = pathBuf.slice(found + 1).toString(\"utf8\")\n\n ret = writeText(block, off, end, path)\n off = fieldOffs[fields.prefix]\n end = fieldEnds[fields.prefix]\n // console.error(\"%% header writing prefix\", off, end, prefix)\n ret = writeText(block, off, end, prefix) || ret\n break\n }\n }\n\n // paths less than 100 chars don't need a prefix\n // and paths longer than 255 need an extended header and will fail\n // on old implementations no matter what we do here.\n // Null out the prefix, and fallthrough to default.\n // console.error(\"%% header writing no prefix\")\n var poff = fieldOffs[fields.prefix]\n , pend = fieldEnds[fields.prefix]\n writeText(block, poff, pend, \"\")\n // fallthrough\n\n // all other fields are numeric or text\n default:\n ret = numeric[field]\n ? writeNumeric(block, off, end, obj[field])\n : writeText(block, off, end, obj[field] || \"\")\n break\n }\n obj.needExtended = obj.needExtended || ret\n }\n\n var off = fieldOffs[fields.cksum]\n , end = fieldEnds[fields.cksum]\n\n writeNumeric(block, off, end, calcSum.call(this, block))\n\n return block\n}", "function copy() {\n\n\t\t// Copy dist files\n\t\tvar distFolder = Release.dir.dist + \"/dist\",\n\t\t\texternalFolder = Release.dir.dist + \"/external\",\n\t\t\trmIgnore = files\n\t\t\t\t.concat( [\n\t\t\t\t\t\"README.md\",\n\t\t\t\t\t\"node_modules\"\n\t\t\t\t] )\n\t\t\t\t.map( function( file ) {\n\t\t\t\t\treturn Release.dir.dist + \"/\" + file;\n\t\t\t\t} );\n\n\t\tshell.config.globOptions = {\n\t\t\tignore: rmIgnore\n\t\t};\n\n\t\t// Remove extraneous files before copy\n\t\tshell.rm( \"-rf\", Release.dir.dist + \"/**/*\" );\n\n\t\tshell.mkdir( \"-p\", distFolder );\n\t\tfiles.forEach( function( file ) {\n\t\t\tshell.cp( \"-f\", Release.dir.repo + \"/\" + file, distFolder );\n\t\t} );\n\n\t\t// Copy Sizzle\n\t\tshell.mkdir( \"-p\", externalFolder );\n\t\tshell.cp( \"-rf\", Release.dir.repo + \"/external/sizzle\", externalFolder );\n\n\t\t// Copy other files\n\t\textras.forEach( function( file ) {\n\t\t\tshell.cp( \"-rf\", Release.dir.repo + \"/\" + file, Release.dir.dist );\n\t\t} );\n\n\t\t// Remove the wrapper from the dist repo\n\t\tshell.rm( \"-f\", Release.dir.dist + \"/src/wrapper.js\" );\n\n\t\t// Write generated bower file\n\t\tfs.writeFileSync( Release.dir.dist + \"/bower.json\", generateBower() );\n\n\t\tconsole.log( \"Adding files to dist...\" );\n\t\tRelease.exec( \"git add .\", \"Error adding files.\" );\n\t\tRelease.exec(\n\t\t\t\"git commit -m 'Release \" + Release.newVersion + \"'\",\n\t\t\t\"Error committing files.\"\n\t\t);\n\t\tconsole.log();\n\n\t\tconsole.log( \"Tagging release on dist...\" );\n\t\tRelease.exec( \"git tag \" + Release.newVersion,\n\t\t\t\"Error tagging \" + Release.newVersion + \" on dist repo.\" );\n\t\tRelease.tagTime = Release.exec( \"git log -1 --format='%ad'\",\n\t\t\t\"Error getting tag timestamp.\" ).trim();\n\t}", "function next() {\n\t\tvar bopts;\n\t\tvar name;\n\t\tvar pkg;\n\t\tvar out;\n\n\t\ti += 1;\n\t\tpkg = pkgs[ i ];\n\n\t\t// TODO: read `package.json`\n\t\tname = packageName( pkg );\n\t\tdebug( 'Package name: %s', name );\n\n\t\tout = join( dest, name );\n\t\tdebug( 'Destination directory: %s', out );\n\n\t\tbopts = {};\n\t\tbopts.readme = opts.readme;\n\t\tbopts.index = opts.index;\n\t\tbopts.title = name;\n\t\tbopts.mount = opts.mount + name + '/';\n\t\tbopts.head = opts.head;\n\t\tbopts.prepend = opts.prepend;\n\t\tbopts.append = opts.append;\n\n\t\tbopts.tests = copy( opts.tests );\n\t\tbopts.tests.title = name + ' - Tests';\n\n\t\tbopts.benchmarks = copy( opts.benchmarks );\n\t\tbopts.benchmarks.title = name + ' - Benchmarks';\n\n\t\tdebug( 'Build options: %s', JSON.stringify( bopts ) );\n\n\t\tdebug( 'Building package: %s (%d of %d)', pkg, i+1, len );\n\t\tbuildPkg( pkg, out, bopts, getClbk( i ) );\n\t}", "function deploy() {\n const publisher = gulpAwspublish.create({\n params: {\n Bucket: config.bucketName,\n },\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n });\n\n return gulp.src(config.src)\n .pipe(gulpIf(Boolean(config.folder), gulpRename((path) => {\n // Prepend the folder to all source files\n path.dirname = `${config.folder}/${path.dirname}`;// eslint-disable-line no-param-reassign\n })))\n .pipe(publisher.publish(config.headers))\n // publisher.sync() deletes all other files than the uploaded\n .pipe(gulpIf(config.sync, publisher.sync()))\n .pipe(gulpAwspublish.reporter());\n }", "function Archiver() {\n\n /**\n * Add a file to be archived. Target filepath is <pre>{options.directory}/{options.file.name}</pre> or just\n * <pre>{options.file.name}</pre> (root directory) if <pre>options.directory</pre> is not specified.\n * @restriction Server SuiteScript only\n * @governance none\n *\n * @param {Object} options\n * @param {file} options.file - file to be archived\n * @param {String} [options.directory] - target directory in the archive\n *\n * @throws {SuiteScriptError} COMPRESS_API_DUPLICATE_PATH if a file has already been added on the same target path\n *\n * @since 2020.2\n */\n this.add = function (options) { };\n\n /**\n * Create an archive with the added files and return it as a temporary file object.\n *\n * The <pre>options.type</pre> doesn't need to be specified if the archive file name (<pre>options.name</pre>) has one\n * of the following extensions: .cpio, .tar, .tar.gz, .tar.bz2, .tgz, .tbz2, .zip.\n * @restriction Server SuiteScript only\n * @governance none\n *\n * @param {Object} options\n * @param {string} options.name - name of the archive file\n * @param {string} options.type - see archive.Type enum\n *\n * @returns {file} - temporary file object representing the archive\n *\n * @throws {SuiteScriptError} COMPRESS_API_UNSUPPORTED_ARCHIVE_TYPE if options.type is an invalid archive type\n * @throws {SuiteScriptError} COMPRESS_API_UNRECOGNIZED_ARCHIVE_FILE_EXTENSION if options.type is not specified\n * and archive type cannot be determined from the file extension\n * @throws {SuiteScriptError} COMPRESS_API_UNABLE_TO_RETRIEVE_FILE_CONTENTS if the contents cannot be retrieved\n * for any of the files to be archived\n *\n * @since 2020.2\n */\n this.archive = function (options) { };\n\n /**\n * Return the object type name (compress.Archiver).\n * @restriction Server SuiteScript only\n * @governance none\n * @return {string}\n *\n * @since 2020.2\n */\n this.toString = function () { };\n\n /**\n * get JSON format of the object\n * @restriction Server SuiteScript only\n * @governance none\n * @return {Object}\n *\n * @since 2020.2\n */\n this.toJSON = function () { };\n }", "function copySourceFilesToDestination(ngPkg, baseBuildPath) {\n return __awaiter(this, void 0, void 0, function* () {\n const separatorIndex = ngPkg.fullPackageName.lastIndexOf(ng_package_data_1.SCOPE_NAME_SEPARATOR);\n if (separatorIndex > -1) {\n const packageNameWithoutEndPart = ngPkg.fullPackageName.substring(0, separatorIndex);\n const destinationPath = path.resolve(ngPkg.rootDestinationPath, packageNameWithoutEndPart);\n yield copy_1.copyFiles(`${ngPkg.buildDirectory}/${packageNameWithoutEndPart}/**/*.{js,js.map}`, destinationPath);\n }\n else {\n yield copy_1.copyFiles(`${ngPkg.buildDirectory}/${ngPkg.fullPackageName}*.{js,js.map}`, ngPkg.rootDestinationPath);\n }\n yield copy_1.copyFiles(`${ngPkg.buildDirectory}/bundles/**/*.{js,js.map}`, `${ngPkg.rootDestinationPath}/bundles`);\n yield copy_1.copyFiles(`${baseBuildPath}/**/*.{d.ts,metadata.json}`, ngPkg.destinationPath);\n });\n}", "rootFiles() {\r\n this.fs.copy(\r\n this.templatePath('babelrc'),\r\n this.destinationPath('.babelrc')\r\n );\r\n this.fs.copy(\r\n this.templatePath('eslintrc.json'),\r\n this.destinationPath('.eslintrc.json')\r\n );\r\n this.fs.copyTpl(\r\n this.templatePath('_bower.json'),\r\n this.destinationPath('bower.json'),\r\n this.opts\r\n );\r\n this.fs.copyTpl(\r\n this.templatePath('_gulpfile.babel.js'),\r\n this.destinationPath('gulpfile.babel.js'),\r\n this.opts\r\n );\r\n this.fs.copyTpl(\r\n this.templatePath('_LICENSE'),\r\n this.destinationPath('LICENSE'),\r\n this.opts\r\n );\r\n this.fs.copyTpl(\r\n this.templatePath('_package.json'),\r\n this.destinationPath('package.json'),\r\n this.opts\r\n );\r\n }", "function writeBundle(savPath, srcPath) {\n fs.readFile(srcPath, 'utf8', (err, data) => {\n if (err) throw err;\n fs.writeFile(savPath, data, (err) => {\n if (err) throw err;\n console.log('complete write vendor');\n });\n });\n}", "function makeZip() {\n const { filename, content } = fflateBuildZipContent()\n const [zipPromise, resolve, reject] = makePromise()\n\n fflate.zip(content, (err, data) => {\n if (err) {\n reject(err)\n return\n }\n resolve(data)\n })\n\n return zipPromise.then(makeBlob).then(blob => {\n saveAs(blob, filename)\n })\n}", "setSourceFiles () {\n let allFiles = []\n this.cliArgs.sources.forEach(source => {\n let sourceStats = lstatSync(source)\n\n if (sourceStats.isFile()) {\n allFiles.push(source)\n } else {\n // Find all files matching source and extensions options\n let globExpression = source\n if (this.cliArgs.recursive) {\n globExpression += '/**'\n }\n globExpression += '/*.{' + this.cliArgs.extensions + '}'\n\n allFiles = allFiles.concat(glob.sync(globExpression, {\n ignore: this.cliArgs.outputDir + '/**/*'\n }))\n }\n })\n\n // Remove possible duplicate\n allFiles = Array.from(new Set(allFiles))\n\n let allFilesIndexInDir = allFiles.reduce((acc, file) => {\n acc.indexs[dirname(file)] = acc.indexs[dirname(file)] || 0\n acc.indexs[dirname(file)]++\n\n acc[file] = acc.indexs[dirname(file)]\n\n return acc\n }, {indexs: {}})\n\n this.sourceFiles = allFiles.map((originalPath, index) => new File(originalPath, index, allFilesIndexInDir[originalPath], this.cliArgs.pattern, this.cliArgs.outputDir))\n }", "function bundle(src, filename) {\n var startTime = Date.now();\n return src.bundle()\n .on('error', handleError)\n .pipe(source(filename))\n .pipe(buffer())\n .pipe($.sourcemaps.init({loadMaps: true}))\n .pipe($.uglify())\n .pipe($.sourcemaps.write('./'))\n .pipe(gulp.dest('./dist/js/'))\n .pipe($.size({\n showFiles: true\n }));\n}", "function processSource(deployment, source, callback) {\n logger.info('Processing source ', source);\n\n // Now build the CSV file for this source\n var filePath = path.join(basedir, 'instances', deployment.esp.name, 'deployments',\n deployment.name, 'data', 'processed', source + '.csv');\n logger.info('File path is ', filePath);\n // We first need to make sure the base directory is built\n var pathElements = filePath.split(path.sep);\n var growPath = '';\n for (var i = 0; i < (pathElements.length - 1); i++) {\n growPath = path.normalize(growPath + path.sep + pathElements[i]);\n if (!fs.existsSync(growPath)) {\n fs.mkdirSync(growPath);\n }\n }\n\n // Check to see if it is being sync'd already\n if (self.ancillaryFilesBeingSyncd.indexOf(filePath) >= 0) {\n logger.warn('File ' + filePath + ' is already being syncd so will ignore request');\n if (callback)\n callback(null);\n } else {\n\n // Add it to the array of files being syncd so we can track what is going on\n self.ancillaryFilesBeingSyncd.push(filePath);\n\n // Check to see if it exists\n if (fs.existsSync(filePath)) {\n logger.info('File already exists');\n\n // Since the file exists, we need to grab the latest timestamp from the file so\n // we only append the data that is new.\n var instream = fs.createReadStream(filePath);\n var outstream = new stream;\n var rl = readline.createInterface(instream, outstream);\n var latestEpoch = null;\n var lineCounter = 0;\n\n // Read down the file looking for the latest epoch seconds\n rl.on('line', function (line) {\n lineCounter++;\n latestEpoch = line.split(',')[0];\n });\n\n // Once the file is closed, query for more recent data and append to the file\n rl.on('close', function () {\n logger.info(\"Reading of file done\");\n logger.info(\"last epoch for file \" + filePath + \" is \" + latestEpoch);\n\n if (latestEpoch && lineCounter > 1) {\n // Grab the source IDs\n var sourceIDArray = getSourceIDs(deployment, source);\n\n // Make sure there are sources to process\n if (sourceIDArray && sourceIDArray.length > 0) {\n // Create the proper query to grab all the data after the latest timestamp\n var query = 'SELECT distinct extract(epoch from timestamp_utc) as epochseconds, ' +\n 'timestamp_utc, string_agg(trim(to_char(value,\\'9999999999D999\\')),\\',\\' ' +\n 'ORDER BY ancillary_source_id_fk) FROM ' +\n 'ancillary_data where ancillary_source_id_fk in (SELECT id from ancillary_sources ' +\n 'WHERE deployment_id_fk=\\'' + deployment._id + '\\' AND instrument_type=\\'' +\n source + '\\') and extract(epoch from timestamp_utc) > ' + latestEpoch +\n ' GROUP BY timestamp_utc ORDER BY timestamp_utc';\n logger.debug('Query string = ' + query);\n\n // Now write the data\n writeAncillaryData(filePath, query, function (err) {\n if (err) {\n logger.error(\"Error caught trying to write ancillary data to file:\", err);\n }\n\n // Clear the entry from the tracker\n var filePathIndex = self.ancillaryFilesBeingSyncd.indexOf(filePath);\n logger.debug(\"File path was found at index \" + filePathIndex + \", will remove it\");\n self.ancillaryFilesBeingSyncd.splice(filePathIndex, 1);\n logger.debug(\"ancillaryFileBeingSyncd:\", self.ancillaryFilesBeingSyncd);\n\n // Send it back to the caller\n if (callback)\n callback(err);\n });\n } else {\n let errorMessage = 'No source ID array was returned, that is just not right!';\n logger.error(errorMessage);\n\n // Clean the entry from the tracker\n let filePathIndex = self.ancillaryFilesBeingSyncd.indexOf(filePath);\n logger.debug(\"File path was found at index \" + filePathIndex + \", will remove it\");\n self.ancillaryFilesBeingSyncd.splice(filePathIndex, 1);\n logger.debug(\"ancillaryFileBeingSyncd:\", self.ancillaryFilesBeingSyncd);\n\n // Send an error back to the caller\n if (callback)\n callback(new Error(errorMessage));\n }\n } else {\n // The file already existed, but there was no latest epoch timestamp\n // found. This should not really happen, so we will send back an error\n let errorMessage = 'While file ' + filePath + ' already exists, it did not seem ' +\n ' to have any existing data. That is very strange';\n logger.error(errorMessage);\n\n // Remove it from the tracker\n let filePathIndex = self.ancillaryFilesBeingSyncd.indexOf(filePath);\n logger.debug(\"File path was found at index \" + filePathIndex + \", will remove it\");\n self.ancillaryFilesBeingSyncd.splice(filePathIndex, 1);\n logger.debug(\"ancillaryFileBeingSyncd:\", self.ancillaryFilesBeingSyncd);\n\n // Send an error back to caller\n if (callback)\n callback(new Error(errorMessage));\n }\n });\n } else {\n logger.info('File ' + filePath + ' does not exist, will create it and write header');\n // Write the header to the file first\n writeHeader(deployment, source, filePath, function (err) {\n // Check for an error\n if (err) {\n logger.error(\"Error trying to write header: \", err);\n\n // Clean the entry from the tracker\n var filePathIndex = self.ancillaryFilesBeingSyncd.indexOf(filePath);\n logger.debug(\"File path was found at index \" + filePathIndex + \", will remove it\");\n self.ancillaryFilesBeingSyncd.splice(filePathIndex, 1);\n logger.debug(\"ancillaryFileBeingSyncd:\", self.ancillaryFilesBeingSyncd);\n\n // Now send it back with the error\n if (callback)\n callback(err);\n } else {\n // Grab sourceIDs\n var sourceIDArray = getSourceIDs(deployment, source);\n\n // Make sure there are some IDs\n if (sourceIDArray && sourceIDArray.length > 0) {\n // Create the proper query to grab all the data\n var query = 'SELECT distinct extract(epoch from timestamp_utc) as epochseconds, ' +\n 'timestamp_utc, string_agg(trim(to_char(value,\\'9999999999D999\\')),\\',\\' ' +\n 'ORDER BY ancillary_source_id_fk) FROM ' +\n 'ancillary_data where ancillary_source_id_fk in (SELECT id from ancillary_sources ' +\n 'WHERE deployment_id_fk=\\'' + deployment._id + '\\' AND instrument_type=\\'' +\n source + '\\') GROUP BY timestamp_utc ORDER BY timestamp_utc';\n logger.debug('Query string = ' + query);\n\n // Now write the data\n writeAncillaryData(filePath, query, function (err) {\n if (err) {\n logger.error(\"Error caught trying to write ancillary data to file:\", err);\n }\n\n // Clear the entry from the tracker\n var filePathIndex = self.ancillaryFilesBeingSyncd.indexOf(filePath);\n logger.debug(\"File path was found at index \" + filePathIndex + \", will remove it\");\n self.ancillaryFilesBeingSyncd.splice(filePathIndex, 1);\n logger.debug(\"ancillaryFileBeingSyncd:\", self.ancillaryFilesBeingSyncd);\n\n // Send it back to the caller\n if (callback)\n callback(err);\n });\n } else {\n let errorMessage = 'No source ID array was returned, that is just not right!';\n logger.error(errorMessage);\n\n // Clean the entry from the tracker\n let filePathIndex = self.ancillaryFilesBeingSyncd.indexOf(filePath);\n logger.debug(\"File path was found at index \" + filePathIndex + \", will remove it\");\n self.ancillaryFilesBeingSyncd.splice(filePathIndex, 1);\n logger.debug(\"ancillaryFileBeingSyncd:\", self.ancillaryFilesBeingSyncd);\n\n // Send an error back to the caller\n if (callback)\n callback(new Error(errorMessage));\n }\n }\n });\n }\n }\n }", "function base() {\n return streamCombiner(\n gulpif(tars.config.js.useBabel, tars.require('gulp-babel')()),\n concat({ cwd: cwd, path: 'main.js' }),\n rename({ suffix: tars.options.build.hash }),\n gulp.dest(destFolder),\n );\n}", "function getTarPath() {\n return __awaiter(this, void 0, void 0, function* () {\n switch (process.platform) {\n case 'win32': {\n const gnuTar = yield utils.getGnuTarPathOnWindows();\n const systemTar = constants_1.SystemTarPathOnWindows;\n if (gnuTar) {\n // Use GNUtar as default on windows\n return { path: gnuTar, type: constants_1.ArchiveToolType.GNU };\n }\n else if ((0, fs_1.existsSync)(systemTar)) {\n return { path: systemTar, type: constants_1.ArchiveToolType.BSD };\n }\n break;\n }\n case 'darwin': {\n const gnuTar = yield io.which('gtar', false);\n if (gnuTar) {\n // fix permission denied errors when extracting BSD tar archive with GNU tar - https://github.com/actions/cache/issues/527\n return { path: gnuTar, type: constants_1.ArchiveToolType.GNU };\n }\n else {\n return {\n path: yield io.which('tar', true),\n type: constants_1.ArchiveToolType.BSD\n };\n }\n }\n default:\n break;\n }\n // Default assumption is GNU tar is present in path\n return {\n path: yield io.which('tar', true),\n type: constants_1.ArchiveToolType.GNU\n };\n });\n}", "function runTaskProcessForCompression(athis, pathesTo, obj) {\n\n\tvar mainLazyPipeObj = createMainLazyPipeObject(pathesTo, \"Compressed \", obj.module);\n\n\t// watch every single file matching those paths\n\tvar wl = watchList(pathesTo);\n\n\t// no transitivity for compression because the compression is a B step out of ABC\n\t// where A is the first and C the last step\n\tvar glob_transitivity = null;\n\n\tgulp.watch(wl, function(event) {\n\n\t\tvar filePath = event.path;\n\n\t\t// checking for extensions matching\n\t\tif (checkMultipleRules(filePath, [event.type !== \"deleted\"].concat(obj.rules))) {\n\n\t\t\t// set the filepath to the object\n\t\t\tmainLazyPipeObj.forMatchingObj.path = filePath;\n\n\t\t\t// find the config through the json and getting watch ; dest ; sourcemapp etc.\n\t\t\tvar matchingEntry = getMatchingEntryConfig(filePath, pathesTo);\n\n\t\t\t// indicate what watch rule, the destination folder, and if there are sourcemaps.\n\t\t\tmainLazyPipeObj.pathesDescr = matchingEntry;\n\n\t\t\t// set the variant pipe part to the process. It will be wrapped in sourcemapps \n\t\t\t// and the transitivity will have to be calculate (not really needed here )\n\t\t\tmainLazyPipeObj.process = obj.mainPipe;\n\n\t\t\tmainLazyPipeObj.source_kind = 'simple';\n\n\t\t\t// COMPUTE THE LAZYPIPE AND DYNAMIC BEHAVIORS -------------------------------------\n\t\t\tconsumePipeProcss(glob_transitivity, mainLazyPipeObj, [filePath]);\n\t\t}\n\t});\n}", "function zipProjectHelper(dirPath, zip) {\n //get all of the files and dirs in the passed in directory\n const allFilesAndDirs = fs.readdirSync(dirPath);\n\n //go through the contents of the dir\n for (let i = 0; i < allFilesAndDirs.length; i++) {\n //get the full path to the file or directory\n const fullPathToFileOrDir = path.join(dirPath, allFilesAndDirs[i]);\n\n //get some stats about the file/dir\n const stats = fs.statSync(fullPathToFileOrDir);\n\n //if this is a file\n if(stats.isFile()) {\n //get a normalized path to the file\n let normalizedFilePath = projectManager.pathHelper.normalizeFilePath(fullPathToFileOrDir);\n //jszip does not like leading / so remove it\n normalizedFilePath = normalizedFilePath.substr(1);\n\n //read the contents of the file\n const fileContents = fs.readFileSync(fullPathToFileOrDir);\n \n //add the file to the zip\n zip.file(normalizedFilePath, fileContents);\n } else if(stats.isDirectory()) {\n //get a normalized path to the dir\n let normalizedDirectoryPath = projectManager.pathHelper.normalizeDirPath(fullPathToFileOrDir);\n //jszip does not like leading / so remove it\n normalizedDirectoryPath = normalizedDirectoryPath.substr(1);\n //add the folder to the zip (for empty dirs)\n zip.folder(normalizedDirectoryPath);\n\n //recurse and add the files in the dir to the zip\n zipProjectHelper(fullPathToFileOrDir, zip);\n }\n }\n}", "export() {\n\t //want to bundle up the images, the texts, the tocs and maybe the charts\n\t this.msg.clear();\n\n\t //directories to zip (relative to this.localDir above)\n\t\tvar dirNames = [\n\t\t\t\t\t\t\t'presentationFlows'\n\t\t\t\t\t\t]; \n\n\t\tvar fileNames =[\n\t\t\t\t\t\t\t//'elements/text/someText.mmd' //as example. In this case it just puts the same file in, but want to allow inidvidual files\n\t\t\t\t\t\t];\n\n\t\tvar archive = archiver.create('zip', {});\n\t\tarchive.on('error', function(err){\n\t\t throw err;\n\t\t});\n\n\t\tvar output = jetpack.createWriteStream(this.downloadDir); //path to create .zip file\n\t\toutput.on('close', function() {\n\t\t\tthis.msg.out('presentationFlows.zip has been saved to your downloads folder');\n\t\t console.log('archive complete: ' + archive.pointer() + ' total bytes written to ' + this.downloadDir);\n\t\t}.bind(this));\n\t\tarchive.pipe(output);\n\n\t\tdirNames.forEach(function(dirName) {\n\t\t archive.directory(this.localDir + dirName, dirName);\n\t\t}.bind(this));\n\n\n\t\tfileNames.forEach(function(fileName) {\n\t\t\tvar stream = jetpack.read(path.join(this.localDir, fileName));\n \t\tarchive.append(stream, { name: fileName });\n\t\t}.bind(this));\n\n\t\tarchive.finalize();\n\t}", "function assetsCopy(){\n return src(\"./src/assets/**/*\")\n .pipe(dest(buildDir+\"assets/\"));\n}", "generatePath( src, key ) {\n if( src.type === \"file\" ) {\n return (\n <div key={key}>\n <a href=\"#\" className=\"info\" onClick={ () => this.handleClick( src.path ) } >{src.name}</a>\n </div>\n );\n }\n\n if( src.type === \"directory\" )\n return (\n <TreeView nodeLabel={src.name} defaultCollapsed={false} key={key} >\n {src.children.map( (newsrc, key) => { return this.generatePath(newsrc, key); } )}\n </TreeView>\n );\n\n }", "async bundleCwd(cwd, index) {\n return concat(cwd).then((result) => {\n let base = cwd.map((p) => p.split(path.sep));\n base = base.map((b) => b.filter((bb) => base[0].includes(bb)));\n\n const suffix = '.bundle';\n let bundle = path.resolve(\n path.join(\n path.dirname(base.sort((a, b) => a.length - b.length)[0].join(path.sep)),\n `${Object.keys(this.config.entry)[index]}${suffix}${path.extname(cwd[0])}`\n )\n );\n\n const directory = bundle.substring(0, bundle.indexOf('.bundle'));\n // Check if the current bundle can be placed.\n if (fs.existsSync(directory) && fs.lstatSync(directory).isDirectory()) {\n this.Console.info(`Compatible bundle directory detected, writing to ${directory}`);\n bundle = path.join(directory, path.basename(bundle));\n }\n\n mkdirp.sync(path.dirname(bundle));\n\n try {\n const minifiedResult = minify(result, this.getOption('minify', {}));\n\n if (minifiedResult.error || !minifiedResult.code) {\n this.Console.log(`Writing bundle: ${bundle}`);\n\n fs.writeFileSync(bundle, result);\n } else {\n this.Console.log(`Writing minified bundle: ${bundle}`);\n\n fs.writeFileSync(bundle, minifiedResult.code);\n }\n } catch (error) {\n this.Console.warning(`Unable to bundle: ${error}`);\n }\n });\n }", "async function zipProject() {\n //if st is active\n if(isStorytellerCurrentlyActive) {\n //prompt for where to store the zip file\n let zipStorageFolders = await vscode.window.showOpenDialog({\n canSelectFiles: false,\n canSelectFolders: true,\n canSelectMany: false,\n defaultUri: vscode.workspace.workspaceFolders[0].uri,\n openLabel: 'Save stProject.zip',\n title: 'Choose a folder to store the Storyteller zip'\n });\n\n //if there was a selected location\n if(zipStorageFolders.length > 0) {\n //create an instance of jszip\n const zip = new JSZip();\n\n //get the path to the open project and the hidden st directory\n const projectDirPath = vscode.workspace.workspaceFolders[0].uri.fsPath;\n\n //recursively add files to the zip\n zipProjectHelper(projectDirPath, zip);\n\n //create and save the zip in the .storyteller dir\n zip.generateNodeStream({\n streamFiles: true,\n compression: 'DEFLATE',\n compressionOptions: {\n level: 9\n }\n }).pipe(fs.createWriteStream(path.join(zipStorageFolders[0].fsPath, 'stProject.zip'))).on('finish', function () {\n //notify user that the zip is complete\n vscode.window.showInformationMessage(`A new zip file, stProject.zip, has been added to the ${zipStorageFolders[0].fsPath} directory. You can share this file with others.`);\n });\n }\n }\n}" ]
[ "0.5825395", "0.5739603", "0.5595743", "0.53256303", "0.5207444", "0.5129628", "0.51209956", "0.50601107", "0.5056975", "0.5041073", "0.5031814", "0.50148463", "0.50113493", "0.49702588", "0.49507222", "0.49234024", "0.49157044", "0.4904952", "0.48901677", "0.48799825", "0.48760596", "0.48602813", "0.48116633", "0.48000267", "0.4778156", "0.47352096", "0.47272584", "0.4723357", "0.47177002", "0.47031152", "0.46990803", "0.46963266", "0.46949384", "0.469285", "0.46905982", "0.46600994", "0.4644515", "0.4644515", "0.4644515", "0.46353948", "0.462302", "0.46209344", "0.45887166", "0.45886618", "0.4554786", "0.45471036", "0.45464194", "0.45348057", "0.4505036", "0.4504847", "0.4499592", "0.4493999", "0.44870293", "0.44845346", "0.44735205", "0.4464727", "0.44557115", "0.44556594", "0.44324854", "0.4427105", "0.44233224", "0.44229448", "0.44209784", "0.4406525", "0.4405986", "0.4402909", "0.4402909", "0.4402254", "0.43979535", "0.43826863", "0.43769354", "0.43693233", "0.43659058", "0.4362302", "0.43616766", "0.43442822", "0.4339439", "0.4336082", "0.4320363", "0.4318378", "0.43149337", "0.42780063", "0.4273622", "0.4271983", "0.42691925", "0.42646116", "0.4227827", "0.4219547", "0.42178243", "0.4216111", "0.4216082", "0.42143056", "0.42139846", "0.42134207", "0.42117146", "0.42067122", "0.41949615", "0.41865116", "0.4183743", "0.41798374" ]
0.8036816
0
The component to render when Manage is selected
function Manage(props) { let {path} = useRouteMatch(); return( <Switch> <Route exact path={`${path}`}> <Organization/> </Route> <Route exact path={`${path}/:orgId`}> <Department currentUser={props.currentUser}/> </Route> <Route path={`${path}/:orgId/:depId`}> <Members/> </Route> </Switch> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderSelectedComponent() {\n const setting = this.state.selectedSetting;\n switch (setting) {\n case \"Password Reset 🔒\":\n return (\n <PasswordReset\n {...this.props}\n settinghaschanges={this.settingHasChanges}\n />\n );\n case \"Add Accounts 💲\":\n return (\n <AddAccounts\n {...this.props}\n settingHasChanges={this.settingHasChanges}\n />\n );\n default:\n return <div>Placeholder</div>;\n }\n }", "function showComponent(componentName){ \n if(componentName === 'default'){\n return (<ProductsList deleteItem={deleteItem} updateItem={updateItem}/>)\n }else if(componentName === 'createForm'){\n return (<ProductCreateForm showCategoryOption={showCategoryOption}/>)\n }else if(componentName === 'updateForm'){\n return (<ProductUpdateForm productSelected={productSelected} showCategoryOption={showCategoryOption}/>)\n }else if(componentName === 'deleteItem'){\n setComponentName('default');\n }else if(componentName === 'verCategories'){\n return (<CategoryList deleteCategory={deleteCategory} updateCategory={updateCategory}/>);\n }else if(componentName === 'createCategory'){\n return (<CategoryCreateForm />)\n }else if(componentName === 'updateCategory'){\n return (<CategoryUpdateForm categorySelected={categorySelected} />)\n }else if(componentName === 'verOrdenes'){\n return (<Ordenes />)\n };\n }", "render() {\n return (\n <div>\n < h2 > Ajouter ou modifier un organisme référent </h2>\n <MenuAllForm />\n <br />\n <AddOrgaRefForm />\n </div>\n );\n }", "getAdminComponent(state) {\n return state.adminComponent;\n }", "function OptionDetailsComponent() {\n }", "onRender () {\n\t\tthis.registerComponent(App.Compontents, \"app-controls\", TopBarControls, this.$el.find(\"#topbar-container\"), { title: \"Home\" });\n }", "getChangeView(){\n\t\t\treturn (\n\t\t\t\t<div>\n\t\t\t\t\t<input type=\"checkbox\" onChange={event => this.handleCheckbox(event)} className={this.state.hideClass} />\n\t\t\t\t\t<label className={this.state.hideClass}>view by soak</label>\n\t\t\t\t</div> \n\t\t\t);\n\t\t}", "render() {\n return html`\n <div .part=\"${this.editMode ? `edit-mode-active` : ``}\">\n ${super.render()}\n </div>\n `;\n }", "render() {\r\n if (this.state.isEditing) {\r\n return this.renderEditMode();\r\n } else {\r\n return this.renderDisplayMode();\r\n }\r\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 }", "render() {\n return this.toolbarTemplate;\n }", "render() {\n return html` ${this.toolbarTemplate} `;\n }", "renderModerationPanel() {\n if (this.context.state.auth.status !== 'admin') {\n return '';\n }\n return (\n <div>\n <ModerationContainer />\n </div>\n );\n }", "getComponent() {\n let crudComponent;\n switch (this.state.option) {\n case 'users':\n crudComponent = <UserCRUDComponent />;\n break;\n case 'phenotypes':\n crudComponent = <PhenotypesCRUDComponent />;\n break;\n case 'pathologies':\n crudComponent = <PathologiesCRUDComponent />;\n break;\n default:\n crudComponent = null;\n break;\n }\n return crudComponent;\n }", "function onManageInstancesBtnClicked(event)\n\t{\n\t\t!this.showingManageView && this.sidebar.breadcrumbsView.add('Collections', this, 'renderManageView');\n\t\tthis.showingManageView = true;\n\t\tthis.renderManageView();\n\t}", "render() {\n return <div>{this.renderManagementModal()}</div>\n }", "render(){\n return(\n <div>\n <h1>Liste des employés</h1>\n <MenuAllForm/>\n <EmployeForm/>\n </div>\n );\n }", "render () {\n\t\tlet { tabStates } = this.state;\n\t\tlet { project, diagram } = this.props;\n\t\tlet tabs = [];\n\n\t\ttabs.push(Tab(0, project ? project.name : 'No Project selected', ProjectMenu, this.props));\n\n\t\tif (project) {\n\t\t\ttabs.push(Tab(1, diagram ? diagram.name : 'No Diagram selected', DiagramMenu, this.props));\n\t\t\tif (diagram) {\n\t\t\t\ttabs.push(Tab(2, `Components [${diagram.type}]`, ComponentMenu, this.props));\n\t\t\t}\n\t\t}\n\n\t\treturn <div className=\"side\">\n\t\t\t<Tabs tabs={tabs} toggle={this.setTabState} states={tabStates}/>\n\t\t</div>;\n\t}", "render() {\n\t\treturn `\n\t\t\t<div id=\"toolbar\" class=\"box\">\n\t\t\t\t${this.optionAll.render()}\n\t\t\t\t${this.options.map((option)=>{\n\t\t\t\t\treturn this['option'+option.id].render()\n\t\t\t\t}).join('')}\n\t\t\t</div>\n\t\t`;\n\t}", "showCompute() {\n return <Compute items={this.state.items} />\n }", "render() {\n if (this.model === null) {\n return null;\n }\n else {\n return (React.createElement(KernelStatusComponent, { status: this.model.status, kernelName: this.model.kernelName, activityName: this.model.activityName, handleClick: this._handleClick }));\n }\n }", "render() {\n console.log(this.props)\n return this.state.editMode && this.props.currentUser.is_admin === true ?\n this.renderEditView()\n :\n this.renderDefaultView()\n }", "render() {\n this.container = d3.select( 'body' )\n .insert( 'div', '#id-container' )\n .attr( 'id', 'manage-panel' )\n .classed( 'hidden', true );\n\n this.panelSidebar = this.container\n .append( 'div' )\n .attr( 'id', 'manage-sidebar-menu' )\n .classed( 'wrapper fill-light keyline-right', true );\n\n this.panelSidebar\n .append( 'h3' )\n .classed( 'manage-header pad1y strong center', true )\n .append( 'label' )\n .text( 'Manage Panel' );\n\n return this;\n }", "function selectInfoItem(props){\r\n switch (props.panel) {\r\n case 'Allergies': \r\n return (<AllergyList config={props.config}/>);\r\n case 'Doctor Visits': \r\n return (<DoctorVisitList config={props.config}/>);\r\n case 'Chronic Health Issues':\r\n return (<ChronicHealthList config={props.config}/>);\r\n case 'Drug Prescriptions': \r\n return (<DrugPrescriptionList config={props.config}/>);\r\n case 'Hospital Visits':\r\n return (<HospitalVisitList config={props.config}/>);\r\n case 'Immunization Records':\r\n return (<ImmunizationRecordList config={props.config}/>);\r\n case 'Lab Reports': \r\n return (<LabReportList />); \r\n default:\r\n return (<div></div>)\r\n }\r\n}", "renderDetails() {\n return (\n <div className=\"requests-container\">\n {this.buttonToolbar()}\n <FileManager web3={this.state.web3} patent={this.state.selectedPatent} gasPrice={this.state.gasPrice}\n patentsInstance={this.state.patentsInstance} requestsInstance={this.state.requestsInstance} />\n </div>\n );\n }", "renderChild() {\n let child;\n if (this.state.loadChild) {\n switch (this.state.selectedService) {\n case Service.METAMASK:\n child = <VerifyMetaMask/>;\n break;\n case Service.SERVER:\n child = <VerifyFree/>;\n break;\n default :\n child = \"\";\n break;\n }\n }\n return child;\n }", "render () {\n return <div className='side-bar-option'>\n <div className='row side-bar-labels'>\n { this.props.name }\n </div>\n <div className='row' >\n <SelectBox\n defaultValue={ this.props.options[this.props.defaultOptionIndex] }\n className='select'\n value={ this.state.selectedOption }\n onChange={ this.handleChange }\n options={ this.props.options }\n />\n </div>\n </div>\n }", "renderSelectedItem() {\n\t\treturn (\n\t\t\t<div>\n YOUR SELECTION ID IS { this.props.selectionId }\n\t\t\t</div>\n\t\t);\n\t}", "createMarkup() {\n // get a list of all the observables\n // and then say render according to the current component\n const state = this.appState.get();\n const { formId } = state;\n\n return `<div id=${formId} class='column'>\n <div> </div>\n <div class=' row section'>\n <button class='rowOffer ' id=\"switchComponent\" type=\"button\"> Switch Component </button>\n </div> \n </div>`;\n }", "getCurrentComponent(){\n return this.currentComponent;\n }", "render() {\n if (!this.model) {\n return null;\n }\n return (React.createElement(GroupItem, { spacing: 2, title: this.model.long_message, onClick: this.handleClick },\n React.createElement(this.model.status_icon.react, { top: '2px', kind: 'statusBar', title: 'LSP Code Intelligence' }),\n React.createElement(TextItem, { source: this.model.short_message }),\n React.createElement(TextItem, { source: this.model.feature_message })));\n }", "onRender () {\n console.log(this.component);\n if(undefined !== this.component) {\n this.el.querySelector(`[data-id=\"${this.component}\"]`).classList.add(\"active\");\n }\n\n var Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"components\");\n this.showComponent(this.component);\n\n }", "render(){\r\n if (this.props.admin == \"true\" || this.props.admin == true) {\r\n return (\r\n <div>\r\n <Row>\r\n <NavItem href='/#/addlogin'> <Button className=\"main-buttons\">\r\n {\" \"}\r\n addlogin{\" \"}\r\n </Button>{\" \"}\r\n </NavItem>\r\n </Row>\r\n </div>\r\n\r\n )\r\n \r\n }\r\n else return(\r\n <Row> </Row>\r\n )\r\n }", "render() {\n\n\n // Otherwise return the Login form.\n return (\n <Label as='a' basic>\n {this.props.favorites.vendor}\n </Label>\n );\n }", "render() {\n return (\n <Container>\n {this.renderCheckbox()}\n <CheckboxName>{this.props.checklistItem.name}</CheckboxName>\n <DeleteItemIcon onClick={this.deleteCheckBox} className='icon-times' />\n </Container>\n )\n }", "get Component() {\n const { componentExport = 'default' } = this.options\n return this.state.get(componentExport) || this.tryGet(componentExport)\n }", "render() {\n\n if (!this.props.selectedModules) {\n console.log(\"No module was selected\")\n }\n\n return (\n <section className={this.isBestandenList(module.modlueID)}>\n {this.renderList()}\n </section>\n )\n }", "render(){\n return(\n <div>\n Your Current Chores\n </div>\n )\n }", "render(){\n\n var modeComponent =\n <ReadMateriasComponent\n changeAppMode={this.changeAppMode} />;\n\n\n switch(this.state.currentMode){\n case 'read':\n break;\n case 'readOne':\n modeComponent = <ReadOneMateriaComponent CveM={this.state.CveM} changeAppMode={this.changeAppMode}/>;\n break;\n case 'create':\n modeComponent = <CreateMateriaPComponent changeAppMode={this.changeAppMode}/>;\n break;\n case 'update':\n modeComponent = <UpdateProductComponent CveM={this.state.CveM} changeAppMode={this.changeAppMode}/>;\n break;\n case 'delete':\n modeComponent = <DeleteMateriaComponent CveM={this.state.CveM} changeAppMode={this.changeAppMode}/>;\n break;\n case 'materia':\n modeComponent = <MateriaComponent rows={this.state.rows} CveM={this.state.CveM} changeAppMode={this.changeAppMode}/>\n break;\n default:\n break;\n }\n return modeComponent;\n }", "render(createElement) {\n var component;\n const { node, param, token } = this;\n if (token && token[0]!=='$') {\n component= \"mk-plain-text\";\n } else if (Array.isArray(node)) {\n // note: we could look at \"param.repeats\" but param is used for both the array slot\n // and the array elements\n component= \"mk-repeater-ctrl\";\n } else if (node) {\n const { itemType } = node;\n if (itemType) {\n // search for a template particular to the item's underlying type.\n const name= itemType.name.replace(\"_\",\"-\");\n component= `mk-${name}-ctrl`;\n\n // if not, use a generic control based on item's role.\n if (!(component in Vue.options.components)) {\n component= `mk-${itemType.uses}-ctrl`;\n }\n }\n }\n return component && createElement( component, {\n key: node&& node.id, // can be empty for repeats...\n props: {\n node,\n param,\n token,\n }\n });\n }", "render(){\n\n\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2>UserList:</h2>\n\t\t\t\t<UserList />\n\t\t\t\t<hr/>\n\t\t\t\t<h2>UserDetail:</h2>\n\t\t\t\t<UserDetail />\n\t\t\t</div>\n\t\t);\n\t}", "function McOptionParentComponent() { }", "render(){\n\t\t\t\treturn <button className=\"ui button primary\">Submit</button>\n\t\t\t}", "renderChildComponents() {\n this.renderModuleButton();\n this.renderRoleDropdown();\n }", "onRender()\n {\n this._initializeSettingsDisplay();\n }", "render(){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2> Our Current Clients Page </h2>\n\t\t\t\t<ClientLogos/>\n\t\t\t\t<ClientDescription/> \n\t\t\t</div>\n\t\t)\n\t}", "function Component(type) {\n this.type = type;\n this.menu = $('select#' + type);\n this.button = $('button#add-' + type);\n this.elementWidth = 125;\n }", "render() {\n return (\n <div className=\" rounded p-1 editor-menu\">\n <div>\n <label className=\"d-block font-weight-bold\">Edit Row</label>\n </div>\n <Row>\n <Col>\n <Form.Label className=\"d-block left w-50\">Add Columns</Form.Label>\n </Col>\n <Col>\n <Form.Control\n type=\"number\"\n min=\"1\"\n max=\"12\"\n placeholder=\"Number of Columns\"\n value={this.state.columnNumber}\n onChange={(event) => {\n this.handleNumColumnsinRow(event.target.value);\n }}\n >\n </Form.Control>\n </Col>\n </Row>\n <EditMenuNav handleBack={this.props.handleBack} handleDelete={this.props.handleDelete} />\n </div>\n );\n }", "manageLoginDisplay() {\n return this.state.registerIsActive ? { display: 'none' } : null;\n }", "render() {\n return (\n <div>\n <Nav mode={this.state.mode} onPageChange={this.pageChangeHandler} />\n <div className=\"card-container\">\n {\n this.state.mode === 'logged in' ? \n <MembersArea /> : \n <LoginForm onLogin={this.loginHandler}/>\n }\n </div>\n\n <footer>\n <p>copyright 2018 &copy;</p>\n </footer>\n </div>\n );\n }", "actionIcons() {\n const componentName = this.breakdownPathComponents()[1];\n return {\n header: \"\",\n key: \"id\",\n render: (id) => <span className=\"icons\" style={{display: this.state.isAdmin ? \"inherit\" : \"none\"}}>\n <Link to={\"/\" + componentName + \"/\" + id}><img className=\"smallicon\" src=\"/assets/images/edit.png\"/></Link>\n <Link to={\"/\" + componentName + \"/\" + id + \"/delete\"}><img className=\"smallicon\" src=\"/assets/images/delete.png\"/></Link>\n </span>\n }\n }", "_renderRemove(){\n\t\tif(this.props.allowRemove){\n\t\t\treturn(\n\t\t\t\t<span>\n\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n\t\t\t\t\t<span \n\t\t\t\t\t\tclassName=\"glyphicon glyphicon-remove pointer\"\n\t\t\t\t\t\tonClick={this.props.onRemove}\n\t\t\t\t\t></span>\n\t\t\t\t</span>\n\t\t\t);\t\n\t\t}\n\n\t\treturn null;\n\t\t\n\t}", "render(){\n return (\n <div>\n <a href='#'\n onClick={() => this.props.changeAppMode('create')}\n className='btn btn-primary margin-bottom-1em'> Create product\n </a>\n </div>\n )\n }", "change() { \r\n\t\tswitch(this.state.page) {\r\n\t\t\tcase 'calendarV': return <CalendarView initialReferenceDate={new Date()} />;\r\n\t\t\tcase 'planned': return <Planned/>;\r\n\t\t\tcase 'following': return <Following/>;\r\n\t\t\tcase 'account': return <Account />;\r\n\t\t\tcase 'create': return <CreateEventPage />;\r\n\t\t\tdefault: return <CalendarView initialReferenceDate= {new Date()} />;\r\n\t\t}\r\n\t}", "onComponentShow() {\n this.subcomponents.form.updateValues();\n }", "render() {\n if (this.state.isBeingEdited === false) {\n return this.renderQuote();\n } else {\n return this.renderEditForm();\n }\n }", "render() {\n return(\n <div className=\"Projects-Tabs\">\n {this.props.isAuthenticated && this.props.user ?\n this.props.user.admin ?\n <Tabs activeKey={this.state.activeKey}\n onSelect={this.handleSelect}\n id=\"tabs\">\n <Tab eventKey={1} title=\"Your projects\">\n {this.renderProjects()}\n </Tab>\n <Tab eventKey={2} title=\"All projects\">\n {this.renderAllProjects()}\n </Tab>\n </Tabs>\n : this.renderProjects()\n : this.renderLander()\n }\n </div>\n );\n }", "setAdminComponent(state, payload) {\n state.adminComponent = payload;\n }", "function RenderScheduleForm() {\n return (\n <div>\n <div>\n Select Patient Self-Monitoring Schedule*\n </div>\n <br />\n <RenderScheduleOptions />\n </div>\n );\n}", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<NumberChange\n\t\t\t\t\tlabel=\" Number is: \"\n\t\t\t\t/>\n\t\t\t\t<NumberChange/>\n\t\t\t\t<NumberChange/>\n\t\t\t\t<NumberChange/>\n\t\t\t</div>\n\t\t);\n\t}", "returnCreatureSelectRender() {\n return (\n <div id=\"gameWindow\">\n <CreatureSelectScreen\n creatureObj={this.state.creatureObj}\n toggleCreatureSelect={this.toggleCreatureSelect}\n playerCreatureId={this.state.playerCreatureId}\n creatures={this.creatures}\n changeGamePhase={this.changeGamePhase}\n />\n </div>\n );\n }", "about_show() {\n let dlgHeight = 470,\n dlgWidth = 750;\n\n if(!current_user.is_admin && pgAdmin.server_mode) {\n dlgWidth = pgAdmin.Browser.stdW.md;\n dlgHeight = 300;\n }\n\n // Render About component\n Notify.showModal(gettext('About %s', pgAdmin.Browser.utils.app_name), () => {\n return <AboutComponent />;\n }, { isFullScreen: false, isResizeable: true, showFullScreen: true, \n isFullWidth: true, dialogWidth: dlgWidth, dialogHeight: dlgHeight, minHeight: dlgHeight\n });\n }", "render() {\n const subtitle = 'Put your life in the hands of a computer';\n\n return (\n <div>\n <Header subtitle={subtitle} />\n <div className=\"container\">\n <Action\n hasOptions={this.state.options.length > 0}\n handlePick={this.handlePick}\n />\n <div className=\"widget\">\n {/* pass the handleDeleteOption from Options to Option */}\n <Options\n options={this.state.options}\n handleDeleteOptions={this.handleDeleteOptions}\n handleDeleteOption={this.handleDeleteOption}\n />\n <AddOption handleAddOption={this.handleAddOption} /> \n </div>\n </div>\n <OptionModal\n selectedOption={this.state.selectedOption}\n handleClearSelectedOption={this.handleClearSelectedOption}\n />\n </div>\n );\n }", "get role() { return this.empty ? null : 'listbox'; }", "get role() { return this.empty ? null : 'listbox'; }", "render() {\n\n return (\n <div className=\"settings-subnav\">\n <Tabs.Tabs className=\"grid-one\">\n <Tabs.Tab label=\"General\">\n <section className=\"grid-one\">\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><Toggle label=\"Toggle Stuff\" defaultToggled={true}/></div>\n </section>\n </Tabs.Tab>\n <Tabs.Tab label=\"Design\" >\n </Tabs.Tab>\n <Tabs.Tab label=\"Modules\" />\n <Tabs.Tab label=\"Notify\" />\n <Tabs.Tab label=\"Priveleges\" />\n </Tabs.Tabs>\n </div>\n // <DropDownMenu menuItems={menuItems} onChange={this.transitionToRoute} />\n );\n }", "renderCategoryDropdown() {\n\t\treturn (\n\t\t\t<div className=\"field\">\n\t\t\t\t<label>Category:</label>\n\t\t\t\t<Form>\n\t\t\t\t<Form.Group widths=\"equal\">\n\t\t\t\t<Form.Select\n onChange={this.onSelectAssetType}\n value={this.state.selectedCategory}\n size=\"small\"\n style={{ maxWidth: \"400px\" }}\n placeholder=\"Select Category\"\n options={this.state.categoryOptions} />\t\t\t\t\n\t\t\t\t</Form.Group>\n\t\t\t\t</Form>\n\t\t\t</div>\n\t\t);\n\t}", "renderComponent(handle) {\n return `<div class=\"component-example\"><span class=\"component-example__preview-link\"><a href=\"../../components/detail/${handle.replace(\n \"@\",\n \"\"\n )}\">Open detail page of this component</a></span><iframe class=\"component-example__iframe\" src=\"../../components/preview/${handle.replace(\n \"@\",\n \"\"\n )}\"></iframe></div>`;\n }", "_customRenderer(root, comboBox, model) {\n let comboBoxItem = root.firstElementChild;\n let comboBoxItemContent;\n\n if (!comboBoxItem) {\n // build the template\n comboBoxItem = document.createElement('div');\n comboBoxItem.setAttribute('part', 'item-template');\n root.appendChild(comboBoxItem);\n comboBoxItemContent = document.createElement('span');\n comboBoxItem.appendChild(comboBoxItemContent); // attach class to host element\n\n const host = root.getRootNode().host;\n host.classList.add('multiselect');\n } else {\n comboBoxItemContent = comboBoxItem.firstElementChild;\n } // set/update item label\n\n\n comboBoxItemContent.textContent = this._getItemDisplayValue(model.item, this.itemLabelPath); // set/update selected attribute\n\n const selected = this._isSelected(model.item, this.selectedItems, this.itemIdPath);\n\n this._updateSelectedAttribute(comboBoxItem, selected);\n }", "render() {\n\t\tconst product = this.props.product;\n\t\t//let icon = this.props.selected ? <Dashicon icon=\"yes\" /> : null;\n//\t{ icon }\n\t\treturn (\n\t\t\t<div className={ 'wc-products-list-card__content' + ( this.props.selected ? ' wc-products-list-card__content--added' : '' ) } onClick={ this.handleClick }>\n\t\t\t\t<img src={ product.images[0].src } />\n\t\t\t\t<span className=\"wc-products-list-card__content-item-name\">{ product.name }</span>\n\t\t\t</div>\n\t\t);\n\t}", "_getCurrentViewComponent() {\n return this.monthView || this.yearView || this.multiYearView;\n }", "_getCurrentViewComponent() {\n return this.monthView || this.yearView || this.multiYearView;\n }", "get editLabel() {\n return this.isEditing ? 'Cancel' : 'Edit';\n }", "showSelectWeapon() {\n return (\n <FormControl variant=\"outlined\" id=\"select\" >\n <InputLabel>Arme</InputLabel>\n <Select\n value={this.state.ID_weapon}\n onChange={this.handleChange}\n name=\"ID_weapon\"\n >\n {this.renderWeaponData()}\n </Select>\n </FormControl>\n );\n }", "render() {\n\t\treturn (\n\t\t\t<div>[User Panel Placeholder]</div>\n\t\t)\n\t}", "render() {\n return this.state.user && this.state.project ? (this.renderComponent()) : (null)\n }", "getName() {\n return 'UIComponent';\n }", "showViewComp (type) {\n\t\t\tthis.$axios.get('api/do_m_scrpt_code/getThisScrpt/'+this.manu_script_id).then(res => {\n\t\t\t\tif (type == 'add') {\n\t\t\t\t\tthis.allManScrpt = res.data.data;\n\t\t\t\t\tthis.is_view_com = true;\n\t\t\t\t} else this.$emit('rowFunc','AuthorManuscriptView',res.data.data);\n\t\t\t});\n\t\t}", "render () {\n const message = !this.props.isLoading && this.props.metadata ?\n this.props.metadata.total_count + ' vehicles available' :\n 'Searching for vehicles';\n\n return <div className='w-100'>\n <div className='row'>\n <div className='col-xs-12 col-sm-6 col-lg-8'>\n <h2>\n { message }\n </h2>\n </div>\n <div className='col-xs-12 col-sm-6 col-lg-4 no-padding'>\n <CustomSelectBox\n metadataKey={ 'order_by' }\n options={ this.getSortOptions() }\n defaultOptionIndex={ 3 }\n onSelectCustomBox={ this.handleChange }/>\n </div>\n </div>\n </div>\n }", "get AppView() {\n return {\n title: 'Expenso',\n component: require('../Containers/App').default,\n leftButton: 'HAMBURGER',\n };\n }", "render() {\n let button = this.el.querySelector('#more-peas');\n button.textContent = this.model.get('peas');\n }", "render() {\n let button = this.el.querySelector('#more-peas');\n button.textContent = this.model.get('peas');\n }", "function TcPermDetailsPanel() {}", "changeAdminComponent({ commit }, payload) {\n commit(\"setAdminComponent\", payload);\n }", "_setInitialComponentDisplay() {\n const that = this;\n\n if (that.spinButtons === false) {\n that.$spinButtonsContainer.addClass('jqx-hidden');\n }\n\n if (that.radixDisplay === false) {\n that.$radixDisplayButton.addClass('jqx-hidden');\n }\n\n if (that.showUnit === false) {\n that.$unitDisplay.addClass('jqx-hidden');\n }\n }", "_renderTools () {\n if (this.state.profile && this.state.contacts) {\n return ([\n <Toolbar key=\"toolbar\" profile={this.state.profile}/>,\n <Compose key=\"compose\" profile={this.state.profile} contacts={this.state.contacts} onSend={this._handleSend} sending={this.state.sending}/>\n ]);\n } else {\n return (\n <div style={{display: 'flex', flex: '1', alignItems: 'center', justifyContent: 'center'}}><span>Authenticating...</span></div>\n );\n }\n }", "onRender()\n {\n var disabledDelete = this.model.get('origin') !== null;\n $(this.ui.buttonDelete).attr('disabled', disabledDelete); \n var disabledDownload = this.model.get('download') === null;\n $(this.ui.buttonDownload).attr('disabled', disabledDownload); \n var disableView = this.model.get('viewer_url') === null || disabledDownload;\n $(this.ui.buttonView).attr('disabled', disableView);\n }", "getRole () {\n\n return 'Manager';\n }", "dataRole () {\n return 'Manager';\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"partsSearchFilter\">\n\n\t\t\t\t<div>Component type:</div>\n\t\t\t\t<TypeAheadMultiSelect />\n\t\t\t\t<div>Component name:</div>\n\t\t\t\t<TypeAheadMultiSelect />\n\n\n\n\n\n\n\n\n\n\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n if (this.state.options) {\n const options = this.state.options.map((option) => (\n <MenuItem key={option} name={option} value={option}>{option}</MenuItem>))\n return (\n <div>\n <br/>\n <FormControl>\n <InputLabel htmlFor={this.state.name}>{this.state.fieldName}</InputLabel>\n <Select\n value={this.state.value}\n onChange={this.handleSelectChange(this.state.name)}\n input={<Input id={this.state.name}/>}\n >\n {options}\n </Select>\n <FormHelperText>{this.state.description}</FormHelperText>\n </FormControl>\n <br/>\n </div>\n );\n } else {\n return (\n <div>\n <TextField\n required\n id={this.state.name}\n name={this.state.name}\n label={this.state.fieldName}\n defaultValue={this.state.defaultValue}\n helperText={this.state.description}\n margin=\"normal\"\n onChange={this.handleTextChange}\n />\n <br/>\n </div>\n );\n }\n }", "render(){\n\t\tlet cn = `registrationHealth ${this.props.renderState}`;\n\t\treturn(\n\t\t\t<div className=\"registrationHealth-container\">\n\t\t\t\t<div className={cn}></div>\n\t\t\t</div>\n\t\t);\n\t}", "get Template() {\n return `\n <div>\n <input type=\"checkbox\" onclick=\"app.tasksController.checkBox('${this.id}')\" aria-label=\"Checkbox for following text input\" ${this.check == true ? \"checked\" : \"\"}>\n ${this.taskName}\n <button class=\"btn btn-info\" onclick=\"app.tasksController.removeTask('${this.id}')\" data-toggle=\"modal\" data-target=\"#exampleModal\" >X</button></div>\n `\n }", "render() {\n switch (this.state.displayState) {\n case 'selectGenre':\n return this.renderSelectGenre();\n case 'displayNewList':\n return this.renderDisplayNewList();\n default:\n return null;\n }\n }", "renderAction() {\n\t\tif(this.props.isRemoval) {\n\t\t\treturn <a className='Track-action' onClick={this.removeTrack}>-</a>;\n\t\t} else {\n\t\t\treturn <a className='Track-action' onClick={this.addTrack}>+</a>;\n\t\t}\n\t}", "render() {\n let icon = this.state.isOpen ? caretDownIconStyled : caretRightIconStyled;\n let isOpen = this.state.isOpen;\n let className = 'jp-extensionmanager-headerText';\n if (this.props.disabled) {\n icon = caretRightIconStyled;\n isOpen = false;\n className = 'jp-extensionmanager-headerTextDisabled';\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"header\", null,\n React.createElement(ToolbarButtonComponent, { icon: icon, onClick: () => {\n this.handleCollapse();\n } }),\n React.createElement(\"span\", { className: className }, this.props.header),\n !this.props.disabled && this.props.headerElements),\n React.createElement(Collapse, { isOpen: isOpen }, this.props.children)));\n }", "get name() { return collapseComponent; }", "handleLeftClickUp() {\n if (this.context.selectedComponents.length === 1) {\n this.context.showComponentSelection();\n }\n\n // Move to a hovered state when hovered after selection\n var hoveredComp = this.context.getHoveredComponent();\n var hoveredConn = this.context.getHoveredConnector();\n if (hoveredComp !== null) {\n this.context.setActiveState(States.HOVER_COMPONENT, hoveredComp);\n } else if (hoveredConn !== null) {\n this.context.setActiveState(States.HOVER_CONNECTOR, hoveredConn);\n } else {\n this.context.setActiveState(States.EMPTY);\n }\n }", "render(){\n switch (this.state.tab) {\n case TABS.FX_TABLE:\n return <FXTable table={this.props.tables.fxrates} onReturn={this.onReturn} />;\n case TABS.HIRING_MANAGERS:\n return <HiringManagers onReturn={this.onReturn} />;\n case TABS.PAY_GRADES:\n return <PayGrades onReturn={this.onReturn} />;\n case TABS.SKILLS:\n return <Skills onReturn={this.onReturn} />;\n case TABS.USERS:\n return <Users onReturn={this.onReturn} />;\n case TABS.HR_ROLES:\n return <HRRoles onReturn={this.onReturn} />;\n case TABS.MAIN:\n default:\n return <AdminPanelComponent onClick={this.onClick} />;\n }\n }", "render () {\n return (\n <React.Fragment>\n <div>\n <MemberDisplay first_name={this.props.first_name} last_name={this.props.last_name} onClick={this.toggleDisplay}/>\n <div className={this.state.display}>\n <p>Responsibilities include:</p>\n <Assignments description ={this.props.description} deadline ={this.props.deadline} className=\"team_members\" />\n <p>Responsible for the following materials:</p>\n <Materials material={this.props.material} />\n </div>\n </div>\n\n </React.Fragment>\n );\n }" ]
[ "0.6010186", "0.5855429", "0.57952416", "0.57691914", "0.57132107", "0.5661863", "0.56283444", "0.5625412", "0.562423", "0.5571572", "0.5569066", "0.5530671", "0.5506387", "0.5463253", "0.5456111", "0.5421458", "0.5420897", "0.53738916", "0.5371859", "0.5369091", "0.53662336", "0.5360565", "0.53586066", "0.5354632", "0.5352926", "0.5331656", "0.53124875", "0.53114206", "0.52994764", "0.529899", "0.52876383", "0.52870446", "0.5281383", "0.5273607", "0.52493125", "0.5245003", "0.5230035", "0.5216061", "0.5178194", "0.5172148", "0.5165723", "0.51607674", "0.51555896", "0.51528126", "0.51458234", "0.51447153", "0.5141855", "0.5131218", "0.5125685", "0.5120071", "0.5119948", "0.51162183", "0.5114316", "0.5109128", "0.510632", "0.5103821", "0.51017004", "0.50967735", "0.5082206", "0.5080464", "0.5080159", "0.5078041", "0.50744", "0.5073002", "0.5073002", "0.50698715", "0.50655353", "0.50597894", "0.50554633", "0.50550765", "0.5052423", "0.5052423", "0.5052023", "0.50512487", "0.50432396", "0.5039317", "0.50388044", "0.5038716", "0.50377417", "0.50327885", "0.50313807", "0.50313807", "0.50283235", "0.50280565", "0.5025479", "0.501847", "0.5016192", "0.5013018", "0.5007267", "0.49962214", "0.49916035", "0.49885964", "0.498826", "0.49789014", "0.49718058", "0.49699226", "0.49668574", "0.4963625", "0.49600446", "0.4949687" ]
0.5322717
26
The component to render when Contacts is selected
function Contacts(props) { let { path } = useRouteMatch(); const { enqueueSnackbar } = useSnackbar(); const [organizations, setOrganizations] = useState([]); const [departments, setDepartments] = useState([]); const [currentOrganization, setCurrentOrganization] = useState(0); const [currentDepartment, setCurrentDepartment] = useState(0); const history = useHistory(); const [dialogOpen, setDialogOpen] = useState(false); const clearSelected = () => { setCurrentDepartment(1); setCurrentOrganization(1); } const handleDialogOpen = () => { setDialogOpen(true); } const handleDialogClose = function() { clearSelected(); setDialogOpen(false); } const handleDialogConfirm = function() { if(currentOrganization < 1 || currentDepartment < 1) { enqueueSnackbar("Please select an organization and departmnet!",{variant: 'warning'}); }else { history.push(`${path}/${currentOrganization}/${currentDepartment}`); setDialogOpen(false); clearSelected(); } } const handleOrgChange = function(event) { const orgId = event.target.value; setCurrentOrganization(orgId); // Fetch departments in this organization getDepartment(orgId).then(res => { if(res.code===200) { // TODO now can select departments const data = res.data.filter(dep => { return dep.status !== 'notJoin'; }); if(data.length === 0) { setDepartments(data); enqueueSnackbar("There is no department you can access in this organization!",{variant: 'warning'}); }else { setDepartments(data); setCurrentDepartment(0); } }else { enqueueSnackbar(res.msg,{variant: 'error'}); } }) } const handleDepChange = function(event) { const depId = event.target.value; setCurrentDepartment(depId); } useEffect(() => { // Fetch organization getOrganization().then(res => { if(res.code === 200) { const data = res.data; if(data.length === 0) { enqueueSnackbar("You have not joined any organizations!\nJoin an organization first!",{variant: 'warning'}); }else { setOrganizations(res.data); } }else { enqueueSnackbar(res.msg,{variant: 'error'}); } }) }) return( <div> <Dialog disableEscapeKeyDown open={dialogOpen} onClose={handleDialogClose}> <DialogTitle>{'Choose an organization and department to display contacts'}</DialogTitle> <DialogContent> <Box component="form" sx={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center', gap: 5}}> <FormControl sx={{ m: 1, minWidth: 200 }}> <InputLabel>{"Organization"}</InputLabel> <Select native value={currentOrganization} onChange={handleOrgChange} input={<OutlinedInput label={'Organization'}/>} > <option aria-label="None" value={-1} /> {organizations.map(item => { return (<option key={item.id} value={item.id}>{item.name}</option>) })} </Select> </FormControl> <FormControl disabled={departments.length <= 0} sx={{ m: 1, minWidth: 200 }}> <InputLabel>{"Department"}</InputLabel> <Select native value={currentDepartment} onChange={handleDepChange} input={<OutlinedInput label={'Department'}/>} > <option aria-label="None" value={-1} /> {departments.map(item => { return (<option key={item.id} value={item.id}>{item.name}</option>) })} </Select> </FormControl> </Box> </DialogContent> <DialogActions> <Button onClick={handleDialogClose}>Cancel</Button> <Button onClick={handleDialogConfirm}>Ok</Button> </DialogActions> </Dialog> <Switch> <Route path={`${path}/:orgId/:depId/:customerId`} > <DisplayCustomer/> </Route> <Route path={`${path}/:orgId/:depId`} > <Customer handleDialogOpen={handleDialogOpen}/> </Route> <Route exact path={`${path}`} > <Box sx={{height: '100vh', width: '100%', minWidth: '600px',flexDirection: 'column', display: 'flex', justifyContent: 'center', alignItems: 'center'}}> <Box> <DialogTitle>{'Choose an organization and department to display contacts'}</DialogTitle> {/* <DialogContent> */} <Box component="form" sx={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center', gap: 5, maxHeight: 300 }}> <FormControl sx={{ m: 1, minWidth: 200 }}> <InputLabel>{"Organization"}</InputLabel> <Select native value={currentOrganization} onChange={handleOrgChange} input={<OutlinedInput label={'Organization'}/>} > <option aria-label="None" value={-1} /> {organizations.map(item => { return (<option key={item.id} value={item.id}>{item.name}</option>) })} </Select> </FormControl> <FormControl disabled={departments.length <= 0} sx={{ m: 1, minWidth: 200 }}> <InputLabel>{"Department"}</InputLabel> <Select native value={currentDepartment} onChange={handleDepChange} input={<OutlinedInput label={'Department'}/>} > <option aria-label="None" value={-1} /> {departments.map(item => { return (<option key={item.id} value={item.id}>{item.name}</option>) })} </Select> </FormControl> </Box> {/* </DialogContent> */} <DialogActions> <Button onClick={handleDialogClose}>Cancel</Button> <Button onClick={handleDialogConfirm}>Ok</Button> </DialogActions> </Box> </Box> </Route> </Switch> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toRenderContactView() {\n ContactView.render({\n model: contact,\n bindings: bindings\n });\n }", "render() {\n return (\n <div>\n {this.props.contacts.map(contact => (\n <Contact displayConvo={this.props.displayConvo} name={contact} />\n ))}\n {/* Should render an array of Contact components , with the prop \"name\"*/}\n </div>\n )\n }", "renderPage() {\n return (\n <Container>\n <Header as=\"h2\" textAlign=\"center\" inverted>List Contacts</Header>\n <Card.Group>\n { this.contacts.map((contact, index) => <Contact contact={contact} key={index}/>) }\n </Card.Group>\n </Container>\n );\n }", "render() {\n\t\tconst { isFetching } = this.state; //a failed attempt to avoid double rendering\n\t\treturn(\n\t\t\t<div>\n\t\t\t{ isFetching ? (\n\t\t\t\t<div>Loading...</div>\n\t\t\t) : (\n\t\t\t\t<div>\n\t\t\t\t\t<ul className=\"contact-ul\">\n\t\t\t\t\t\t{this.state.contactList.map(\n\t\t\t\t\t\t\t(contact) =>\n\t\t\t\t\t\t\t\t<li key={contact.phone} className=\"contact-li\">\n\t\t\t\t\t\t\t\t\t<div className=\"contact\">\n\t\t\t\t\t\t\t\t\t\t<span className=\"fname\"> {contact.fname} </span>\n\t\t\t\t\t\t\t\t\t\t<span className=\"lname\"> {contact.lname} </span>\n\t\t\t\t\t\t\t\t\t\t<span className=\"phone\"> {contact.phone} </span>\n\t\t\t\t\t\t\t\t\t\t<span className=\"gender\"> {contact.gender}</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ul>\n\t\t\t\t\t<br />\n\t\t\t\t\t<AddContact onSubmit= {this.handleNewContact} />\n\t\t\t\t\t<GenderChart genders={this.state.genderCount} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}", "function renderContactListView() {\n app.router.load('list');\n }", "showContacts() {\n this.bShowModal = true;\n\n this.selectedCons = [];\n\n let selectedRows = this.template.querySelectorAll('lightning-input');\n\n // based on selected row getting values of the contact\n for(let i = 0; i < selectedRows.length; i++) {\n if(selectedRows[i].checked && selectedRows[i].type === 'checkbox') {\n this.selectedCons.push({\n Name: selectedRows[i].value,\n Id: selectedRows[i].dataset.id\n })\n }\n }\n }", "onRender () {\n console.log(this.component);\n if(undefined !== this.component) {\n this.el.querySelector(`[data-id=\"${this.component}\"]`).classList.add(\"active\");\n }\n\n var Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"components\");\n this.showComponent(this.component);\n\n }", "function loanContacts_Select(evt, ui) {\n\n if (typeof ui !== \"undefined\" && ui !== null) {\n var contactId = ui.rowKey;\n loanContacts_ShowContactDetails(contactId);\n }\n }", "renderSelectedItem() {\n\t\treturn (\n\t\t\t<div>\n YOUR SELECTION ID IS { this.props.selectionId }\n\t\t\t</div>\n\t\t);\n\t}", "function renderContact(id) {\n const contactId = id || getSelectedContactId()\n\n if (contactId) {\n const contact = client.contacts.get(contactId)\n updateContactForm(contact)\n const contactDisplay = document.getElementById('display')\n let text = '<h5>Contact Info</h5>'\n contactDisplay.innerHTML = ''\n Object.keys(contact).forEach(\n key => (text += '<li><b>' + key + '</b>: <i>' + contact[key] + '</i></li>')\n )\n\n contactDisplay.innerHTML = '<ul>' + text + '</ul>';\n } else {\n const contactDisplay = document.getElementById('display')\n contactDisplay.innerHTML = '';\n clearContact()\n }\n}", "renderContactInfo() {\n return (\n <ContactInfo\n onChange={this.onChangeContactInfo}\n onClickUpdate={this.onClickUpdateInfo}\n {...this.state.userdata}\n />\n );\n }", "function handleContactSelected(event) {\n // Get the contactId from event\n const contactId = event.currentTarget.dataset.id;\n\n // Create LMS message payload\n const payload = { recordId: contactId };\n\n // sforce.one.publish passed in from page as _pageConfigs.lmsPublish\n _pageConfigs.lmsPublish(_pageConfigs.messageChannel, payload);\n}", "contact(state) {\n return state.contact;\n }", "render() {\n\t\t\n//map over ouur contacts which match the specific patternto find matching REGULAR EXPRESSIONS \n\t\tlet showingContacts \n//if this.state.query is truthy (meabibg someone has typed smth into input field)\n\t\tif (this.state.query) {\n// \n\t\t\tconst match = new RegExp(escapeRegExp(this.state.query), 'i')\n\t\t \tshowingContacts = this.props.contacts.filter((contact) => match.test(contact.name))\n\t\t} else {\n//if nothing typed in the input field \n\t\t\tshowingContacts = this.props.contacts\n\t\t}\n\t\t\n\t\tshowingContacts.sort(sortBy('name'));\n//we access contacts array (value of the property(attribute) contacts which we assigned to the ListContacts component in the App.js file\n\t\n\t\treturn (\t\t\t\n\t\t\t<div className='list-contacts'>\n\t\t\t<div className='list-contacts-top'>\n\t\t\t\t<input \n\t\t\t\t\tclassName='search-contacts'\n\t\t\t\t\ttype='text'\n\t\t\t\t\tplaceholder='Search contacts'\n\t//we want the value of this input to allwats be as this.setate.query\n\t//we want this.state.query to change whenever the input changes \n\t\t\t\t\tvalue={this.state.query}\n\t\t\t\t\tonChange={(event) => this.updateQuery(event.target.value)}\n\t\t\t/>\n//after importin Link we cange a tag to the Link componenet (it will still render ancor tag)\n\t\t\t<Link\n//instead of an href it uses TO prop (href='#create'), it also updates the URL to /create\n\t\t\t to='/create'\n//when th button is clicked, this function invokes, now we are in the ListContacts component - it does now own the state of the screen (that state lives in our App) to be able to change that we need to pass a function to the ListContacts component in Render () on App.js\n// not needed anymore, as React router does that job for us (onClick={this.props.onNavigate})\n\t\t\t className='add-contact'\n\t\t\t >Add Contact </Link>\n\t\t\t</div>\n\t\t\t\n {showingContacts.length !== this.props.contacts.length && (\n \t\t<div className='showing-contacts'>\n\t <span>Now showing {showingContacts.length} of {this.props.contacts.length}</span>\n\t <button onClick={this.clearQuery}>Show all</button>\n\t </div>\n )}\n\n\t\t<ol className='contact-list'>\n\t\t\t{showingContacts.map((contact) => \n\t\t\t\t<li key={contact.id} className='contact-list-item'>\n\t\t\t\t\t\n\t\t\t\t\t<div className='contact-avatar' \n\t\t style={{ backgroundImage: `url(${contact.avatarURL})` }}/>\n\t\t\t\n\t<div className='contact-details'>\n\t\t\t\t<p>{contact.name}</p>\n\t\t\t\t<p>{contact.email}</p>\n\t\t\t</div>\n\t\t\t<button onClick={() => this.props.onDeleteContact(contact)} className='contact-remove'>\n\t\t\t\tRemove \n\t\t\t</button>\n\t\t\t\t</li>\t\n\t\t)}\n\t\t\t</ol>\n\t\t\t\n\t\t\t</div>\n\t\n\t\t)\n\t}", "render() {\n\n return (\n <div>\n <div className=\"header\">\n <h1>Contacts</h1>\n </div>\n <div className=\"contactList\">\n <h2>Favorite Contacts</h2>\n {this.state.fav.map((item, i) => <FavoriteContacts key={i} fav={item} parentHandler={this.toggleClick}/>)}\n <h2>Other Contacts</h2>\n {this.state.unFav.map((item, i) => <OtherContacts key={i} other={item} parentHandler={this.toggleClick}/>)}\n <ActiveContact info={this.state.clickedContact} handleClick={this.favClick} modalExit={this.modalExit}/>\n </div>\n </div>\n )\n }", "function App() {\n const [contactSelected, setContactSelected] = useState(\"About\");\n // const [categories] = useState([\n // \"About\", \"Resume\", \"Project\", \"Contact\"\n // ])\n \nreturn (\n <div>\n <Header\n // categories={categories}\n // contactSelected={contactSelected}\n setContactSelected={setContactSelected} \n ></Header>\n <main>\n {/* {!contactSelected ? (\n <> */}\n <Navigation contactSelected={contactSelected}/>\n\n {/* </> */}\n {/* ) : ( */}\n {/* <ContactForm></ContactForm> */}\n {/* )} */}\n </main>\n <Footer></Footer>\n </div>\n)\n\n\n}", "function showContacts() {\n context.setPage({\n prev: pageNames.allMessages,\n curr: pageNames.showContacts,\n });\n }", "constructor(props) {\n super(props);\n this.state = {\n peopleArray: [],\n selectedPerson: [], // this is the clicked on contact so that we can pass their data to the dialog / modal\n open: false, // this is whether or not the dialog / modal is open\n };\n }", "getVisibleContactTextBox(){\n return this.contactText;\n }", "function BlockOfContact(props){\n // onClick function return the index of the contact in the array of App Component has the contacts\n console.log(props.msg)\n return(\n <div className=\"block-chat\" >\n <img src={Icon} />\n <div>\n <h2>{props.name}</h2>\n <span>{'aa'}</span>\n </div>\n </div>\n )\n}", "render(){\n return (\n <section id=\"contact\" className='contact'>\n <div className='contactUs'>\n <div className=\"map left\">\n <div className=\"contactBook\">\n <h2>GET IN TOUCH</h2>\n <ul>\n <li><span>Address:</span><div>{this.props.contact.address} <br /><a href={this.props.contact.googleMap} target=\"blank\"> view map <i className=\"fas fa-share\"></i></a></div></li>\n <li><span>Call:</span><div>{this.props.contact.mobile}</div></li>\n <li><span>Email:</span> <div><a href=\"mailto:divyavikrant@gmail.com?subject=Request%20a%20Service\">{this.props.contact.email}</a></div></li>\n </ul>\n </div>\n </div>\n <div className=\"map right\">\n <div className=\"bookForm\">\n <h2> BOOK AN APPOINTMENT</h2>\n <div className=\"formAdjust inContact\">\n <BookMe></BookMe>\n </div>\n </div>\n </div>\n </div>\n </section>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"partsSearchFilter\">\n\n\t\t\t\t<div>Component type:</div>\n\t\t\t\t<TypeAheadMultiSelect />\n\t\t\t\t<div>Component name:</div>\n\t\t\t\t<TypeAheadMultiSelect />\n\n\n\n\n\n\n\n\n\n\n\t\t\t</div>\n\t\t);\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "function Contacts() {\n return (\n \n <div className = \"justify-content-center\">\n <ContactForm/>\n </div>\n \n )\n}", "render() {\n return (\n <ul>\n {\n Object\n .keys(this.props.contacts)\n .filter(key => this.props.contacts[key]['name'].toLowerCase().includes(this.props.filter.toLowerCase()))\n .map(key => <ListItem key={key} contact={this.props.contacts[key]} selectedContact={this.props.selectedContact} selectContact={this.props.selectContact}/>)\n }\n </ul>\n )\n }", "render () {\n const { addContact, onChange } = this\n const { newContact } = this.store\n\n return (\n <tr className='contact-creator'>\n <td><input name='name' value={newContact.name} onChange={onChange} placeholder='Contact name...' /></td>\n <td><input name='email' value={newContact.email} onChange={onChange} placeholder='Contact email...' /></td>\n <td><button onClick={addContact}>Add Contact</button></td>\n </tr>\n )\n }", "render() {\n if (this.textContent) {\n return html`\n <label part=\"label\" for=\"${this.name}\"><slot /></label>\n ${this.renderSelect()}\n `;\n }\n return this.renderSelect();\n }", "function ContactUs() {\n return (\n <div className=\"contact-div\">\n <ContactForm />\n <span className=\"div-seperator\" />\n <MapDisplay />\n </div>\n );\n}", "componentWillReceiveProps() {\n console.log(\"willreceiveprops\")\n console.log(\"hello sandeep\");\n var selectContact = contact.getSelectedContact();\n console.log(selectContact);\n this.setState({\n viewContact: selectContact\n }, () => console.log(this.state.viewContact))\n }", "selectAndContactApplicant () {\n var selectedApplicant = this.props.selectedApplicant;\n this.props.multiSelectDeselectAll();\n this.props.multiSelectAdd(selectedApplicant.student_id);\n this.openConfirmMultiApplicantContactModal();\n }", "render() {\n //Map creates contacts into a new object using the function(contact)\n const contactList = this.state.contacts.map(function(contact){\n //Creates a new instance of Contact the function\n return <Contact\n fname={contact.fname}\n lname={contact.lname}\n pnumber={contact.pnumber}\n status={contact.status}\n />\n });\n //this is what you want to return from the render function\n return(\n <div>\n <Greet fname=\"Victoria\" lname=\"Echevarria\" pnumber=\"704-555-1234\"/>\n {contactList}\n </div>\n );\n }", "function OptionDetailsComponent() {\n }", "function toggleSelectContact(contact, event)\n {\n if ( event )\n {\n event.stopPropagation();\n }\n\n if ( vm.selectedContacts.indexOf(contact) > -1 )\n {\n vm.selectedContacts.splice(vm.selectedContacts.indexOf(contact), 1);\n }\n else\n {\n vm.selectedContacts.push(contact);\n }\n }", "render() {\n const companies = transformFilmsToCompanyName(films) // [{label: 'company', value: 'company' }]\n const { selectedCompany } = this.state\n return (\n <Container className=\"App\">\n <Segment className='attribution'>\n Built with love by <strong>Ifiok Jr.</strong>\n </Segment>\n <Select \n name='companies'\n placeholder='Select your company' \n options={companies}\n onChange={this.changeCompany}\n value={this.state.selectedCompany}\n />\n {\n films\n .sort((a, b) => {\n\n if(a.name < b.name) {\n return -1;\n }\n if (a.name > b.name) {\n return 1;\n }\n\n // Names must be equal\n return 0;\n })\n .filter(film => selectedCompany ? film.company === selectedCompany : true)\n .map(film => (\n <Card\n key={film.url}\n image={film.image}\n header={film.name}\n meta={film.company}\n as='a'\n href={film.url}\n />\n ))\n }\n </Container>\n );\n }", "render() {\n return (\n <div>\n {/* Render all contacts */}\n <Route exact path='/' render={() =>\n (\n <ListContacts\n onDeleteContact={this.deleteContact}\n contacts={this.state.contacts}\n />\n )}\n />\n\n {/* Render Component to create a new Contact */}\n <Route path='/create' render={({ history }) =>\n (\n <AddContact\n onCreateContact={(contact) => {\n this.addContact(contact);\n history.push('/')\n }}\n />\n )}\n />\n </div>\n )\n }", "_updatePreviewField(){\n if(this._showingContacts && this._chosenContact !== null){\n // Meh\n this._displayName.value = this._chosenContact.firstName + \" \" + this._chosenContact.lastName;\n }\n else{\n this._displayName.value = this._user.FirstName + \" \" + this._user.LastName;\n }\n }", "render() {\n return (\n <div>\n <div className=\"viewContainer\">\n <div style={{ marginBottom: '20px', marginTop: '10px' }}>\n <Typography variant=\"h5\">Visitors Seeking More Info</Typography>\n </div>\n <hr style={{marginTop:'15px'}}/>\n <Table>\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Email</TableCell>\n <TableCell>Phone Number</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {/* This will be where the cards with each garment will be displayed. \n cards will be mapped over here and will appear in a grid*/}\n {this.state.newContacts.map((contact, i)=>{\n return(\n <ContactRow key= {i} contact={contact} />// remember to pass in function here for adding a user to the subscription list so it works with the button on ContactRow Component\n );\n })}\n </TableBody>\n </Table>\n </div>\n </div>\n );\n }", "getChangeView(){\n\t\t\treturn (\n\t\t\t\t<div>\n\t\t\t\t\t<input type=\"checkbox\" onChange={event => this.handleCheckbox(event)} className={this.state.hideClass} />\n\t\t\t\t\t<label className={this.state.hideClass}>view by soak</label>\n\t\t\t\t</div> \n\t\t\t);\n\t\t}", "render(){\n return (\n <div>\n <h1>Add Contact </h1>\n <Form>\n <FormGroup>\n <Label for=\"Name\">Name: </Label>\n <Input\n type=\"text\"\n name=\"name\"\n placeholder=\"with a placeholder\"\n value= {this.state.name}\n onChange={ this.handleChange }\n />\n </FormGroup>\n <FormGroup>\n <Label for=\"Number\">Number: </Label>\n <Input\n type=\"text\"\n number=\"number\"\n id=\"examplePassword\"\n placeholder=\"number placeholder\"\n value= {this.state.number}\n onChange={ this.handleChange }\n />\n </FormGroup>\n <FormGroup>\n <Label for=\"Address\">Address: </Label>\n <Input\n type=\"address\"\n address=\"address\"\n id=\"examplePassword\"\n placeholder=\"address placeholder\"\n value={ this.state.address }\n onChange={ this.handleChange }\n />\n </FormGroup>\n <Button\n onClick={this.handleSubmit}>\n Submit\n </Button>\n </Form>\n <br />\n\n <AddressBook\n name={this.state.name}\n number={this.state.number}\n address={this.state.address}\n />\n </div>\n )\n }", "function render(contacts) {\n var main = document.querySelector(\"#contacts\");\n main.innerHTML = \"\";\n var content = contacts.map(function (contact) {\n return renderContact(contact);\n }).join(\"\");\n main.innerHTML = content;\n loadCities(contacts);\n}", "showContact(model) {\n const entry = new ContactEntry({ model });\n this.showChildView('layout', entry);\n\n Backbone.history.navigate(`contact/${model.id}`);\n }", "function select(state) {\n console.log('select', state);\n return {\n contacts: state.contacts\n };\n}", "render() {\n if (this.$.overlay._selector) {\n this.$.overlay._selector.querySelectorAll('vaadin-combo-box-item').forEach(item => item._render());\n }\n }", "function ViewContact({contactId, contacts, deleteContact, history}) {\n const contact = _.find(contacts, {id: contactId});\n\n if (!contact)\n return <h1>Contact not found</h1>\n\n const handleDeleteClick = () => {\n if (window.confirm('Are you sure you want to delete this contact?')) {\n deleteContact(contactId);\n history.push('/contacts')\n }\n }\n\n return (\n <div className=\"row center\">\n <div className=\"col-md-6 offset-md-3 contact\">\n <h2>{contact.name}</h2>\n\n <ProfilePic imgUrl={contact.imgUrl} imgType=\"contact-view-img\"></ProfilePic>\n <p>{contact.email}</p>\n <p>{contact.number}</p>\n \n <Link to={'/contacts'} className=\"button btn btn-primary\">Back</Link>\n\n <Link to={`/contacts/${contactId}/edit`} className=\"button btn btn-primary\">Edit</Link>\n <button type=\"button\" className=\"btn btn-primary delete-contact-btn\" onClick={handleDeleteClick}>Delete</button>\n </div>\n </div>\n )\n}", "get contact() {\n\t\treturn this.__contact;\n\t}", "get contact() {\n\t\treturn this.__contact;\n\t}", "function Contact(label, value) {\n this.label = label;\n this.value = value;\n}", "get contacts() {\r\n return new Contacts(this);\r\n }", "get contacts() {\r\n return new Contacts(this);\r\n }", "renderCreatableSelect() {\n return (\n <Fragment>\n <CreatableSelect\n isMulti\n onChange={this.handleChange}\n className= {this.props.className}\n classNamePrefix = {this.props.classNamePrefix}\n defaultValue={this.props.defaultValue}\n isDisabled={this.props.isDisabled}\n isLoading={this.props.isLoading}\n isClearable={this.props.isClearable}\n isRtl={this.props.isRtl}\n isSearchable={this.props.isSearchable}\n name={this.props.controlName}\n options={this.props.options}\n value = {this.props.selectedValue}\n // onChange = {this.props.onChange}\n />\n </Fragment>\n )\n }", "function loanContactsPanel_Set(loanContacts, subjectPropertyAddress) {\n //if there is one contact then only display that contact detail. To display \n // a list of one contact would not be good design.\n if (loanContacts !== null && loanContacts.length > 0) {\n\n /* store the loan contacts list locally*/\n window.Compass.Helm.LoanContacts = loanContacts;\n if (loanContacts.length === 1) {\n //only one contact -- no need to show list.\n var loanContactId = loanContacts[0].ContactId;\n /* * Show Contact Details * */\n loanContacts_ShowContactDetails(loanContactId);\n }\n else {\n loanContacts_igGrid_DataBind(loanContacts);\n loanContacts_ShowContactList(true);\n }\n\n }\n\n if (subjectPropertyAddress !== null) {\n var address = subjectPropertyAddress;\n //Combine address lines one and two into one line (if there is an address 2)\n var addressLine1 = helm.formatText(address.Address1);\n var addressLine2 = helm.formatText(address.Address2);\n addressLine1 += (addressLine2 === \"\" ? \"\" : \", \" + addressLine2);\n $(\"#LoanContactsAddress1_helm\").text(addressLine1);\n //$(\"#LoanContactsAddress2_helm\").text(helm.formatText(address.Address2));\n $(\"#LoanContactsCityStateZip_helm\").text(helm.formatText(address.CityStateZipFormatted));\n\n //2015_08_18 MP In order to reduce clutter and info overload, Nancy E. \n // and I talked about County display not being needed on dashboard.\n //$(\"#LoanContactsCounty_helm\").text(helm.formatText(address.CountyName));\n }\n }", "function Contacts() {\n return (\n <div className=\"container\">\n <h1>Contacts</h1>\n\n <div className=\"content\">\n <List />\n {/* <AnotherList /> */}\n <Form />\n {/* <AnotherForm /> */}\n </div>\n </div>\n );\n}", "renderUser(){\n return <ListEntryCompetence\n type=\"currentUser\"\n underlayColor={styles._.primary}\n onPress={() => this.showUsers()}\n rowData={this.state.currentUser} />\n }", "function showcompanyname(){\n if (compname !== \"\"){\n return <Title level = {4} className = \"text_nameCard_companyinfo\">{compname}</Title>;\n }else{\n return <Title level = {4} className = \"text_nameCard_companyinfo\">dummy</Title>;\n }\n }", "render () {\n return <div className='side-bar-option'>\n <div className='row side-bar-labels'>\n { this.props.name }\n </div>\n <div className='row' >\n <SelectBox\n defaultValue={ this.props.options[this.props.defaultOptionIndex] }\n className='select'\n value={ this.state.selectedOption }\n onChange={ this.handleChange }\n options={ this.props.options }\n />\n </div>\n </div>\n }", "render() {\n var links = [];\n var contactInfo = this.props.user && this.props.user.contactInformation;\n\n var contactTypes = [\n {setting: \"useEmail\", contactType: \"email\"},\n {setting: \"useFacebook\", contactType: \"facebook\"},\n {setting: \"usePhone\", contactType: \"phone\"},\n {setting: \"useWhatsapp\", contactType: \"whatsapp\"},\n ];\n\n for (var i = contactTypes.length - 1; i >= 0; i--) {\n var setting = contactTypes[i].setting;\n var contactType = contactTypes[i].contactType;\n\n if (contactInfo[setting]) {\n if (this.props.small) {\n links.push(\n <Ons.Icon\n style={{marginRight: \"15px\"}}\n icon={`md-${contactType}`}\n key={contactType} />\n )\n } else {\n links.push(\n <a href={this.getContactLink(contactInfo, contactType)}\n className=\"button\"\n style={{\n marginRight: \"5px\",\n height: \"40px\",\n width: \"40px\",\n textAlign: \"center\",\n color: \"white\",\n }}\n key={contactType} >\n <Ons.Icon icon={`md-${contactType}`} />\n </a>\n )\n }\n }\n }\n\n if (links.length != 0) {\n return links;\n } else {\n return null;\n }\n }", "selectContact(name, index) {\n this.setState({\n message: this.state.contacts[index].message,\n selected_contact: name\n }, () => this.fetchImage(this.state.selected_contact, 'friend_img'));\n }", "renderUser(){\n if(this.state.currentUser){\n return <ListEntryCompetence\n type=\"currentUser\"\n underlayColor={styles._.primary}\n onPress={() => {this.showUsers()}}\n rowData={this.state.currentUser}\n />\n }\n return null;\n }", "function renderCompany(params) { \n if (!params.data.name) {\n return '<div class=\"placeholder\"></div>';\n } \n else { \n return '<a href=\"/companies/'+params.data.id+'\">'+ '<b>' + params.data.name + '</b>'+ '</a>';\n }\n }", "showContacts() {\n this._qs(\".show-contacts\").addEventListener(\"click\", () => {\n if (this._qs(\".contacts\").style.display == \"none\") {\n this._qs(\".contacts\").style.display = \"flex\";\n this._qs(\".show-contacts\").classList.add(\"collapse\");\n } else {\n this._qs(\".contacts\").style.display = \"none\";\n this._qs(\".show-contacts\").classList.remove(\"collapse\");\n }\n });\n }", "render() {\n return (\n <div>\n <Typography variant={\"body1\"}>Si no ves a quien buscas, da clic en <b>Buscar</b>. </Typography>\n <NormalPeoplePicker\n onResolveSuggestions={this._onFilterChanged}\n pickerSuggestionsProps={{\n suggestionsHeaderText: 'Sugerencias',\n noResultsFoundText: 'Sin resultados',\n searchForMoreText: 'Buscar',\n loadingText: 'Cargando...',\n isLoading: this.state.isLoadingPics\n }}\n inputProps={{\n autoFocus: this.props.autoFocus,\n placeholder: '¿Quién solicita? Inicie escribiendo el nombre del usuario'\n }\n }\n getTextFromItem={(persona) => persona.primaryText}\n onChange={this._onSelectionChanged}\n onGetMoreResults={this.state.selectedPeople.length === 0 ? this._onGetMoreResults : null}\n className='ms-PeoplePicker People'\n key='normal-people-picker'\n />\n\n <br />\n {\n this.state.result &&\n <MessageBar\n messageBarType={this.state.result.type}>\n {this.state.result.text}\n </MessageBar>\n }\n </div>\n );\n }", "render() {\n return (\n <div>\n < h2 > Ajouter ou modifier un organisme référent </h2>\n <MenuAllForm />\n <br />\n <AddOrgaRefForm />\n </div>\n );\n }", "specifyCompanyContacts()\n\t\t{\n\t\t\tBX.Salescenter.Manager.openSlider(this.$root.$app.options.urlSettingsCompanyContacts, {width: 1200} );\n\t\t}", "function getSelectedContactForInfo() {\n return localStorage.getItem(configSrvc.cinfoLocalStorage);\n }", "getContactInfo(e) {\r\n Contact.clickedContact = Number(\r\n e.currentTarget.getAttribute(\"data-contactNumber\")\r\n );\r\n console.log(Contact.clickedContact);\r\n document.querySelector(\"#name\").value =\r\n Contact.list[Contact.clickedContact].name;\r\n document.querySelector(\"#phone\").value =\r\n Contact.list[Contact.clickedContact].phone_number;\r\n document.querySelector(\"#website\").value =\r\n Contact.list[Contact.clickedContact].website;\r\n document.querySelector(\"#description\").value =\r\n Contact.list[Contact.clickedContact].description;\r\n UI.openForm(\"update\");\r\n saveContactButton.textContent = \"update\";\r\n deleteContactButton.style.display = \"block\";\r\n }", "contactList() {\n\t if (Session.get(\"searchName\") != \"\") {\n\t\tvar searchString = Session.get(\"searchName\");\n\t\treturn Template.contacts.__helpers[\" findContact\"](searchString);\n\t }\n\t else\n\t\treturn Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t}", "render() {\n return html`\n\n <style>\n\n \n .centerContent{\n color: #39DB80;\n position: absolute;\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n z-index: 99;\n }\n \n </style>\n <div style=\"position: relative\">\n ${this.renderBasicContactForm()}\n </div>\n `;\n }", "renderCategoryDropdown() {\n\t\treturn (\n\t\t\t<div className=\"field\">\n\t\t\t\t<label>Category:</label>\n\t\t\t\t<Form>\n\t\t\t\t<Form.Group widths=\"equal\">\n\t\t\t\t<Form.Select\n onChange={this.onSelectAssetType}\n value={this.state.selectedCategory}\n size=\"small\"\n style={{ maxWidth: \"400px\" }}\n placeholder=\"Select Category\"\n options={this.state.categoryOptions} />\t\t\t\t\n\t\t\t\t</Form.Group>\n\t\t\t\t</Form>\n\t\t\t</div>\n\t\t);\n\t}", "function renderContact(contact) {\n var id = contact.id,\n name = contact.name,\n email = contact.email,\n picture = contact.picture,\n _contact$address = contact.address,\n street = _contact$address.street,\n suite = _contact$address.suite,\n city = _contact$address.city,\n zipcode = _contact$address.zipcode,\n phone = contact.phone,\n website = contact.website,\n company = contact.company;\n return \"\\n <div class=\\\"card\\\" data-id=\\\"\".concat(id, \"\\\">\\n <button class=\\\"deleteBtn\\\" title=\\\"Delete this contact\\\">X</button>\\n <div class=\\\"avatar\\\">\\n <div class=\\\"circle\\\"></div>\\n <div class=\\\"circle\\\"></div>\\n <img src=\\\"\").concat(picture, \"\\\" />\\n </div>\\n <div class=\\\"info\\\">\\n <span class=\\\"name big\\\">\").concat(name, \"</span>\\n <span class=\\\"email small\\\">\").concat(email, \"</span>\\n </div>\\n <div class=\\\"details\\\">\\n <div class=\\\"phone\\\">\").concat(phone, \"</div>\\n <div class=\\\"website\\\">\").concat(website, \"</div>\\n </div>\\n\\n <div class=\\\"additional\\\">\\n <div class=\\\"address\\\">\\n <div class=\\\"suite\\\">\").concat(suite, \"</div>\\n <div class=\\\"street\\\">\").concat(street, \"</div>\\n <div class=\\\"city\\\">\").concat(city, \", \").concat(zipcode, \"</div>\\n </div>\\n <div class=\\\"company\\\">\\n <div class=\\\"label\\\">Works at</div>\\n <div class=\\\"company-name\\\">\").concat(company.name, \"</div>\\n </div>\\n </div>\\n</div>\\n\");\n}", "function showComponent(componentName){ \n if(componentName === 'default'){\n return (<ProductsList deleteItem={deleteItem} updateItem={updateItem}/>)\n }else if(componentName === 'createForm'){\n return (<ProductCreateForm showCategoryOption={showCategoryOption}/>)\n }else if(componentName === 'updateForm'){\n return (<ProductUpdateForm productSelected={productSelected} showCategoryOption={showCategoryOption}/>)\n }else if(componentName === 'deleteItem'){\n setComponentName('default');\n }else if(componentName === 'verCategories'){\n return (<CategoryList deleteCategory={deleteCategory} updateCategory={updateCategory}/>);\n }else if(componentName === 'createCategory'){\n return (<CategoryCreateForm />)\n }else if(componentName === 'updateCategory'){\n return (<CategoryUpdateForm categorySelected={categorySelected} />)\n }else if(componentName === 'verOrdenes'){\n return (<Ordenes />)\n };\n }", "function contact() {\n return (\n <div>\n <ContactHeader />\n <ContactBody />\n <br></br>\n <SmallFooter />\n </div>\n );\n}", "componentDidMount() {\n let obj = this.props.navigation.getParam('contact');\n\t\tthis.setContact(obj);\n }", "renderSelectedComponent() {\n const setting = this.state.selectedSetting;\n switch (setting) {\n case \"Password Reset 🔒\":\n return (\n <PasswordReset\n {...this.props}\n settinghaschanges={this.settingHasChanges}\n />\n );\n case \"Add Accounts 💲\":\n return (\n <AddAccounts\n {...this.props}\n settingHasChanges={this.settingHasChanges}\n />\n );\n default:\n return <div>Placeholder</div>;\n }\n }", "function Contact (props) {\n return(\n <div>\n <Header />\n <div className=\"container col-md-6 rounded p-3 lato pt-4\" style={{width: \"fit-content\"}}>\n <div className=\"row rounded px-3\">\n <h1>⟹ Let's Connect ⟸</h1>\n </div>\n <div className=\"row\">\n <ul className=\"list-group list-group-flush pl-4\">\n <li className=\"list-group-item\"><i className=\"fab fa-github pink mr-2\"></i><a href=\"https://github.com/LiliCecilia23\" target=\"_blank\" rel=\"noreferrer\">GitHub</a></li>\n <li className=\"list-group-item\"><i className=\"fab fa-linkedin pink mr-2\"></i><a href=\"https://www.linkedin.com/in/lili-clift/\" target=\"_blank\" rel=\"noreferrer\">LinkedIn</a></li>\n <li className=\"list-group-item\"><i className=\"fab fa-twitter-square mr-2 pink\"></i><a href=\"https://twitter.com/Lili_Cece23\" target=\"_blank\" rel=\"noreferrer\">Twitter</a></li>\n \n </ul>\n <ul className=\"list-group list-group-flush pr-4\">\n <li className=\"list-group-item\"><span className=\"pink satisfy mr-2\">Phone</span> (512) 738 - 3988</li>\n <li className=\"list-group-item\"><span className=\"pink satisfy mr-2\">Email</span> liliclift@gmail.com</li>\n <li className=\"list-group-item\"><span className=\"pink satisfy mr-2\">Resume</span><a href={ pdf } target=\"_blank\" rel=\"noreferrer\">Click to View</a></li>\n </ul>\n </div> \n </div>\n </div>\n );\n}", "createContacts() {\n this.props.createApplicant(this.createContactValue(this.state.contact));\n }", "renderCustomerInfoComponent(){\n return(\n <CustomerInfoComponent\n customerInfo={this.state.customerInfo}\n onCustomerNameChange={this.handleCustomerNameChange}\n onCustomerEmailChange={this.handleCustomerEmailChange}\n />\n );\n }", "render() {\n return (\n <ListWrapper>\n <List>\n {Array.prototype.map.call(this.state.arr, (contact, index) => {\n if (index < 100) return <ContactItem key={index} contact={contact} index={index} onDeleteContact={()=>this.onDeleteContact(contact.id)}></ContactItem>\n }\n )}\n </List>\n </ListWrapper>\n );\n }", "function linkFocusedContact(e) {\n return function(dispatch, getState) {\n var state = getState();\n // Select current focused contact and open link context.\n var contact = getTargetedContacts(ContactTarget.FOCUSED, state)[0];\n var targetIndex = -1;\n state.outlook.pages[state.outlook.page].forEach(function(e, index) {\n if (contact.Id == e.Id) {\n targetIndex = index;\n }\n });\n if (targetIndex !== -1) {\n dispatch(toggleSelect(e, targetIndex));\n }\n dispatch(showLinkContext());\n };\n }", "function makeContact(selectedMenu) {\n\n $mdBottomSheet.show({\n controllerAs : \"cp\",\n templateUrl : './src/menus/view/contactSheet.html',\n controller : [ '$mdBottomSheet', ContactSheetController],\n parent : angular.element(document.getElementById('content'))\n }).then(function(clickedItem) {\n $log.debug( clickedItem.name + ' clicked!');\n });\n\n /**\n * User ContactSheet controller\n */\n function ContactSheetController( $mdBottomSheet ) {\n this.menu = selectedMenu;\n this.actions = [\n { name: 'Phone' , icon: 'phone' , icon_url: 'assets/svg/phone.svg'},\n { name: 'Twitter' , icon: 'twitter' , icon_url: 'assets/svg/twitter.svg'},\n { name: 'Google+' , icon: 'google_plus' , icon_url: 'assets/svg/google_plus.svg'},\n { name: 'Hangout' , icon: 'hangouts' , icon_url: 'assets/svg/hangouts.svg'}\n ];\n this.contactUser = function(action) {\n // The actually contact process has not been implemented...\n // so just hide the bottomSheet\n\n $mdBottomSheet.hide(action);\n };\n }\n }", "function showLinkContext() {\n return function(dispatch, getState) {\n var state = getState();\n var selectedContacts = state.outlook.pages[state.outlook.page].filter(function(e) {\n return e.selected;\n });\n if (selectedContacts.length === 0) {\n dispatch(showAlert(resources_1.default.getString('MailApp_Module_Select_Link_Alert')));\n return;\n }\n dispatch({ type: actionTypes_1.default.SHOW_LINK_CONTEXT });\n dispatch(loadAccounts());\n };\n }", "onShowContactChat() {\n App.bus.trigger(OPEN_CONTACT_CHAT);\n }", "handleClickOnComponent(item, e) {\n if(item.id === this.state.activeComponentId) {\n this.setState({activeComponentId: '', activeComponentName: ''});\n } else {\n if(item.subType === 'CUSTOM') {\n let config = item.topologyComponentUISpecification.fields,\n name = _.find(config, {fieldName: \"name\"});\n let activeComponentName = name ? name.defaultValue : 'Custom';\n this.setState({activeComponentId: item.id, activeComponentName: activeComponentName});\n } else {\n this.setState({activeComponentId: item.id, activeComponentName: item.name});\n }\n }\n state.showSpotlightSearch = false;\n this.props.addComponentCallback(item);\n }", "render() {\n let persons = null;\n\n if (this.state.showPersons) {\n persons = <Persons\n persons={this.state.persons}\n clicked={this.deletePersonHandler}\n changed={this.nameChangedHandler} />;\n }\n\n return (\n <Aux>\n <Cockpit\n showPersons={this.state.showPersons}\n persons={this.state.persons}\n login={this.loginHandler}\n clicked={this.togglePersonsHandler} />\n <AuthContext.Provider value={this.state.authenticated}>\n {persons}\n </AuthContext.Provider>\n </Aux>\n );\n }", "function displayDuplicateContacts(selectForm, params){\n console.log('displaying duplicate contacts . . .');\n gmail.tools.add_modal_window('Duplicate Contacts found', selectForm, function(){\n params['ot_target_contact_id'] = $('input[name=\"contact_id\"]:checked').val();\n // display Activity Confirmation screen\n activityConfirmationScreen(params);\n // remove model window on Click OK\n gmail.tools.remove_modal_window();\n });\n}", "render(){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2> Our Current Clients Page </h2>\n\t\t\t\t<ClientLogos/>\n\t\t\t\t<ClientDescription/> \n\t\t\t</div>\n\t\t)\n\t}", "function makeContact(selectedNew) {\n\n $mdBottomSheet.show({\n controllerAs : \"vm\",\n templateUrl : './src/users/view/contactSheet.html',\n controller : [ '$mdBottomSheet', ContactSheetController],\n parent : angular.element(document.getElementById('content'))\n }).then(function(clickedItem) {\n $log.debug( clickedItem.name + ' clicked!');\n });\n\n /**\n * User ContactSheet controller\n */\n function ContactSheetController( $mdBottomSheet ) {\n this.new = selectedNew;\n this.items = [\n { name: 'Phone' , icon: 'phone' , icon_url: 'assets/svg/phone.svg'},\n { name: 'Twitter' , icon: 'twitter' , icon_url: 'assets/svg/twitter.svg'},\n { name: 'Google+' , icon: 'google_plus' , icon_url: 'assets/svg/google_plus.svg'},\n { name: 'Hangout' , icon: 'hangouts' , icon_url: 'assets/svg/hangouts.svg'}\n ];\n this.contactUser = function(action) {\n // The actually contact process has not been implemented...\n // so just hide the bottomSheet\n\n $mdBottomSheet.hide(action);\n };\n }\n }", "render() {\n return (\n <div className=\"contentDetail\">\n <div className=\"autoContent\">\n\n <CampaignHeading selectedCampaignType={this.props.campaign.selectedCampaign}/>\n\n <div className=\"compaigns_list_content\">\n <div className=\"compaigns_list_detail\">\n\n <TopTabs selectedCampaignType={this.props.campaign.selectedCampaign}\n selectedTab={this.props.selectedTab}\n topTabClicked={this.topTabClicked} highestVisitedTab={this.props.highestVisitedTab}\n tabs={this.tabs}\n segmentTypeSelected={this.props.segment.type}/>\n\n <div>\n {this.getComponent()}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n }", "function AppComponent(props) {\n var _this = _super.call(this, props) || this;\n // ---\n // PRIVATE METHODS.\n // ---\n //// I get the next available ID from the given collection of contacts.\n //private getNextID( contacts: Contact[] ) : number {\n //\tif ( contacts.length ) {\n //\t\t//return( _.maxBy( contacts, \"id\" ).id + 1 );\n //\t} else {\n //\t\treturn( 1 );\n //\t}\n //}\n // I handle name emitted from the form component, adding a new contact.\n // --\n // CAUTION: Using an instance-property to define the function so that we don't lose\n // the \"this\" context when the method reference is passed into the React element.\n _this.handleAdd = function (name) {\n //// NOTE: Since the next state is based on the previous state, we need to use the\n //// callback-style invocation so that we can handle asynchronous state updates.\n //this.setState(\n //\t( state: State, props: Props ) : Partial<State> => {\n //\t\treturn({\n //\t\t\tcontacts: [\n //\t\t\t\t...state.contacts, \n //\t\t\t\t{\n //\t\t\t\t\tid: this.getNextID( state.contacts ),\n //\t\t\t\t\tname: name\n //\t\t\t\t}\n //\t\t\t]\n //\t\t});\n //\t}\n //);\n };\n // I handle the delete event emitted from the contact list, removing a contact.\n // --\n // CAUTION: Using an instance-property to define the function so that we don't lose\n // the \"this\" context when the method reference is passed into the React element.\n _this.handleDelete = function (contact) {\n //// NOTE: Since the next state is based on the previous state, we need to use the\n //// callback-style invocation so that we can handle asynchronous state updates.\n //this.setState(\n //\t( state: State, props: Props ) : Partial<State> => {\n //\t\treturn({\n //\t\t\tcontacts: _.without( state.contacts, contact )\n //\t\t});\n //\t}\n //);\n };\n _this.state = {\n contacts: [\n { id: 1, name: \"Kim\" },\n { id: 2, name: \"Sarah\" },\n { id: 3, name: \"Joanna\" },\n { id: 4, name: \"Libby\" }\n ]\n };\n return _this;\n }", "function AppComponent(props) {\n var _this = _super.call(this, props) || this;\n // ---\n // PRIVATE METHODS.\n // ---\n //// I get the next available ID from the given collection of contacts.\n //private getNextID( contacts: Contact[] ) : number {\n //\tif ( contacts.length ) {\n //\t\t//return( _.maxBy( contacts, \"id\" ).id + 1 );\n //\t} else {\n //\t\treturn( 1 );\n //\t}\n //}\n // I handle name emitted from the form component, adding a new contact.\n // --\n // CAUTION: Using an instance-property to define the function so that we don't lose\n // the \"this\" context when the method reference is passed into the React element.\n _this.handleAdd = function (name) {\n //// NOTE: Since the next state is based on the previous state, we need to use the\n //// callback-style invocation so that we can handle asynchronous state updates.\n //this.setState(\n //\t( state: State, props: Props ) : Partial<State> => {\n //\t\treturn({\n //\t\t\tcontacts: [\n //\t\t\t\t...state.contacts, \n //\t\t\t\t{\n //\t\t\t\t\tid: this.getNextID( state.contacts ),\n //\t\t\t\t\tname: name\n //\t\t\t\t}\n //\t\t\t]\n //\t\t});\n //\t}\n //);\n };\n // I handle the delete event emitted from the contact list, removing a contact.\n // --\n // CAUTION: Using an instance-property to define the function so that we don't lose\n // the \"this\" context when the method reference is passed into the React element.\n _this.handleDelete = function (contact) {\n //// NOTE: Since the next state is based on the previous state, we need to use the\n //// callback-style invocation so that we can handle asynchronous state updates.\n //this.setState(\n //\t( state: State, props: Props ) : Partial<State> => {\n //\t\treturn({\n //\t\t\tcontacts: _.without( state.contacts, contact )\n //\t\t});\n //\t}\n //);\n };\n _this.state = {\n contacts: [\n { id: 1, name: \"Kim\" },\n { id: 2, name: \"Sarah\" },\n { id: 3, name: \"Joanna\" },\n { id: 4, name: \"Libby\" }\n ]\n };\n return _this;\n }", "function makeContact(selectedUser) {\n\n $mdBottomSheet.show({\n controllerAs : \"vm\",\n templateUrl : 'public/users/contactSheet.html',\n controller : [ '$mdBottomSheet', ContactSheetController],\n parent : angular.element(document.getElementById('content2'))\n }).then(function(clickedItem) {\n $log.debug( clickedItem.name + ' clicked!');\n });\n\n /**\n * User ContactSheet controller\n */\n function ContactSheetController( $mdBottomSheet ) {\n this.user = selectedUser;\n this.items = [\n { name: 'E-mail' , icon: 'email' , icon_url: '/public/assets/svg/envelope.svg'}\n ];\n this.contactUser = function(action) {\n //show email\n $mdBottomSheet.hide(action);\n };\n }\n }", "function contactHtmlFromObject(contact) {\n console.log(contact);\n var html = '';\n html += '<li class=\"list-group-item contact\">';\n html += '<div>';\n if (contact.name != '') {\n html += '<p class=\"lead\">' + contact.name + '</p>';\n }\n html += '<p><a href=\"' + contact.email + '\" target=\"_blank\" title=\"' + contact.email + '\">' + contact.email + '</a></p>';\n var textSelect = filterSelect(contact.location.city, listOption)\n if (textSelect != '') {\n\n\n var strZip = contact.location.zip == \"\" ? '' : '--' + contact.location.zip\n var strState = contact.location.state == \"\" ? '' : ',' + contact.location.state\n html += '<p><small>' + '<b>' + textSelect + '</b>' + strState + strZip + '</small></p>';\n }\n if (contact.time != undefined) {\n var d = new Date(contact.time);\n html += '<p>' + d.toLocaleString() + '</p>';\n }\n html += '</div>';\n html += '</li>';\n return html;\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 getSelectedContactForChat() {\n return localStorage.getItem(configSrvc.cidLocalStorage);\n }", "function cspJSLinkColorPicker_ViewForm(ctx) {\n\n var color = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];\n \n var fieldhtml = \"<div id='\" + cspJSLink_ColorPicker.HTMLID + \"' data-\" + cspJSLink_ColorPicker.HTMLDataAttr + \"='\" + color + \"' style='cursor:pointer;width:20px;height:20px;background-color:\" + color + \";border:1px solid #000;padding:2px;'></div>\";\n return fieldhtml;\n}", "function SelectDisplay(props) {\n const choices = ['Description', 'Created With', 'More Details'];\n\n return (\n <Container fluid={true}>\n <Row >\n {choices.map(function (choice) {\n return (\n <Col\n xs='4'\n key={choice}\n className=\"select-column\">\n <li\n style={choice === props.selectedDisplay ? { color: 'black', fontWeight: 700, textDecoration: 'underline'}: null}\n onClick={props.onSelect.bind(null, choice)}\n className=\"select-item\"\n >\n {choice}\n </li>\n </Col>\n )\n }, this)}\n </Row>\n </Container>\n )\n}", "getComponent() {\n let crudComponent;\n switch (this.state.option) {\n case 'users':\n crudComponent = <UserCRUDComponent />;\n break;\n case 'phenotypes':\n crudComponent = <PhenotypesCRUDComponent />;\n break;\n case 'pathologies':\n crudComponent = <PathologiesCRUDComponent />;\n break;\n default:\n crudComponent = null;\n break;\n }\n return crudComponent;\n }", "render() {\n\t\t// Creating the option elements\n\t\tvar currentSourceName = this.props.currentSourceName;\n\t\tvar categoryNames = this.props.categoryNames;\n\t\tvar options = [];\n\n\t\tcategoryNames.forEach(function(categoryName) {\n\t\t\t// Key combines source name & category name to ensure that categories belonging to different sources with the same name can be distinguished from each other\n\t\t\toptions.push(<option name={categoryName} key={currentSourceName + \" \" + categoryName}>{categoryName}</option>);\n\n\t\t});\n\n\t\treturn (\n\t\t\t<div className=\"filter-group\">\n\t\t\t\t<label htmlFor=\"categoryNames\">Category: </label>\n\t\t\t\t<select id=\"categoryNames\" name=\"categoryNames\" onChange={this.onChangeCategory}>\n\t\t\t\t\t{options}\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t);\n\t}", "function Contacts() {\n\t\n}" ]
[ "0.64872533", "0.61435807", "0.5944054", "0.5852314", "0.5846402", "0.5755448", "0.573583", "0.5705119", "0.57034034", "0.5689367", "0.56595653", "0.56244636", "0.5612604", "0.55912143", "0.5578331", "0.5572586", "0.5545431", "0.55096495", "0.5505732", "0.54934657", "0.5493318", "0.54510427", "0.53887606", "0.53887606", "0.53887606", "0.53887606", "0.5385871", "0.5374804", "0.5372844", "0.53703845", "0.5358097", "0.532983", "0.531711", "0.53150845", "0.5312877", "0.5303936", "0.5299219", "0.5267114", "0.5265776", "0.52633375", "0.5257978", "0.5249985", "0.5246434", "0.52460563", "0.52456784", "0.5239801", "0.52363193", "0.5228976", "0.5228976", "0.5226082", "0.5221771", "0.5221771", "0.52202415", "0.5216605", "0.52134484", "0.520182", "0.5187485", "0.51707155", "0.516747", "0.5161991", "0.5159377", "0.5154535", "0.5153483", "0.514672", "0.51397413", "0.5137271", "0.5124782", "0.51236624", "0.5120539", "0.51189506", "0.5112235", "0.5109819", "0.51082796", "0.51081914", "0.51045907", "0.51025665", "0.51009744", "0.50975394", "0.5096691", "0.5090722", "0.50853455", "0.50852716", "0.5084555", "0.508279", "0.5082109", "0.5079368", "0.5070108", "0.5069131", "0.5068314", "0.50642824", "0.50559044", "0.50559044", "0.5049782", "0.50457364", "0.5040156", "0.5035832", "0.5028304", "0.50261396", "0.5025457", "0.5019585", "0.50139976" ]
0.0
-1
Service created lifecycle event handler
async created() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "created() {\n this.onCreatedHandler();\n }", "initService() {\n\t\tthis.settings = new ServiceSettings();\n\t\tthis.service = new Service({\n\t\t\tonDisconnect: (hadError) => {\n\t\t\t\tthis.stopCancellableQueues(!!hadError, !!hadError);\n\t\t\t}\n\t\t});\n\t}", "constructor() { \n \n ServiceInstance.initialize(this);\n }", "onConstructed() {}", "onConstructed() {}", "listenForServices() {\n console.debug(\"dependency manager: listenForServices in \" + this.name);\n // wait until the microkernel stage is done so pubsub responders are available\n systemManagerClient_1.default.waitForBootStage(\"kernel\", \"stageEntered\", () => {\n this.RouterClient.subscribe(constants_1.SERVICES_STATE_CHANNEL, (err, event) => {\n this.onServiceStateChange(event.data);\n });\n // TODO: The pubsub responder doesnt seem to work here. IT works for the above when not closing.\n this.RouterClient.addListener(constants_1.SERVICE_CLOSED_CHANNEL, (err, event) => {\n let services = {};\n services[event.data.name] = {\n state: \"closed\"\n };\n this.onServiceStateChange(services);\n });\n this.RouterClient.subscribe(constants_1.APPLICATION_STATE_CHANNEL, (err, response) => {\n switch (response.data.state) {\n //authenticated will only be caught by components/services that are up before auth does its thing. Otherwise, a component/service coming up will have the 'ready' application state. In either case, we need to do the things below. But only once.\n case \"authenticated\":\n case \"ready\":\n break;\n case \"closing\":\n this.shutdown.checkDependencies();\n break;\n }\n });\n });\n }", "_addWebContentsCreatedHandler() {\n\t\tthis.app.on('web-contents-created', this._onWebContentsCreated);\n\t}", "onComponentConstructed() {}", "onComponentConstructed() {}", "function initEventListener() {\n //$scope.$on(vm.controllerId + '.action.refresh', function (event, data) {\n // getPage(_tableState);\n //});\n }", "created() {\n\t\tthis.logger.info(\"Participation Service created!\");\n\t}", "async created() { \n\n this.connector = new Connector({ broker: this.broker, options: this.settings });\n\n // map service names and wait for services\n this.services = { \n agents: this.settings?.services?.agents ?? \"agents\"\n };\n await this.broker.waitForServices(Object.values(this.services));\n\n }", "created() {\n this.__initEvents();\n }", "beforeDestroy(){\n //Antes de destruir la instancia\n console.log('beforeDestroy')\n }", "constructor () {\n this._lifecycleConfig = null;\n }", "created() {\n if (!this.$isPage\n || (this.$isPage && !this.$isSupportOninit)) {\n let propDescriptors = {\n $app: {\n get() {\n return getCurrApp();\n }\n }\n };\n Object.keys(base).forEach(k => {\n propDescriptors[k] = {\n get() {\n return base[k];\n }\n };\n });\n\n Object.defineProperties(this, propDescriptors);\n\n }\n this.$listener = new EventListener();\n // call beforeCreate hook\n this.beforeCreate && this.beforeCreate();\n }", "onCreatedHandler() {\n this.fetchData();\n }", "$onInit() {\n \n }", "createdCallback() {}", "function init() {\n TodoService.name = 'todo';\n readTodoList();\n }", "constructor(service) {\n this.service = service;\n }", "createdCallback() {\r\n this.init()\r\n }", "onInit() {}", "beforeDestroy(fn) {\n if (!this.beforeDestroyHandlers) {\n this.beforeDestroyHandlers = [];\n }\n this.beforeDestroyHandlers.push(fn);\n }", "_dispatchOnInit(){\n for (const instance of this._instances.values()) {\n instance.onInit&&instance.onInit()\n }\n }", "postConstruct() {}", "function RegisterService() { }", "onInitialize() {}", "function Service() {\n}", "afterCreate(result) {}", "listener() {}", "onInit() {\n this.__initEvents();\n }", "started(broker) {\n broker.createService(require(\"@steedos/service-enterprise\"));\n\t}", "afterCreation( ) {\n\n }", "startEventListener() {\n // Utils.pzChestContract.CreateChest().watch((err, { result }) => {\n // if (err) return console.error('Failed to bind event listener:', err);\n\n // console.log('Chest Created');\n // console.log(result);\n // });\n }", "constructor(){\n this.service = new BookService();\n this.load() \n }", "static onDestroy(callback) {\n if (!ForegroundServiceEmitter) {\n return null;\n }\n\n return ForegroundServiceEmitter.addListener(\n 'ForegroundService.onDestroy',\n (data) => {\n callback(data);\n },\n );\n }", "onLoad() {\n emitter.on(this, \"refreshAchieve\", this.onRefreshAchieve);\n }", "beforeDestroy(){\n console.log('beforeDestroy');\n }", "function onInit() {}", "function onStart() {\n console.log(this.name);\n }", "function onInit() {\n lodash.defaultsDeep(ctrl.function, {\n ui: {\n delete: deleteFunction\n }\n });\n\n ctrl.convertedStatusState = lodash.chain(ctrl.function.status.state).lowerCase().upperFirst().value();\n\n ctrl.invocationURL = lodash.isNil(ctrl.function.status.httpPort) ? 'Not yet deployed' : 'http://' + ctrl.externalAddress + ':' + ctrl.function.status.httpPort;\n\n ctrl.actions = initActions();\n }", "function AddVehicleService() {\n }", "destroy() {\n logger.log({level: 'info', type: 'service', message: 'Destroying Service'});\n this.end = true;\n clearTimeout(this.pollInterval);\n }", "function onConstruct () \n\t{\n\t\tself.emitThen(E.PUBLISH_HANDLES, (...args) => self.emit(E.CONSUME_HANDLES, ...args), {});\n\t}", "createdCallback() {\n self = this\n self.init()\n }", "constructor() {\n this.services = [];\n }", "initialize(framework) {\n // event service:up means a new unified service available\n this.socket.on('service:up', service => {\n if (service) {\n // decode/unpack\n service = this._encoder.unpack(service)\n\n // register each method for further call\n for (let i = 0; i < service.methods.length; i++) {\n this.register(service.name, service.methods[i])\n }\n\n this.servicesDico[service.name] = service\n\n if (service.options && service.options.uiComponentInjection) {\n // effective load\n // no need to check for css (to be removed in v5)\n this.loadAsync(service.name, 'build.css', 'css').then(added => {\n this.servicesDico[service.name].domElements =\n this.servicesDico[service.name].domElements || []\n\n this.servicesDico[service.name].domElements.push(added)\n }).catch(err => {\n console.log('css not available for service ' + service.name, '' + err)\n })\n\n this.loadAsync(service.name, 'chunk-vendors.css', 'css').then(added => {\n this.servicesDico[service.name].domElements =\n this.servicesDico[service.name].domElements || []\n\n this.servicesDico[service.name].domElements.push(added)\n }).catch(err => {\n console.log('vendors css not available for service ' + service.name, '' + err)\n })\n\n let loadMainJS = () => {\n return new Promise((resolve, reject) => {\n this.loadAsync(service.name, 'build.js', 'js').then(async added => {\n this.servicesDico[service.name].ready = true\n this.servicesDico[service.name].domElements =\n this.servicesDico[service.name].domElements || []\n\n this.servicesDico[service.name].domElements.push(added)\n\n // tells locally (client side) that a service is up\n utils.waitForProperty(this, '$i18n').then($i18n => {\n // translations\n $i18n.addTranslations(\n this.servicesDico[service.name].options.description.i18n)\n })\n\n // call main service client (browser) function\n global['iios_' + service.name](framework)\n\n this.emit('service:up', service)\n resolve()\n }).catch(err => reject(err))\n })\n }\n\n this.loadAsync(service.name, 'chunks.js', 'js').then(added => {\n this.servicesDico[service.name].domElements =\n this.servicesDico[service.name].domElements || []\n\n this.servicesDico[service.name].domElements.push(added)\n\n loadMainJS().catch(err => console.log(err))\n }).catch(err => {\n console.log('no chunks for service [' + service.name + ']: ' + err)\n loadMainJS().catch(err => console.log(err))\n })\n } else {\n this.servicesDico[service.name].ready = true\n // tells locally (client side) that a service is up\n this.emit('service:up', service)\n }\n }\n })\n\n // a service has been shut down\n this.socket.on('service:down', service => {\n // decode/unpack\n service = this._encoder.unpack(service)\n\n let onReadyToBeRemove = () => {\n clearTimeout(destroyTimeout)\n\n // if dom elements, then remove\n if (this.servicesDico[service.name].domElements) {\n for (let domElId of this.servicesDico[service.name].domElements) {\n select('#' + domElId).remove()\n }\n }\n\n // deletes registered reference\n delete this[service.name]\n delete this.servicesDico[service.name]\n\n // send event before destroying data\n this.emit('service:down', service.name, this.servicesDico[service.name])\n }\n\n // destroy automatically if no request for that\n let destroyTimeout = setTimeout(onReadyToBeRemove, 3000)\n\n this.once('service:destroy:' + service.name + ':done', onReadyToBeRemove)\n this.emit('service:destroy:' + service.name)\n })\n }", "function $onDestroy(){\n removeEventListeners();\n }", "function startup(data, reason) {\n TabSourceService.register();\n}", "constructor(){\n this._events = {};\n }", "constructor() {\n super();\n this.handlers = {};\n }", "setupDataListener(){\n PubSub.subscribe('Items:item-data-loaded',(evt)=>{this.initiliaze(evt.detail)});\n }", "$onInit() {\n console.info('backbuttonComponent', this);\n console.info('backbuttonComponent component loaded!!');\n\n //call an internal function\n this.exampleRequest();\n }", "created() {\n console.log('created');\n }", "$onDestroy(){\n console.log('destroyed');\n }", "function ctrl() {\r\n\t// Subscribe to routeChanging which is published by user\r\n\t// when accessing a new route (after app init)\r\n\tpubSub.subscribe('routeChanging', () => {\r\n\t\t// Show loader and start animation\r\n\t\tloader.start();\r\n\t});\r\n\r\n\t// Subscribe to routeChanged which is published whenever\r\n\t// template of target route has been rendered\r\n\tpubSub.subscribe('routeChanged', () => {\r\n\t\t// Stop animation and hide loader\r\n\t\tloader.stop();\r\n\t});\r\n}", "createService() {\r\n this._service = new CurrencyService();\r\n }", "init() {\n this._isInitialised = true;\n this.emitBaseBubblingEvent('itemCreated');\n this.emitUnknownBubblingEvent(this.type + 'Created');\n }", "function onInit() {\n vm.lists = mainService.get();\n }", "initialize(){\n this.loadListeners()\n }", "created(broker) {}", "constructor (ptr) {\n this.ptr = ptr\n this._destroyListeners = []\n this._destroyPromise = new Promise((resolve) => {\n this._destroyResolve = resolve\n })\n this._destroyPromise.then(() => {\n this._destroyListeners.forEach((listener) => {\n listener(this)\n })\n })\n }", "onInit()\n {\n // \n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "constructor () {\n this._onProxyConnected = null;\n this._onProxyClosed = null;\n this._onServiceStarted = null;\n this._onServiceEnded = null;\n this._onError = null;\n }", "async initializeService({ label, service, options }) {\n let bindings = null;\n switch (service) {\n case 'Philips Hue':\n bindings = new PhilipsHueBindings(this.#connection, label, options);\n break;\n\n default:\n this.displayFatalError(`Cannot display unrecognised service: \"${service}\"`);\n return;\n }\n\n this.#container.appendChild(bindings.element);\n this.#bindings.push(bindings);\n }", "ngOnDestroy() {\n this._destroyed = true;\n this._completeExit();\n }", "onCreate() {\n // console.log('onCreate');\n }", "created_() {\n\t\tthis.addSurfacesFromTemplates_();\n\t\tsuper.created_();\n\t}", "onInit () {\n\n this._setState(PortalService.STATE.INITIALIZED);\n\n }", "constructor(){\n this.onNotify = (instance, payload) => {};\n }", "function DelegateService() {\n this._instances = [];\n }", "function DelegateService() {\n this._instances = [];\n }", "start() {\n\t\tthis.registerListeners();\n\t}", "destroyed(){\n console.log('Destroyed');\n }", "render(){\n console.log('Render Fired')\n return(\n <div>Lifecycle Method Examples</div>\n )\n }", "setupServices() {\n // Setup services\n const coveringService = new this.hap.Service.WindowCovering();\n coveringService\n .getCharacteristic(this.hap.Characteristic.CurrentPosition)\n .on('get', this.getCurrentPosition.bind(this));\n coveringService\n .getCharacteristic(this.hap.Characteristic.TargetPosition)\n .on('set', this.setTargetPosition.bind(this));\n coveringService\n .getCharacteristic(this.hap.Characteristic.PositionState)\n .on('get', this.getPositionState.bind(this));\n\n this.services.push(coveringService);\n }", "initialise(){\n this._initialise(this._body)\n this._initEvents()\n this._dispatchOnInit()\n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "_registerOnDestroy(fn) {\n this._onDestroyCallbacks.push(fn);\n }", "componentDidMount(){\n \t\teventsStore.addListener(eventsConstants.EVENT_CREATED, this.handleEventCreatedSuccessfully.bind(this));\n \t}", "static publish() {\r\n ViewportService.subscribers.forEach(el => {el.callback();});\r\n }", "onLaunch() {\n this.$eventHub = eventCenter;\n this.__bindBroadcastEvents(this.broadcastEvents);\n }", "_constructCallbacks() {\n\t\tthis._contract.on(\"PriceSent\", this._receivePrice.bind(this));\n\n\t\tthis._contract.on(\"InvoiceSent\", this._receiveInvoice.bind(this));\n\t}", "constructor() {\n this._listeners = {};\n }", "handleServiceStateChange(params) {\n let serviceName = params.name;\n let serviceState = params.state;\n this.ServiceStates[serviceName] = {\n state: serviceState\n };\n let firstLogArg = `SERVICE LIFECYCLE: STATE CHANGE: Service ${serviceState}`;\n logger_1.default.system.log(firstLogArg, serviceName);\n //Two messages go out.\n //1. Individual service state. \"Hey, logger is ready\".\n routerClientInstance_1.default.publish(`Finsemble.Service.State.${serviceName}`, { state: serviceState });\n //2. Aggregate service state, keyed by service name. \"Hey here's the state of all services.\".\n routerClientInstance_1.default.publish(Constants.SERVICES_STATE_CHANNEL, this.ServiceStates);\n }", "onCreated() {\n return this.preload();\n }", "createdCallback() {\n this.setProperties();\n this.parseAttributes();\n }", "setupListener() {\n if (!this.isDestroyed && !this.isDestroying) {\n this._registerTableScroll();\n this._registerViewResize();\n\n set(\n this,\n 'mutationObserver',\n new MutationObserver(() => {\n this._registerViewResize();\n })\n );\n\n document\n .querySelectorAll('tr.table-header-row-vc')\n .forEach((el) => this.mutationObserver.observe(el, { attributes: false, childList: true, subtree: true }));\n }\n }", "_initServices() {\n this.workbenchCoreSerivce = new WorkbenchCoreService();\n this.authTwoService = new AuthTwoService();\n }", "async onAdded() {\n // This device has just been added by Homey\n this.log('Device: onAdded...');\n }", "function onInit() {\n $scope.$on('search-posts_make-search', onSearchFinishedHandler);\n }", "setupServices() {\n super.setupServices();\n const sensorService = this.platformAccessory.getOrAddService(plugin_1.Service.SmokeSensor);\n this.primaryService = sensorService;\n sensorService.getCharacteristic(plugin_1.Characteristic.SmokeDetected).onGet(() => this.device.smokeDetected);\n }", "onChildAppStart () {\n\n }" ]
[ "0.68110543", "0.6215897", "0.61676764", "0.61611104", "0.61611104", "0.6119992", "0.610259", "0.6070838", "0.6070838", "0.6067955", "0.60517883", "0.6039822", "0.59989184", "0.59704554", "0.59457517", "0.5918045", "0.58979523", "0.5826529", "0.5819539", "0.57962817", "0.5744387", "0.57098925", "0.57028073", "0.56771505", "0.56717396", "0.5660139", "0.5611719", "0.55810684", "0.55793554", "0.5570301", "0.5559645", "0.5558973", "0.5553715", "0.5536229", "0.5519252", "0.5517793", "0.5512205", "0.55067927", "0.55057865", "0.54995614", "0.5496546", "0.54933715", "0.54787827", "0.5465598", "0.5462096", "0.5447643", "0.544551", "0.54402435", "0.5439456", "0.54303366", "0.5414736", "0.5411694", "0.5401662", "0.5400182", "0.5392699", "0.5391495", "0.5387416", "0.5383165", "0.5378584", "0.537473", "0.53657544", "0.5359873", "0.53544617", "0.53481025", "0.53275794", "0.53261495", "0.5317106", "0.53151447", "0.5310826", "0.53103113", "0.52986", "0.5297886", "0.5282462", "0.5282462", "0.52807575", "0.5279277", "0.5274545", "0.52721316", "0.5269351", "0.52687687", "0.52687687", "0.52687687", "0.52687687", "0.52687687", "0.52687687", "0.5266321", "0.52642095", "0.5261987", "0.52494776", "0.52489376", "0.5248133", "0.5232791", "0.523168", "0.52291393", "0.5227789", "0.52206266", "0.52165437", "0.52163756", "0.52132064" ]
0.5626522
26
Service started lifecycle event handler
async started() { this.broker.waitForServices("steedos-server").then(async () => { await this.publicClientJS() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startService() {\n $log.log(TAG + 'starting');\n running = true;\n }", "started() {\n\n }", "started() {\n\n }", "started() {\n\n }", "function startService() {\n $log.log(TAG + 'starting.');\n running = true;\n }", "preStart() {\n }", "started() {\r\n\r\n\t}", "setServiceStarted(state, value) {\n state.serviceStarted = value\n }", "started() { }", "async started() {\n this.broker.logger.info('[service][company]===>', 'started')\n }", "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\n }", "started () {\n\n }", "started () {\n\n }", "started() {\n\t}", "async started() {}", "async started() {}", "async started() {}", "async started() {}", "async started() {}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}", "function start(state) { \n service.goNext(state);\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "start() {\n\t\tthis.registerListeners();\n\t}", "started () {}", "function onStart() {\n console.log(this.name);\n }", "_onStart() {\n this.running = true;\n this._startTime = Date.now();\n\n this._log('query:start'); // Register this query so we can stop it if the DHT stops\n\n\n this.dht._queryManager.queryStarted(this);\n }", "listenForServices() {\n console.debug(\"dependency manager: listenForServices in \" + this.name);\n // wait until the microkernel stage is done so pubsub responders are available\n systemManagerClient_1.default.waitForBootStage(\"kernel\", \"stageEntered\", () => {\n this.RouterClient.subscribe(constants_1.SERVICES_STATE_CHANNEL, (err, event) => {\n this.onServiceStateChange(event.data);\n });\n // TODO: The pubsub responder doesnt seem to work here. IT works for the above when not closing.\n this.RouterClient.addListener(constants_1.SERVICE_CLOSED_CHANNEL, (err, event) => {\n let services = {};\n services[event.data.name] = {\n state: \"closed\"\n };\n this.onServiceStateChange(services);\n });\n this.RouterClient.subscribe(constants_1.APPLICATION_STATE_CHANNEL, (err, response) => {\n switch (response.data.state) {\n //authenticated will only be caught by components/services that are up before auth does its thing. Otherwise, a component/service coming up will have the 'ready' application state. In either case, we need to do the things below. But only once.\n case \"authenticated\":\n case \"ready\":\n break;\n case \"closing\":\n this.shutdown.checkDependencies();\n break;\n }\n });\n });\n }", "start() {\r\n // Add your logic here to be invoked when the application is started\r\n }", "function onStartup()\n{\n\tprintLog(\"info\", \"onStartup called\");\n}", "onStart() {\n log('starting the core...');\n history.start({pushStart: false});\n\n /**\n * App has started.\n *\n * @event App#start\n */\n this.channel.trigger('start');\n\n // Remove loading class\n $('.-loading').removeClass('-loading');\n }", "initService() {\n\t\tthis.settings = new ServiceSettings();\n\t\tthis.service = new Service({\n\t\t\tonDisconnect: (hadError) => {\n\t\t\t\tthis.stopCancellableQueues(!!hadError, !!hadError);\n\t\t\t}\n\t\t});\n\t}", "function startup(data, reason) {\n TabSourceService.register();\n}", "started(broker) {\n broker.createService(require(\"@steedos/service-enterprise\"));\n\t}", "created() {\n\t\tthis.logger.info(\"Participation Service created!\");\n\t}", "started() {\n\n\t\tthis.app.listen(Number(this.settings.port), err => {\n\t\t\tif (err)\n\t\t\t\treturn this.broker.fatal(err);\n\t\t\tthis.logger.info(`API Server started on port ${this.settings.port}`);\n\t\t});\n\n\t}", "function onStart(data) {\n\t\tconsole.log(\"Player \" + data.name + \" has started the game\");\n\t\tdocument.getElementById('debugoutput').innerText = \"Player \" + data.name + \" has started the game\";\n\t\n\t\t// Set client \"running\" state here?\n}", "start() {\n // Add your logic here to be invoked when the application is started\n }", "onMessageStart() { }", "function onInstallStart(ev) {\n future.when(function () {\n console.log('start', ev, 'status', appCache.status, new Date().toISOString());\n primaryEmitter.emit('start');\n });\n }", "async started() { \n\n // connect to db\n await this.connector.connect();\n\n const serviceId = process.env.SERVICE_ID;\n const authToken = process.env.SERVICE_AUTH_TOKEN; \n const { serviceToken } = await this.broker.call(this.services.agents + \".login\", { serviceId, authToken});\n if (!serviceToken) throw new Error(\"failed to login service\");\n this.serviceToken = serviceToken;\n\n }", "created() {\n this.onCreatedHandler();\n }", "constructor() { \n \n ServiceInstance.initialize(this);\n }", "function initEventListener() {\n //$scope.$on(vm.controllerId + '.action.refresh', function (event, data) {\n // getPage(_tableState);\n //});\n }", "onInit() {}", "async started(broker) {}", "onStreamStart() {\n if (this.onStartTrigger.length > 0) {\n this.onStartTrigger.forEach(trigger => {\n controller.handleData(trigger);\n })\n }\n }", "function handleStart(e) {\n if (e.kind === 'start') {\n if (startCallback) {\n startCallback(e);\n }\n return true;\n }\n\n return false;\n }", "onLoadStarted() {\n this.messageLoading = true;\n this.messageLoaded = false;\n }", "onStart() {\n this.requestQueueLength++;\n if (this.requestQueueLength > 1 || !this.callbacks.onStart) {\n return;\n }\n this.callbacks.onStart(this.requestQueueLength);\n }", "start() {\n // Start ticking our safety timer. If the whole advertisement\n // thing doesn't resolve within our set time, then screw this.\n this._startSafetyTimer(12000, 'start()');\n\n // Subscribe to the AD_SDK_LOADER_READY event and clear the\n // initial safety timer set within the start of our start() method.\n this.eventBus.subscribe('AD_SDK_LOADER_READY', () => {\n this._clearSafetyTimer('AD_SDK_LOADER_READY');\n });\n\n // Subscribe to AD_SDK_MANAGER_READY, which is a custom event.\n // We will want to start and clear a timer when requestAds()\n // is called until the ads manager has been resolved.\n // As it can happen that an ad request stays on pending.\n // This will cause the IMA SDK adsmanager to do nothing.\n this.eventBus.subscribe('AD_SDK_MANAGER_READY', () => {\n this._clearSafetyTimer('AD_SDK_MANAGER_READY');\n });\n\n // Subscribe to the LOADED event as we will want to clear our initial\n // safety timer, but also start a new one, as sometimes advertisements\n // can have trouble starting.\n this.eventBus.subscribe('LOADED', () => {\n // Start our safety timer every time an ad is loaded.\n // It can happen that an ad loads and starts, but has an error\n // within itself, so we never get an error event from IMA.\n this._clearSafetyTimer('LOADED');\n this._startSafetyTimer(8000, 'LOADED');\n });\n\n // Show the advertisement container.\n this.eventBus.subscribe('CONTENT_PAUSE_REQUESTED', () => {\n this._show();\n });\n\n // Subscribe to the STARTED event, so we can clear the safety timer\n // started from the LOADED event. This is to avoid any problems within\n // an advertisement itself, like when it doesn't start or has\n // a javascript error, which is common with VPAID.\n this.eventBus.subscribe('STARTED', () => {\n this._clearSafetyTimer('STARTED');\n });\n }", "start() {\n if (this.listening_) {\n return;\n }\n\n this.listening_ = true;\n this.chromeEvent_.addListener(this.callback_);\n }", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "started() {\n\t\tthis.clearStats();\n\n\t}", "start() {\n //DO BEFORE START APP CONFIGURATION/INITIALIZATION\n super.start();\n }", "get start() {}", "function notifyApplicationStarted() {\n\t if (_isApplicationRunning) {\n\t return;\n\t }\n\n\t _isApplicationRunning = true;\n\t applicationEventListeners.forEach(function (listener) {\n\t listener('started');\n\t });\n\t}", "onStart() {\n console.log('timer has been started');\n \n this.startStopButton.innerText = 'Stop';\n this.startStopButton.classList.remove('start')\n this.startStopButton.classList.add('stop');\n\n const today = new Date();\n const time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n \n logger\n .push({\n action: 'click start',\n startedAt: time,\n started: this.isStarted,\n typeOfTimer: this.timerType\n });\n \n \n}", "onChildAppStart () {\n\n }", "function onInit() {}", "start () {\n this.status = 'running';\n }", "onStart(totalDuration) {\n\t\tduration = totalDuration;\n\t}", "async created() { \n\n this.connector = new Connector({ broker: this.broker, options: this.settings });\n\n // map service names and wait for services\n this.services = { \n agents: this.settings?.services?.agents ?? \"agents\"\n };\n await this.broker.waitForServices(Object.values(this.services));\n\n }", "function init() {\n TodoService.name = 'todo';\n readTodoList();\n }", "startTracking() {\n HyperTrack.onTrackingStart();\n }", "start() {\n this.broadcast('wc:hello');\n }", "onComponentConstructed() {}", "onComponentConstructed() {}", "startServiceDependeny(readyItem) {\n systemLog_1.default.log({ indent: true }, `starting service: ${readyItem.name}`);\n this.subscribeToDependencyBootStatus(readyItem.name);\n logger_1.default.system.debug(`bootEngine.processReadyList starting service ${readyItem.name} in ${this.currentStage}`, readyItem);\n this.serviceLauncher.createService(readyItem.config.originalConfig, this.splinterAgentPool);\n }", "function onLoadStarted(callback)\n {\n if (options && options.onLoadStarted) \n {\n options.onLoadStarted.call(null, function()\n {\n callback.call(null);\n });\n }\n }", "onInitialize() {}" ]
[ "0.6500062", "0.64819014", "0.64819014", "0.64819014", "0.6467215", "0.6429847", "0.636004", "0.63335705", "0.62732744", "0.62657464", "0.6257874", "0.6257874", "0.6257874", "0.6257874", "0.6257874", "0.6257874", "0.6257874", "0.6257874", "0.62467724", "0.62467724", "0.62467724", "0.6174387", "0.6173564", "0.6173564", "0.6173564", "0.6173564", "0.6173564", "0.61548615", "0.61548615", "0.61548615", "0.61548615", "0.61548615", "0.61548615", "0.61548615", "0.61473024", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.6145675", "0.61274403", "0.61003786", "0.60771066", "0.6072551", "0.6054298", "0.60188943", "0.60169107", "0.5938643", "0.5920391", "0.5917349", "0.59103835", "0.588622", "0.5883047", "0.5876928", "0.5871007", "0.5835437", "0.58319443", "0.5828663", "0.5825756", "0.58203876", "0.57393813", "0.5735765", "0.5711697", "0.5710932", "0.5709995", "0.5700116", "0.5682845", "0.56651974", "0.5664337", "0.5651843", "0.5651843", "0.5651843", "0.5651843", "0.5651843", "0.5651843", "0.5651843", "0.5651843", "0.56434137", "0.5634685", "0.5634225", "0.5629688", "0.5628389", "0.56178546", "0.5614372", "0.5599666", "0.55943197", "0.5593802", "0.55815005", "0.5579701", "0.5574734", "0.5574698", "0.5574698", "0.5573336", "0.55594605", "0.5556537" ]
0.5794123
65
Service stopped lifecycle event handler
async stopped() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stopped() {\n\n }", "stopped() {\n\n }", "stopped() {\n\n }", "stopped () {\n\n }", "stopped () {\n\n }", "stopped () {\n\n }", "stopped() {\r\n\r\n\t}", "stopped() { }", "destroy() {\n logger.log({level: 'info', type: 'service', message: 'Destroying Service'});\n this.end = true;\n clearTimeout(this.pollInterval);\n }", "async stopped() {}", "async stopped() {}", "async stopped() {}", "async stopped() {}", "async stopped() {}", "stop() {\n\t\t// Call service `started` handlers\n\t\tthis.services.forEach(service => {\n\t\t\tif (service && service.schema && isFunction(service.schema.stopped)) {\n\t\t\t\tservice.schema.stopped.call(service);\n\t\t\t}\n\t\t});\n\n\t\tif (this.metricsTimer) {\n\t\t\tclearInterval(this.metricsTimer);\n\t\t\tthis.metricsTimer = null;\n\t\t}\n\t\t\n\t\tif (this.transit) {\n\t\t\tthis.transit.disconnect();\n\n\t\t\tif (this.heartBeatTimer) {\n\t\t\t\tclearInterval(this.heartBeatTimer);\n\t\t\t\tthis.heartBeatTimer = null;\n\t\t\t}\n\n\t\t\tif (this.checkNodesTimer) {\n\t\t\t\tclearInterval(this.checkNodesTimer);\n\t\t\t\tthis.checkNodesTimer = null;\n\t\t\t}\n\t\t}\n\n\t\tthis.logger.info(\"Broker stopped.\");\n\n\t\tprocess.removeListener(\"beforeExit\", this._closeFn);\n\t\tprocess.removeListener(\"exit\", this._closeFn);\n\t\tprocess.removeListener(\"SIGINT\", this._closeFn);\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "stopped() {\n\n\t}", "function stopService() {\n $log.log(TAG + 'stopping');\n running = false;\n }", "handleServerStop() {\n this.activeStartingResource = null;\n this.activeStartingTime = null;\n }", "async stopped() {\n\n }", "function stopService() {\n $log.log(TAG + 'stopping.');\n running = false;\n }", "async stopped(broker) {}", "stop() {\n this.log('stopped');\n if (typeof this.onStop === 'function') {\n this.onStop();\n }\n }", "function onStop() { /* Currently empty, just to avoid annoying log message */ }", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stopped() {}", "stop() {\n if (!this._running) {\n return console.log('Already stopped');\n }\n clearInterval(this._interval);\n this._running = false;\n console.log('Service stopped');\n }", "stopped () {}", "stop() {\n this.onStop(false);\n }", "static onDestroy(callback) {\n if (!ForegroundServiceEmitter) {\n return null;\n }\n\n return ForegroundServiceEmitter.addListener(\n 'ForegroundService.onDestroy',\n (data) => {\n callback(data);\n },\n );\n }", "onDestroy(e) {\n\n }", "async stopped () {\n\t\t// await this.tortoise.destroy();\n\t}", "stop() {\n this.isStopped = true;\n }", "stop(){\n //TODO: implement me.\n }", "stopped() {\n\t\tif (this.app.listening) {\n\t\t\tthis.app.close(err => {\n\t\t\t\tif (err)\n\t\t\t\t\treturn this.logger.error(\"Server close error!\", err);\n\n\t\t\t\tthis.logger.info(\"Server Stopped\");\n\t\t\t});\n\t\t}\n\t}", "stopped() {\n\t\tthis.clearStats();\n\n\t}", "_onStop(){\n\t\tthis._isWatching = false\n\t}", "destroyed(){\n console.log('Destroyed');\n }", "onStop(callback) {\n\t\tthis.onStopCallback = callback;\n\t}", "postStop() {\n }", "function stop () {\n stopTimerAndResetCounters();\n dispatchEvent('stopped', eventData);\n }", "stop() {\n\t\tthis._stopped = true;\n\t\tthis.heartbeatTimeout.enabled = false;\n\t}", "function stop () {\n stopped = true\n }", "onStopClicked(){\n console.log(\"in stop\");\n }", "Stop() {}", "function $onDestroy(){\n removeEventListeners();\n }", "shutdown() {\n this._stopped = true;\n }", "getIsDestroyed(){return this.__isDestroyed}", "stop()\n\t{\n\t\t//Chheck not stopped alrady\n\t\tif (!this.endpoint)\n\t\t\t//Do nothing\n\t\t\treturn;\n\t\t\n\t\t//Don't listen for stopped event\n\t\tthis.endpoint.off(\"stopped\",this.onendpointstopped);\n\t\t\n\t\t//For all transports\n\t\tfor (const transport of this.transports)\n\t\t\t//Stop them\n\t\t\ttransport.stop();\n\t\t\n\t\t//Close ns\n\t\tthis.ns.close();\n\t\t\n\t\t/**\n\t\t* PeerConnectionServer stopped event\n\t\t* \n\t\t* @name stopped\n\t\t* @memberof PeerConnectionServer\n\t\t* @kind event\n\t\t* @argument {PeerConnectionServer} peerConnectionServer\n\t\t*/\n\t\tthis.emitter.emit(\"stopped\",this);\n\t\t\n\t\t//Stop emitter\n\t\tsuper.stop();\n\t\t\n\t\t//Null\n\t\tthis.transports = null;\n\t\tthis.emitter = null;\n\t\tthis.ns = null;\n\t\tthis.endpoint = null;\n\t}", "stop() {\n this.isStarted = false;\n }", "$onDestroy(){\n console.log('destroyed');\n }", "async stopped() { \n\n // disconnect from db\n await this.connector.disconnect();\n\n }", "destroy() {\n\t\tthis._listener.stopListening();\n\t}", "ngOnDestroy() {\n this._destroyed = true;\n this._completeExit();\n }", "onDestroy() {\n this.unlisten()\n }", "function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }", "function onStop() {\n\tlog('#logs', \"Clicked the stop button\");\n\tif (detector && detector.isRunning) {\n \t\tdetector.removeEventListener();\n \tdetector.stop();\n\t}\n}", "stop() {\n Bangle.removeListener('HRM', handleHeartBeat)\n Bangle.setHRMPower(false)\n }", "stop()\n\t{\n\t\t//Don't call it twice\n\t\tif (this.stopped) return;\n\n\t\t//Stopped\n\t\tthis.stopped = true;\n\t\t/**\n\t\t* IncomingStreamTrack stopped event\n\t\t*\n\t\t* @name stopped\n\t\t* @memberof IncomingStreamTrack\n\t\t* @kind event\n\t\t* @argument {IncomingStreamTrack} incomingStreamTrack\n\t\t*/\n\t\tthis.emitter.emit(\"stopped\",this);\n\t\t\n\t\t//remove encodings\n\t\tthis.encodings.clear();\n\t\tthis.depacketizer = null;\n\t\t\n\t\t//Remove transport reference, so destructor is called on GC\n\t\tthis.bridge = null;\n\t\tthis.receiver = null;\n\t}", "_onCreateStop() {\n this.props.onCreateStop();\n }", "stop() {\n Emitters.get(APPLICATION).emit(ON_STOP);\n this._app.stop();\n }", "onStop () {\n this.leave()\n }", "stop(){\n \n }", "stop() {\n this.listening_ = false;\n this.chromeEvent_.removeListener(this.callback_);\n }", "onStop() {\n try {\n this.recognition.stop()\n this.setState({ listening: false })\n this.notify('info', 'Stopped Listening')\n } catch {\n this.notify('danger', 'Unable to stop Listening')\n }\n }", "stop() {\n this.status = \"inactive\"\n }", "destroy() {\n\t\tthis.stopListening();\n\t}", "async stop() {\n /**\n * Only stop service when service is running.\n */\n if (this.state === transport_1.DeviceState.off)\n return;\n debug_1.logger.debug('stop nfc service');\n /**\n * Update service state.\n */\n this.state = transport_1.DeviceState.off;\n /**\n * Stop native card service.\n */\n pcsc_1.pcsc.stop();\n /**\n * Remove all device form store.\n */\n this.device.clear();\n /**\n * Make sure promises are resolved.\n */\n return;\n }", "stop() {}", "stop() {\n this.stopEventListeners();\n this.stopJobStatusUpdates();\n this.stopLogAutoFetch();\n if (this.requestLoop) {\n clearTimeout(this.requestLoop);\n }\n if (this.fsm) {\n this.fsm.stop();\n }\n if (this.runClock) {\n this.runClock.stop();\n }\n this.state.stopped = false;\n if (this.container) {\n this.container.innerHTML = '';\n }\n }", "function stop() {\n if (!started)\n return;\n started = false;\n loading.value = false;\n onStopHandlers.forEach(function (handler) { return handler(); });\n onStopHandlers = [];\n if (query.value) {\n query.value.stopPolling();\n query.value = null;\n }\n if (observer) {\n observer.unsubscribe();\n observer = null;\n }\n }", "stopEvent () {\n this._stop = true;\n }", "stop () {\n listener.end();\n }", "OnDeactivated() {}", "stop () {\n const priv = privs.get(this)\n if (!priv.receiving) return\n priv.receiving = false\n priv.emitter.removeListener(priv.eventName, priv.receive)\n if (priv.watchError) {\n priv.emitter.removeListener('error', priv.receiveError)\n }\n priv.emitter = null\n priv.receive = null\n priv.receiveError = null\n priv.fail = null\n priv.updated = null\n priv.values = null\n }", "function handleRemoteStreamRemoved(event) {\r\n //console.log(event);\r\n if(hidingVideo){\r\n remoteVideoStream.stop();\r\n remoteVideoStream = null;\r\n hidingVideo = false;\r\n }\r\n\r\n if (typeof remoteStreamScreen != 'undefined' && !hidingVideo) {\r\n remoteStreamScreen.stop();\r\n remoteStreamScreen = null;\r\n $rootScope.$broadcast('screenRemoved');\r\n }\r\n else {\r\n remoteStreamScreen.stop();\r\n remoteVideoStream.stop();\r\n\r\n remoteStreamScreen = null;\r\n remoteVideoStream = null;\r\n }\r\n }" ]
[ "0.7112776", "0.7112776", "0.7112776", "0.70919883", "0.70919883", "0.70919883", "0.6991065", "0.6959354", "0.6933851", "0.69287086", "0.69287086", "0.69287086", "0.69287086", "0.69287086", "0.6915627", "0.6905836", "0.6905836", "0.6905836", "0.6905836", "0.6905836", "0.6905836", "0.6905836", "0.6905836", "0.6905836", "0.6871583", "0.68589634", "0.6853373", "0.68261945", "0.6809556", "0.6800888", "0.6798441", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67639107", "0.67574275", "0.6747007", "0.66610324", "0.65822804", "0.65259093", "0.6521499", "0.64606744", "0.6438765", "0.64306754", "0.64162856", "0.6351207", "0.6339186", "0.6320127", "0.630564", "0.6301901", "0.62727386", "0.6255278", "0.6253042", "0.62254035", "0.6220699", "0.621042", "0.62023854", "0.6196273", "0.616671", "0.6158532", "0.6139033", "0.61333", "0.6101963", "0.6090447", "0.6089659", "0.60865295", "0.6075509", "0.6064122", "0.60623825", "0.60427284", "0.6033783", "0.6032626", "0.6026448", "0.6025762", "0.6014413", "0.59984577", "0.59810454", "0.5974862", "0.5969777", "0.59694964", "0.5958442", "0.5953497", "0.5940257", "0.5913735", "0.5901304" ]
0.69112134
20
Set Admin Roles from
function initialize(){ sheets.spreadsheets.values.get({ auth: oauth2Client, spreadsheetId: '1KFcvgsjI_6eCBoltdD50ddWxeLcIGfRBd6LWcKEI_Uw', range: 'Permissions!B2:B', }, function(err, response) { if (err) { console.log('The API returned an error: ' + err); } var rows = response.values; if(rows == null) { console.log('No data found: No Admin Roles'); } else { for (var i = 0; i < rows.length; i++) { adminRoles.push(rows[i][0]); } console.log('Admin Roles initialized'); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_roles() {\n\n // Define roles, resources and permissions\n acl.allow([\n {\n roles: '0', //super -admin\n allows: [\n { resources: '/secret', permissions: '*' }\n ]\n }, {\n roles: '1', //organization-admin\n allows: [\n { resources: '/secret', permissions: 'get' },\n { resources: '/user', permissions: '*' }\n ]\n }, {\n roles: '2', //partipent\n allows: [\n {resources:'/secret' , permissions:'get'}\n ]\n }\n ]);\n\n acl.addRoleParents( 'user', 'guest' );\n acl.addRoleParents( 'admin', 'user' );\n}", "setRole(changeset) {\n this.toggleProperty('is_admin');\n if (this.is_admin) {\n this._setAdmin(changeset);\n } else {\n this._revokeAdmin(changeset);\n }\n }", "_setRole() {}", "role(user, editor, admin) {\n this.role = user;\n this.role = editor;\n this.role = admin; \n }", "function setRoles() {\n var roleIDs = \"\";\n \n $('.btn-role.btn-primary').each(function() {\n roleIDs = roleIDs + $(this).val() + \",\";\n });\n \n $('#role_ids').val(roleIDs);\n }", "function adminRolesChangedHandler() {\n\tlogger('TODO implement Start button disabling based on role checks');\n}", "getRoles() {}", "getUserRoles() {}", "function getRoles() {\n\n queries.executeRequest('GET', 'permissions/roles')\n .then(function (result) {\n if (result.success) {\n $scope.roles = result.data;\n }\n });\n }", "assignRoles() {\n const available = roles[this.players.length];\n\n shuffle(available);\n\n this.players.forEach((player, i) => {\n player.role = available[i];\n });\n }", "async getRoles () {\n return [\n {\n id: 'viewer',\n name: 'Viewer',\n permissions: [\n 'view',\n ],\n },\n {\n id: 'operator',\n name: 'Operator',\n permissions: [\n 'view',\n 'operate',\n ],\n },\n {\n id: 'admin',\n name: 'Admin',\n permissions: [\n 'view',\n 'operate',\n 'administrate',\n ],\n },\n ]\n }", "function setRole(role) {\n //api call to retrieve user info\n _user.role = role;\n}", "function getUserRoles() {\n APIUtils.getAccountServiceRoles()\n .then((roles) => {\n $scope.userRoles = roles;\n })\n .catch((error) => {\n console.log(JSON.stringify(error));\n $scope.userRoles = null;\n })\n }", "setAuthManagementRoleList() {\n axios.get('/home/admin/auth/role/list').then(res => {\n if (res.data.success) {\n this.response.authManagement.role.list = res.data.data\n } else {\n Swal.fire('', res.data.message, 'error')\n }\n }).catch(err => {\n Swal.fire('', err.toString(), 'error')\n })\n }", "function setRight(accessRights,role,action,enabled){\n var roleIdx = wordLookup(role,$.roles);\n var actionIdx = wordLookup(action,$.allActions);\n accessRights[roleIdx][actionIdx].enabled = enabled;\n }", "function updateRoles(){\n console.log('update role')\n mainMenu();\n}", "function _processRoles() {\n if (__auth.$vm.data) {\n const roles = [];\n\n roles.push(__auth.$vm.data.system_role);\n roles.push(__auth.$vm.data.role?.slug);\n\n switch (__auth.$vm.data.role?.slug) {\n case 'customer-integrator':\n case 'customer-end-user':\n roles.push('customer'); // general role\n break;\n }\n\n __auth.$vm.data[__auth.options.rolesKey] = roles;\n }\n }", "async function setEmployeeRole() {\n const\n employeeList = await employees.getListAll(),\n roleList = await roles.getListAll()\n\n const {employeeId, roleId} = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which employee's role would you like to change?\",\n choices: employeeList,\n name: \"employeeId\"\n },\n {\n type: \"list\",\n message: \"What is the employee's new role?\",\n choices: roleList,\n name: \"roleId\"\n }\n ])\n\n await employees.setRole(employeeId, roleId)\n promptMainMenu()\n}", "function mapRoles(roles) {\n var mappedRoles = $scope.data.ACL.roles.map(function(aclRole) {\n _.find(roles, function(role) {\n if (aclRole.uid === role.uid) {\n aclRole[\"name\"] = role.name;\n aclRole['uid'] = role.uid;\n }\n });\n return aclRole;\n });\n\n $scope.data.ACL.roles = mappedRoles;\n }", "function addRole(x) {\n this.forEach(function (user) {\n user.role = x\n });\n return this;\n}", "toggleRole() {\n if(this.role == 'Manager') {\n this.role = 'Employee';\n this.employee = this.tempEmployee;\n this.editEmployee = this.employee;\n } else {\n this.role = 'Manager';\n }\n }", "function saveUserRole() {\n\t\t\tdailyMailScanDataService.getUserRole()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\t//self.userRole=\"LexviasuperAdmin\";\n\t\t\t\t\tself.userRole = response.data.role;\n\t\t\t\t});\n\n\t\t}", "getRoles()\n {\n return this.loading\n .then((db) => db('role')\n .select()\n .map((role) =>\n {\n // We store the permissions as a JSON string, because that's way easier than doing crazy joins.\n // And this doesn't add much overhead at all.\n role.permissions = JSON.parse(role.permissions);\n return role;\n }));\n }", "function getRoles() {\n\n DashboardFactory.getRoles().then(\n\n function(response) {\n\n vm.roles = response;\n console.log(response);\n\n // Get all the Users that exist in the origin.API DB\n getUsers();\n\n },\n\n function(error) {\n\n console.log(error);\n \n });\n\n }", "function getRoles() {\n /* return the roles array */\n return roles || [];\n }", "changeRole() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n yield _this2.getUsers();\n //this.title = this.selectedRole.name;\n })();\n }", "function InitializeRoles()\r\n{\r\n\t\r\n\tif(roleValues.localRoles.length <= 0)\r\n\t{\r\n\t\tconsole.log(\"Error no local role values set\");\r\n\t\treturn;\r\n\t}\r\n\r\n\t//PULL SUBSECTION ROLE VALUES\r\n\tfor(var i = 0; i < roleValues.localRoles.length; i = i + 2)\r\n\t{\r\n\t\tlocalRoles.push(roleValues.localRoles[i]);\r\n\t}\r\n\tfor(var i = 1; i < roleValues.localRoles.length; i = i + 2)\r\n\t{\r\n\t\tlocalRoleValues.push(roleValues.localRoles[i]);\r\n\t}\r\n\r\n\t\r\n\r\n\r\n\treturn;\r\n}", "function InitializeRoles()\r\n{\r\n\t\r\n\tif(roleValues.localRoles.length <= 0)\r\n\t{\r\n\t\tconsole.log(\"Error no local role values set\");\r\n\t\treturn;\r\n\t}\r\n\r\n\r\n\t//PULL ROLES WITH VALUES\r\n\tfor(var i = 0; i < roleValues.localRoles.length; i = i + 2)\r\n\t{\r\n\t\tlocalRoles.push(roleValues.localRoles[i]);\r\n\t}\r\n\tfor(var i = 1; i < roleValues.localRoles.length; i = i + 2)\r\n\t{\r\n\t\tlocalRoleValues.push(roleValues.localRoles[i]);\r\n\t}\r\n\r\n\r\n\r\n\treturn;\r\n}", "function isAdmin(m){\n var ret = false\n config.adminRoles.forEach((adminRole) => {\n if (m.roles.has(adminRole)){\n ret = true\n }\n })\n return ret\n}", "function getRoles() {\n selectRole();\n return roleArray;\n}", "_setAdmin(changeset) {\n set(changeset, 'is_admin', true);\n }", "[types.SET_USER_ROLES](state,payload){\n if(payload){\n if(payload.isAdministrator!==undefined)state.user.isAdministrator=payload.isAdministrator;\n if(payload.isContentManager!==undefined)state.user.isContentManager=payload.isContentManager;\n if(payload.isLogisticManager!==undefined)state.user.isLogisticManager=payload.isLogisticManager;\n }\n }", "function rolesTest(toSelect) {\n cy.get('[name=\"role\"]').select(toSelect)\n }", "function _setRolePrivileges(xml) {\n var valueNode = Sdk.Xml.selectSingleNode(xml, \"//a:KeyValuePairOfstringanyType[b:key='RolePrivileges']/b:value\");\n if (!Sdk.Xml.isNodeNull(valueNode)) {\n _rolePrivileges = Sdk.Util.createRolePrivilegeCollectionFromNode(valueNode);\n }\n }", "function viewRoles() {\n var query = \"SELECT * FROM ROLES\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Role: \" + res[i].title);\n }\n runManager();\n });\n }", "function createRoleListOnEdit(data) {\r\n\t\t\r\n\t $(\"#userRole\").find(\"option\").remove();\r\n\t\tvar availableRole = \"\";\r\n\t\t$.each(data[0].availableRoleList, function(index, value){\r\n\t\t\tif(data[0].availableRoleList[index].roleName != 'ROLE_GRW'){\r\n\t\t\t\tif(data[0].availableRoleList[index].roleDescription != 'Class Admin User'){\r\n\t\t\t\t\tavailableRole += '<option value=\"'+ data[0].availableRoleList[index].roleName +'\" >' +data[0].availableRoleList[index].roleDescription+'</option>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t$(\"#userRole\").append(availableRole);\t\t\r\n\t\t$(\"#userRole\").change(function(){\r\n\t\t\t$(\"#userRole option[value='ROLE_USER']\").attr('selected', true);\r\n\t\t});\r\n\t\t//alert(masterRole);\r\n\t}", "function getRoles() {\n\t$.getJSON(\"/rpc/account/GetRoles\").done(function (jsonData) {\n\t\twindow.roles = jsonData;\n\t});\n}", "function setRole(role) {\n this.role = role;\n }", "function validateRoles(roles) { return roles; }", "addRoles(accessToken, postBody) {\n\n var role = this.app.Role();\n role = role\n .setName(postBody.name)\n .addUsers(postBody.users)\n .setHeader('access_token', accessToken);\n return this.makePromise(role.save());\n }", "init () {\n const {\n activeUser,\n getRoles,\n userFromId,\n roles } = this.props;\n const { currentRolesMaxCount } = this.state;\n const user = userFromId(activeUser);\n if (!user) return;\n\n let roleIds = user.memberOf;\n if (roles && roles.length) {\n roleIds = roleIds && roleIds.filter(\n roleId => !roles.find(role => role.id === roleId)\n );\n }\n roleIds && getRoles(roleIds.slice(0, currentRolesMaxCount));\n }", "function getUserRoles() {\n return webApiServiceReference.makeRetryRequest(1, function () {\n return authenticationServiceReference.getUserRoles();\n })\n .then(function (data) {\n commonReference.config.userRoles = data;\n })\n .catch(function (reason) {\n commonReference.showErrorMessage(reason, Messages.error.userRoles)\n });\n }", "viewRoles() {\n return connection.query(`SELECT er.id, er.title,er.department_id, ed.dept_name\n from role er \n inner join department ed \n on er.department_id = ed.id`)\n }", "getRole() {\n this.role = 'Employee';\n }", "function roles() {\n connection.query(\"SELECT * from roles;\", function (err, results){\n if (err) throw err;\n console.table(results)\n runSearch();\n });\n }", "async function viewRoles() {\n const roleList = await db.obtainAllRoles();\n\n console.log(`\\nTASK: VIEW ALL ROLES\\n`);\n console.table(roleList);\n\n displayMenus();\n}", "function getRoles() {\r\n\treturn room.getPlugin(`sav/roles`);\r\n}", "async function viewRoles () {\n \n try {\n const roles = await connection.getAllRoles();\n console.table(roles);\n } catch(err) {\n console.log(err); \n }\n \n \n employeeChoices();\n \n }", "function assignAdminHeaders (req, res, next) {\n switch(req.baseUrl) {\n case '/api/illustrations':\n res.set('Administer-Illustrations', req.user.permissions.indexOf('administer:illustrations') > -1);\n break;\n case '/api/sermons':\n res.set('Administer-Sermons', req.user.permissions.indexOf('administer:sermons') > -1);\n break;\n case '/api/guides':\n res.set('Administer-Guides', req.user.permissions.indexOf('administer:guides') > -1);\n break;\n }\n\n next();\n}", "function setCurrentRole(){\n\t$(\"ul.filter li\").each(function(){\n\t\t\tif( $(this).data(\"asrole\") == localStorage.sd_user_role){\n\t\t\t\t$(this).addClass(\"active\");\n\t\t\t};\n\t\t});\n\t}", "setRole(newRole) {\n if (newRole === 'Parent') {\n this.setState({role: 'PARENT'});\n }\n else if(newRole === 'Student') {\n this.setState({role: 'STUDENT'});\n }\n else if(newRole=== 'College Counselor'){\n this.setState({role: 'COLLEGE_COUNSELOR'})\n } else if (newRole === 'Admin') {\n this.setState({role: 'ADMIN'});\n }\n }", "function toggleUserRoleVisibility() {\n\tif (currentUserRole == null) {return;}\n\tif (dx_admin_roles.includes(currentUserRole.toLowerCase())) {\n\t\t$('.administrator-visible').removeClass(\"user-role-visible\");\n\t} else {\n\t\t$('.'+currentUserRole.toLowerCase()+'-visible').removeClass(\"user-role-visible\");\n\t}\n}", "targetRole () {\n const userRole = this.userRole()\n return config.userRoles[userRole + 1]\n }", "function manageRoles(roleId) {\n return $http({\n url: EnvironmentConfig.api + 'roles/manage_roles/'+roleId,\n method: 'GET',\n })\n .then(getDataComplete)\n .catch(getDataFailed);\n }", "setRoles() {\n let detectives = this.numDetectives(this.players.length);\n this.players[0].role = 'THIEF';\n this.players[1].role = 'DETECTIVE';\n this.players[2].role = 'THIEF';\n this.players[3].role = 'DETECTIVE';\n this.players[4].role = 'THIEF';\n this.players[5].role = 'DETECTIVE';\n // for (let i = 0; i < this.players.length; i++) {\n // this.players[i].role = 'DETECTIVE'\n // }\n }", "function viewRoles() {\n db.query('SELECT * FROM role', function (err, results) {\n console.table(results);\n goPrompt();\n });\n}", "function handleGetRolesResponse(response){\n ROLES = response;\n response.forEach((role) => {\n addRoleOptionToRoleSelect(role.roleName);\n addRoleToRolesTable(role);\n });\n\n}", "getRole(){}", "function viewRoles() {\n connection.query(\"SELECT * FROM role\", function(error, results) {\n if (error) throw error;\n console.table(results);\n start();\n })\n}", "async _initializeAdmins() {\n logger.info('Initializing administrators');\n const orgs = this.networkUtil.getOrganizations();\n for (const org of orgs) {\n const adminName = `admin.${org}`;\n\n // Check if the caliper config file has this identity supplied\n if (!this.networkUtil.getClients().has(adminName)) {\n logger.info(`No ${adminName} found in caliper configuration file - unable to perform admin options`);\n continue;\n }\n\n // Since admin exists, conditionally use it\n logger.info(`Administrator ${adminName} found in caliper configuration file - checking for ability to use the identity`);\n const usesOrgWallets = this.networkUtil.usesOrganizationWallets();\n if (usesOrgWallets) {\n // If a file wallet is provided, it is expected that *all* required identities are provided\n // Admin is a super-user identity, and is consequently optional\n const orgWallet = this.orgWallets.get(org);\n const hasAdmin = await orgWallet.get(adminName);\n if (!hasAdmin) {\n logger.info(`No ${adminName} found in wallet - unable to perform admin options using client specified in caliper configuration file`);\n }\n } else {\n // Build up the admin identity based on caliper client items and add to the in-memory wallet\n const cryptoContent = this.networkUtil.getAdminCryptoContentOfOrganization(org);\n if (!cryptoContent) {\n logger.info(`No ${adminName} cryptoContent found in caliper configuration file - unable to perform admin options`);\n continue;\n } else {\n await this._addToOrgWallet(org, cryptoContent.signedCertPEM, cryptoContent.privateKeyPEM, adminName);\n }\n }\n logger.info(`${org}'s admin's materials are successfully loaded`);\n }\n logger.info('Completed initializing administrators');\n }", "adminRole(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .get(\"admin/roles\", { params: payload })\n .then(response => {\n resolve(response);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "function viewRoles() {\n connection.query(\"SELECT * FROM role\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "getRole(){\n this.role = \"Manager\";\n return this.role;\n }", "function getRoles() {\n return $http.get('/api/roles').then(function(data) { return data.data; });\n }", "function populateMasterRoles(data) {\n var index = 0;\n\n $(\"#orgRoleList\").empty();\n\n while (index < data.length) {\n // Declare a local Role object\n var role = new Role();\n role.ID = data[index].ID;\n role.Name = data[index].Name;\n role.Description = data[index].Description;\n // Add the current role to the referece role array\n referenceRoles.push(role);\n // Add a list item for the organization.\n // Add a check box for each master role\n $(\"<DIV id='rowContainer\" + data[index].ID + \"'</DIV>\").addClass(\"sectionSpan\").appendTo(\"#orgRoleList\");\n// var node = <label for = 'role\" + data[index].ID + \"'>\" + data[index].Name + \"</label>\";\n $(\"<input type='checkbox' id='role\" + data[index].ID + \"'/>\").val(data[index].ID).css({ 'margin-left': '15px' }).on(\"click\", activateRole).appendTo(\"#rowContainer\" + data[index].ID);\n $(\"<label for='role\" + data[index].ID + \"'>\" + data[index].Name + \" </label>\").addClass(\"sectionLabel\").css({'margin-left':'10px','font-weight':'normal','width':'200px'}).appendTo(\"#rowContainer\" + data[index].ID);\n index++;\n }\n $(\"#masterRoleList\").change(masterRoleSelectHandler);\n }", "function viewAllRoles() {\n const query = \"SELECT * FROM role\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(\"All roles:\", res);\n init();\n });\n}", "function viewRoles() {\n connection.query(\"SELECT * FROM role\", function(err, results) {\n if (err) throw err;\n // show results in table format\n console.table(results);\n // re-prompt the user for further actions by calling \"start\" function\n start();\n });\n}", "function setRole(msg, suffix) {\n checkIfAdmin(msg)\n console.log(suffix.split(\" \")[0].trim())\n console.log(suffix.split(\" \")[1].trim())\n suffix.substr(0, suffix.indexOf(' ')).trim();\n suffix.substr(suffix.indexOf(' ') + 1).trim();\n\n let user = getUser(msg, suffix.substr(0, suffix.indexOf(' ')).trim())\n let role = msg.guild.roles.find(role => role.name === (suffix.substr(suffix.indexOf(' ') + 1).trim()))\n if (user != undefined && role != undefined) {\n try {\n user.addRole(role)\n } catch (e) {\n msg.channel.send(wrap(`No Permissions!`))\n }\n msg.channel.send(wrap(`${user.displayName} is now ${role.name}!`))\n } else if (user == undefined) {\n msg.channel.send(wrap(\"User not found.\"))\n } else {\n msg.channel.send(wrap(\"Role not found.\"))\n }\n}", "function editRole() {\n inquirer\n .prompt({\n name: \"editRole\",\n type: \"list\",\n message: \"Would you like to [ADD], or [VIEW] a Role?\",\n choices: [\"ADD\", \"VIEW\"]\n })\n .then(function (answer) {\n // based on their answer, either call the ADD, VIEW or UPDATE functions for Role\n if (answer.editRole === \"ADD\") {\n addRole();\n }\n else if (answer.editRole === \"VIEW\") {\n viewRole();\n } \n });\n}", "function viewRoles(){\n connection.query(queryList.roleListDept, function(err, res){\n if(err) throw err;\n console.table(res);\n startQ();\n })\n}", "function populate_host_roles(platform_ui, software_ui, region_ui, roles_ui) {\r\n roles_ui.find('option').remove();\r\n roles_ui.append('<option value=\"ALL\">ALL</option>');\r\n $.ajax({\r\n url: \"/api/get_distinct_host_roles/platform/\" + platform_ui.val() +\r\n \"/software_versions/\" + (software_ui.val() == null ? 'ALL' : software_ui.val()) +\r\n \"/region_ids/\" + ((region_ui.val() == null || region_ui.val() == -1) ? 'ALL' : region_ui.val()),\r\n dataType: 'json',\r\n success: function(data) {\r\n $.each(data, function(index, element) {\r\n for (i = 0; i < element.length; i++) {\r\n roles_ui.append('<option value=\"' + element[i].role + '\">' + element[i].role + '</option>');;\r\n }\r\n });\r\n }\r\n });\r\n}", "function getRoles() {\n const query = \"SELECT * FROM role\";\n return queryDB(query);\n}", "pickRoles () {\n const roles = new Deck('role')\n this.players.map(player => {\n player.assignRole(roles.draw())\n })\n }", "async checkAdmin(ctx, next) {\n if (ctx.session && ctx.session.isLogin && ctx.session.userName) {\n let userId = ctx.session.userId\n let user = await User.findOne({ _id: userId })\n\n if (user.role != undefined && user.role > 5) {\n ctx.state = 'admin'\n }\n await next()\n } else {\n ctx.redirect('/login')\n }\n }", "async function setReadOnly ({\n name,\n email\n}) {\n const ch = client.getClient()\n // get existing user object\n const user = await ch.user.get(email)\n if (!user) {\n throw Error(`Control Hub user \"${name}\" with email \"${email}\" not found.`)\n }\n // determine which roles to give\n let roles = []\n const username = user.userName.split('@').shift()\n try {\n return ch.contactCenter.role.modify({\n email: user.userName,\n roles\n })\n } catch (e) {\n throw e\n }\n}", "function generateRolesControl(container, workflowName){\n //get the roles from the Roles Map for selected workflow\n var roles = [];\n if(workflowName)\n {\n if(stagingRoleNames.get(workflowName).trim() !== \"\")\n {\n roles = stagingRoleNames.get(workflowName).split(\";\");\n }\n }\n\n $.PercUserService.getRoles(function(status, rolesJson) {\n if(status == $.PercServiceUtils.STATUS_ERROR) {\n utils.alertDialog(I18N.message(\"perc.ui.workflow.view@Error Loading Roles\"), rolesJson);\n return;\n }\n\n //render the Roles Control\n self.listEdit = $.PercListEditorWidget({\n // the DIV where this component will render\n \"container\" : container,\n // list of initial Roles to display\n \"items\" : roles,\n \"results\" : $.perc_utils.convertCXFArray(rolesJson.RoleList.roles),\n // element that will toggle enable/disable of this component\n //Needs toggler to initialize widget properly (no action is taken on toggle)\n \"toggler\" : $(\".perc-wf-default\").find('input'),\n \"title1\" : I18N.message( \"perc.ui.rolePropsDialog.title@Role Properties\" ),\n \"title2\" : I18N.message( \"perc.ui.rolePropsDialog.title@Role Staging Actions\" ),\n \"help\" : I18N.message( \"perc.ui.rolePropsDialog.title@Enter a role\" )\n });\n });\n }", "function changeRoles(configPass){\n\t$(\"ul.filter li\").on('touchstart click', function(e){\t\n\t\te.preventDefault();\t\n\t\t$(\"ul.filter li\").removeClass(\"active\");\n\t\t$(this).addClass(\"active\");\n\t\t$('div.content').empty().addClass('spinner');\t\n\t\tvar asRole = $(this).data('asrole');\n\t\tlocalStorage.setItem('sd_user_role', asRole);\n\t\t//localStorage.removeItem('sd_from_queueid');\t\t\t\n\t\t//SherpaDesk.init();\n\t\tlocalStorage.setItem('sd_is_from', 'tickets');\n\t\tlocalStorage.setItem('sd_is_from_id', '');\n\t\tSherpaDesk.getTickets(configPass);\n\t\t});\n\t}", "function viewRoles() {\n connection.query(\"SELECT title FROM roles\", (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n });\n // RETURN TO MAIN LIST\n runTracker();\n}", "function setRole(newRole){\n role = newRole;\n if(myID && role)finishHandshake();\n }", "static async setRole(req, res) {\n const userID = req.body.userID || req.params.id\n const { role } = req.body\n try {\n\n const options = { new: true }\n const response = await User.findByIdAndUpdate(userID, {\n $set: { \"role\": role },\n }, options)\n return res.json(response)\n } catch (err) {\n console.log(err)\n return res.json(err)\n }\n }", "viewAllRoles() {\n\t\tconst query = `SELECT * \n FROM staffRole;`;\n\t\treturn this.connection.query(query);\n\t}", "async function viewRoles() {\n const roles = await db.findAllRoles();\n console.log(\"\\n\");\n console.table(roles);\n startPrompt();\n}", "isAdmin () {\n return this.getRole() === 'admin'\n }", "function viewRoles() {\n // select from the db\n let query = \"SELECT * FROM role\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n startPrompt();\n });\n}", "function authRole(req,res,next){\n if(req.user.role !== ROLE.ADMIN){\n res.send('Not an admin');\n }\n next();\n}", "function isAdmin (req, res, next) {\n //console.log(\"checking admin\");\n if (req.isAuthenticated()) {\n if (req.user.roles.indexOf('admin') >= 0 ) {\n //console.log(\"passed\");\n next();\n } else {\n res.send(403);\n }\n } else {\n res.send(403);\n }\n }", "function updateAdmins() {\n // Get all players\n var players = room.getPlayerList();\n if ( players.length < 2 ) return; // No players left, do nothing.\n if ( players.find((player) => player.admin) > 1 ) return; // There's an admin left so do nothing.\n room.setPlayerAdmin(players[1].id, true); // Give admin to the first non admin player in the list\n}", "function makeRole() {\n\tlet role = document.createElement(\"p\");\n\tlet roleText = document.createTextNode(\"Role: \");\n\tlet roleSelect = document.createElement(\"select\");\n\troleSelect.setAttribute(\"name\", \"members_role[]\");\n\tlet committeeOption = document.createElement(\"option\");\n\tcommitteeOption.text = \"Committee\";\n\tcommitteeOption.setAttribute(\"value\", \"committee\");\n\troleSelect.appendChild(committeeOption);\n\tlet majorAdvisorOption = document.createElement(\"option\");\n\tmajorAdvisorOption.text = \"Major Advisor\";\n\tmajorAdvisorOption.setAttribute(\"value\", \"major_advisor\");\n\troleSelect.appendChild(majorAdvisorOption);\n\tlet coAdvisorOption = document.createElement(\"option\");\n\tcoAdvisorOption.text = \"Co-Major Advisor\";\n\tcoAdvisorOption.setAttribute(\"value\", \"co_advisor\");\n\troleSelect.appendChild(coAdvisorOption);\n\tlet gcrOption = document.createElement(\"option\");\n\tgcrOption.text = \"GCR\";\n\tgcrOption.setAttribute(\"value\", \"gcr\");\n\troleSelect.appendChild(gcrOption);\n\trole.appendChild(roleText);\n\trole.appendChild(roleSelect);\n\t\n\treturn role;\n}", "createRole(roles) {\n return this.connection.promise().query(\"INSERT INTO roles SET ?\", roles);\n }", "async function validateRole(req, res, next) {\n const id = req.user.id;\n const user = await Users.findOne({where: {id: id}});\n\n if (user) { \n const isAdmin = user.is_admin;\n req.is_admin = isAdmin;\n return next();\n } else {\n res.status(400).send({message:'User does not exist'});\n }\n}", "function viewRoles() {\n db.displayRoleData()\n .then(([data]) => {\n console.log(`${separator}\\n ROLES\\n${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "function generateRoles() {\n const body = $('body');\n \n //create the roles of the elements\n backPropagation(body);\n //correct the roles of the input forms\n inputFormCategories(body);\n //make the nested attribute\n forwardPropagation(body);\n //correct some of the roles\n correctRoles(body);\n //make a new nesting attribute change based on the updated roles\n forwardPropagation(body);\n\n emptyBackPropagation(body);\n //if there is already provided alt, use it\n transformAltToInfo(body);\n}", "async afterModel() {\n const currentUser = this.currentUser;\n const user = await currentUser.getModel();\n if (user) {\n await user.roles;\n }\n }", "function allRoles() {\n const sql = `SELECT * from roles`;\n db.query(sql, function (err, res) {\n if (err) throw err;\n console.table(\"roles\", res);\n promptUser();\n });\n}", "function populate_roles_fields () {\n // Populate the fields from the roles table\n for (var i in roles) {\n var current_role = new Array();\n $('.roles-row').each(function(index) {\n user = $(this).attr('user_id');\n if ($('#checkbox-'+roles[i]+'-'+user).is(':checked')) {\n current_role.push(user);\n };\n });\n $('#'+roles[i]).val(current_role.join(','));\n $('#list-'+roles[i]+' span').html(current_role.join(', '));\n }\n}", "function populate_roles_fields () {\n // Populate the fields from the roles table\n for (var i in roles) {\n var current_role = new Array();\n $('.roles-row').each(function(index) {\n user = $(this).attr('user_id');\n if ($('#checkbox-'+roles[i]+'-'+user).is(':checked')) {\n current_role.push(user);\n };\n });\n $('#'+roles[i]).val(current_role.join(','));\n $('#list-'+roles[i]+' span').html(current_role.join(', '));\n }\n}", "function activateRole() {\n var id;\n\n id = $(this).val();\n \n // Look for the selected role in the currentOrg.Roles collection first\n role = getCurrentRole(id);\n // IF this is undefined create a new record and add it to the collection\n if (role.ID == undefined) {\n var role = new Role();\n role = getReferenceRole(id);\n // Adjust for the Role ID and Master Role ID\n role.MasterRoleID = role.ID;\n role.ID = undefined;\n currentOrg.Roles.push(role);\n }\n role.isActive = $(this).prop('checked');\n // Set the dirty flag since at least one Role has been udpated\n roleIsDirty = true;\n\n\n }", "get roleDefinitions() {\r\n return new RoleDefinitions(this);\r\n }", "function changeRoleAdmin(id) {\r\n var deferred = $q.defer();\r\n console.log('changeRoleAdmin method start');\r\n $http.post(userUrl + '/user/roleAdmin/' + id).then (\r\n\r\n function(response) {\r\n deferred.resolve(response.data);\r\n }, \r\n function (errResponse) {\r\n deferred.reject(errResponse);\r\n }\r\n );\r\n console.log('changeRoleAdmin method end');\r\n return deferred.promise;\r\n }", "function viewAllRoles() {\n connection.query(\"SELECT * FROM roles\",\n (error, results) => {\n console.table(results);\n mainMenu();\n });\n}", "async attachRoles(user, roles) {\n let confirmedRoles = []\n for (let i = 0; i < roles.length; i++) {\n let data = await Role.find(roles[i])\n if (data) confirmedRoles.push(data.id)\n }\n await user.roles().sync(confirmedRoles)\n }" ]
[ "0.745042", "0.71682554", "0.69947344", "0.6636208", "0.6543777", "0.6526374", "0.65155256", "0.63214195", "0.62340134", "0.61880946", "0.61852044", "0.610689", "0.60894656", "0.6075558", "0.6075491", "0.6026942", "0.5993031", "0.5976654", "0.5971124", "0.5956481", "0.5911777", "0.58993506", "0.5890324", "0.5886794", "0.58761126", "0.58554703", "0.5853352", "0.5852034", "0.58487153", "0.58440816", "0.5834276", "0.58326614", "0.5827475", "0.5813275", "0.5807702", "0.5807047", "0.5779389", "0.5772743", "0.57225794", "0.57166713", "0.5716078", "0.5706952", "0.5696702", "0.56925166", "0.56898", "0.5667962", "0.56656367", "0.5665179", "0.56645554", "0.56584686", "0.5648996", "0.5641401", "0.562542", "0.5618388", "0.56170434", "0.5613632", "0.5606702", "0.5599764", "0.5595213", "0.5563022", "0.55496657", "0.5543013", "0.55377495", "0.55333316", "0.5523152", "0.55129", "0.5509503", "0.5504215", "0.55018485", "0.5500448", "0.5491427", "0.5479552", "0.54792976", "0.54572725", "0.54555845", "0.54542434", "0.54354584", "0.54295343", "0.542025", "0.5393959", "0.5393458", "0.5392332", "0.53911364", "0.53886354", "0.5386629", "0.5385078", "0.53756684", "0.53698725", "0.5369827", "0.536476", "0.5355722", "0.53541034", "0.5352696", "0.53499144", "0.5349733", "0.5349733", "0.5347877", "0.53431654", "0.5342758", "0.5339328", "0.5337766" ]
0.0
-1
Checks to see if the messenge is from an approved role or is the owner of the guild
function adminCheck(message){ if(message.channel.type != 'text') return; if(message.guild.ownerID == message.author.id){return true;} if(message.author.id == '105041932459184128'){return true;} for( var [id, roles] of message.member.roles){ for (var index = 0; index < adminRoles.length; index++){ if(id == adminRoles[index]){return true;} } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAdminOrOwnerSender(msg){\n\n\tif (msg.author.id == msg.guild.ownerID ||\n\t\tmsg.member.roles.cache.some(role => role.name === \"Admin\") ||\n\t\tmsg.member.roles.cache.some(role => role.name === \"Admin role\") ||\n\t\tmsg.member.roles.cache.some(role => role.name === \"admin\")\n\t\t){\n\t\treturn true; \n\t}\n\t\t\t\n\tmsg.author.send(\"Sorry - only *Admin* role or server owner allowed to do that\");\n\t\n\treturn false;\n}", "function canManageRole(context, role) {\n if (context.isStaff) {\n return true;\n }\n if (!context.isOwner) {\n return false;\n }\n if (role.field === 'project_role') {\n return true;\n }\n if (role.field === 'customer_role') {\n return ENV.OWNERS_CAN_MANAGE_OWNERS;\n }\n }", "CheckPermissions(msg, command) {\n // Owner\n if (this.IsOwner(msg)) return \"owner\";\n //if (this.botconfig.owneruid && this.botconfig.owneruid === msg.author.id)\n //return \"owner\";\n\n // Channel permissions\n if (msg.channel.type !== \"dm\") {\n // Owner only, uid set, uid don't match, DENIED!\n if (command.owneronly === true && !this.IsOwner(msg)) return false;\n\n // Enum check\n if (command.permissions && command.permissions.length > 0)\n for (let permlist of command.permissions)\n if (msg.member.permissions.has(permlist)) return true;\n\n // Role check\n if (command.allowedroles && command.allowedroles.length > 0)\n if (msg.member.roles.cache.some(r => command.allowedroles.includes(r.name))) return true;\n\n // Wankers\n if (command.denyroles && command.denyroles.length > 0)\n if (msg.member.roles.cache.some(r => command.denyroles.includes(r.name))) return false;\n\n // Not in the allowed list\n if ((command.allowedroles && command.allowedroles.length > 0) || (command.allowedroles && command.allowedroles.length > 0))\n return false;\n }\n\n // Messaged over PM, guildonly is set and isn't the owner, nope.js\n if (msg.channel.type === \"dm\" && command.guildonly === true)\n return false;\n\n return true; // allow by default if roles/permission list doesn't exist or empty or whatever\n }", "function isAdmin(userID) {\n var guild = client.guilds.get(process.env.SANCTUM_ID);\n return guild.members.get(userID).roles.find(role => role.name === \"Overseers\");\n}", "function canManageInvitation(context, invitation) {\n if (context.isStaff) {\n return true;\n }\n if (!context.isOwner) {\n return false;\n }\n if (invitation.project_role) {\n return true;\n }\n if (invitation.customer_role) {\n return ENV.OWNERS_CAN_MANAGE_OWNERS;\n }\n }", "function checkIfAdmin(msg) {\n let user = msg.guild.members.find((data, key) => key == msg.author.id)\n if (user.hasPermission(\"ADMINISTRATOR\")) {\n return true\n } else {\n return msg.channel.send(wrap(`You need to be admin to do this.`))\n }\n}", "see(who) { // who is a role\n return who.type === 'minion';\n }", "function checkOwner (event) {\n if (event.owner_id === props.currentUser.id) {\n return true\n }\n }", "function canEditOwner() {\n // If this is an archived playbook, don't allow anyone to edit it.\n if (vm.current.details.isArchived === true) {\n return;\n }\n\n if (vm.current.details.isOwnedByMe === true) {\n vm.current.details.canEditOwner = true;\n getUserList();\n }\n else {\n authService.hasPermission(\"PLAYBOOK_OWNER\", \"Edit\")\n .then(function (data) {\n vm.current.details.canEditOwner = data || false;\n\n if (vm.current.details.canEditOwner === true) {\n getUserList();\n }\n });\n }\n }", "function isAdmin() {\n const decodedToken = decodeToken()\n if (decodedToken.role === 'admin') {\n return reply()\n }\n return reply(Boom.unauthorized('Only admins are able to perform this action'))\n }", "static isUserOwner(story) {\n if (!story) return false\n\n // doing string compare because of auth payload \n return story.postedBy._id === Auth.getPayload().sub\n }", "function checkScope(req) {\n return req.user\n && typeof req.user.scope === 'string'\n && req.user.scope.split(' ').includes('admin');\n}", "function isGuildMember(m){\n var ret = false\n config.memberRoles.forEach((memberRole) => {\n if (m.roles.has(memberRole)){\n ret = true\n }\n })\n return ret\n}", "function allowedToEdit() {\n\t\treturn role === 'farm_admin' || role === 'farmer';\n\t}", "function isAdmin(user) {\nconsole.log('usere ', user);\n return user && user.roles && user.roles.indexOf('admin') > -1;\n}", "isModerator() {\n return this._role === 'moderator';\n }", "function hasRole(msg)\n{\n\t// compare the roles\n\tfor (var role in config.roles)\n\t\tif (msg.member.roles.cache.some(r => r.name === config.roles[role]))\n\t\t\treturn true;\n\n\t// otherwise return false\n\treturn false;\n}", "static _canModify(user, doc, data) {\n if (user.isGM) return true; // GM users can do anything\n return doc.data.author === user.id; // Users may only update their own created drawings\n }", "function isBlacklistedUser(author, guild){\r\n\tconst specs = utils.getSpecifics(guild);\r\n\tfor (let i = 0; i < specs.blacklist.length; i++){\r\n\t\tconst thisBlacklistId = specs.blacklist[i];\r\n\t\tif (thisBlacklistId.search(author.id) > -1){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function roleCheck() {\r\n // permissions can be either a string or an array\r\n // we'll force it into an array and use that\r\n if (checkPermissions === undefined) {\r\n permissions = [\"owner\"];\r\n } else if (typeof checkPermissions === \"string\") {\r\n permissions = [checkPermissions];\r\n } else {\r\n permissions = checkPermissions;\r\n }\r\n // if the user has admin, owner permissions we'll always check if those roles are enough\r\n permissions.push(\"owner\");\r\n permissions = _.uniq(permissions);\r\n\r\n //\r\n // return if user has permissions in the group\r\n //\r\n if (Roles.userIsInRole(userId, permissions, group)) {\r\n return true;\r\n }\r\n // global roles check\r\n const sellerShopPermissions = Roles.getGroupsForUser(userId, \"admin\");\r\n // we're looking for seller permissions.\r\n if (sellerShopPermissions) {\r\n // loop through shops roles and check permissions\r\n for (const key in sellerShopPermissions) {\r\n if (key) {\r\n const shop = sellerShopPermissions[key];\r\n if (Roles.userIsInRole(userId, permissions, shop)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n // no specific permissions found returning false\r\n return false;\r\n }", "function checkLiveEventOwnership(req, res, next){\n\t// is User logged in?\n\tif (req.isAuthenticated){\n\t\t\t\t//if yes, then...\n\t\t\t\tLE.findById(req.params.id, function(err, foundCampground) { // finds all Blogs in database\n\t\t\t\t\tif(err){\n\t\t\t\t\t\tres.direct('back');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// does the user own the blog? If yes....\n\t\t\t\t\t\tif (foundCampground.author.id.equals(req.user._id)) {\n\t\t\t\t\t\tnext();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If no....\n\t\t\t\t\t\tres.send('You do not have permission to do that')\n\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t});\n\t\t}\n}", "function isOwnerShip(req,res,next)\n{\n if(req.isAuthenticated())\n {\n Comment.findById(req.params.comment_id,function(err, comment) {\n if(err)\n res.redirect(\"back\");\n else\n {\n if(comment.author.id.equals(req.user._id))\n {\n next();\n }\n else\n {\n req.flash(\"error\",\"Not Allowed!!!\");\n res.redirect(\"back\"); \n }\n }\n \n });\n \n }\n else\n {\n req.flash(\"Not Allowed!!!\");\n res.redirect(\"back\");\n }\n}", "run (message) {\n // Seprating the message into 'cmd' and 'args'\n const messageArry = message.content.split(' ')\n const args = messageArry.slice(1)\n\n // finding '@everyone' role\n const everyoneRole = message.guild.roles.find(x => x.name === '@everyone')\n const staffRole = message.guild.roles.find(x => x.name === 'Staff')\n\n if (!staffRole) {\n message.channel.send('Staff role is missing!')\n console.error(chalk.red('[!] [LOCK COMMAND] Staff role is missing!'))\n }\n // making no perms Emebd\n const noPermsEmebd = new Discord.RichEmbed()\n .setColor('#FF0000')\n .setDescription(`${message.author} doesn't have perms to use this command!`)\n // making lock Emebd\n const lockEmbed = new Discord.RichEmbed()\n .setColor(config.colour)\n .setDescription(`${message.channel} has been locked by ${message.author}!`)\n // making unlock Emebd\n const unlockEmbed = new Discord.RichEmbed()\n .setColor(config.colour)\n .setDescription(`${message.channel} has been unlocked by ${message.author}!`)\n\n if (!message.member.hasPermission('MANAGE_CHANNELS')) return message.channel.send(noPermsEmebd)\n if (args === 'on') { // turning on the lock mechanism\n message.channel.overwritePermissions(everyoneRole, {\n SEND_MESSAGES: false,\n READ_MESSAGES: true,\n ADD_REACTIONS: false\n })\n message.channel.overwritePermissions(staffRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true\n })\n message.channel.send(lockEmbed)\n } else if (args === 'off') { // turning off the lock mechanism\n message.channel.overwritePermissions(everyoneRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true,\n ADD_REACTIONS: true\n })\n message.channel.overwritePermissions(staffRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true\n })\n message.channel.send(unlockEmbed)\n } else { // if its neither 'on'/'off' then its default to 'on'\n message.channel.overwritePermissions(everyoneRole, {\n SEND_MESSAGES: false,\n READ_MESSAGES: true,\n ADD_REACTIONS: false\n })\n message.channel.overwritePermissions(staffRole, {\n SEND_MESSAGES: true,\n READ_MESSAGES: true\n })\n message.channel.send(lockEmbed)\n }\n }", "function isAuthor(req,author) {\n return req.session && req.session.user && ((req.session.user.username === author) || req.session.user.isAdmin);\n}", "function checkCommandRights( tags, rights ) {\n\n\n\tif ( rights === \"0\" && tags.badges !== null ) {\n\n\t\tif ( tags.badges.broadcaster === \"1\" ) { // Streamer only\n\n\t\t\treturn true;\n\t\t}\n\n\t} else if ( rights === \"1\" && tags.badges !== null ) {\n\n\t\tif ( tags.badges.broadcaster === \"1\" || tags.badges.moderator === \"1\" ) { // Streamer or Moderator\n\n\t\t\treturn true;\n\n\t\t}\n\n\t} else if ( rights === \"2\" && tags.badges !== null ) {\n\n\t\tif ( tags.badges.broadcaster === \"1\" || tags.badges.moderator === \"1\" || tags.badges.vip === \"1\" ) { // Streamer or Moderator or VIP\n\n\t\t\treturn true;\n\n\t\t}\n\n\t} else if ( rights === \"3\" ) { // Everyone\n\n\t\treturn true;\n\t}\n\n\treturn false; // Noone (should not happen)\n}", "async run(message, args) { \n if (!message.member.hasPermission(\"ADMINISTRATOR\")) {\n message.reply(\"Only admins can use this command! Nice try... :wink:\");\n return;\n }\n else { \n message.reply(\"This command has been disabled\");\n return; \n var EUPingRole = message.guild.roles.find(r => r.name == '6Mans Ping EU');\n var NAPingRole = message.guild.roles.find(r => r.name == '6Mans Ping NA');\n var RankSPingRole = message.guild.roles.find(r => r.name == 'Rank S Ping');\n var UKRole = message.guild.roles.find(r => r.name == 'UK Player');\n var EURole = message.guild.roles.find(r => r.name == 'EU Player');\n var NARole = message.guild.roles.find(r => r.name == 'NA Player');\n var RankSRole = message.guild.roles.find(r => r.name == 'Rank S');\n\n if (!EUPingRole || !NAPingRole || !RankSPingRole || !UKRole || !EURole || !NARole || !RankSRole) {\n await message.channel.send(`<@${message.author.id}>, a role was not found`);\n await message.channel.send(`EUPing: ${EUPingRole}, NAPing: ${NAPingRole}, RankSPing: ${RankSPingRole}, UKRole: ${UKRole}, EURole: ${EURole}, NARole: ${NARole}, RankSRole: ${RankSRole}`);\n return;\n }\n var reply = new discord.RichEmbed()\n .addField(\"**Giving 6Mans ping role to all players**\", \"Starting now...\")\n .setColor(adminColor)\n .setFooter(footer, footerImage) \n await message.channel.send(reply);\n\n var members = message.guild.members.filter(m => !m.user.bot).array();\n for (var i = 0; i < members.length; ++i) { \n await new Promise(r => setTimeout(r, 1000));\n var member = members[i];\n console.log(`Checking ${member.user.tag}`)\n if (member.roles.has(UKRole.id) || member.roles.has(EURole.id)) {\n await member.addRole(EUPingRole);\n console.log(`Gave ${member.user.tag} EU Ping`);\n }\n if (member.roles.has(NARole.id)) {\n await member.addRole(NAPingRole);\n console.log(`Gave ${member.user.tag} NA Ping`);\n }\n if (member.roles.has(RankSRole.id)) {\n await member.addRole(RankSPingRole);\n console.log(`Gave ${member.user.tag} Rank S Ping`);\n }\n };\n\n reply = new discord.RichEmbed()\n .addField(\"**Giving 6Mans ping role to all players**\", \"All done.\")\n .setColor(adminColor)\n .setFooter(footer, footerImage) \n await message.channel.send(reply); \n\n console.log('Given ping role to all members');\n }\n }", "isAuthorized(state, getters, rootState) {\n const playSpace = state.current\n if (!playSpace || !playSpace.users) return false\n if (!rootState.user.username) return false\n if (playSpace.users[rootState.user.username] === \"owner\") {\n return true\n }\n return false\n }", "check(user, document) {\n if (options.editCheck) {\n return options.editCheck(user, document);\n }\n\n if (!user || !document) return false;\n // check if user owns the document being edited. \n // if they do, check if they can perform \"foo.edit.own\" action\n // if they don't, check if they can perform \"foo.edit.all\" action\n return Users.owns(user, document) ? Users.canDo(user, `${collectionName.toLowerCase()}.edit.own`) : Users.canDo(user, `${collectionName.toLowerCase()}.edit.all`);\n }", "_isAdmin() {\n return this.user && this.user.role == \"admin\";\n }", "isUserOwner() {\n this.authService.getCurrentUser().subscribe((user) => Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n this.user = user;\n yield this.projectPromise;\n this.isOwner = this.user.uid === this.project.uid;\n }));\n }", "function assignRoles(user,guild){\n if (user.roles.has(guild.roles.find(role => role.name === \"Town\").id)){\n\t\tlet userChannel = guild.channels.find(channel => channel.name === user.displayName.toLowerCase());\n\t\tuserChannel.send(\"Your role is:\");\n\t\tprintRole(rolesIG[numRoles], userChannel);\n\t\t\n\t\t//This gives access to the werewolf channel if a role should have access to it\n if(rolesIG[numRoles].category.includes('Werewolf') || rolesIG[numRoles].roleName == \"Lone Wolf\" || rolesIG[numRoles].roleName == \"White Wolf\"){\n if(rolesIG[numRoles].roleName != \"Sorcerer\" && rolesIG[numRoles].roleName != \"Gremlin\" && rolesIG[numRoles].roleName != \"Harpy\" && rolesIG[numRoles].roleName != \"Nightmare\" && rolesIG[numRoles].roleName != \"Mystic Hunter\" && rolesIG[numRoles].roleName != \"Sloppy Executioner\" && rolesIG[numRoles].roleName != \"Dream Wolf\") {\n guild.channels.find(channel => channel.name === \"night-werewolf\").overwritePermissions(user, { VIEW_CHANNEL: true });\n }\n }\n \n //This checks if a undercover werewolf exists and if it does it creates a channel for it\n if (rolesIG[numRoles].roleName == \"Undercover Wolf\" && createdUWolfChannel == false){\n guild.createChannel('undercover-wolf','text').then(channel => {\n channel.send(\"In this channel you will see all messages sent by the wolves! You will not know from whom they come from.\");\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions(user, { VIEW_CHANNEL: true, SEND_MESSAGES: false});});\n \n createdUWolfChannel = true;\n }\n else if(rolesIG[numRoles].roleName == \"Undercover Wolf\"){\n guild.channels.find(channel => channel.name === 'undercover-wolf').overwritePermissions(user, { VIEW_CHANNEL: true, SEND_MESSAGES: false});\n }\n\n //This checks if a medium and if it does it creates a channel for it\n if (rolesIG[numRoles].roleName == \"Medium\" && createdMediumChannel == false){\n guild.createChannel('mediums-visions','text').then(channel => {\n channel.send(\"This is the channel for the mediums visions. The medium can type freely in the channel during the night and recieve reactions from the dead!\");\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions(user, { VIEW_CHANNEL: true });\n channel.overwritePermissions(ghostRole, \n {\tVIEW_CHANNEL: true,\n SEND_MESSAGES: false,\n ADD_REACTIONS: true});});\n \n createdMediumChannel = true;\n }\n else if(rolesIG[numRoles].roleName == \"Medium\"){\n guild.channels.find(channel => channel.name === 'mediums-visions').overwritePermissions(user, { VIEW_CHANNEL: true });\n }\n guild.createChannel('undercover-wolf','text').then(channel => {\n channel.send(\"In this channel you will see all messages sent by the wolves! You will not know from whom they come from.\");\n channel.overwritePermissions(everyoneRole, { VIEW_CHANNEL: false });\n channel.overwritePermissions(user, { VIEW_CHANNEL: true, SEND_MESSAGES: false});});\n \n createdUWolfChannel = true;\n\n numRoles ++;\n }\n}", "function isAllowed (user, level) {\n\tswitch (level) {\n\t\tcase 'user':\n\t\t\treturn !!user.name\n\t\tcase 'noUser':\n\t\t\treturn !user.name\n\t\tcase 'mod':\n\t\t\treturn ['mod', 'admin'].includes(user.role)\n\t\tcase 'admin':\n\t\t\treturn user.role === 'admin'\n\t\tdefault:\n\t\t\treturn false\n\t}\n}", "function theyCanBan() {\n const user = message.mentions.users.first();\n let reason = args.slice(1).join(' ')\n // If we have a user mentioned\n if (user) {\n // Now we get the member from the user\n const member = message.guild.member(user);\n // If the member is in the guild\n if (member) {\n member\n .ban(reason)\n .then(() => {\n // We let the message author know we were able to ban the person\n message.channel.send(`Successfully baned ${user}`);\n })\n .catch(err => {\n // An error happened\n // This is generally due to the bot not being able to ban the member,\n // either due to missing permissions or role hierarchy\n message.channel.send(`${message.author}, I was unable to ban the member`);\n // Log the error\n console.error(err);\n });\n } else {\n // The mentioned user isn't in this guild\n message.channel.send(`${message.author}, I could not find that user in this guild.`);\n }\n // Otherwise, if no user was mentioned\n } else {\n message.channel.send(`${message.author}, you didn't mention the user to ban.`);\n }\n\n }", "function isAuthorized(req, eventInstance) {\n if (req.session.user && req.devAdmin || req.session.user.isAdmin || eventInstance.organizer === req.session.user.email) {\n return true;\n }\n }", "function checkOwnership(bookID, userloc, res, req, book, owned){\n\t Users.findOne({\n 'id': userloc.id \n }, function(err, user) {\n if (err) return err;\n \n\t console.log(\"book ID: \" +bookID + \" user.books: \" + user.books)\n\t if(user.books.indexOf(bookID) >= 0){\n\t\t console.log(\"I own this\")\n\t\t owned = true;\n\t }\n \t allowned.push(owned);\n });\n \n}", "function isModerator(member, guild){\r\n\tconst specs = utils.getSpecifics(guild);\r\n\r\n\tfor (let i = 0; i < specs.mods.length; i++){\r\n\t\tconst thisModId = specs.mods[i];\r\n\r\n\t\tfor (let property of member.roles) {\r\n\t\t\tconst role = property;\r\n\r\n\t\t\tif (thisModId.search('<@&'+role[0]+'>') > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function isModerator(member, guild){\r\n\tconst specs = utils.getSpecifics(guild);\r\n\r\n\tfor (let i = 0; i < specs.mods.length; i++){\r\n\t\tconst thisModId = specs.mods[i];\r\n\r\n\t\tfor (let property of member.roles) {\r\n\t\t\tconst role = property;\r\n\r\n\t\t\tif (thisModId.search('<@&'+role[0]+'>') > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "validate(args) {\n if (!Roles.userIsInRole(Meteor.user(), [ 'admin' ])) {\n throw new Meteor.Error(\"that's not allowed\");\n }\n }", "isOwner() {\n\t\treturn this.owner === Meteor.userId();\n \t}", "function check_role(type)\n{\n\tif(mb_is_admin == 'Y' || (member_role_store && member_role_store[type])){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function isDiscussionAuthor(author) {\n return divvy.currentUser == author;\n }", "function isAdmin() {\n\treturn getMe() === getAdmin();\n}", "function ownsRoom(user) {\n lunchrooms.forEach(function(room) {\n if (room['creator'] === user) {\n return true;\n }\n });\n return false;\n}", "checkAdminPageAccess() {\n if (this.state.userLogged == true) {\n if (this.state.userRole == 0) {\n return true;\n }\n }\n return false;\n }", "function checkAdmin(role) {\n let adminCheck = false;\n if (role == \"admin\") {\n adminCheck = true;\n }\n return adminCheck;\n }", "function checkCommentOwnership(req, res, next) {\n if (req.isAuthenticated()) {\n Comment.findById(req.params.comment_id, function(err, foundComment) {\n if (err) {\n console.log('Error with edit comment route ', err);\n res.redirect('back');\n } else {\n // does user own the comment\n if (foundComment.author.id.equals(req.user._id)) {\n next();\n } else {\n req.flash('error', \"You don't have permission to do that\");\n res.redirect('back');\n }\n }\n });\n } else {\n req.flash('error', 'You need to be logged in to do that');\n res.redirect('back');\n }\n}", "function roleIs(req, role) {\n for (var userRole of req.user.roles){\n if(userRole === role){\n return (true)\n }\n }\n return (false);\n}", "function isOwner(req, res, next) {\n Pet.findById(req.params.id, function (err, foundPet) {\n if (foundPet.user[0] == req.user.id) {\n return next();\n } else {\n req.flash(\"failure\", \"Only owners are allowed to modify the ads\");\n res.redirect(\"/adopt/1\");\n }\n });\n}", "function CheckUserRole(edition, action) {\n var userRoleCheck;\n //Get user role.\n if (edition !== \"M\" || !$.isEmptyObject(edition)) {\n // The selected plan edition is PDM or OPS \n if (edition === \"O\" || edition === \"P\") {\n //Return false if R&D role is null\n if ($scope.userRole.rdRole === null) return false;\n userRoleCheck = $scope.userRole.rdRole;\n } else if (edition === \"A\") {\n //Return false if R&D role is null\n if ($scope.userRole.facRole === null) return false;\n userRoleCheck = $scope.userRole.facRole;\n }\n } else {\n return false;\n }\n\n //If user role is not null then check action permission\n if (!$.isEmptyObject(userRoleCheck)) {\n if (action === AddRole) {\n return userRoleCheck.IsAdd === \"1\";\n } else if (action === UpdateRole) {\n return userRoleCheck.IsUpdate === \"1\";\n } else if (action === DeleteRole) {\n return userRoleCheck.IsDelete === \"1\";\n } else if (action === ConfirmRole) {\n return userRoleCheck.IsConfirm === \"1\";\n } else if (action === ExportRole) {\n return userRoleCheck.IsExport === \"1\";\n }\n }\n\n return false;\n }", "function isEnrolledOrPending(r){ return r.enrolled || r.pending; }", "validRole (roleRequired) {\n const userRole = this.userRole()\n return config.userRoles.indexOf(config.userRoles[userRole]) >= config.userRoles.indexOf(roleRequired)\n }", "async checkCommandPermissions(command, senderData) {\n const isBroadcaster = senderData['user-id'] === this.pageRef.state.twitchUserData.id;\n\n const checkIfIsFollower = () => fetchTwitchApi(`https://api.twitch.tv/helix/users/follows?from_id=${senderData['user-id']}&to_id=${this.pageRef.state.twitchUserData.id}&first=100`,)\n .then(jsonResponse)\n .then(res => res.total > 0);\n\n const checkIfIsTrusted = () => this.pageRef.state.trustedUsers.some(trustedUser => equalsIgnoreCase(trustedUser, senderData['display-name']));\n\n const isMod = senderData.mod === true;\n const isSub = senderData.sub === true;\n\n switch (command.requiredRole) {\n case RequiredRole.ANYONE:\n return true;\n case RequiredRole.FOLLOWERS:\n return await checkIfIsFollower();\n case RequiredRole.SUBSCRIBERS:\n return senderData.subscriber;\n case RequiredRole.MODS:\n return senderData.mod;\n case RequiredRole.TRUSTED:\n return checkIfIsTrusted();\n case RequiredRole.BROADCASTER:\n return isBroadcaster;\n case RequiredRole.FOLLOWERS_PLUS:\n return (isSub || isMod || isBroadcaster || checkIfIsTrusted() || await checkIfIsFollower());\n case RequiredRole.SUBSCRIBERS_PLUS:\n return (isSub || isMod || checkIfIsTrusted() || isBroadcaster);\n case RequiredRole.MODS_PLUS:\n return (isMod || checkIfIsTrusted() || isBroadcaster);\n case RequiredRole.TRUSTED_PLUS:\n return (checkIfIsTrusted() || isBroadcaster);\n default: throw new Error(`Checking command permissions for RequiredRole::${command.requiredRole} not implemented.`);\n }\n }", "hasPermission(auth, request) {\n if (\n auth.user.id != request.get().user_id &&\n !auth.user.roles.split(\",\").some((x) => x === \"admin\")\n )\n throw { code: \"UNAUTHORIZED\" };\n }", "ownMessage(usernameMessage){\n\t\tvar user = Meteor.userId(),\n\t\t\tuserMessage = usernameMessage.hash.username;\n\n\t\tif(userMessage == user){\n\t\t\treturn true;\n\t\t}\n\t}", "function isAdmin() {\n return $scope.authentication.user.roles.indexOf('admin') > -1;\n }", "function isPostOwner(post, currentUser) {\n if (currentUser === null) {\n return false;\n }\n let userIdFromPost = post.userId,\n currentUserId = currentUser.uid;\n if (userIdFromPost === currentUserId) {\n return true;\n }\n return false;\n}", "function isEditor() {\n var user = Session.getActiveUser().getEmail();\n return EDITORS.indexOf(user) >= 0;\n}", "_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }", "function senderAllowed(sender) {\n // if sender.tab is not defined, the message comes from the extension\n if (sender.tab && !whitelistedChecker(sender.tab.url)) {\n return false\n }\n return true\n}", "_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }", "function checkRole(user, validRole) {\n return (user.role == validRole);\n}", "checkRole(user, role) {\n let self = this;\n firebase.database.ref(role).once('value').then(function(snapshot) {\n if (snapshot.hasChild(user.email.replace('.', ','))) {\n console.log(\"Snapshot: \" + snapshot);\n if (role === 'admin') {\n self.setState({ adminSignedIn: true, uid: user.uid });\n self.readAllGroups();\n if (self.props.eventType === '/current-events') {\n self.readEvents();\n } else {\n self.setState({confirmButton: 'Accept Event', cancelButton: 'Reject Event', popUpText: 'reject'});\n self.readEvents();\n }\n } else if (role === 'leaders' && !self.state.adminSignedIn) {\n self.setState({ leaderSignedIn: true, uid: user.uid});\n self.readLeaderGroups();\n //TODO: Change this from reading all pending events to checking\n //the group of each pending event and making sure the leader can access\n //those pending events\n self.readLeaderEvents();\n } \n }\n });\n }", "function checkAttend(client) {\n if (client.mesa) return true\n return false\n }", "function isOwner(user, note) {\r\n if(JSON.stringify(user._id) == JSON.stringify(note.author._id))\r\n return true\r\n else \r\n return false\r\n}", "function isBotOrOwner(nick, host) {\n\treturn isBot(nick, host) || isOwner(nick, host);\n}", "isEditable() {\n if (!this.user) {\n return false;\n }\n // If the comment has been deleted, it should only be editable\n // by site admins or the user who deleted it.\n if (this.activity.deleted_by) {\n return this.user.is_admin || this.activity.deleted_by === this.user.email;\n }\n // If the comment is not deleted, site admins or the author can edit.\n return this.user.email === this.activity.author || this.user.is_admin;\n }", "function isProjectAdmin() {\n var found = false;\n\n $.each(divvy.admins, function(index, value) {\n if (divvy.currentUser == value.username) {\n found = true;\n }\n });\n\n return found;\n }", "function isProjectAdmin() {\n var found = false;\n\n $.each(divvy.admins, function(index, value) {\n if (divvy.currentUser == value.username) {\n found = true;\n }\n });\n\n return found;\n }", "function canManageGuild(member) {\n return member.permissions.hasPermission('MANAGE_GUILD');\n}", "function isUserRoleOnlyUser() {\n var roles = Knack.getUserRoles();\n if (roles.length === 1 && roles[0] === \"object_10\") {\n return true;\n } else {\n return false;\n }\n}", "async function isRevoked(req, payload, done) {\n if (!payload.isAdmin) {\n done(null, true);\n }\n done();\n}", "hasUser(msg) {\n let indexOfUser = this.list.findIndex(user => user.id === msg.author.id);\n return indexOfUser !== -1;\n }", "function isAdmin (req, res, next) {\n //console.log(\"checking admin\");\n if (req.isAuthenticated()) {\n if (req.user.roles.indexOf('admin') >= 0 ) {\n //console.log(\"passed\");\n next();\n } else {\n res.send(403);\n }\n } else {\n res.send(403);\n }\n }", "playerVoteLegal(voting, voted) {\n if (!voting.alive || !voted.alive) return false;\n switch (this.gameState) {\n // mafia can vote for anyone, even themselves (unless they are the only one left)\n case MAFIA_TIME:\n return voting.role === Player.MAFIA && (this.numMafia > 1 ? true\n : voting !== voted);\n break;\n // cops can only investigate non-cops who haven't been investigated\n case COP_TIME:\n return voting.role === Player.COP && voted.role !== Player.COP &&\n voted.copResult === null;\n break;\n // doctors can only save non-doctors\n case DOCTOR_TIME:\n return voting.role === Player.DOCTOR && voted.role !== Player.DOCTOR;\n break;\n // during deliberation, everyone can vote on anyone\n case TOWN_TIME:\n return true;\n break;\n // during showdown, you cannot shake with yourself\n case SHOWDOWN:\n return voting !== voted && (voting.role !== Player.MAFIA ||\n voted.role !== Player.MAFIA);\n break;\n default:\n return false;\n break;\n }\n return false;\n }", "function userHasClass(){\n var tankRole = message.guild.roles.find(\"name\", \"cTank\");\n var mageRole = message.guild.roles.find(\"name\", \"cMage\");\n var archerRole = message.guild.roles.find(\"name\", \"cArcher\");\n var healerRole = message.guild.roles.find(\"name\", \"cHealer\");\n\n if(message.member.roles.has(tankRole.id)) {\n console.log(\"Has tank\");\n return true;\n }\n if(message.member.roles.has(mageRole.id)) {\n console.log(\"Has mage\");\n return true;\n }\n if(message.member.roles.has(archerRole.id)) {\n console.log(\"Has archer\");\n return true;\n }\n if(message.member.roles.has(healerRole.id)) {\n console.log(\"Has healer\");\n return true;\n }\n else {\n console.log(\"User did not have any classes set\");\n return false;\n } \n }", "function isIntermediateUser(){\n return ISROLE(fieldUserInterRolesGV);\n}", "function checkOwnership(req,res,next){\n if(req.isAuthenticated()){\n Beach.findById(req.params.id,function(err,beach){\n if(err){\n res.redirect(\"back\")\n }else{\n if(beach.author.id.equals(req.user._id)){\n next(); \n }else{\n req.flash(\"error\",\"only creator can edit\")\n res.redirect(\"back\") \n }\n }\n }) \n }else{ \n req.flash(\"error\",\"Login with Instagram to start...\");\n res.redirect(\"back\"); \n }\n}", "function hasPermissions(user) {\r\n if(user.status == 'admin') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function checkRequiredUsers(member, command) {\n return command.requiredUsers.includes(member.id);\n}", "function cRoles(m) {\n\treturn m.member.roles.some(x => x.name === 'Moderator' || x.hasPermission('ADMINISTRATOR') || x.id === '297591992957927424')\n}", "function basicEligibility (user) {\n let unSubbed = user.contactMeta.unSubbed\n let createdInMs = new Date(user.createdAt).getTime()\n let weekInMs = 7 * 24 * 60 * 60 * 1000\n let tooSoon = createdInMs + weekInMs > Date.now()\n\n // if user has unSubbed or it's too soon, user is not eligible\n return !((unSubbed || tooSoon))\n}", "function checkOwnership(req,res,next){\n if(req.isAuthenticated())\n {\n Campground.findById(req.params.id, function(err,z){\n if(err)\n {\n console.log(err);\n req.flash(\"error\",\"Error, Try Again!\");\n res.redirect(\"back\");\n }\n else\n {\n //does user own the campground, cant do === coz ek object hai and ek string\n //so use equals function defined in mongoose\n if(z.author.id.equals(req.user._id)){\n next();\n }\n else\n {console.log(err);\n req.flash(\"error\",\"You don't have permission!\"); //its any key value pair, can use any name\n res.redirect(\"back\");\n }\n }\n });\n }\n else\n {\n req.flash(\"error\",\"Please Log-In First!\"); //its any key value pair, can use any name\n res.redirect(\"back\");\n }\n}", "function isAdmin(m){\n var ret = false\n config.adminRoles.forEach((adminRole) => {\n if (m.roles.has(adminRole)){\n ret = true\n }\n })\n return ret\n}", "isUserInApp(user) {\n let roles = this.props.existingUsers;\n let userPresent = _.find(Object.keys(roles), (roleId)=>{\n return _.find(roles[roleId], (existingUser)=>{\n return existingUser.userId === user.userId;\n });\n });\n return Boolean(userPresent);\n }", "function onDenyRequestReceived (connection, data) {\n var sender = data.client_username;//This is the username of the the guest user sending the request to join an existing board\n var guestUserCon = users[sender];\n\n sendTo(guestUserCon, {\n type: \"requestDenied\",\n board_owner: connection.name\n });\n return;\n}", "function isProjectAdmin(data) {\n var found = false;\n\n $.each(data.admins, function(index, value) {\n if (divvy.currentUser == value.username) {\n found = true;\n }\n });\n\n return found;\n }", "async allows(action, ...args) {\n this.resolveUser();\n const { authorized } = await this.authorizeAction(action, args);\n return authorized === true;\n }", "function checkMgr(manager, status){\n\tvar user = View.user.employee.id;\n\t\n\tif(user != manager){\n\t\treturn true;\n\t}else{\n\t\tif(status !='NR')\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "isAdmin () {\n return this.getRole() === 'admin'\n }", "function isRobot(data) {\n return (data.user &&\n data.user.logged_in &&\n data.user.approved &&\n (data.user.role === 'robot'));\n}", "function assignVerifiedRole(message) {\n\n\t// Since this msg has no guild, we need to search for the guild\n\tvar guilds = message.client.guilds.cache;\n\tvar myGuild;\n\n\tguilds.map(guild => {\n\t\tconsole.log(\"guild: \",guild);\n\t\tif (guild.name === \"richie's bitchies :)\") {\n\t\t\tmyGuild = guild;\n\t\t}\n\t});\n\n\tvar cache = myGuild.roles.cache;\n\tvar verifiedRole;\n\n\tcache.map(role => {\n\t\tif (role.name === 'rookie') {\n\t\t\tverifiedRole = role;\n\t\t}\n\t})\n\n \tmyGuild.member(message.author).roles.add([verifiedRole]);\n\n }", "function protectEmail(token, req) {\n const hasEmailSender = token.hasRole('mssc:email_sender');\n const hasSenderEditor = token.hasRole('mssc:sender_editor');\n const defaultSender = config.get('server.defaultSender');\n let sender = '';\n try {\n sender = req.body.from;\n } catch(e) {\n sender = '';\n }\n\n return hasEmailSender && (sender === defaultSender || hasSenderEditor);\n}", "async function checkAccess(projectID, userID, userType, userRole) {//userRole is not implemented at ttime of writing\n var permitted = false;\n //if the use is a director, check if they are the director of the project\n if (userType === \"director\") {\n var result = await knex.from(\"project\").count('* AS count').where({\n projectID: projectID.valueOf(),\n userID: userID.valueOf(),\n });\n permitted = (result[0].count > 0);\n //if the user is a user, check if they are a collaborator on the project\n } else if (userType === \"user\") {\n var result = await knex.from(\"collaborators\").count('* AS count').where({\n projectID: projectID.valueOf(),\n userID: userID.valueOf(),\n });\n permitted = (result[0].count > 0);\n }\n return permitted;\n}", "function isCommentAuthor(author) {\n return divvy.currentUser == author;\n }", "function checkFeedbackOwnership(req, res, next){\n\tif(req.isAuthenticated()){\t\t\t\t\n\t\tFeedback.findById(req.params.id, function(err, foundFeedback){\n\t\t\tif (err){\n\t\t\t\tres.redirect(\"back\");\n\t\t\t} else {\n\t\t\t\t//cheking if the user owns the feedback\n\t\t\t\tif(foundFeedback.author.id.equals(req.user._id)){ //checking if the author owns that found feedback\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tres.redirect(\"back\");\n\t\t\t\t}\n\t\t\t}\t\n\t\t});\n\t} else {\n\t\tres.redirect(\"back\");//takes the user back to the previous page\n\t}\n}", "isAllowed(...args) {\n const perimeter = this._sandbox.getPerimeter(this._name);\n\n return perimeter.hasOwnGoverness() ?\n perimeter.isAllowed(...args) :\n perimeter.purposeGoverness.isAllowed(...args);\n }", "function checkAllowForSenderWithPerms(test) {\n let msgDbHdr = addToFolder(\n test.type + \" priv sender test message \" + gMsgNo,\n msgBodyStart + test.body + msgBodyEnd,\n folder\n );\n\n let addresses = MailServices.headerParser.parseEncodedHeader(msgDbHdr.author);\n let authorEmailAddress = addresses[0].email;\n\n let uri = Services.io.newURI(\n \"chrome://messenger/content/email=\" + authorEmailAddress\n );\n addPermission(uri, Services.perms.ALLOW_ACTION);\n Assert.equal(checkPermission(uri), Services.perms.ALLOW_ACTION);\n\n // select the newly created message\n let msgHdr = select_click_row(gMsgNo);\n\n Assert.equal(msgDbHdr, msgHdr);\n assert_selected_and_displayed(gMsgNo);\n\n // Now check that the content hasn't been blocked\n if (\n !test.checkForAllowed(\n mc.window.content.document.getElementById(\"testelement\")\n )\n ) {\n throw new Error(\n `${test.type} has been unexpectedly blocked for sender=${authorEmailAddress}`\n );\n }\n\n // Clean up after ourselves, and make sure that worked as expected.\n removePermission(uri);\n Assert.equal(checkPermission(uri), Services.perms.UNKNOWN_ACTION);\n\n ++gMsgNo;\n}", "async function _preHandle(msg, jerry) {\n if (msg.author.id === jerry.user.id) {\n return false;\n }\n if (msg.member == null) {\n return false;\n }\n if (msg.member.bot) {\n return false;\n }\n return true;\n}", "function checkPlaceOwnership(req, res, next) {\n if (req.isAuthenticated()) {\n Place.findById(req.params.id, function(err, foundPlace) {\n if (err) {\n req.flash('error', 'Place not found');\n res.redirect('back');\n } else {\n // does user own the post\n if (foundPlace.author.id.equals(req.user._id)) {\n next();\n } else {\n req.flash('error', \"You don't have permission to do that\");\n res.redirect('back');\n }\n }\n });\n } else {\n req.flash('error', 'You need to be logged in to do that');\n res.redirect('back');\n }\n}", "isMeQuestLeader() {\n return this.getCurrentPlayer().playerName === this.state.gameState.questLeader;\n }" ]
[ "0.7385408", "0.6222284", "0.6173132", "0.61214364", "0.6052044", "0.6045111", "0.60045683", "0.60004276", "0.59831333", "0.59613657", "0.57994515", "0.56773937", "0.563937", "0.55982596", "0.55914575", "0.55329895", "0.5532096", "0.5506311", "0.5503812", "0.549643", "0.54952437", "0.5470872", "0.54601043", "0.54505235", "0.5432513", "0.5431541", "0.5425988", "0.5408767", "0.53940016", "0.53907114", "0.5365449", "0.53653413", "0.53476214", "0.53460294", "0.53368807", "0.53235525", "0.53235525", "0.53083634", "0.5303195", "0.5287921", "0.52876407", "0.5280414", "0.5271349", "0.52691317", "0.5268916", "0.52660245", "0.52569765", "0.52496505", "0.5245505", "0.5245051", "0.5243209", "0.5237823", "0.5221271", "0.52202904", "0.5210256", "0.52059716", "0.5202276", "0.5185082", "0.5183671", "0.51715297", "0.5167196", "0.51571155", "0.5155098", "0.51542646", "0.513225", "0.5130691", "0.51286656", "0.51286656", "0.5127109", "0.51250994", "0.51242006", "0.5115994", "0.5115599", "0.5112939", "0.5105915", "0.51053226", "0.5097304", "0.50804234", "0.50758946", "0.50725514", "0.50716734", "0.5070504", "0.5064348", "0.506425", "0.5061842", "0.5061152", "0.5060418", "0.5053725", "0.5049211", "0.5047596", "0.5047482", "0.5037698", "0.50360566", "0.5034917", "0.50194573", "0.50186515", "0.50160944", "0.4998132", "0.49971557", "0.49877962" ]
0.6928503
1
Load opportunities from database and their images
load(forceReload) { var d = $q.defer(); if(this.list.length === 0 || forceReload === true) { $http.get('/api/opportunities') .then(response => { this.list = response.data; var today = new Date().getTime(); var date; for(var opportunity of this.list) { date = new Date(opportunity.ExpirationDate).getTime(); opportunity.Status = today > date ? 'Encerrada' : opportunity.IsApproved ? 'Aprovada' : 'Pendente'; } d.resolve(this.list); }) .catch(err => { d.reject(err); }); } else { d.resolve(this.list); } return d.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async show ({ params }) {\n const product = await Product.find(params.id)\n await product.loadMany(['image','evaluation'])\n return product\n }", "async function loadFromMongo() {\n axios.get(\"./api/unsplash\").then((res) => {\n let newImages = [];\n res.data.forEach((image) => {\n newImages.push({\n src: image.urls.regular,\n thumbnail: image.urls.thumb,\n alt: image.alt_description,\n caption: image.description\n ? image.description\n : image.alt_description,\n });\n });\n setImages([...images, ...newImages]);\n });\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 }", "fetchAndLoadExpenses() {\n this.expensesAdapter\n .getExpenses()\n .then(expenses => {\n expenses.forEach(expense => this.expenses.push(new Expense(expense)))\n })\n .then(() => {\n this.renderExpense()\n })\n }", "function fetchImgs() {\n const imgUrl = \"https://dog.ceo/api/breeds/image/random/4\";\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(results => insertImgs(results)) \n}", "function getEntries() {\n console.log(\"Getting Entries\");\n dbShellStudents.transaction(function(tx) {\n tx.executeSql(\"select id,name,image from students order by name\",[],renderEntries,dberrorhandler);\n }, dberrorhandler);\n}", "load(data) {\n // By default, if no user dimensions saved, we generate a 6mx4m garden\n const {width, length} = (typeof(data.garden.userDimensions) !== 'undefined')\n ? data.garden.userDimensions\n : {width: DEFAULT_USER_WIDTH, length: DEFAULT_USER_LENGTH};\n this.generate(width, length);\n\n data.garden.plants.map(jsonPlant => {\n const idImage = this.idGardenCounter;\n this.idGardenCounter = this.idGardenCounter + 1;\n const img = cst.PLANTS_IMAGES[jsonPlant.idPlant] || cst.DEFAULT_PLANT_IMAGE;\n fabric.Image.fromURL(`${cst.URL_IMAGES}/${img}`, oImg => {\n oImg.set({\n id: idImage\n });\n this.addPlantOnGrid(oImg, jsonPlant.idPlant, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, jsonPlant.position);\n });\n });\n }", "function preload() {\n images[0] = loadImage('assets/up.png');\n images[1] = loadImage('assets/down.png');\n\n \n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n content = new Content_Man('data/Content.csv');\n adventureManager = new AdventureManager(\"data/adventureStates.csv\", \"data/interactionTable.csv\");\n}", "function loadPhotos() {\n if ($scope.product) {\n if ($scope.product.photos) {\n if ($scope.product.photos.length > 0) {\n $scope.photos = $scope.product.photos;\n var indexesToDelete = [];\n for (var i = 0; i < $scope.photos.length; i++) {\n if (!Photos.checkIfImageData($scope.photos[i])) {\n indexesToDelete.push(i);\n }\n }\n for (i = 0; i < indexesToDelete.length; i++) {\n $scope.photos.splice(indexesToDelete[i], 1);\n }\n $scope.photosURLs = Photos.imageDataToUrls($scope.photos);\n $scope.selectPhoto(0);\n }\n }\n }\n }", "getImages() {\n return [\n {\n id: 1,\n src: '/' + process.env.PUBLIC_URL + 'images/event/tenis.jpg',\n name: 'tenis',\n },\n {\n id: 2,\n src: '/' + process.env.PUBLIC_URL + 'images/event/swim.jpg',\n name: 'swim',\n },\n {\n id: 3,\n src: '/' + process.env.PUBLIC_URL + 'images/event/baseball.jpg',\n name: 'baseball',\n },\n {\n id: 5,\n src: '/' + process.env.PUBLIC_URL + 'images/event/cycling.jpg',\n name: 'cycling',\n },\n {\n id: 6,\n src: '/' + process.env.PUBLIC_URL + 'images/event/football.jpg',\n name: 'football',\n },\n {\n id: 7,\n src: '/' + process.env.PUBLIC_URL + 'images/event/volleyball.jpg',\n name: 'volleyball',\n },\n {\n id: 8,\n src: '/' + process.env.PUBLIC_URL + 'images/event/hokej.jpg',\n name: 'hockey',\n },\n {\n id: 9,\n src: '/' + process.env.PUBLIC_URL + 'images/event/florbal.jpg',\n name: 'floorball',\n },\n {\n id: 10,\n src: '/' + process.env.PUBLIC_URL + 'images/event/basketbal.jpg',\n name: 'basketball',\n },\n {\n id: 11,\n src: '/' + process.env.PUBLIC_URL + 'images/event/golf.jpg',\n name: 'golf',\n },\n {\n id: 12,\n src: '/' + process.env.PUBLIC_URL + 'images/event/sipky.jpg',\n name: 'darts',\n },\n {\n id: 13,\n src: '/' + process.env.PUBLIC_URL + 'images/event/stolnihry.jpg',\n name: 'boardgames',\n },\n {\n id: 14,\n src: '/' + process.env.PUBLIC_URL + 'images/event/karty.jpg',\n name: 'cards',\n }\n ]\n }", "function loadResources(db) {\n var allResources = [];\n db.collection(\"characters\").get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n if (doc.exists) {\n let character = doc.data();\n for (var emotion in character.emotionURL) {\n if (!(character.emotionURL[emotion] == \"\")) {\n allResources.push(character.emotionURL[emotion])\n if (!(doc.id in characterImages)) {\n characterImages[doc.id] = {}\n }; \n characterImages[doc.id][emotion] = character.emotionURL[emotion]; \n } \n };\n } else {\n console.error(\"No data found for characters.\");\n }\n });\n })\n .then(() => {\n db.collection(\"stories\").get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n if (doc.exists) {\n stories.push({\n id: doc.id,\n data: doc.data()\n });\n let scenes = doc.data().scenes;\n for (var id in scenes) {\n allResources.push(scenes[id].imageUrl);\n }\n } else {\n console.error(\"No data found for stories.\");\n }\n });\n });\n })\n .then(() => {\n for (let i = 0; i < stories.length; i++) {\n extractStoryData(stories[i].data, stories[i]);\n }\n resources.load(allResources);\n resources.onReady(() => { init(db) });\n });\n}", "preload() {\n const images = Object.keys(ASSET.IMAGE).map(\n (imgKey) => ASSET.IMAGE[imgKey]\n );\n for (let image of images) {\n this.load.image(image.KEY, image.ASSET);\n }\n }", "function findImagesToLoad() {\n\tsetLazyImagePositions.call(this);\n\tconst imagesToLoad = getImagesInView(this.images);\n\tloadImages.call(this, imagesToLoad);\n}", "preloadImages() {\n const {products} = this.props;\n const groups = _.keys(products.byGroup);\n const images = [];\n\n groups.map(name => {\n const productId = products.byGroup[name][0]\n const image = new Image();\n\n image.src = products.byId[productId].image; \n return images.push(image);\n });\n\n return images;\n }", "fetchData(url) {\n fetch(url)\n .then(res => res.json())\n .then(data => data.map(item => \n this.add(\n {\n id: item._id,\n name: item.name,\n category: item.category,\n description: item.description,\n price: item.price,\n images: item.images\n }\n )\n ))\n .catch(err => console.error(err))\n }", "async loadOpinions() {\n const result = await Prediction.getOpinionsFromProjectId(this.state.portfolio._id);\n if (result.success) {\n this.props.setProjectOpinions(result.opinions);\n }\n }", "function createImages(venues) {\n for (let i = 0; i < venues.length; i++) {\n let venue = venues[i].venue;\n let titleid = '#title' + (i + 1);\n let imgid = '#img' + (i + 1);\n let imgsrc = '../../venue_imgs/' + venues[i].id + '.jpg';\n let imgalt = venue + 'Image';\n\n $(titleid).html(venue);\n $(imgid).attr('src', imgsrc);\n $(imgid).attr('alt', imgalt);\n }\n}", "loadPoke(){\n\t\t//testing\n\t\t//console.log(this.pokes[this.current].abilities);\n\n\t\tpokeName.innerHTML = this.pokes[this.current].name;\n\t\tpokePic.src=this.pokes[this.current].img;\n\t\tpokePic.alt=\"Image of \"+this.pokes.name;\n\t\t//console.log(this.pokes[this.current].img);\n\t\t$(\"#hp\").html(this.pokes[this.current].hp);\n\t\t$(\"#attack\").html(this.pokes[this.current].attack);\n\t\t$(\"#defense\").html(this.pokes[this.current].defense);\n\t\t//the number of abilities varries in number so I put it in its own function \n\t\tthis.createAbilities();\n\t}", "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 fetchPets () {\n let dogs = [];\n return fetch('../public/dogs.json')\n .then(function(response) { return response.json();})\n .then((data) => {\n dogs = data.dogs;\n galleryItems.load(dogs);\n galleryItems.enlarge();\n });\n}", "function loadImageList() {\n let filterElem = $('#filter_annotation_type');\n let filter = filterElem.val();\n let params = {\n image_set_id: gImageSetId\n };\n\n // select the corresponding annotation type for the label tool\n if (filter !== '' && !isNaN(filter)) {\n params.filter_annotation_type_id = filter;\n $('#annotation_type_id').val(filter);\n handleAnnotationTypeChange();\n }\n\n $.ajax(API_IMAGES_BASE_URL + 'imageset/load/?' + $.param(params), {\n type: 'GET',\n headers: gHeaders,\n dataType: 'json',\n success: function(data, textStatus, jqXHR) {\n if (data.image_set.images.length === 0) {\n // redirect to image set view.\n displayFeedback($('#feedback_image_set_empty'));\n filterElem.val('').change();\n return;\n }\n displayImageList(data.image_set.images);\n },\n error: function() {\n $('.annotate_button').prop('disabled', false);\n displayFeedback($('#feedback_connection_error'));\n }\n });\n }", "LoadImage(){\n var images=[]\n // hard coded for convenienceproxy to a static serving end point\n if(this.state.images!=undefined){\n this.state.images.map(i =>{\n images.push(\n this.request.getStamp()+'-' + i\n )\n })\n return images; \n }\n else{\n \n return null\n }\n }", "async function loadImagesIntoPage(userPhotoLibrary) {\n var imageDiv = document.getElementById(\"grid\");\n while (imageDiv.firstChild) {\n imageDiv.removeChild(imageDiv.firstChild);\n }\n\n // Generate image HTML\n var i = 0;\n for (i = 0; i < userPhotoLibrary.length; i++) {\n var img = document.createElement(\"img\");\n var imageUrl = 'https://img.rec.net/' + userPhotoLibrary[i].ImageName + '?width=500';\n img.setAttribute('data-src', imageUrl);\n img.classList.add(\"grid-image\");\n //img.src = \"\";\n\n var divGridItem = document.createElement(\"div\");\n divGridItem.classList.add(\"grid-item\");\n divGridItem.setAttribute('type', 'button');\n divGridItem.setAttribute('data-toggle', 'modal');\n divGridItem.setAttribute('data-target', '#imageDetailModal');\n divGridItem.setAttribute('onclick', 'loadDataImageDetailModal(' + userPhotoLibrary[i].Id + '); return false;');\n divGridItem.appendChild(img);\n\n if (userPhotoLibrary[i].CheerCount >= 1) {\n var divCheerContainer = document.createElement(\"div\");\n divCheerContainer.classList.add(\"imageCheerContainer\");\n divGridItem.appendChild(divCheerContainer);\n\n var cheerIcon = document.createElement(\"img\");\n cheerIcon.classList.add(\"imageCheerIcon\");\n cheerIcon.setAttribute('src', './images/cheer.png');\n\n // add image to container\n divCheerContainer.appendChild(cheerIcon);\n\n var cheerCount = document.createElement(\"div\");\n cheerCount.classList.add(\"imageCheerText\");\n cheerCount.innerText = userPhotoLibrary[i].CheerCount;\n\n // add div to container\n divCheerContainer.appendChild(cheerCount);\n }\n\n var src = document.getElementById(\"grid\");\n src.appendChild(divGridItem); // append Div\n }\n\n const targets = document.querySelectorAll('img');\n const lazyLoad = target => {\n let observer = {\n threshold: 1\n }\n const io = new IntersectionObserver((entries, observer) => {\n\n entries.forEach(entry => {\n\n if (entry.isIntersecting) {\n const img = entry.target;\n const src = img.getAttribute('data-src');\n\n if (img.hasAttribute('data-src')) {\n img.setAttribute('src', src);\n }\n observer.disconnect();\n }\n });\n });\n io.observe(target);\n };\n targets.forEach(lazyLoad);\n}", "async function Load_State_Of_Image_IDB() {\n image_annotations = await fns_DB_IDB.Get_Record(image_files_in_dir[image_index - 1])\n console.log(`in load state of image idb image annotations: ${JSON.stringify(image_annotations)} \n and the imageName : ${image_annotations.imageName}`)\n tagging_view_annotate.Display_Image_State_Results(image_files_in_dir,image_annotations)\n}", "function fetchImages() {\n $.getJSON(\"/images.php\", function(data) {\n preloadImages(data);\n }); \n }", "lazyLoad() {\n if(!this.state.loading && this.state.next) {\n const offset = this.state.offset + this.state.limit;\n this.getAlbums(offset);\n }\n }", "getInitialData() {\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\n if (error) {\n console.log(error);\n } else if (item == null) {\n // Gallery not found.\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\n } else {\n this.setState({ gallery: item,\n editGallery : {\n name: item.name,\n description: item.description\n }});\n\n // Get medias\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ images: [...items] });\n }\n });\n }\n });\n }", "function fetchPhotos(id) {\n\t\t\t// console.log('fetchPhotos',id)\n\t\t\tvar directory = '';\n\t\t\tvar filePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\tconsole.log('fetchPhotos',id,directory,filePath);\n\t\t\t// Load Stage photos\n\t\t\tif (id === 'thestage') {\n\t\t\t\tdirectory = 'stage';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (stagePicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tstagePicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Hall photos\n\t\t\telse if (id === 'thehall') {\n\t\t\t\tdirectory = 'hall';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (hallPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\thallPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Gallery photos\n\t\t\telse if (id === 'thegallery') {\n\t\t\t\tdirectory = 'lobby';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (galleryPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tgalleryPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Screening room photos\n\t\t\telse if (id === 'thescreeningroom') {\n\t\t\t\tdirectory = 'screening';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (screeningPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tscreeningPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function loadData(){\n\n var row = 0;\n var im = 0;\n var tempRow = [];\n for(idx=0; idx < cereals_data.length; idx++){\n // Let's load the image supposed to go with this\n var cell = {};\n cell.source = \"images/\" + cereals_data[idx].id + \".jpg\";\n //console.log(\"images/\" + cereals_data[idx].id + \".jpg\");\n tempRow.push(cell);\n im++;\n // Check if we loaded all the images for this row. In this case, push the row and go to the next one\n if(im == rowsModelSize[row]){\n pyramid.modelRows.push(tempRow);\n pyramid.idxModel.push(0);\n tempRow = [];\n im = 0;\n row++;\n }\n }\n}", "function addimage(req, res, nxt) {\n var newimage = { data: req.files[0].buffer };\n var arenaid = req.params.arenaid;\n Arena.findOne({ _id: arenaid }, function (err, arena) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n if (!arena) {\n return res.status(400).json({ error: 'the arena is not found' });\n }\n if (req.user && arena.service_provider == req.user._id) {\n arena.photos.push(newimage);\n arena.save(function (err) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n });\n return res.json(arena);\n } else {\n return res.status(400).json({ error: 'you are not autherized to view this page' });\n }\n });\n}", "loadOpponent(data)\n {\n playSound(\"oppJoined\");\n if(game.id === data.id)\n {\n game.opponent = data.challenger\n game.opponentKey = data.challengerkey\n }\n else\n {\n game.opponent = data.username\n game.opponentKey = data.userkey\n }\n firebase.database().ref('/users/' + game.opponentKey).once('value').then(function(snapshot)\n {\n game.opponentBattleText = (snapshot.val().battleText);\n var img = (snapshot.val().image);\n firebase.storage().ref(img).getDownloadURL().then(function(url)\n {\n game.opponentPicURL = url;\n document.getElementById('opponentUsername').innerHTML = game.opponent;\n document.getElementById('opponentBattleText').innerHTML = '\"' + game.opponentBattleText +'\"';\n \n $('#opponentImage').attr('src', url);\n document.getElementById('opponentCard').style.visibility = \"visible\";\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\n 'right' : '0%'\n });\n game.opponentLeft = false;\n game.startMatch(data);\n })\n })\n }", "function loadData (data) {\n data.results.forEach((entry) => {\n const card = document.createElement('DIV')\n card.className = 'card'\n const innerHTML = `\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${entry.picture.medium}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${entry.name.first} ${entry.name.last}</h3>\n <p class=\"card-text\">${entry.email}</p>\n <p class=\"card-text cap\">${entry.location.city}, ${entry.location.state}</p>\n </div>`\n\n card.insertAdjacentHTML('beforeend', innerHTML)\n\n card.addEventListener('click', () => {\n showModal(entry)\n })\n document.querySelector('#gallery').insertAdjacentElement('beforeEnd', card)\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 fetchImageDataAndUpdateState() {\n\n const titleList = images.reduce((newList, img) => [...newList, img.title], []);\n\n hydrateDetailPageImages(titleList, currDetailPage).then(function(detailPage) {\n\n // Update wiki page from our in memory list\n wikiPages[pageID] = detailPage;\n\n // Dispatch our pages list update and set data for the current detail view\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n\n }).catch((e) => {\n console.error('Failed to hydrate image info on details page', e);\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n });\n }", "function loadEnemyImage(enemy) {\n\tvar large_enemy_image = enemy.img;\n\tdocument.getElementById(\"enemy-image\").innerHTML = '<img id=\"enemy\" src=\"images/people/' + large_enemy_image + '\" />';\n}", "nextImage() {\n this.postFeatures();\n //get the scenes for the next lat/lng\n const collectionid = 'GOOGLE/GEO/ALL/SATELLITE/WORLDVIEW3/ORTHO/RGB';\n // const collectionid = 'LANDSAT/LC8_L1T_TOA';\n this._get(GEE_IMAGE_SERVER_ENDPOINT + \"getIdsForPoint?lng=\" + this.state.lng + \"&lat=\" + this.state.lat + \"&collectionid=\" + collectionid).then(json => {\n //the geeImageServer returns quasi-json data\n const sceneIds = eval(json.records.substring(json.records.indexOf(\"[\"), json.records.length - 1));\n //if there are scenes then get the first\n const sceneId = (sceneIds.length) ? sceneIds[0] : undefined;\n //load that scene\n if (sceneId) this.addGEEImage(sceneId);\n });\n }", "function fetchDataPhotographer(){\n fetch('./FishEyeData.json')\n .then(res => res.json())\n .then( function (datas) {\n for( data of datas.photographers){\n allPhotographers.push(data);\n let photographer = new Photographer(data.name,data.id,data.city,data.country,data.portrait,data.tagline,data.price,data.tags);\n createCards(photographer);\n photographer.tags.forEach(value => { getTagsElement(value);})\n }\n showTagsNav();\n })\n .catch(error => alert (\"Erreur : \" + error));\n}", "function fetchDogs() {\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(data => renderDogs(data));\n}", "function load_news(list) {\n\tvar object_list = list.hits.hits;\n\tconsole.log(JSON.stringify(object_list));\n\tfor (var i = 0; i < object_list.length; i++) {\n\t\t// Populate the values of the graph here\n\t\tcurr_latitude = object_list[i]._source.location[1];\n\t\tcurr_longitude = object_list[i]._source.location[0];\n\t\t//Check if the following variable is correct or not (most probably will require dominant emotion)\n\t\tobject_list[i]._source.img_source = image_emotion_mapper(object_list[i]._source.emotion);\n\n\t}\n\n}", "function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}", "function loadFlickrPhotos() {\n var photoSetId, photoSetName;\n photoSetId = this.id.substring(2); // remove \"ps\" prefix\n photoSetName = $(this).text();\n\n // Get all the photos associated with the given photoset id.\n $.getJSON('/photos/' + photoSetId).then(\n function (data) {\n $('#photos').empty();\n Object.keys(data).sort().forEach(function (title) {\n var photo = data[title];\n loadFlickrPhoto(photo);\n });\n });\n }", "function large_image(result){\n\tvar parsed = JSON.parse(result);\n\tvar image_url = parsed.collection.items[1].href;\n\tvar image_spot = document.getElementById('side_image');\n\t\n\tdocument.getElementById('loading_photo').style.display = \"none\";\n\t\n\tvar img = new Image(); \n\timg.src = image_url;\n\timg.setAttribute('width',\"100%\");\n\timage_spot.appendChild(img);\n}", "function fetchDBPokemons() {\n $.ajax({\n url: './php/pokemon/pokemon-list.php',\n type: 'GET',\n success: function (response) {\n let pokemons_response = JSON.parse(response);\n pokemons_response.forEach(pokemon => {\n pokemons.push({\n \"id\": pokemon.id,\n \"img\": pokemon.imagen,\n \"poke_types\": pokemon.type,\n \"name\": pokemon.name\n });\n createPokemonCard(pokemon);\n });\n }\n })\n}", "function onLoadData(data, insert) {\n applyLayout();//for static pins\n\tdata = data.objects;\n\tpage++;\n\tvar maxImages = 10 //max images to include on tag/group pin flow cover\n\tvar minImages = 7 //min images to include on tag/group pin flow cover\n\tvar tags = {}\n\tvar i=0, length=data.length, image;\n\tfor(; i<length; i++) {\n\t\timage = data[i];\n\t\tvar html = '';\n\t\tvar userFav = 'False'\n\t\tvar userPin = 'False'\n\t\tvar userCmnt = 'False'\n\t\tvar repined = 'False' //TODO: used to determine if pin has been repined by authUser\n\t\t//layout for all views except for those listed below\n\t\tif (av != 'tags'){\n\t\t\tconsole.log('onLoadData() av != tags')\n\t\t\t\n\t\t\t//package pin data for js access(req for repin)\n\t\t\tpinA[image.id] = {\n\t\t\t\tsrcUrl:image.srcUrl,\n\t\t\t\timgUrl:image.imgUrl,//CHECK: this was changed from origin+image.image, if it works we dont need origin\n\t\t\t\t//the origin did not work with heroku due to amazon\n\t\t\t\t//thumbnail:origin+image.image,\n\t\t\t\trepin:image.id,//:TODO: this may need to be just id or pin object???\n\t\t\t};\n\t\t\t\n\t\t\tif (authUserO){\n\t\t\t\tfor (f in image.favorites){\n\t\t\t\t\tif (image.favorites[f].user.id == authUserO.id){\n\t\t\t\t\t\tuserFav = 'True';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (r in image.repins){\n\t\t\t\t\tif (image.repins[r].submitter.id == authUserO.id){\n\t\t\t\t\t\trepined = 'True';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (c in image.comments){\n\t\t\t\t\tif (image.comments[c].user_id == authUserO.id){\n\t\t\t\t\t\tuserCmnt = 'True';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (image.submitter.id == authUserO.id){\n\t\t\t\t\tuserPin = 'True'\n\t\t\t\t}\n\t\t\t}\n\t\t\t//SETUP HTML FOR LARGE PINS DISPLAY\n\t\t\thtml += '<div class=\"pin item\" id=\"'+image.id+'-pin\" data-favs=\"'+image.favorites.length+'\" data-cmnts=\"'+image.comments.length+'\" data-repins=\"'+image.repins.length+'\">';\n\t\t\t//IMAGE CONTAINER\n\t\t\t\thtml += '<div class=\"image touch-off\">';\n\t\t\t//OPTIONS\n\t\t\t\t\tif (authUserO.id !== 'anon'){\n\t\t\t\t\t//was used to toggle options//html += '<div class=\"pin-options-btn touch-off hide\"><i id=\"optionsBtn\" class=\"icon-cog\"data-state=\"False\" title=\"Show Options\"></i></div>';\n\t\t\t\t\thtml += '<div class=\"pin-options\">';\n\t\t\t//PIN OPTIONS BUTTON\n\t\t\t\t\t\thtml += '<div class=\"background-50 btn-lg\">';\n\t\t\t\t\t\t\tif (userPin == 'True' || authUserO.is_superuser){\n\t\t\t\t\t\t\thtml += '<div id=\"delete\" title=\"Delete\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/delete-pin/'+image.id+'/\">';\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-trash\"></i>'\n\t\t\t\t\t\t\t\thtml += '<br>Delete</a></div>';\n\t\t\t\t\t\t\thtml += '<div id=\"edit\" title=\"Edit\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/edit-pin/'+image.id+'/\">';\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-edit\"></i>'\n\t\t\t\t\t\t\t\thtml += '<br>Edit</a></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += '<div id=\"favs\" data-state=\"'+userFav+'\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/fav-pin/'+image.id+'/\">'\n\t\t\t\t\t\t\t\tif (userFav == 'True') {\n\t\t\t\t\t\t\t\thtml += '<i title=\"Remove Favorite\" class=\"icon-star icon-star-empty\"></i>';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += '<i title=\"Add Favorite\" class=\"icon-star\"></i>';\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\thtml += '<br>Fav</a></div>'\n\t\t\t\t\t\t\tif (userPin == 'False' && repined == 'False'){\n\t\t\t\t\t\t\thtml += '<div id=\"repins\" data-state=\"'+userPin+'\" title=\"Re-Pin\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/re-pin/'+image.id+'/\">'\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-plus\"></i><br>Add</a></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += '<div id=\"cmnts\" data-state=\"True\" title=\"Comment\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/cmnt-pin/'+image.id+'/\">'\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-chat\"></i><br>Comm</a></div>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t//SOURCE BUTTON\n\t\t\t\t\t\thtml += '<div id=\"source\" class=\"background-50 btn-lg\">';\n\t\t\t\t\t\t\thtml += '<a target=\"_blank\" href=\"'+image.srcUrl+'\">'\n\t\t\t\t\t\t\thtml += '<div class=\"inline option one-icon\"><i class=\"icon-bookmark\"></i><br>GO</div>';\n\t\t\t\t\t\t\thtml += '<div class=\"inline one-text\">'+getHost(image.srcUrl)+'</div></a>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t//PIN NAVIGATION\n\t\t\t\t\t\thtml += '<div id=\"details\" class=\"background-50 btn-lg\">';\n\t\t\t\t\t\t\thtml += '<div id=\"info\" title=\"Pin Details\" class=\"inline\">';\n\t\t\t\t\t\t\t\thtml += '<a href=\"/pin/'+image.id+'/\">';\n\t\t\t\t\t\t\t\t\thtml += '<div class=\"inline option two\"><i class=\"icon-info-sign\"></i><br>Detail View</div>';\n\t\t\t\t\t\t\t\thtml += '</a>';\n\t\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\t\thtml += '<div class=\"inline divider spacer\"></div>';\n\t\t\t\t\t\t\thtml += '<div id=\"large-image\" title=\"Large Image\" class=\"inline\">';\n\t\t\t\t\t\t\t\thtml += '<a href=\"\">';\n\t\t\t\t\t\t\t\t\thtml += '<div class=\"inline option two\"><i class=\"icon-zoom-in\"></i><br>Zoom Image</div>';\n\t\t\t\t\t\t\t\thtml += '</a>';\n\t\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t}\n\t\t\t//IMAGE\n\t\t\t\t\thtml += '<div class=\"img-btn touch-off\"></div>';//prevent fancybox & toggle options\n\t\t\t\t\thtml += '<a class=\"pin-img fancybox\" rel=\"pins\" href=\"'+image.image+'\">';\n\t\t\t\t\thtml += '<img src=\"'+image.thumbnail+'\" width=\"200\" ></a>';\n\t\t\t\thtml += '</div>';\n\t\t\t//INFO - STATS\n\t\t\t\t//submitter\n\t\t\t\thtml += '<div class=\"pin-info\">';\n\t\t\t\t\thtml += '<l><span class=\"\">By: </span>'\n\t\t\t\t\thtml += '<a class=\"pin-submitter\" title=\"User\\'s pins\" href=\"/user/'+image.submitter.id+'/\">'+image.submitter.username+'</a></l>';\n\t\t\t\thtml += '</div>';\n\t\t\t\t//favs\n\t\t\t\thtml +='<div class=\"pin-stats pull-right dropdown display favs\">'\n\t\t\t\t\thtml += '<div class=\"stat dropdown-toggle\" id=\"dLabel\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\">'\n\t\t\t\t\thtml += '<i class=\"icon-favs\"></i><span class=\"text light favs \">'+image.favorites.length+'</span></div>';\n\t\t\t\t\thtml += '<ul class=\"list-favs dropdown-menu dm-caret\" role=\"menu\" aria-labelledby=\"dLabel\">';\n\t\t\t\t\tuu = uniqueUsers(image.favorites, 'user')\n\t\t\t\t\tfor (u in uu){\n\t\t\t\t\t\thtml += '<li id=\"'+uu[u].id+'\" class=\"display favs item\"><a href=\"/user/'+uu[u].id+'/\">'+uu[u].username+'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\thtml +='</div>'\n\t\t\t\t//cmnts\n\t\t\t\thtml +='<div class=\"pin-stats pull-right dropdown display cmnts\">'\n\t\t\t\t\thtml += '<div class=\"stat dropdown-toggle\" id=\"\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\">'\n\t\t\t\t\thtml += '<i class=\"icon-cmnts\"></i><span class=\"text light cmnts \">'+image.comments.length+'</span></div>';\n\t\t\t\t\thtml += '<ul class=\"list-cmnts dropdown-menu dm-caret\" role=\"menu\" aria-labelledby=\"\">';\n\t\t\t\t\tuu = uniqueUsers(image.comments, 'user')\n\t\t\t\t\tfor (u in uu){\n\t\t\t\t\t\thtml += '<li id=\"'+uu[u].id+'\" class=\"display cmnts item\"><a href=\"/user/'+uu[u].id+'/\">'+uu[u].username+'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\thtml +='</div>'\n\t\t\t\t//repin\n\t\t\t\thtml +='<div class=\"pin-stats pull-right dropdown display repins\">'\n\t\t\t\t\thtml += '<div class=\"stat dropdown-toggle\" id=\"\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\">'\n\t\t\t\t\thtml += '<i class=\"icon-plus\"></i><span class=\"text light repins\">'+image.repins.length+'</span></div>';\n\t\t\t\t\thtml += '<ul class=\"list-repins dropdown-menu dm-caret\" role=\"menu\" aria-labelledby=\"\">';\n\t\t\t\t\tuu = uniqueUsers(image.repins, 'submitter')\n\t\t\t\t\tfor (u in uu){\n\t\t\t\t\t\thtml += '<li id=\"'+uu[u].id+'\" class=\"display repins item\"><a href=\"/user/'+uu[u].id+'/\">'+uu[u].username+'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\thtml +='</div>';\n\t\t\t//DESCRIPTION\n\t\t\t\thtml += '<div class=\"pin-desc\">';\n\t\t\t\t\tif (image.description) html += '<p id=\"desc\">'+image.description+'</p>';\n\t\t\t\thtml += '</div>';\n\t\t\t//TAGS\n\t\t\t\thtml += '<div class=\"pin-tags section\">';\n\t\t\t\tif (image.tags) {\n\t\t\t\t\thtml += '<l>';\n\t\t\t\t\thtml += '<span>Groups: </span>'\n\t\t\t\t\tfor (tag in image.tags) {\n\t\t\t\t\t\thtml += '<span class=\"tag\" onclick=\"loadData(\\'' + image.tags[tag] + '\\')\">' + image.tags[tag] + '</span> ';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</l>';\n\t\t\t\t}\n\t\t\t\thtml += '</div>';\n\t\t\t//COMMENTS\n\t\t\t\tif (authUserO){\n\t\t\t\t\thtml += '<div class=\"section pin-cmnts\">';\n\t\t\t\t\t\tif (image.comments){ \n\t\t\t\t\t\t\tfor (cmnt in image.comments) {\n\t\t\t\t\t\t\t\t//TODO: get user object from CmntResource instead or build one so user vars are consistant.\n\t\t\t\t\t\t\t\t//console.log(image.comments[cmnt])\n\t\t\t\t\t\t\t\thtml += insertComment(image.comments[cmnt].username, image.comments[cmnt].user_id, image.comments[cmnt].comment, parseInt(image.comments[cmnt].id))\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\thtml += '</div>'//end pin-cmnts;\n\t\t\thtml += '</div>'//end pin;\n\n\t\t\t//inserts pin into docuement\n\t\t\tif (insert==\"prepend\"){\n\t\t\t\t$('#pins').prepend(html);\n\t\t\t}else{\n\t\t\t\t$('#pins').append(html);\n\t\t\t}\n\t\t\t//\n\t\t\t//hide elements as required\n\t\t\thidePinComponents(image.id)\n\t\t\t\n\t\t\tapplyLayout1(image.id);//for each pin individual pin\n\t\t}//end typical view\n\t\t\n\t\t//lay out tags/group view\n\t\tif (av == 'tags'){\n\t\t\tconsole.log('-loadData-av == tags')\n\t\t\t//console.log('----setting up group: '+image.tags)\n\t\t\t\n\t\t\t//*TODO: seperate muti tags into individual tags\n\t\t\t//*TODO: Bug on groups scroll to bottom and url refresh (most likely related) check av flow.\n\t\t\t\n\t\t\t//build tags array for creation of tag/group covers\n\t\t\tfor (key in image.tags){\n\t\t\t\ttag = image.tags[key]\n\t\t\t\t//add image.tags to tags array if it is not already there. bump zero qty. to one\n\t\t\t\tif (!tags[tag]) {tags[tag]=1}else{tags[tag]=tags[tag]+1};\n\t\t\t\t//add group for each unique tag in tags array.\n\t\t\t\tif (tags[tag] == 1){\n\t\t\t\t\ttagId = idSafe(tag)\n\t\t\t\t\thtml += '<div class=\"pin group\" id=\"'+tagId+'\">'\n\t\t\t\t\t\thtml += '<a class=\"thumbs\"></a>'\n\t\t\t\t\t\thtml += '<div class=\"info\">'\n\t\t\t\t\t\t\thtml += '<h5><a class=\"title\">'+tag+'</a></h5>'\n\t\t\t\t\t\t\thtml += '<div class=\"details\"></div>'\n\t\t\t\t\t\thtml += '</div>'\n\t\t\t\t\thtml += '</div>'\n\t\t\t\t}\n\t\t\t}//end for\n\t\t\t\n\t\t\t$('#pins').append(html);\n\t\t\t\n\t\t\t//for each tag/group in images.tags, add image to tag/group untill max images reached\n\t\t\tfor (key in image.tags){\n\t\t\t\ttag = image.tags[key]\n\t\t\t\tconsole.log('image.tags: '+image.tags)\n\t\t\t\tconsole.log('key: '+key)\n\t\t\t\tconsole.log('image.tags[key]: '+image.tags[key])\n\t\t\t\tconsole.log('tag: '+tag)\n\t\t\t\tconsole.log('tags (below)')\n\t\t\t\tconsole.log(tags)\n\t\t\t\tconsole.log(tags[tag])\n\t\t\t\t//add images to group untill max images reached\n\t\t\t\tif (tags[tag] <= maxImages){\n\t\t\t\t\ttagId = idSafe(tag)\n\t\t\t\t\tconsole.log('--adding image to tag id: '+tagId)\n\t\t\t\t\t$('#'+tagId+' .thumbs').append('<div class=\"'+tagId+' thumb\"><img src=\"'+image.thumbnail+'\" alt=\"\"></div>');\n\t\t\t\t\tw = image.image.wdth\n\t\t\t\t\th = image.image.height\n\t\t\t\t\t//todo finish resize images for icon square, also change image ref to thumb.\n\t\t\t\t}\n\t\t\t}//end for\n\t\t\tapplyLayout();\n\t\t}//end tag/group view\n\t}//end image for loop\n\t// for each tag add place holder images as required by min/max\n\tif (av == 'tags'){\n\t\tfor (key in tags){\n\t\t\ttagId = idSafe(key)\n\t\t\tconsole.log('--key: '+key)\n\t\t\tconsole.log('--tagId: '+tagId)\n\t\t\t//for tags with one image\n\t\t\tif (tags[key]==1) {\n\t\t\t\t$('#'+tagId+' .thumbs .thumb').addClass('p1');\n\t\t\t//TODO: add formatting for other image quantities here.\n\t\t\t//add extra blank images for pin layout if there are not enough existing then apply the layout\n\t\t\t}else if (tags[key] <= maxImages){\n\t\t\t\t//console.log('--<10 key: '+key)\n\t\t\t\t$('#'+tagId+' .thumbs .thumb').addClass('board');\n\t\t\t\tvar i=tags[key]\n\t\t\t\twhile (i < maxImages){\n\t\t\t\t\t//console.log('--while adding images key: '+key)\n\t\t\t\t\t$('#'+tagId+' .thumbs').append('<div class=\"thumb board space\"><img width=\"64px\" height=\"2px\" src=\"http://www.webdesign.org/img_articles/12337/1_002.jpg\" alt=\"\"></div>');\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\t//apply layout to pins in tag group\n\t\t\t\tlayoutThumbs('#'+tagId);\n\t\t\t}\n\t\t\t//fix up layout after extra images added\n\t\t\tapplyLayout();\n\t\t}\n\t}\n\tisLoading = false;\n\t$('#loader').hide();console.log('hiding loader')\n\t//Apply layout to show any static pins in template\n\tapplyLayout();\n\t//TOUCH: DEVICE SETUP\n\tsetUpTouch(touchOn)\n}", "function index(req, res) {\n return _news2.default.find().populate('image', 'PublicID').exec().then(respondWithResult(res)).catch(handleError(res));\n}", "function loadAllPrepared(img,opt) {\n\t\tif (img.data('preloading')==1) return false;\n\n\t\tvar ar = opt.aspectratio,\n\t \t \taratio=parseInt(ar[0],0) / parseInt(ar[1],0),\n\t \t \tlimg = new Image();\n\n\n\n\n \t \tif (img.data('lazysrc')!=img.attr('src') && img.data('lazysrc')!=undefined && img.data('lazysrc')!='undefined') {\n\n\t\t\tif (img.data('lazysrc') !=undefined && img.data('lazysrc') !='undefined')\n\t\t\t\timg.attr('src',img.data('lazysrc'));\n\t\t}\n\n\t\timg.data('preloading',1);\n\n\t\tlimg.onload = function(loadedimg) {\n\t\t\timg.data('lazydone',1);\n\t\t\timg.data('ww',limg.width);\n\t\t\timg.data('hh',limg.height);\n\t\t\timg.closest('.showmeonload').addClass(\"itemtoshow\").removeClass(\"showmeonload\").addClass(\"loadedmedia\");\n\t\t\tevenImageRatio(img,opt);\n\t\t\tif (opt.lazyLoad==\"on\")\n\t\t\t\twaittorungGrid(img,opt,true);\n\n\t\t}\n\n\t\tlimg.onerror = function() {\n\t\t\t\timg.data('lazydone',1);\n\t\t\t\timg.closest('.showmeonload').addClass(\"itemtoshow\").removeClass(\"showmeonload\").addClass(\"loadedmedia\");\n\t\t\t\tif (opt.lazyLoad==\"on\")\n\t\t\t\t\twaittorungGrid(img,opt,true);\n\n\t\t\t}\n\n\n\t\tif (img.attr('src')!=undefined && img.attr('src')!='undefined')\n\t\t\tlimg.src = img.attr('src');\n\t\t else\n\t\t\tlimg.src = img.data('src');\n\n\t\tif (limg.complete) {\n\t\t\timg.data('lazydone',1);\n\t\t\timg.data('ww',limg.width);\n\t\t\timg.data('hh',limg.height);\n\t\t\timg.closest('.showmeonload').addClass(\"itemtoshow\").removeClass(\"showmeonload\").addClass(\"loadedmedia\");\n\t\t\tevenImageRatio(img,opt);\n\t\t\tif (opt.lazyLoad==\"on\")\n\t\t\t\twaittorungGrid(img,opt,true);\n\t\t}\n\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 load_img() {\n fabric.Image.fromURL('golf-h.png', function (img) {\n hole = img;\n hole.scaleToWidth(60);\n hole.scaleToHeight(60);\n hole.set({\n top: holey,\n left: holex\n });\n canvas.add(hole);\n });\n\n fabric.Image.fromURL('ball.png', function (img) {\n ball = img;\n ball.scaleToWidth(ballw);\n ball.scaleToHeight(ballh);\n ball.set({\n top: bally,\n left: ballx\n });\n canvas.add(ball);\n });\n}", "cellLoad(img) {\r\n\t\tlet portal = this.portalsViewModel.getPortal(img);\r\n\t\t\r\n\t\tconst url = PortalCell.readUrl(img);\r\n\t\t// fill display data\r\n\t\tthis.mainImg.src = url;\r\n\t\t//this.mainCaption.textContent = img.title;\r\n\t\tthis.mainCaption.innerHTML = `<a href=\"${url}\" target=\"_blank\">${img.title}</a>`;\r\n\t\tthis.mainSection.style.display = '';\r\n\t\tthis.mainForm.style.display = '';\r\n\r\n\t\t// prep internals\r\n\t\tthis.mainForm._zoomerImg = img;\r\n\t\tthis.mainForm._portal = portal;\r\n\r\n\t\t// init fields\r\n\t\tthis.updateDoneField(portal.done);\r\n\t\tthis.updatePuzzleField(portal);\r\n\t\tthis.updateDisplay(portal);\r\n\t\tthis.mainFields.notes.value = portal.notes;\r\n\t}", "function dataload() {\r\n \r\n var param = [];\r\n var proc = 'hotels_list_get';\r\n SelectorNoSession1(param, proc).then(function (result) {\r\n $res = JSON.parse(result);\r\n\r\n if ($res.length != []) {\r\n $(\"#hotel_list\").empty();\r\n for ($i = 0; $i < $res[\"dt1\"].length; $i++) {\r\n $(\"#hotel_list\").append('<li>'+\r\n '<article class= \"box\" >'+\r\n '<figure>'+\r\n //'<a href=\"ajax/slideshow-popup.html\" class=\"hover-effect popup-gallery\">' +\r\n '<a onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id +')\" class=\"hover-effect popup-gallery\">' +\r\n \r\n '<img alt=\"\" style=\"height: 209px;\" src=' + \"/\" + $res[\"dt1\"][$i].images +'>' +\r\n '</a >'+\r\n '</figure>'+\r\n '<div class=\"details\">'+\r\n '<a title=\"View all\" onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id +')\" class=\"pull-right button uppercase popup-gallery\">'+'select'+'</a>'+\r\n '<h4 class=\"box-title\">' + $res[\"dt1\"][$i].Name + '</h4>'+\r\n '<label class=\"price-wrapper\">'+\r\n '<span class=\"price-per-unit\">' + 'RS' + $res[\"dt1\"][$i].Avg_Night +'</span>'+'avg/night'+\r\n '</label>'+\r\n '</div>'+\r\n '</article >'+\r\n '</li >');\r\n\r\n\r\n }\n\n for ($i = 0; $i < $res[\"dt1\"].length; $i++) {\r\n $(\"#imageCrousal\").append('<li>'+\r\n '<article class= \"box\">'+\r\n '<figure>'+\r\n '<a onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\" class=\"hover-effect popup-gallery\">' +\r\n //'<a onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\" class=\"hover-effect popup-gallery\">' +\r\n //'<img width=\"270\" height=\"161\" alt=\"\" src=\"~/online_services/assest/img/amin_hotel.jpg\">' + '</a>' +\r\n '<img alt=\"\" style=\"height:161px;width:270px\" src=' + \"/\" + $res[\"dt1\"][$i].images + '>' +\r\n '</figure>'+\r\n '<div class=\"details\">'+\r\n ' <span class=\"price\">'+\r\n '<small>'+ 'avg / night' +'</small>'\r\n + $res[\"dt1\"][$i].Avg_Night +\r\n '</span>' +\r\n\r\n //'<span class=\"price-per-unit\">' +\r\n //'RS' + $res[\"dt1\"][$i].Avg_Night + '</span>' + 'avg/night' +\r\n '<h4 class=\"box-title\">' + $res[\"dt1\"][$i].Name + '<small>' + $res[\"dt1\"][$i].District_Name + '</small>' + '</h4>' +\r\n '<div class=\"feedback\">'+\r\n '<div data-placement=\"bottom\" data-toggle=\"tooltip\" class=\"five-stars-container\" title=\"4 stars\">' +\r\n\r\n '<span style=\"width: 80%;\" class=\"five-stars\">' +\r\n\r\n '</span>' +\r\n\r\n '</div>' +\r\n ' <span class=\"review\">'+'270 reviews'+'</span>'+\r\n '</div>'+\r\n '<p class=\"description\">' + $res[\"dt1\"][$i].Description +'</p>'+\r\n '<div class=\"action\">'+\r\n '<a class=\"button btn-small\" onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\">' + 'SELECT' + '</a>' +\r\n //'<a title=\"View all\" onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\" class=\"pull-right button uppercase\">' + 'select' + '</a>' +\r\n '<a class=\"button btn-small yellow popup-map\" href=\"#\" data-box=\"48.856614, 2.352222\">'+'VIEW ON MAP'+'</a>'+\r\n '</div>'+\r\n '</div>'+\r\n '</article>'+\r\n '</li>');\r\n\r\n\r\n }\n }\r\n });\r\n}", "function LoadAlternateIDTable() {\n\n var columns = [\n { dataField: 'Id', width:'0px' },\n { dataField: 'Name', caption: 'Name' }\n ];\n\n LoadGrid('.alternateidgridcontainer', 'altidgrid', columns, 'constituents/' + currentEntity.Id + '/alternateids', 'alternateids'\n , null, 'ai-', '.alternateidmodal', '.alternateidmodal', 250, false, true, false, null);\n}", "getImageByUserId(userId) {\r\n this.sql_getImageByUserId = `SELECT A.id, A.user_id, B.full_name, B.email_id, A.image, A.created, \r\n A.last_modified \r\n FROM user_image_tb A, user_tb B WHERE A.user_id = B.id AND A.user_id = ${userId}\r\n ORDER BY A.id ASC`;\r\n return this.apdao.all(this.sql_getImageByUserId);\r\n }", "function getAllUserImages(req, res, next) {\n db\n .any(\"SELECT img_url FROM users JOIN images ON users.id = images.user_id\")\n .then(function(data) {\n res.status(200).json({\n status: \"success\",\n data: data,\n message: \"Fetched all images for all users\"\n });\n })\n .catch(function(err) {\n return next(err);\n });\n}", "function getOpportunitySource(req, res) {\n if (!validator.isValid(req.body.companyId)) {\n res.json({code: Constant.ERROR_CODE, message: Constant.REQUIRED_FILED_MISSING});\n } else {\n source.find({companyId: req.body.companyId, moduleType: req.body.moduleType, deleted: false})\n .collation({locale: \"en\"})\n .sort({sourceName: 1})\n .exec(function(err, laborRatelist) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: laborRatelist});\n }\n\n });\n }\n}", "function loadDetails(place) {\n var photos = [];\n place.photos.forEach(function(photo) {\n photo.url = photo.getUrl({\n maxWidth: 300\n });\n photos.push(photo);\n });\n\n /* this is for handlebars to know where to place it in the html file */\n var html = detailsTemplate(place);\n $('#location-details-pane').html(html);\n}", "function getSingleImageInfo(req, res, next) {\n db\n .any(\"SELECT user_id AS image_owner_id, img_id, img_url, img_likes, comments.id AS comment_id, comment, comments.username AS commenters_username, comment_timestamp FROM comments JOIN images ON (img_id = images.id) WHERE img_id=${img_id} ORDER BY comment_timestamp DESC\",\n { img_id: req.params.img_id } \n )\n .then(function(data) {\n res.status(200).json({\n status: \"success\",\n data: data,\n message: \"Fetched info for single image\"\n });\n })\n .catch(function(err) {\n return next(err);\n });\n}", "function addImagesToPoi(poi_oid) {\n\t\n\t// add images\n\tfor (var img of poi_img_list) {\n\t\tvar img2poi_params = \"?oid=\" + poi_oid + \"&new_img_oid=\" + img.data.$id + \"&display_name=\" + img.name;\n\t\t\n\t\tjQuery.ajax({\n\t url: updatePoi_url + img2poi_params,\n\t data: null,\n\t type: \"POST\",\n\t async: true,\n\t contentType: \"application/json;charset=utf-8\",\n\t success: function(data) {\n\n\t },\n\t error: function(xhr, status, err) {\n\n\t alert(\"Image \" + img.data.$id + \" couldn't be added to POI \" + poi_oid + \".\");\n\t }\n\t });\n\t}\n\t\n\t// refresh poi\n\tpois.clearLayers();\n getPois(m.map);\n\t\n\t// clear lists\n\timg_list = new Array();\n\tjQuery(\"#poi_img_table\").html(\"\");\n\tjQuery(\"#poi_img_table_header\").html(\"\");\n\tjQuery(\"#poi_img_upload_status\").html(\"\");\n}", "function showModal(storyId){\n storyId = storyId.id;\n var story = JSON.parse(localStorage.getItem(\"stories\")).find(function (item) {\n return (item.story_id === storyId);\n })\n\n var images = story.input_image;\n\n var modal = document.getElementById(\"modal\");\n\n for (var i=0; i<images.length; i++){\n var modalImg = document.getElementById(\"img\"+(i+1));\n modal.style.display = \"block\";\n modalImg.src = images[i];\n\n }\n\n}", "componentDidMount() {\n fetch('/techniques/' + this.state.id)\n .then(res => res.json())\n .then(data => {\n //Fetch the ID so it can be used to fetch the images\n let id = data[0].id;\n if(id !== undefined){\n fetch('/techniques/' + id + '/images')\n .then(res => res.json())\n .then(data => this.setState({images: data}));\n }\n //Set the technique object asynchronously\n this.setState({technique: data[0]});\n });\n }", "function startLoadingImage(table){\t\n\tvar tab = ge(table+'_table');\n\ttab.rows[0].firstChild.innerHTML = \"<img src=\\'\" + easyCrudPath + \"css/img/loading2.gif\\' ></img>\";\t\n}", "function init() {\n imageContainers = [];\n if (product_id && !$model) {\n // Should look up the product by id and call render() when done()\n currentProduct = Alloy.createModel('product');\n currentProduct.id = product_id;\n currentProduct.ensureImagesLoaded('heroImage').done(function() {\n render();\n });\n } else {\n // Just render with what we have\n currentProduct.ensureImagesLoaded('heroImage').done(function() {\n render();\n }).fail(function() {\n logger.error('cannot get images!');\n });\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 }", "function load() {\n var apiurl_c = ENTRYPOINT + 'diseases/?type=c&top=5';\n var apiurl_d = ENTRYPOINT + 'diseases/?type=d&top=5';\n var apiurl_u = ENTRYPOINT + 'users/?type=status';\n\n personalAlert(\"CARGANDO \", \" -- Generando resultados...Cargando gráficas\", \"info\", 2000, true);\n\n rankingDead_db(apiurl_d);\n rankingContagion_db(apiurl_c);\n allUsers(apiurl_u);\n}", "function populatePageSecondPart(tripId) {\n $.ajax({\n type: \"get\", url: \"/photos?tripId=\" + tripId,\n success: function (resultTwo) {\n for (var i = 0; i < resultTwo.length; i++) {\n $('<div class=\"col-md-4 photoImage\"> <img src=\"' + resultTwo[i]['photoLink'] + '\" alt=\"photo\" class=\"img-thumbnail\"> <h3>' + resultTwo[i]['title'] + '</h3></div>').insertAfter(\".googleMap\");\n }\n },\n\n error: function (error) {\n alert(\"The photos couldn't be loaded!\");\n }\n });\n }", "function loadLatestImageByCategoryId(cell, cate_id, types){\n\tvar c_ads_library = Alloy.createCollection('categoryAds');\n\t \n\tif(types == \"popular\"){\n\t\tvar latestc = c_ads_library.getPopularAdsByCategory(cate_id, 1);\n\t}else{\n\t\tvar latestc = c_ads_library.getLatestAdsByCategory(cate_id, 0, 1);\n\t}\n\tconsole.log(latestc.length+\" latestc\");\n\tif(latestc.length > 0){\n\t\tvar adImage = Ti.UI.createImageView({\n \t\t\tdefaultImage: \"/images/warm-grey-bg.png\",\n\t\t\timage: latestc[0].img_path,\n\t\t\tcate_id: cate_id,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE\n\t\t});\n\t\tadImage.addEventListener(\"click\", goAds);\n \t\tcell.add(adImage);\n \t}else{\n \t\tvar adImage = Ti.UI.createImageView({\n \t\t\timage: \"/images/ComingSoon_2.png\",\n\t\t\tcate_id: cate_id,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE\n\t\t});\n \t\tcell.add(adImage);\n \t}\n}", "function loadData() {\n consolidatedresults.loaded = false;\n dataService.getConsolidatedResults()\n .then(function(response) {\n //handle the success condition here\n var data = response.data;\n consolidatedresults.realdata = data[0];\n consolidatedresults.col_names = data[1];\n consolidatedresults.loaded = true;\n // console.log(consolidatedresults.realdata);\n // console.log(consolidatedresults.col_names);\n });\n }", "function loadExperiences(org) {\n self.loading = true;\n\n content.getExperiencesByOrg(org.id)\n .then(function(exps) {\n var expUserPromiseArray = [];\n\n data.appData.experiences = exps;\n data.experiences = exps;\n\n exps.forEach(function(exp) {\n expUserPromiseArray.push(account.getUser(exp.user)\n .then(function(user) {\n exp.user = user;\n }));\n });\n\n return $q.all(expUserPromiseArray);\n })\n .finally(function() {\n data.query = null;\n self.loading = false;\n self.action = 'experiences';\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 LoadSuccess() {\n // Image: set properties\n that.Properties($i);\n // Image: all image loaded\n SetupAfterAllLoaded();\n }", "refreshWaypoints() {\n this.lazyImages.on('load', function() { /* on the 'load' event for any of the lazyImages */\n Waypoint.refreshAll(); /* let's refresh the main Waypoint object */\n });\n }", "getOpportunities() {\n firestore.onceGetNonValidatedOpportunities().then(snapshot => {\n let res = {};\n snapshot.forEach(doc => {\n res[doc.id] = doc.data();\n });\n this.setState(() => ({ opportunities: res }));\n })\n .catch(err => {\n console.log('Error getting documents', err);\n });\n }", "static fetchNeighborhoods () {\r\n return fetch(`${DBHelper.DATABASE_URL}/neighborhoods`).then(res => {\r\n return res.json().then(json => {\r\n return idb.cacheCollection('neighborhoods', json.neighborhoods).then(() => json.neighborhoods);\r\n });\r\n });\r\n }", "function fetchData(url, select, img) {\n fetch(url) // First getting data\n .then(function (response) {\n return response.json();\n })\n .then(function (myJson) {\n addPokemonToDOM(myJson, select, img); // Add data to DOM\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "function importInViewAndShowScore(data) {\n importInView.call(this, data);\n\n $('body').css(\"background\", \"url('img/6795655-gamer-wallpaper.jpg')\");\n table.getData();\n }", "async loadProperty() {\n await axios\n .post(`${this.host}/property/get-property`, {\n propertyId: window.location.pathname.split(\"/\")[2],\n })\n .then((res) => {\n this.state.id = res.data._id;\n let data = `\n <div class=\"images\">\n <div class=\"main-image-container\">\n <img class=\"img main-image\" src=\"/assets/img/alt/load-post.gif\" />\n </div>\n <div class=\"sub-images\">\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n </div>\n </div>\n \n <div class=\"details\">\n <div class=\"preview-image-container\">\n <img class=\"preview-image\" />\n </div>\n <div class=\"row rwo-title\">\n <div class=\"title\">${res.data.title}</div>\n <div class=\"price\">Rs.${res.data.price}/Month</div>\n </div>\n <div class=\"row row-status\">\n <div class=\"status\">`;\n\n switch (res.data.property_status) {\n case \"0\":\n data += `<img class=\"btn\" title=\"NotAvailable\" src=\"/assets/icon/Available/NotAvailable_24px.png\"> Pending Approval`;\n break;\n case \"1\":\n data += `<img class=\"btn\" title=\"Available\" src=\"/assets/icon/Available/Available_24px.png\"> Available`;\n break;\n case \"2\":\n data += `<img class=\"btn\" title=\"Rejected\" src=\"/assets/icon/Available/rejected_24px.png\"> Rejected`;\n break;\n default:\n data += `<img class=\"btn\" title=\"Reserved\" src=\"/assets/icon/Available/reserved_24px.png\"> Reserved`;\n break;\n }\n\n data += `</div>\n <div class=\"favourite\" title=\"Add to favourite\"><img class=\"btn\" src=\"/assets/icon/Favourite/Heart_NotFilled_24px.png\"></div>\n <div class=\"share\" title=\"share\"><img class=\"btn\" src=\"/assets/icon/Share/share_24px.png\" id=\"share-post\"></div>\n </div>\n <div class=\"row\">\n <div class=\"description\">\n ${res.data.description}\n </div>\n </div>\n <div class=\"row\">\n <div class=\"features\">\n </div>\n </div>\n <div class=\"row\">\n <div class=\"contact-info\">\n <span class=\"show-contacts\"> <a>Show contacts </a></span>\n <div class=\"contacts\" id=\"contacts\">\n <span>Email: lakmal@gmail.com</span>\n <span>Mobile: 077 527 7373</span>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"action\">\n ${\n res.data.user_id != this.getUserId()\n ? res.data.reserved != 1\n ? '<button class=\"reserve\"> Reserve Now! </button>'\n : \"\"\n : \"\"\n }\n <button class=\"feedback\"> Feedback </button>\n <button class=\"map\"> On map 📌</button>\n </div>\n </div>\n </div>\n `;\n this._qs(\".container\").innerHTML = data;\n\n // load feature List\n this.loadFeatureList(JSON.parse(res.data.facilities));\n\n //Load the reserve component\n res.data.user_id != this.getUserId()\n ? res.data.reserved != 1\n ? this.loadReserve()\n : false\n : false;\n\n //loadComment\n this.loadComment();\n\n //Load map view component\n this.loadMapView();\n this.state.location = res.data.location;\n });\n }", "function loadProductImages(id){\n $('#product_detail_images').html('');\n $('#product_detail_thumbs').html('');\n var _token = $(\"input[name='_token']\").val();\n $.ajax({\n url: \"/product/load/images\",\n type:'POST',\n data: {_token:_token, id:id},\n dataType: 'json',\n success:function(response){\n $.each(response[0].images, function(key,value){\n $('#product_detail_images').append('<div class=\"lg-image\"><a href=\"/images/product/design/'+response[0].folder+'/'+value+'\" class=\"img-poppu\"><img src=\"/images/product/design/'+response[0].folder+'/'+value+'\" alt=\"product image\"></a></div>');\n $('#product_detail_thumbs').append('<div class=\"sm-image\"><img src=\"/images/product/design/'+response[0].folder+'/'+value+'\" alt=\"product image thumb\"></div>');\n });\n destroyCarousel();\n loadSlick();\n }\n });\n \n }", "async GetImages(fetchParams) {\n if (this.state.lastCursor) {\n fetchParams.after = this.state.lastCursor;\n }\n\n CameraRoll.getPhotos(fetchParams).then(\n r => this.AppendImages(r)\n )\n }", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category';\n var category = 'nature';\n var size = '1920x1080';\n\n var source = baseUrl + '/' + category + '/' + size;\n\n buildElement(source)\n .then(render);\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 loadData() {\n // STAND\n loadStandData();\n // PIT\n loadPitData();\n // IMAGES\n loadImageData();\n // NOTES\n loadNotesData();\n // PRESCOUTING\n loadPrescouting(\"./resources/prescout.csv\");\n\n}", "function initialize_listing_previews(){\n for (var i = 0; i < window.ST.poolToolRows; i++) {\n\n // Function in a loop. Do not use i in there!\n /*jshint -W083 */\n $('#rowheader' + i).on('mouseover', function(ev){\n if (ev.currentTarget.firstChild.firstChild){\n var id = ev.currentTarget.id;\n var text = ev.currentTarget.firstChild.firstChild.data;\n var ii = parseInt(id.substr(9,1));\n var alreadyThere = false;\n\n if (gon.source[ii].image && gon.source[ii].name === text){\n for(var j=0; j<window.ST.poolToolImages.length; j++){\n if (ii === window.ST.poolToolImages[j]){\n alreadyThere = true;\n }\n }\n window.ST.poolToolImages.push(ii);\n\n if(alreadyThere){\n $('#rowheader_image' + ii).show();\n }else{\n var img = $('<img id=\"rowheader_image'+ ii +'\" height=\"' + $(\".spacer\").height() + '\"/>').attr('src', gon.source[ii].image)\n // Function in a loop. Do not use i in there!\n /*jshint -W083 */\n .on('load', function(){\n if (!this.complete || typeof this.naturalWidth === \"undefined\" || this.naturalWidth === 0) {\n } else {\n $(\".spacer\").append(img);\n img.show();\n }\n });\n }\n }\n }\n });\n\n // Function in a loop. Do not use i in there.\n /*jshint -W083 */\n $('#rowheader'+i).on('mouseout', function(ev){\n var id = ev.currentTarget.id;\n var ii = parseInt(id.substr(9,1));\n\n $('#rowheader_image' + ii).hide();\n });\n }\n }", "async load(include) {\n const { Activity, Dining, Hotel } = this.dao;\n const query = ResortModel.buildQuery(this.dao, { where: { [this.idKey]: this.id } }, false);\n // check to see if we are including different associations\n if (include) {\n // include.forEach(i => {\n // if (i === GetTypes.Activities) {\n // queryInclude.push({\n // attributes: RAW_ACTIVITIES_ATTRIBUTES,\n // include: [{\n // attributes: ['name'],\n // model: Area\n // }],\n // model: Activity\n // });\n // }\n // });\n }\n if (this.instance) {\n await this.instance.reload(query);\n }\n else {\n this.instance = await Hotel.findOne(query);\n }\n if (!this.instance) {\n // let the caller handle not found\n this.instance = null;\n return false;\n }\n // lets reset the id to the internal one\n this.id = this.instance.get('id');\n // We need to handle counts separately, there is currently a bug with sequelize\n // where you cannot make multiple counts in a single fetch\n const activityCount = await Activity.count({ where: { locationId: this.instance.get('locationId') } });\n const diningCount = await Dining.count({ where: { locationId: this.instance.get('locationId') } });\n this.counts = { activity: activityCount, dining: diningCount };\n return true;\n }", "function loadPhotos() {\n\n for(let i = 0; i < 10; i++) {\n fetch(`https://picsum.photos/500/500?random=${i}`)\n .then(x => {\n \n gallery.innerHTML += `\n <img src=\"${x.url}\" alt=\"\">\n `\n });\n }\n}", "function load(req, res, next, expenseId) {\n Expense.get(req.params.userId, expenseId)\n .then(expense => {\n req.expense = expense;\n return next();\n })\n .catch(e => next(e));\n}", "retrievePoliticianImages(id){\n var self = this;\n id = id.replace(/-/g, \" \");\n var args = \"state=\" + self.selected_state_id + \"&role=\" + self.selected_role + \"&district=\" + self.selected_district;\n get_state_politician_profile(args, self.loadPoliticianImages.bind(self));\n }", "function loadList () {\n return fetch(apiUrl).then(function (response) {\n return response.json();\n }).then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url\n };\n add(pokemon);\n });\n }).catch(function (e) {\n window.alert(e);\n })\n }", "async fetchGallery(_,{ id }) {\n const galleries = await Gallery.find(id)\n return galleries.toJSON()\n }", "async function loadDataImageDetailModal(imageId) {\n // Modal Elements\n const LOADING_TEXT = \"Loading...\";\n var modalDisplayImage = document.getElementById(\"imageDisplay\");\n modalDisplayImage.setAttribute('src', ''); // Clear out image source so the old image is not there still\n\n var modalImageId = document.getElementById(\"imageId\");\n modalImageId.innerText = LOADING_TEXT;\n\n // Activity Name\n var modalImageActivityName = document.getElementById(\"imageActivity\");\n modalImageActivityName.innerText = LOADING_TEXT;\n\n // List of tagged players\n var modalImageTaggedPlayers = document.getElementById(\"imageTaggedPlayers\");\n modalImageTaggedPlayers.innerText = LOADING_TEXT;\n\n // Event Name\n var modalImageEventName = document.getElementById(\"imageEvent\");\n modalImageEventName.innerText = LOADING_TEXT;\n\n var modalImageCheerCount = document.getElementById(\"imageCheerCount\");\n imageCheerCount.innerText = LOADING_TEXT;\n\n var modalImageCommentCount = document.getElementById(\"imageCommentCount\");\n modalImageCommentCount.innerText = LOADING_TEXT;\n\n var modalImageDate = document.getElementById(\"imageDate\");\n modalImageDate.innerText = LOADING_TEXT;\n\n var modalImageRnLink = document.getElementById(\"imageRecNetLink\");\n modalImageRnLink.innerText = LOADING_TEXT;\n\n var username = document.getElementById(\"txtUsername\").value;\n \n\n var userId = 0;\n var buttonFeedType = document.getElementById(\"btnFeedLibrary\");\n if (buttonFeedType.value != 2) {\n userId = await getUserId(username);\n }\n\n var userPhotoLibrary = await getUserPublicPhotoLibrary(userId);\n var imageData = {};\n var i = 0;\n for (i = 0; i < userPhotoLibrary.length; i++) {\n if (userPhotoLibrary[i].Id === imageId) {\n imageData = userPhotoLibrary[i];\n break;\n }\n };\n\n // Image Display\n if (modalDisplayImage) {\n var imageUrl = 'https://img.rec.net/' + imageData.ImageName;\n //console.log(imageUrl);\n modalDisplayImage.src = imageUrl;\n }\n\n // Image ID\n if (modalImageId) {\n var szImageId = imageData.Id;\n modalImageId.innerText = szImageId;\n }\n\n // Activity Name\n var roomData = await getRoomInfo(imageData.RoomId);\n if (modalImageActivityName) {\n if (roomData.length >= 1) {\n var szActivityName = roomData[0].Name;\n modalImageActivityName.innerText = '^' + szActivityName;\n } else if (roomData === 'null') {\n modalImageActivityName.innerText = 'Null';\n } else {\n modalImageActivityName.innerText = \"Unavailable, room is not public.\"\n }\n }\n\n // Event Name\n if (modalImageEventName) {\n var szEventName = imageData.PlayerEventId;\n if (szEventName === null || szEventName === undefined) {\n szEventName = \"No event data.\";\n }\n modalImageEventName.innerText = szEventName;\n }\n\n // Tagged Players\n if (imageData.TaggedPlayerIds.length > 0) {\n var playerInfoJson = await getUsernameFromId(imageData.TaggedPlayerIds);\n if (modalImageTaggedPlayers) {\n var szTaggedPlayers = \"\";\n var i = 0;\n playerInfoJson.forEach(item => {\n if (i == playerInfoJson.length - 1) {\n szTaggedPlayers = szTaggedPlayers + (item.displayName + \" (@\" + item.username + \") \\r\\n\");\n } else {\n szTaggedPlayers = szTaggedPlayers + (item.displayName + \" (@\" + item.username + \"), \\r\\n\");\n }\n });\n modalImageTaggedPlayers.innerText = szTaggedPlayers;\n }\n } else {\n modalImageTaggedPlayers.innerText = \"No players were tagged.\";\n }\n\n // Cheer Count\n if (modalImageCheerCount) {\n var szCheerCount = imageData.CheerCount;\n modalImageCheerCount.innerText = szCheerCount;\n }\n\n // Comment Count\n if (modalImageCommentCount) {\n var szCommentCount = imageData.CommentCount;\n modalImageCommentCount.innerText = szCommentCount;\n }\n\n // Image Date\n if (modalImageDate) {\n var szDate = imageData.CreatedAt;\n modalImageDate.innerText = moment(szDate).format('MMMM Do YYYY, h:mm a') + ' (' + moment(szDate, \"YYYYMMDD\").fromNow() + ')';\n }\n\n // RN Image Link\n if (modalImageRnLink) {\n var szUrl = \"https://rec.net/image/\" + imageData.Id;\n modalImageRnLink.innerText = szUrl;\n modalImageRnLink.setAttribute(\"onclick\", \"openImageInBrowser(\" + imageData.Id + \"); return false;\");\n }\n}", "function loadPlayers() {\n // Selects all of the data from the MySQL products table\n connection.query(\"SELECT Player, (MP/G)*(USGP)*(PER/4 + TSP/3 + 3PAR/4 + FTR/4 + TRBP/3 + ASTP/3 + STLP/4 + BLKP/4 - TOVP/4) + 100*(OWS + DWS/2 + WS + WS48) + 20*(OBPM + DBPM/2 + BPM + VORP) AS rawAdv FROM playersadvanced WHERE Tm ='HOU' OR Tm='GSW' ORDER BY rawAdv DESC LIMIT 200\", function(err, res) {\n if (err) throw err;\n\n // Draw the table in the terminal using the response\n console.table(res);\n });\n}", "function preloadFood() {\n for (let i = 0; i < numImgFood; i++) {\n // Add the loaded images to the images array.\n imgFood.push(loadImage(`assets/images/food/food${i}.png`));\n }\n}", "function loadListFunctionality() {\n return fetch(API_URL)\n .then(function (response) {\n return response.json();\n })\n .then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url,\n };\n pokemonRepository.add(pokemon);\n });\n })\n .catch(function (e) {\n console.error(e);\n });\n}", "function loadImageSource(provider) {\r\n return new Promise(function(resolve, reject) {\r\n // Temporarily grab images from redditbooru\r\n require('./js/service-connectors/' + provider + '.js', function(provider) {\r\n provider().then(function(data) {\r\n images = data;\r\n lightbox.setData(data);\r\n imageGrid.render(images);\r\n });\r\n });\r\n });\r\n }", "async function loadingImg() {\r\n let img = await prom; // continuation of function will halt till prom is resolved\r\n\r\n let id = self.createID()\r\n self.fill_ID_ImageHash(id,img)\r\n img.id = id\r\n \r\n // now we can set options for image, or do something else with it\r\n if (ops) {\r\n img.set(ops)\r\n };\r\n\r\n\r\n if (canv) {\r\n canv.add(img);\r\n } else {\r\n self.canvas.add(img)\r\n }\r\n\r\n if (cb) {\r\n cb(img)\r\n\r\n };\r\n\r\n //return img\r\n }", "function listFotos(id){\r\n fetch(\"/Trabalho_F/php/getPhotosP.php?\"+\"user=\"+id).then(function(resp){\r\n return resp.json();\r\n }).then(function(data){\r\n // obter grid\r\n var grid = document.getElementById(\"images-profile\");\r\n if(data.imagens ==\"noImages\"){\r\n var ups = document.createElement(\"h5\");\r\n ups.classList=\"lead\";\r\n ups.innerHTML=\"No photos avaible\";\r\n grid.appendChild(ups);\r\n }\r\n else if(data.imagens.length>0){\r\n \r\n for(var i=0;i<data.imagens.length;i++ ){\r\n\r\n var cards = document.createElement(\"div\");\r\n cards.className=\"col-md-5 center-block\";\r\n \r\n var content = document.createElement(\"div\");\r\n content.className=\"card mb-5 shadow-sm\";\r\n\r\n var head = document.createElement(\"div\");\r\n head.className=\"card-header\";\r\n\r\n var btnDelete = document.createElement(\"btn\");\r\n btnDelete.type=\"button\";\r\n btnDelete.id=data.imagens[i].id_imagem;\r\n btnDelete.className=\"btn btn-sm btn-warning\";\r\n btnDelete.addEventListener(\"dblclick\", function(event){\r\n event.preventDefault();\r\n $.get(\"/Trabalho_F/php/deletePhoto.php?\",{id:this.id});\r\n location.reload();\r\n })\r\n\r\n var span = document.createElement(\"span\");\r\n span.innerHTML=\"Delete Image\";\r\n btnDelete.appendChild(span);\r\n head.appendChild(btnDelete);\r\n content.appendChild(head);\r\n\r\n var img_display = document.createElement(\"img\");\r\n img_display.className = \"bd-placeholder-img card-img-top\";\r\n var path_img = data.imagens[i].url_image;\r\n var imgs = path_img.replace('c:/wamp64/www','');\r\n img_display.src=imgs;\r\n img_display.width=\"100%\";\r\n img_display.height=\"500\";\r\n img_display.preserveAspectRatio=\"xMidYMid slice\";\r\n img_display.focusable=\"false\";\r\n\r\n content.appendChild(img_display);\r\n\r\n var card = document.createElement(\"div\");\r\n card.className=\"card-body\";\r\n\r\n var descs = document.createElement(\"p\");\r\n descs.className=\"card-text\";\r\n descs.innerHTML=data.imagens[i].descriptions;\r\n card.appendChild(descs);\r\n\r\n var locBtns = document.createElement(\"div\");\r\n locBtns.className=\"d-flex justify-content-between align-items-center\";\r\n\r\n var btns = document.createElement(\"div\");\r\n btns.className=\"btn-group\";\r\n\r\n var btnUp = document.createElement(\"btn\");\r\n btnUp.type=\"button\";\r\n btnUp.id=data.imagens[i].id_imagem;\r\n btnUp.addEventListener(\"click\",function(event){\r\n event.preventDefault()\r\n if(this.className==\"btn btn-sm btn-outline-success\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:0})\r\n .done(function(data){\r\n if(data==\"Upvote\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints+1;\r\n }\r\n }\r\n }\r\n })\r\n this.className=\"btn btn-sm btn-success\";\r\n var aux = document.getElementsByClassName(\"btn btn-sm btn-danger\");\r\n for(var x = 0; x < aux.length; x++){\r\n if(aux[x].id==this.id){\r\n aux[x].className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n }\r\n }\r\n else if(this.className==\"btn btn-sm btn-success\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:1})\r\n .done(function(data){\r\n if(data==\"Pontuacao anulada\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints-1;\r\n }\r\n }\r\n }\r\n })\r\n this.className=\"btn btn-sm btn-outline-success\";\r\n }\r\n })\r\n\r\n var btnDown = document.createElement(\"btn\");\r\n btnDown.type=\"button\";\r\n btnDown.id=data.imagens[i].id_imagem\r\n btnDown.addEventListener(\"click\",function(event){\r\n event.preventDefault()\r\n if(this.className==\"btn btn-sm btn-outline-danger\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:2})\r\n .done(function(data){\r\n if(data==\"Downvote\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints-1;\r\n }\r\n }\r\n } \r\n })\r\n this.className=\"btn btn-sm btn-danger\";\r\n var aux = document.getElementsByClassName(\"btn btn-sm btn-success\");\r\n for(var x = 0; x < aux.length; x++){\r\n if(aux[x].id==this.id){\r\n aux[x].className=\"btn btn-sm btn-outline-success\";\r\n }\r\n }\r\n }\r\n else if(this.className==\"btn btn-sm btn-danger\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:1})\r\n .done(function(data){\r\n if(data==\"Pontuacao anulada\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints+1;\r\n }\r\n }\r\n }\r\n })\r\n this.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n })\r\n\r\n \r\n var iconDown = document.createElement(\"object\");\r\n iconDown.data=\"/Trabalho_F/icons/arrow-down.svg\";\r\n iconDown.type=\"image/svg+xml\";\r\n iconDown.width=\"24\";\r\n iconDown.height=\"24\";\r\n var iconUp = document.createElement(\"object\");\r\n iconUp.data=\"/Trabalho_F/icons/arrow-up.svg\";\r\n iconUp.type=\"image/svg+xml\";\r\n iconUp.width=\"24\";\r\n iconUp.height=\"24\";\r\n\r\n btnUp.appendChild(iconUp);\r\n btnDown.appendChild(iconDown);\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'GET',\r\n url: \"/Trabalho_F/php/getReact.php?\"+\"photo=\"+data.imagens[i].id_imagem,\r\n success: function(datas) {\r\n var obj = JSON.parse(datas);\r\n if(obj==1){\r\n btnUp.className=\"btn btn-sm btn-outline-success\";\r\n btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n else if(obj.react.ponto == 1){\r\n btnUp.className=\"btn btn-sm btn-success\";\r\n btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n else if(obj.react.ponto == -1){\r\n btnUp.className=\"btn btn-sm btn-outline-success\";\r\n btnDown.className=\"btn btn-sm btn-danger\";\r\n }\r\n else{\r\n btnUp.className=\"btn btn-sm btn-outline-success\";\r\n btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n }\r\n });\r\n\r\n // $.get(\"/Trabalho_F/php/getReact.php?\"+\"photo=\"+data.imagens[i].id_imagem)\r\n // .done(function (data) {\r\n // if(data==1){\r\n // btnUp.className=\"btn btn-sm btn-outline-success\";\r\n // btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n // }\r\n // else if(data.react.ponto == 1){\r\n // btnUp.className=\"btn btn-sm btn-success\";\r\n // btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n // }\r\n // else if(data.react.ponto == -1){\r\n // btnUp.className=\"btn btn-sm btn-outline-success\";\r\n // btnDown.className=\"btn btn-sm btn-danger\";\r\n // }\r\n // else{\r\n // btnUp.className=\"btn btn-sm btn-outline-success\";\r\n // btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n // }\r\n // })\r\n // .fail(function (xhr) {\r\n // console.log(xhr);\r\n // });\r\n\r\n\r\n btns.appendChild(btnUp);\r\n btns.appendChild(btnDown);\r\n\r\n locBtns.appendChild(btns);\r\n\r\n var pontos = document.createElement(\"p\");\r\n pontos.className=\"lead pontos\";\r\n pontos.id=data.imagens[i].id_imagem;\r\n pontos.innerHTML=data.imagens[i].pontos;\r\n\r\n locBtns.appendChild(pontos);\r\n\r\n var time = document.createElement(\"p\");\r\n time.className=\"text-muted\";\r\n time.innerHTML=data.imagens[i].dates;\r\n\r\n locBtns.appendChild(time);\r\n\r\n card.appendChild(locBtns);\r\n\r\n content.appendChild(card);\r\n\r\n cards.appendChild(content);\r\n\r\n grid.appendChild(cards);\r\n\r\n } \r\n }\r\n })\r\n}", "function loadList() {\n return fetch(apiUrl).then(function (response) {\n return response.json();\n }).then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url\n };\n add(pokemon);\n });\n }).catch(function (e) {\n console.error(e);\n });\n }", "async getAllResults() {\n const results = await dbContext.Results.find().populate('profile', 'name picture').populate('game', 'name')\n return results\n }", "function loadAll(){\n\tchangeSeason()\n\tgetAnimeData()\n\tgetCharacterData()\n\tgetEpisodeData()\n\tgetImageData()\n\tgetVideoData()\n}", "function getPhotos() {\n imageCount = 0;\n ready = false;\n loader.hidden = false;\n if (random) {\n getRandomPhotos();\n } else {\n getSearchResults(query);\n }\n}", "function displayPhoto(data, howMuch) {\n var limiter = 0;\n\n if (howMuch && data.items.length > howMuch) {\n limiter = howMuch;\n show(\"data>howMuch\");\n show(limiter);\n } else {\n limiter = data.items.length;\n show(\"NO\");\n }\n\n for (var i = 0; i < limiter; i++) {\n\n //on stock les infos voulues pour y voir plus clair\n var photoInfos = data.items[i];\n var newPhoto = {\n id: i,\n title: photoInfos.title,\n media: photoInfos.media,\n tags: photoInfos.tags\n };\n\n // show(newPhoto);\n\n // on clone notre patron html pour faire une nouvelle photo\n var newPhotoHTML = $('#photoPatron').clone();\n\n // on viens modifier et injecter le contenu dans notre nouvelle photo\n newPhotoHTML.attr(\"id\", newPhoto.id);\n newPhotoHTML.addClass('grid-item');\n newPhotoHTML.find('img').attr('src', newPhoto.media.m);\n newPhotoHTML.find('img').css('opacity', 1);\n\n\n $(grid).prepend(newPhotoHTML);\n // add and lay out newly prepended items\n // .masonry('prepended', newPhotoHTML);\n\n }\n // $grid.imagesLoaded().progress(function(instance, image) {\n // var result = image.isLoaded ? 'loaded' : 'broken';\n // console.log('image is ' + result + ' for ' + image.img.src)\n // $grid.masonry('layout');\n // sr.reveal('.grid-item');\n // });\n $grid.imagesLoaded(function(instance) {\n $('#loadingDiv').hide();\n // $('.grid-item').find('img').css('opacity', 1);\n $grid.masonry('reloadItems');\n $grid.masonry('layout');\n });\n\n // $grid.masonry('reloadItems');\n // layout Masonry after each image loads\n\n\n }", "function getLoadedImages() {\r\n return images;\r\n }", "function LoadRoiTable(id) {\n const url = \"http://\"+document.location.hostname + \":8081/api/roi/state/?image=\" + id.toString();\n\n $.ajax({\n url: url,\n type: \"GET\",\n crossDomain: true,\n success: function (data) {\n $.each(data, function (roi) {\n //$('#ImageTags-' + id).append(\"<tr><td>\" + data.tags[tag] + \"</td></tr>\")\n AppendNewRoiToTable(id, data[roi])\n\n })\n }\n })\n\n}" ]
[ "0.5514424", "0.53767127", "0.5372775", "0.5362709", "0.5298192", "0.5244988", "0.5236877", "0.52081877", "0.5201501", "0.51782775", "0.5169627", "0.514522", "0.5143002", "0.5134626", "0.5133915", "0.51057476", "0.51000327", "0.5094199", "0.5090067", "0.50642043", "0.506246", "0.5060521", "0.5055671", "0.50368935", "0.5010533", "0.50074047", "0.49945933", "0.49923745", "0.4983342", "0.4979927", "0.49794322", "0.49734986", "0.49619806", "0.49571604", "0.49559653", "0.4939669", "0.4938938", "0.49387822", "0.49260837", "0.490999", "0.49060318", "0.48994794", "0.48973137", "0.4889569", "0.4874126", "0.48707092", "0.48635706", "0.4857735", "0.48485112", "0.4847015", "0.4845788", "0.48435298", "0.4841861", "0.48376903", "0.4825982", "0.48209873", "0.48204303", "0.48162687", "0.48140553", "0.4805451", "0.48046583", "0.4791561", "0.47895917", "0.47864532", "0.47858703", "0.47854447", "0.47821805", "0.47790185", "0.4774037", "0.47739077", "0.47739065", "0.47714397", "0.47606954", "0.4759764", "0.4756723", "0.47558096", "0.47487584", "0.4742386", "0.4736983", "0.4734327", "0.47338986", "0.4731937", "0.47289616", "0.47282884", "0.47265103", "0.4724799", "0.4724577", "0.47239435", "0.4720538", "0.471716", "0.47116596", "0.47113782", "0.47111076", "0.47050568", "0.47037756", "0.47033024", "0.47009075", "0.47004327", "0.4700337", "0.46987993", "0.46984604" ]
0.0
-1
Load opportunities from database and their images
get (OpportunityId, forceReload) { var d = $q.defer(); if(!this.loadedOpportunities[OpportunityId] || forceReload === true) { $http.get(`/api/opportunities/${OpportunityId}`) .then(response => { var opportunity = response.data; this.loadedOpportunities[OpportunityId] = opportunity; d.resolve(opportunity); }) .catch(err => { d.reject(err); }); } else { d.resolve(this.loadedOpportunities[OpportunityId]); } return d.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async show ({ params }) {\n const product = await Product.find(params.id)\n await product.loadMany(['image','evaluation'])\n return product\n }", "async function loadFromMongo() {\n axios.get(\"./api/unsplash\").then((res) => {\n let newImages = [];\n res.data.forEach((image) => {\n newImages.push({\n src: image.urls.regular,\n thumbnail: image.urls.thumb,\n alt: image.alt_description,\n caption: image.description\n ? image.description\n : image.alt_description,\n });\n });\n setImages([...images, ...newImages]);\n });\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 }", "fetchAndLoadExpenses() {\n this.expensesAdapter\n .getExpenses()\n .then(expenses => {\n expenses.forEach(expense => this.expenses.push(new Expense(expense)))\n })\n .then(() => {\n this.renderExpense()\n })\n }", "function fetchImgs() {\n const imgUrl = \"https://dog.ceo/api/breeds/image/random/4\";\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(results => insertImgs(results)) \n}", "function getEntries() {\n console.log(\"Getting Entries\");\n dbShellStudents.transaction(function(tx) {\n tx.executeSql(\"select id,name,image from students order by name\",[],renderEntries,dberrorhandler);\n }, dberrorhandler);\n}", "load(data) {\n // By default, if no user dimensions saved, we generate a 6mx4m garden\n const {width, length} = (typeof(data.garden.userDimensions) !== 'undefined')\n ? data.garden.userDimensions\n : {width: DEFAULT_USER_WIDTH, length: DEFAULT_USER_LENGTH};\n this.generate(width, length);\n\n data.garden.plants.map(jsonPlant => {\n const idImage = this.idGardenCounter;\n this.idGardenCounter = this.idGardenCounter + 1;\n const img = cst.PLANTS_IMAGES[jsonPlant.idPlant] || cst.DEFAULT_PLANT_IMAGE;\n fabric.Image.fromURL(`${cst.URL_IMAGES}/${img}`, oImg => {\n oImg.set({\n id: idImage\n });\n this.addPlantOnGrid(oImg, jsonPlant.idPlant, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, jsonPlant.position);\n });\n });\n }", "function preload() {\n images[0] = loadImage('assets/up.png');\n images[1] = loadImage('assets/down.png');\n\n \n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n content = new Content_Man('data/Content.csv');\n adventureManager = new AdventureManager(\"data/adventureStates.csv\", \"data/interactionTable.csv\");\n}", "function loadPhotos() {\n if ($scope.product) {\n if ($scope.product.photos) {\n if ($scope.product.photos.length > 0) {\n $scope.photos = $scope.product.photos;\n var indexesToDelete = [];\n for (var i = 0; i < $scope.photos.length; i++) {\n if (!Photos.checkIfImageData($scope.photos[i])) {\n indexesToDelete.push(i);\n }\n }\n for (i = 0; i < indexesToDelete.length; i++) {\n $scope.photos.splice(indexesToDelete[i], 1);\n }\n $scope.photosURLs = Photos.imageDataToUrls($scope.photos);\n $scope.selectPhoto(0);\n }\n }\n }\n }", "getImages() {\n return [\n {\n id: 1,\n src: '/' + process.env.PUBLIC_URL + 'images/event/tenis.jpg',\n name: 'tenis',\n },\n {\n id: 2,\n src: '/' + process.env.PUBLIC_URL + 'images/event/swim.jpg',\n name: 'swim',\n },\n {\n id: 3,\n src: '/' + process.env.PUBLIC_URL + 'images/event/baseball.jpg',\n name: 'baseball',\n },\n {\n id: 5,\n src: '/' + process.env.PUBLIC_URL + 'images/event/cycling.jpg',\n name: 'cycling',\n },\n {\n id: 6,\n src: '/' + process.env.PUBLIC_URL + 'images/event/football.jpg',\n name: 'football',\n },\n {\n id: 7,\n src: '/' + process.env.PUBLIC_URL + 'images/event/volleyball.jpg',\n name: 'volleyball',\n },\n {\n id: 8,\n src: '/' + process.env.PUBLIC_URL + 'images/event/hokej.jpg',\n name: 'hockey',\n },\n {\n id: 9,\n src: '/' + process.env.PUBLIC_URL + 'images/event/florbal.jpg',\n name: 'floorball',\n },\n {\n id: 10,\n src: '/' + process.env.PUBLIC_URL + 'images/event/basketbal.jpg',\n name: 'basketball',\n },\n {\n id: 11,\n src: '/' + process.env.PUBLIC_URL + 'images/event/golf.jpg',\n name: 'golf',\n },\n {\n id: 12,\n src: '/' + process.env.PUBLIC_URL + 'images/event/sipky.jpg',\n name: 'darts',\n },\n {\n id: 13,\n src: '/' + process.env.PUBLIC_URL + 'images/event/stolnihry.jpg',\n name: 'boardgames',\n },\n {\n id: 14,\n src: '/' + process.env.PUBLIC_URL + 'images/event/karty.jpg',\n name: 'cards',\n }\n ]\n }", "function loadResources(db) {\n var allResources = [];\n db.collection(\"characters\").get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n if (doc.exists) {\n let character = doc.data();\n for (var emotion in character.emotionURL) {\n if (!(character.emotionURL[emotion] == \"\")) {\n allResources.push(character.emotionURL[emotion])\n if (!(doc.id in characterImages)) {\n characterImages[doc.id] = {}\n }; \n characterImages[doc.id][emotion] = character.emotionURL[emotion]; \n } \n };\n } else {\n console.error(\"No data found for characters.\");\n }\n });\n })\n .then(() => {\n db.collection(\"stories\").get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n if (doc.exists) {\n stories.push({\n id: doc.id,\n data: doc.data()\n });\n let scenes = doc.data().scenes;\n for (var id in scenes) {\n allResources.push(scenes[id].imageUrl);\n }\n } else {\n console.error(\"No data found for stories.\");\n }\n });\n });\n })\n .then(() => {\n for (let i = 0; i < stories.length; i++) {\n extractStoryData(stories[i].data, stories[i]);\n }\n resources.load(allResources);\n resources.onReady(() => { init(db) });\n });\n}", "preload() {\n const images = Object.keys(ASSET.IMAGE).map(\n (imgKey) => ASSET.IMAGE[imgKey]\n );\n for (let image of images) {\n this.load.image(image.KEY, image.ASSET);\n }\n }", "function findImagesToLoad() {\n\tsetLazyImagePositions.call(this);\n\tconst imagesToLoad = getImagesInView(this.images);\n\tloadImages.call(this, imagesToLoad);\n}", "fetchData(url) {\n fetch(url)\n .then(res => res.json())\n .then(data => data.map(item => \n this.add(\n {\n id: item._id,\n name: item.name,\n category: item.category,\n description: item.description,\n price: item.price,\n images: item.images\n }\n )\n ))\n .catch(err => console.error(err))\n }", "preloadImages() {\n const {products} = this.props;\n const groups = _.keys(products.byGroup);\n const images = [];\n\n groups.map(name => {\n const productId = products.byGroup[name][0]\n const image = new Image();\n\n image.src = products.byId[productId].image; \n return images.push(image);\n });\n\n return images;\n }", "async loadOpinions() {\n const result = await Prediction.getOpinionsFromProjectId(this.state.portfolio._id);\n if (result.success) {\n this.props.setProjectOpinions(result.opinions);\n }\n }", "function createImages(venues) {\n for (let i = 0; i < venues.length; i++) {\n let venue = venues[i].venue;\n let titleid = '#title' + (i + 1);\n let imgid = '#img' + (i + 1);\n let imgsrc = '../../venue_imgs/' + venues[i].id + '.jpg';\n let imgalt = venue + 'Image';\n\n $(titleid).html(venue);\n $(imgid).attr('src', imgsrc);\n $(imgid).attr('alt', imgalt);\n }\n}", "loadPoke(){\n\t\t//testing\n\t\t//console.log(this.pokes[this.current].abilities);\n\n\t\tpokeName.innerHTML = this.pokes[this.current].name;\n\t\tpokePic.src=this.pokes[this.current].img;\n\t\tpokePic.alt=\"Image of \"+this.pokes.name;\n\t\t//console.log(this.pokes[this.current].img);\n\t\t$(\"#hp\").html(this.pokes[this.current].hp);\n\t\t$(\"#attack\").html(this.pokes[this.current].attack);\n\t\t$(\"#defense\").html(this.pokes[this.current].defense);\n\t\t//the number of abilities varries in number so I put it in its own function \n\t\tthis.createAbilities();\n\t}", "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 fetchPets () {\n let dogs = [];\n return fetch('../public/dogs.json')\n .then(function(response) { return response.json();})\n .then((data) => {\n dogs = data.dogs;\n galleryItems.load(dogs);\n galleryItems.enlarge();\n });\n}", "function loadImageList() {\n let filterElem = $('#filter_annotation_type');\n let filter = filterElem.val();\n let params = {\n image_set_id: gImageSetId\n };\n\n // select the corresponding annotation type for the label tool\n if (filter !== '' && !isNaN(filter)) {\n params.filter_annotation_type_id = filter;\n $('#annotation_type_id').val(filter);\n handleAnnotationTypeChange();\n }\n\n $.ajax(API_IMAGES_BASE_URL + 'imageset/load/?' + $.param(params), {\n type: 'GET',\n headers: gHeaders,\n dataType: 'json',\n success: function(data, textStatus, jqXHR) {\n if (data.image_set.images.length === 0) {\n // redirect to image set view.\n displayFeedback($('#feedback_image_set_empty'));\n filterElem.val('').change();\n return;\n }\n displayImageList(data.image_set.images);\n },\n error: function() {\n $('.annotate_button').prop('disabled', false);\n displayFeedback($('#feedback_connection_error'));\n }\n });\n }", "LoadImage(){\n var images=[]\n // hard coded for convenienceproxy to a static serving end point\n if(this.state.images!=undefined){\n this.state.images.map(i =>{\n images.push(\n this.request.getStamp()+'-' + i\n )\n })\n return images; \n }\n else{\n \n return null\n }\n }", "async function loadImagesIntoPage(userPhotoLibrary) {\n var imageDiv = document.getElementById(\"grid\");\n while (imageDiv.firstChild) {\n imageDiv.removeChild(imageDiv.firstChild);\n }\n\n // Generate image HTML\n var i = 0;\n for (i = 0; i < userPhotoLibrary.length; i++) {\n var img = document.createElement(\"img\");\n var imageUrl = 'https://img.rec.net/' + userPhotoLibrary[i].ImageName + '?width=500';\n img.setAttribute('data-src', imageUrl);\n img.classList.add(\"grid-image\");\n //img.src = \"\";\n\n var divGridItem = document.createElement(\"div\");\n divGridItem.classList.add(\"grid-item\");\n divGridItem.setAttribute('type', 'button');\n divGridItem.setAttribute('data-toggle', 'modal');\n divGridItem.setAttribute('data-target', '#imageDetailModal');\n divGridItem.setAttribute('onclick', 'loadDataImageDetailModal(' + userPhotoLibrary[i].Id + '); return false;');\n divGridItem.appendChild(img);\n\n if (userPhotoLibrary[i].CheerCount >= 1) {\n var divCheerContainer = document.createElement(\"div\");\n divCheerContainer.classList.add(\"imageCheerContainer\");\n divGridItem.appendChild(divCheerContainer);\n\n var cheerIcon = document.createElement(\"img\");\n cheerIcon.classList.add(\"imageCheerIcon\");\n cheerIcon.setAttribute('src', './images/cheer.png');\n\n // add image to container\n divCheerContainer.appendChild(cheerIcon);\n\n var cheerCount = document.createElement(\"div\");\n cheerCount.classList.add(\"imageCheerText\");\n cheerCount.innerText = userPhotoLibrary[i].CheerCount;\n\n // add div to container\n divCheerContainer.appendChild(cheerCount);\n }\n\n var src = document.getElementById(\"grid\");\n src.appendChild(divGridItem); // append Div\n }\n\n const targets = document.querySelectorAll('img');\n const lazyLoad = target => {\n let observer = {\n threshold: 1\n }\n const io = new IntersectionObserver((entries, observer) => {\n\n entries.forEach(entry => {\n\n if (entry.isIntersecting) {\n const img = entry.target;\n const src = img.getAttribute('data-src');\n\n if (img.hasAttribute('data-src')) {\n img.setAttribute('src', src);\n }\n observer.disconnect();\n }\n });\n });\n io.observe(target);\n };\n targets.forEach(lazyLoad);\n}", "async function Load_State_Of_Image_IDB() {\n image_annotations = await fns_DB_IDB.Get_Record(image_files_in_dir[image_index - 1])\n console.log(`in load state of image idb image annotations: ${JSON.stringify(image_annotations)} \n and the imageName : ${image_annotations.imageName}`)\n tagging_view_annotate.Display_Image_State_Results(image_files_in_dir,image_annotations)\n}", "function fetchImages() {\n $.getJSON(\"/images.php\", function(data) {\n preloadImages(data);\n }); \n }", "lazyLoad() {\n if(!this.state.loading && this.state.next) {\n const offset = this.state.offset + this.state.limit;\n this.getAlbums(offset);\n }\n }", "getInitialData() {\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\n if (error) {\n console.log(error);\n } else if (item == null) {\n // Gallery not found.\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\n } else {\n this.setState({ gallery: item,\n editGallery : {\n name: item.name,\n description: item.description\n }});\n\n // Get medias\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ images: [...items] });\n }\n });\n }\n });\n }", "function fetchPhotos(id) {\n\t\t\t// console.log('fetchPhotos',id)\n\t\t\tvar directory = '';\n\t\t\tvar filePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\tconsole.log('fetchPhotos',id,directory,filePath);\n\t\t\t// Load Stage photos\n\t\t\tif (id === 'thestage') {\n\t\t\t\tdirectory = 'stage';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (stagePicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tstagePicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Hall photos\n\t\t\telse if (id === 'thehall') {\n\t\t\t\tdirectory = 'hall';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (hallPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\thallPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Gallery photos\n\t\t\telse if (id === 'thegallery') {\n\t\t\t\tdirectory = 'lobby';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (galleryPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tgalleryPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Screening room photos\n\t\t\telse if (id === 'thescreeningroom') {\n\t\t\t\tdirectory = 'screening';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (screeningPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tscreeningPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function loadData(){\n\n var row = 0;\n var im = 0;\n var tempRow = [];\n for(idx=0; idx < cereals_data.length; idx++){\n // Let's load the image supposed to go with this\n var cell = {};\n cell.source = \"images/\" + cereals_data[idx].id + \".jpg\";\n //console.log(\"images/\" + cereals_data[idx].id + \".jpg\");\n tempRow.push(cell);\n im++;\n // Check if we loaded all the images for this row. In this case, push the row and go to the next one\n if(im == rowsModelSize[row]){\n pyramid.modelRows.push(tempRow);\n pyramid.idxModel.push(0);\n tempRow = [];\n im = 0;\n row++;\n }\n }\n}", "loadOpponent(data)\n {\n playSound(\"oppJoined\");\n if(game.id === data.id)\n {\n game.opponent = data.challenger\n game.opponentKey = data.challengerkey\n }\n else\n {\n game.opponent = data.username\n game.opponentKey = data.userkey\n }\n firebase.database().ref('/users/' + game.opponentKey).once('value').then(function(snapshot)\n {\n game.opponentBattleText = (snapshot.val().battleText);\n var img = (snapshot.val().image);\n firebase.storage().ref(img).getDownloadURL().then(function(url)\n {\n game.opponentPicURL = url;\n document.getElementById('opponentUsername').innerHTML = game.opponent;\n document.getElementById('opponentBattleText').innerHTML = '\"' + game.opponentBattleText +'\"';\n \n $('#opponentImage').attr('src', url);\n document.getElementById('opponentCard').style.visibility = \"visible\";\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\n 'right' : '0%'\n });\n game.opponentLeft = false;\n game.startMatch(data);\n })\n })\n }", "function addimage(req, res, nxt) {\n var newimage = { data: req.files[0].buffer };\n var arenaid = req.params.arenaid;\n Arena.findOne({ _id: arenaid }, function (err, arena) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n if (!arena) {\n return res.status(400).json({ error: 'the arena is not found' });\n }\n if (req.user && arena.service_provider == req.user._id) {\n arena.photos.push(newimage);\n arena.save(function (err) {\n if (err) {\n return res.status(500).json({ error: err.message });\n }\n });\n return res.json(arena);\n } else {\n return res.status(400).json({ error: 'you are not autherized to view this page' });\n }\n });\n}", "function loadData (data) {\n data.results.forEach((entry) => {\n const card = document.createElement('DIV')\n card.className = 'card'\n const innerHTML = `\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${entry.picture.medium}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${entry.name.first} ${entry.name.last}</h3>\n <p class=\"card-text\">${entry.email}</p>\n <p class=\"card-text cap\">${entry.location.city}, ${entry.location.state}</p>\n </div>`\n\n card.insertAdjacentHTML('beforeend', innerHTML)\n\n card.addEventListener('click', () => {\n showModal(entry)\n })\n document.querySelector('#gallery').insertAdjacentElement('beforeEnd', card)\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 fetchImageDataAndUpdateState() {\n\n const titleList = images.reduce((newList, img) => [...newList, img.title], []);\n\n hydrateDetailPageImages(titleList, currDetailPage).then(function(detailPage) {\n\n // Update wiki page from our in memory list\n wikiPages[pageID] = detailPage;\n\n // Dispatch our pages list update and set data for the current detail view\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n\n }).catch((e) => {\n console.error('Failed to hydrate image info on details page', e);\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n });\n }", "function loadEnemyImage(enemy) {\n\tvar large_enemy_image = enemy.img;\n\tdocument.getElementById(\"enemy-image\").innerHTML = '<img id=\"enemy\" src=\"images/people/' + large_enemy_image + '\" />';\n}", "function fetchDataPhotographer(){\n fetch('./FishEyeData.json')\n .then(res => res.json())\n .then( function (datas) {\n for( data of datas.photographers){\n allPhotographers.push(data);\n let photographer = new Photographer(data.name,data.id,data.city,data.country,data.portrait,data.tagline,data.price,data.tags);\n createCards(photographer);\n photographer.tags.forEach(value => { getTagsElement(value);})\n }\n showTagsNav();\n })\n .catch(error => alert (\"Erreur : \" + error));\n}", "function fetchDogs() {\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(data => renderDogs(data));\n}", "nextImage() {\n this.postFeatures();\n //get the scenes for the next lat/lng\n const collectionid = 'GOOGLE/GEO/ALL/SATELLITE/WORLDVIEW3/ORTHO/RGB';\n // const collectionid = 'LANDSAT/LC8_L1T_TOA';\n this._get(GEE_IMAGE_SERVER_ENDPOINT + \"getIdsForPoint?lng=\" + this.state.lng + \"&lat=\" + this.state.lat + \"&collectionid=\" + collectionid).then(json => {\n //the geeImageServer returns quasi-json data\n const sceneIds = eval(json.records.substring(json.records.indexOf(\"[\"), json.records.length - 1));\n //if there are scenes then get the first\n const sceneId = (sceneIds.length) ? sceneIds[0] : undefined;\n //load that scene\n if (sceneId) this.addGEEImage(sceneId);\n });\n }", "function load_news(list) {\n\tvar object_list = list.hits.hits;\n\tconsole.log(JSON.stringify(object_list));\n\tfor (var i = 0; i < object_list.length; i++) {\n\t\t// Populate the values of the graph here\n\t\tcurr_latitude = object_list[i]._source.location[1];\n\t\tcurr_longitude = object_list[i]._source.location[0];\n\t\t//Check if the following variable is correct or not (most probably will require dominant emotion)\n\t\tobject_list[i]._source.img_source = image_emotion_mapper(object_list[i]._source.emotion);\n\n\t}\n\n}", "function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}", "function loadFlickrPhotos() {\n var photoSetId, photoSetName;\n photoSetId = this.id.substring(2); // remove \"ps\" prefix\n photoSetName = $(this).text();\n\n // Get all the photos associated with the given photoset id.\n $.getJSON('/photos/' + photoSetId).then(\n function (data) {\n $('#photos').empty();\n Object.keys(data).sort().forEach(function (title) {\n var photo = data[title];\n loadFlickrPhoto(photo);\n });\n });\n }", "function large_image(result){\n\tvar parsed = JSON.parse(result);\n\tvar image_url = parsed.collection.items[1].href;\n\tvar image_spot = document.getElementById('side_image');\n\t\n\tdocument.getElementById('loading_photo').style.display = \"none\";\n\t\n\tvar img = new Image(); \n\timg.src = image_url;\n\timg.setAttribute('width',\"100%\");\n\timage_spot.appendChild(img);\n}", "function fetchDBPokemons() {\n $.ajax({\n url: './php/pokemon/pokemon-list.php',\n type: 'GET',\n success: function (response) {\n let pokemons_response = JSON.parse(response);\n pokemons_response.forEach(pokemon => {\n pokemons.push({\n \"id\": pokemon.id,\n \"img\": pokemon.imagen,\n \"poke_types\": pokemon.type,\n \"name\": pokemon.name\n });\n createPokemonCard(pokemon);\n });\n }\n })\n}", "function onLoadData(data, insert) {\n applyLayout();//for static pins\n\tdata = data.objects;\n\tpage++;\n\tvar maxImages = 10 //max images to include on tag/group pin flow cover\n\tvar minImages = 7 //min images to include on tag/group pin flow cover\n\tvar tags = {}\n\tvar i=0, length=data.length, image;\n\tfor(; i<length; i++) {\n\t\timage = data[i];\n\t\tvar html = '';\n\t\tvar userFav = 'False'\n\t\tvar userPin = 'False'\n\t\tvar userCmnt = 'False'\n\t\tvar repined = 'False' //TODO: used to determine if pin has been repined by authUser\n\t\t//layout for all views except for those listed below\n\t\tif (av != 'tags'){\n\t\t\tconsole.log('onLoadData() av != tags')\n\t\t\t\n\t\t\t//package pin data for js access(req for repin)\n\t\t\tpinA[image.id] = {\n\t\t\t\tsrcUrl:image.srcUrl,\n\t\t\t\timgUrl:image.imgUrl,//CHECK: this was changed from origin+image.image, if it works we dont need origin\n\t\t\t\t//the origin did not work with heroku due to amazon\n\t\t\t\t//thumbnail:origin+image.image,\n\t\t\t\trepin:image.id,//:TODO: this may need to be just id or pin object???\n\t\t\t};\n\t\t\t\n\t\t\tif (authUserO){\n\t\t\t\tfor (f in image.favorites){\n\t\t\t\t\tif (image.favorites[f].user.id == authUserO.id){\n\t\t\t\t\t\tuserFav = 'True';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (r in image.repins){\n\t\t\t\t\tif (image.repins[r].submitter.id == authUserO.id){\n\t\t\t\t\t\trepined = 'True';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (c in image.comments){\n\t\t\t\t\tif (image.comments[c].user_id == authUserO.id){\n\t\t\t\t\t\tuserCmnt = 'True';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (image.submitter.id == authUserO.id){\n\t\t\t\t\tuserPin = 'True'\n\t\t\t\t}\n\t\t\t}\n\t\t\t//SETUP HTML FOR LARGE PINS DISPLAY\n\t\t\thtml += '<div class=\"pin item\" id=\"'+image.id+'-pin\" data-favs=\"'+image.favorites.length+'\" data-cmnts=\"'+image.comments.length+'\" data-repins=\"'+image.repins.length+'\">';\n\t\t\t//IMAGE CONTAINER\n\t\t\t\thtml += '<div class=\"image touch-off\">';\n\t\t\t//OPTIONS\n\t\t\t\t\tif (authUserO.id !== 'anon'){\n\t\t\t\t\t//was used to toggle options//html += '<div class=\"pin-options-btn touch-off hide\"><i id=\"optionsBtn\" class=\"icon-cog\"data-state=\"False\" title=\"Show Options\"></i></div>';\n\t\t\t\t\thtml += '<div class=\"pin-options\">';\n\t\t\t//PIN OPTIONS BUTTON\n\t\t\t\t\t\thtml += '<div class=\"background-50 btn-lg\">';\n\t\t\t\t\t\t\tif (userPin == 'True' || authUserO.is_superuser){\n\t\t\t\t\t\t\thtml += '<div id=\"delete\" title=\"Delete\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/delete-pin/'+image.id+'/\">';\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-trash\"></i>'\n\t\t\t\t\t\t\t\thtml += '<br>Delete</a></div>';\n\t\t\t\t\t\t\thtml += '<div id=\"edit\" title=\"Edit\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/edit-pin/'+image.id+'/\">';\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-edit\"></i>'\n\t\t\t\t\t\t\t\thtml += '<br>Edit</a></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += '<div id=\"favs\" data-state=\"'+userFav+'\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/fav-pin/'+image.id+'/\">'\n\t\t\t\t\t\t\t\tif (userFav == 'True') {\n\t\t\t\t\t\t\t\thtml += '<i title=\"Remove Favorite\" class=\"icon-star icon-star-empty\"></i>';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += '<i title=\"Add Favorite\" class=\"icon-star\"></i>';\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\thtml += '<br>Fav</a></div>'\n\t\t\t\t\t\t\tif (userPin == 'False' && repined == 'False'){\n\t\t\t\t\t\t\thtml += '<div id=\"repins\" data-state=\"'+userPin+'\" title=\"Re-Pin\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/re-pin/'+image.id+'/\">'\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-plus\"></i><br>Add</a></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thtml += '<div id=\"cmnts\" data-state=\"True\" title=\"Comment\" class=\"inline option\">'\n\t\t\t\t\t\t\t\thtml += '<a href=\"'+pinsPrefix+'/cmnt-pin/'+image.id+'/\">'\n\t\t\t\t\t\t\t\thtml += '<i class=\"icon-chat\"></i><br>Comm</a></div>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t//SOURCE BUTTON\n\t\t\t\t\t\thtml += '<div id=\"source\" class=\"background-50 btn-lg\">';\n\t\t\t\t\t\t\thtml += '<a target=\"_blank\" href=\"'+image.srcUrl+'\">'\n\t\t\t\t\t\t\thtml += '<div class=\"inline option one-icon\"><i class=\"icon-bookmark\"></i><br>GO</div>';\n\t\t\t\t\t\t\thtml += '<div class=\"inline one-text\">'+getHost(image.srcUrl)+'</div></a>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t//PIN NAVIGATION\n\t\t\t\t\t\thtml += '<div id=\"details\" class=\"background-50 btn-lg\">';\n\t\t\t\t\t\t\thtml += '<div id=\"info\" title=\"Pin Details\" class=\"inline\">';\n\t\t\t\t\t\t\t\thtml += '<a href=\"/pin/'+image.id+'/\">';\n\t\t\t\t\t\t\t\t\thtml += '<div class=\"inline option two\"><i class=\"icon-info-sign\"></i><br>Detail View</div>';\n\t\t\t\t\t\t\t\thtml += '</a>';\n\t\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\t\thtml += '<div class=\"inline divider spacer\"></div>';\n\t\t\t\t\t\t\thtml += '<div id=\"large-image\" title=\"Large Image\" class=\"inline\">';\n\t\t\t\t\t\t\t\thtml += '<a href=\"\">';\n\t\t\t\t\t\t\t\t\thtml += '<div class=\"inline option two\"><i class=\"icon-zoom-in\"></i><br>Zoom Image</div>';\n\t\t\t\t\t\t\t\thtml += '</a>';\n\t\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t}\n\t\t\t//IMAGE\n\t\t\t\t\thtml += '<div class=\"img-btn touch-off\"></div>';//prevent fancybox & toggle options\n\t\t\t\t\thtml += '<a class=\"pin-img fancybox\" rel=\"pins\" href=\"'+image.image+'\">';\n\t\t\t\t\thtml += '<img src=\"'+image.thumbnail+'\" width=\"200\" ></a>';\n\t\t\t\thtml += '</div>';\n\t\t\t//INFO - STATS\n\t\t\t\t//submitter\n\t\t\t\thtml += '<div class=\"pin-info\">';\n\t\t\t\t\thtml += '<l><span class=\"\">By: </span>'\n\t\t\t\t\thtml += '<a class=\"pin-submitter\" title=\"User\\'s pins\" href=\"/user/'+image.submitter.id+'/\">'+image.submitter.username+'</a></l>';\n\t\t\t\thtml += '</div>';\n\t\t\t\t//favs\n\t\t\t\thtml +='<div class=\"pin-stats pull-right dropdown display favs\">'\n\t\t\t\t\thtml += '<div class=\"stat dropdown-toggle\" id=\"dLabel\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\">'\n\t\t\t\t\thtml += '<i class=\"icon-favs\"></i><span class=\"text light favs \">'+image.favorites.length+'</span></div>';\n\t\t\t\t\thtml += '<ul class=\"list-favs dropdown-menu dm-caret\" role=\"menu\" aria-labelledby=\"dLabel\">';\n\t\t\t\t\tuu = uniqueUsers(image.favorites, 'user')\n\t\t\t\t\tfor (u in uu){\n\t\t\t\t\t\thtml += '<li id=\"'+uu[u].id+'\" class=\"display favs item\"><a href=\"/user/'+uu[u].id+'/\">'+uu[u].username+'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\thtml +='</div>'\n\t\t\t\t//cmnts\n\t\t\t\thtml +='<div class=\"pin-stats pull-right dropdown display cmnts\">'\n\t\t\t\t\thtml += '<div class=\"stat dropdown-toggle\" id=\"\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\">'\n\t\t\t\t\thtml += '<i class=\"icon-cmnts\"></i><span class=\"text light cmnts \">'+image.comments.length+'</span></div>';\n\t\t\t\t\thtml += '<ul class=\"list-cmnts dropdown-menu dm-caret\" role=\"menu\" aria-labelledby=\"\">';\n\t\t\t\t\tuu = uniqueUsers(image.comments, 'user')\n\t\t\t\t\tfor (u in uu){\n\t\t\t\t\t\thtml += '<li id=\"'+uu[u].id+'\" class=\"display cmnts item\"><a href=\"/user/'+uu[u].id+'/\">'+uu[u].username+'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\thtml +='</div>'\n\t\t\t\t//repin\n\t\t\t\thtml +='<div class=\"pin-stats pull-right dropdown display repins\">'\n\t\t\t\t\thtml += '<div class=\"stat dropdown-toggle\" id=\"\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\">'\n\t\t\t\t\thtml += '<i class=\"icon-plus\"></i><span class=\"text light repins\">'+image.repins.length+'</span></div>';\n\t\t\t\t\thtml += '<ul class=\"list-repins dropdown-menu dm-caret\" role=\"menu\" aria-labelledby=\"\">';\n\t\t\t\t\tuu = uniqueUsers(image.repins, 'submitter')\n\t\t\t\t\tfor (u in uu){\n\t\t\t\t\t\thtml += '<li id=\"'+uu[u].id+'\" class=\"display repins item\"><a href=\"/user/'+uu[u].id+'/\">'+uu[u].username+'</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\thtml +='</div>';\n\t\t\t//DESCRIPTION\n\t\t\t\thtml += '<div class=\"pin-desc\">';\n\t\t\t\t\tif (image.description) html += '<p id=\"desc\">'+image.description+'</p>';\n\t\t\t\thtml += '</div>';\n\t\t\t//TAGS\n\t\t\t\thtml += '<div class=\"pin-tags section\">';\n\t\t\t\tif (image.tags) {\n\t\t\t\t\thtml += '<l>';\n\t\t\t\t\thtml += '<span>Groups: </span>'\n\t\t\t\t\tfor (tag in image.tags) {\n\t\t\t\t\t\thtml += '<span class=\"tag\" onclick=\"loadData(\\'' + image.tags[tag] + '\\')\">' + image.tags[tag] + '</span> ';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</l>';\n\t\t\t\t}\n\t\t\t\thtml += '</div>';\n\t\t\t//COMMENTS\n\t\t\t\tif (authUserO){\n\t\t\t\t\thtml += '<div class=\"section pin-cmnts\">';\n\t\t\t\t\t\tif (image.comments){ \n\t\t\t\t\t\t\tfor (cmnt in image.comments) {\n\t\t\t\t\t\t\t\t//TODO: get user object from CmntResource instead or build one so user vars are consistant.\n\t\t\t\t\t\t\t\t//console.log(image.comments[cmnt])\n\t\t\t\t\t\t\t\thtml += insertComment(image.comments[cmnt].username, image.comments[cmnt].user_id, image.comments[cmnt].comment, parseInt(image.comments[cmnt].id))\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\thtml += '</div>'//end pin-cmnts;\n\t\t\thtml += '</div>'//end pin;\n\n\t\t\t//inserts pin into docuement\n\t\t\tif (insert==\"prepend\"){\n\t\t\t\t$('#pins').prepend(html);\n\t\t\t}else{\n\t\t\t\t$('#pins').append(html);\n\t\t\t}\n\t\t\t//\n\t\t\t//hide elements as required\n\t\t\thidePinComponents(image.id)\n\t\t\t\n\t\t\tapplyLayout1(image.id);//for each pin individual pin\n\t\t}//end typical view\n\t\t\n\t\t//lay out tags/group view\n\t\tif (av == 'tags'){\n\t\t\tconsole.log('-loadData-av == tags')\n\t\t\t//console.log('----setting up group: '+image.tags)\n\t\t\t\n\t\t\t//*TODO: seperate muti tags into individual tags\n\t\t\t//*TODO: Bug on groups scroll to bottom and url refresh (most likely related) check av flow.\n\t\t\t\n\t\t\t//build tags array for creation of tag/group covers\n\t\t\tfor (key in image.tags){\n\t\t\t\ttag = image.tags[key]\n\t\t\t\t//add image.tags to tags array if it is not already there. bump zero qty. to one\n\t\t\t\tif (!tags[tag]) {tags[tag]=1}else{tags[tag]=tags[tag]+1};\n\t\t\t\t//add group for each unique tag in tags array.\n\t\t\t\tif (tags[tag] == 1){\n\t\t\t\t\ttagId = idSafe(tag)\n\t\t\t\t\thtml += '<div class=\"pin group\" id=\"'+tagId+'\">'\n\t\t\t\t\t\thtml += '<a class=\"thumbs\"></a>'\n\t\t\t\t\t\thtml += '<div class=\"info\">'\n\t\t\t\t\t\t\thtml += '<h5><a class=\"title\">'+tag+'</a></h5>'\n\t\t\t\t\t\t\thtml += '<div class=\"details\"></div>'\n\t\t\t\t\t\thtml += '</div>'\n\t\t\t\t\thtml += '</div>'\n\t\t\t\t}\n\t\t\t}//end for\n\t\t\t\n\t\t\t$('#pins').append(html);\n\t\t\t\n\t\t\t//for each tag/group in images.tags, add image to tag/group untill max images reached\n\t\t\tfor (key in image.tags){\n\t\t\t\ttag = image.tags[key]\n\t\t\t\tconsole.log('image.tags: '+image.tags)\n\t\t\t\tconsole.log('key: '+key)\n\t\t\t\tconsole.log('image.tags[key]: '+image.tags[key])\n\t\t\t\tconsole.log('tag: '+tag)\n\t\t\t\tconsole.log('tags (below)')\n\t\t\t\tconsole.log(tags)\n\t\t\t\tconsole.log(tags[tag])\n\t\t\t\t//add images to group untill max images reached\n\t\t\t\tif (tags[tag] <= maxImages){\n\t\t\t\t\ttagId = idSafe(tag)\n\t\t\t\t\tconsole.log('--adding image to tag id: '+tagId)\n\t\t\t\t\t$('#'+tagId+' .thumbs').append('<div class=\"'+tagId+' thumb\"><img src=\"'+image.thumbnail+'\" alt=\"\"></div>');\n\t\t\t\t\tw = image.image.wdth\n\t\t\t\t\th = image.image.height\n\t\t\t\t\t//todo finish resize images for icon square, also change image ref to thumb.\n\t\t\t\t}\n\t\t\t}//end for\n\t\t\tapplyLayout();\n\t\t}//end tag/group view\n\t}//end image for loop\n\t// for each tag add place holder images as required by min/max\n\tif (av == 'tags'){\n\t\tfor (key in tags){\n\t\t\ttagId = idSafe(key)\n\t\t\tconsole.log('--key: '+key)\n\t\t\tconsole.log('--tagId: '+tagId)\n\t\t\t//for tags with one image\n\t\t\tif (tags[key]==1) {\n\t\t\t\t$('#'+tagId+' .thumbs .thumb').addClass('p1');\n\t\t\t//TODO: add formatting for other image quantities here.\n\t\t\t//add extra blank images for pin layout if there are not enough existing then apply the layout\n\t\t\t}else if (tags[key] <= maxImages){\n\t\t\t\t//console.log('--<10 key: '+key)\n\t\t\t\t$('#'+tagId+' .thumbs .thumb').addClass('board');\n\t\t\t\tvar i=tags[key]\n\t\t\t\twhile (i < maxImages){\n\t\t\t\t\t//console.log('--while adding images key: '+key)\n\t\t\t\t\t$('#'+tagId+' .thumbs').append('<div class=\"thumb board space\"><img width=\"64px\" height=\"2px\" src=\"http://www.webdesign.org/img_articles/12337/1_002.jpg\" alt=\"\"></div>');\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\t//apply layout to pins in tag group\n\t\t\t\tlayoutThumbs('#'+tagId);\n\t\t\t}\n\t\t\t//fix up layout after extra images added\n\t\t\tapplyLayout();\n\t\t}\n\t}\n\tisLoading = false;\n\t$('#loader').hide();console.log('hiding loader')\n\t//Apply layout to show any static pins in template\n\tapplyLayout();\n\t//TOUCH: DEVICE SETUP\n\tsetUpTouch(touchOn)\n}", "function index(req, res) {\n return _news2.default.find().populate('image', 'PublicID').exec().then(respondWithResult(res)).catch(handleError(res));\n}", "function loadAllPrepared(img,opt) {\n\t\tif (img.data('preloading')==1) return false;\n\n\t\tvar ar = opt.aspectratio,\n\t \t \taratio=parseInt(ar[0],0) / parseInt(ar[1],0),\n\t \t \tlimg = new Image();\n\n\n\n\n \t \tif (img.data('lazysrc')!=img.attr('src') && img.data('lazysrc')!=undefined && img.data('lazysrc')!='undefined') {\n\n\t\t\tif (img.data('lazysrc') !=undefined && img.data('lazysrc') !='undefined')\n\t\t\t\timg.attr('src',img.data('lazysrc'));\n\t\t}\n\n\t\timg.data('preloading',1);\n\n\t\tlimg.onload = function(loadedimg) {\n\t\t\timg.data('lazydone',1);\n\t\t\timg.data('ww',limg.width);\n\t\t\timg.data('hh',limg.height);\n\t\t\timg.closest('.showmeonload').addClass(\"itemtoshow\").removeClass(\"showmeonload\").addClass(\"loadedmedia\");\n\t\t\tevenImageRatio(img,opt);\n\t\t\tif (opt.lazyLoad==\"on\")\n\t\t\t\twaittorungGrid(img,opt,true);\n\n\t\t}\n\n\t\tlimg.onerror = function() {\n\t\t\t\timg.data('lazydone',1);\n\t\t\t\timg.closest('.showmeonload').addClass(\"itemtoshow\").removeClass(\"showmeonload\").addClass(\"loadedmedia\");\n\t\t\t\tif (opt.lazyLoad==\"on\")\n\t\t\t\t\twaittorungGrid(img,opt,true);\n\n\t\t\t}\n\n\n\t\tif (img.attr('src')!=undefined && img.attr('src')!='undefined')\n\t\t\tlimg.src = img.attr('src');\n\t\t else\n\t\t\tlimg.src = img.data('src');\n\n\t\tif (limg.complete) {\n\t\t\timg.data('lazydone',1);\n\t\t\timg.data('ww',limg.width);\n\t\t\timg.data('hh',limg.height);\n\t\t\timg.closest('.showmeonload').addClass(\"itemtoshow\").removeClass(\"showmeonload\").addClass(\"loadedmedia\");\n\t\t\tevenImageRatio(img,opt);\n\t\t\tif (opt.lazyLoad==\"on\")\n\t\t\t\twaittorungGrid(img,opt,true);\n\t\t}\n\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 load_img() {\n fabric.Image.fromURL('golf-h.png', function (img) {\n hole = img;\n hole.scaleToWidth(60);\n hole.scaleToHeight(60);\n hole.set({\n top: holey,\n left: holex\n });\n canvas.add(hole);\n });\n\n fabric.Image.fromURL('ball.png', function (img) {\n ball = img;\n ball.scaleToWidth(ballw);\n ball.scaleToHeight(ballh);\n ball.set({\n top: bally,\n left: ballx\n });\n canvas.add(ball);\n });\n}", "cellLoad(img) {\r\n\t\tlet portal = this.portalsViewModel.getPortal(img);\r\n\t\t\r\n\t\tconst url = PortalCell.readUrl(img);\r\n\t\t// fill display data\r\n\t\tthis.mainImg.src = url;\r\n\t\t//this.mainCaption.textContent = img.title;\r\n\t\tthis.mainCaption.innerHTML = `<a href=\"${url}\" target=\"_blank\">${img.title}</a>`;\r\n\t\tthis.mainSection.style.display = '';\r\n\t\tthis.mainForm.style.display = '';\r\n\r\n\t\t// prep internals\r\n\t\tthis.mainForm._zoomerImg = img;\r\n\t\tthis.mainForm._portal = portal;\r\n\r\n\t\t// init fields\r\n\t\tthis.updateDoneField(portal.done);\r\n\t\tthis.updatePuzzleField(portal);\r\n\t\tthis.updateDisplay(portal);\r\n\t\tthis.mainFields.notes.value = portal.notes;\r\n\t}", "function LoadAlternateIDTable() {\n\n var columns = [\n { dataField: 'Id', width:'0px' },\n { dataField: 'Name', caption: 'Name' }\n ];\n\n LoadGrid('.alternateidgridcontainer', 'altidgrid', columns, 'constituents/' + currentEntity.Id + '/alternateids', 'alternateids'\n , null, 'ai-', '.alternateidmodal', '.alternateidmodal', 250, false, true, false, null);\n}", "function dataload() {\r\n \r\n var param = [];\r\n var proc = 'hotels_list_get';\r\n SelectorNoSession1(param, proc).then(function (result) {\r\n $res = JSON.parse(result);\r\n\r\n if ($res.length != []) {\r\n $(\"#hotel_list\").empty();\r\n for ($i = 0; $i < $res[\"dt1\"].length; $i++) {\r\n $(\"#hotel_list\").append('<li>'+\r\n '<article class= \"box\" >'+\r\n '<figure>'+\r\n //'<a href=\"ajax/slideshow-popup.html\" class=\"hover-effect popup-gallery\">' +\r\n '<a onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id +')\" class=\"hover-effect popup-gallery\">' +\r\n \r\n '<img alt=\"\" style=\"height: 209px;\" src=' + \"/\" + $res[\"dt1\"][$i].images +'>' +\r\n '</a >'+\r\n '</figure>'+\r\n '<div class=\"details\">'+\r\n '<a title=\"View all\" onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id +')\" class=\"pull-right button uppercase popup-gallery\">'+'select'+'</a>'+\r\n '<h4 class=\"box-title\">' + $res[\"dt1\"][$i].Name + '</h4>'+\r\n '<label class=\"price-wrapper\">'+\r\n '<span class=\"price-per-unit\">' + 'RS' + $res[\"dt1\"][$i].Avg_Night +'</span>'+'avg/night'+\r\n '</label>'+\r\n '</div>'+\r\n '</article >'+\r\n '</li >');\r\n\r\n\r\n }\n\n for ($i = 0; $i < $res[\"dt1\"].length; $i++) {\r\n $(\"#imageCrousal\").append('<li>'+\r\n '<article class= \"box\">'+\r\n '<figure>'+\r\n '<a onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\" class=\"hover-effect popup-gallery\">' +\r\n //'<a onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\" class=\"hover-effect popup-gallery\">' +\r\n //'<img width=\"270\" height=\"161\" alt=\"\" src=\"~/online_services/assest/img/amin_hotel.jpg\">' + '</a>' +\r\n '<img alt=\"\" style=\"height:161px;width:270px\" src=' + \"/\" + $res[\"dt1\"][$i].images + '>' +\r\n '</figure>'+\r\n '<div class=\"details\">'+\r\n ' <span class=\"price\">'+\r\n '<small>'+ 'avg / night' +'</small>'\r\n + $res[\"dt1\"][$i].Avg_Night +\r\n '</span>' +\r\n\r\n //'<span class=\"price-per-unit\">' +\r\n //'RS' + $res[\"dt1\"][$i].Avg_Night + '</span>' + 'avg/night' +\r\n '<h4 class=\"box-title\">' + $res[\"dt1\"][$i].Name + '<small>' + $res[\"dt1\"][$i].District_Name + '</small>' + '</h4>' +\r\n '<div class=\"feedback\">'+\r\n '<div data-placement=\"bottom\" data-toggle=\"tooltip\" class=\"five-stars-container\" title=\"4 stars\">' +\r\n\r\n '<span style=\"width: 80%;\" class=\"five-stars\">' +\r\n\r\n '</span>' +\r\n\r\n '</div>' +\r\n ' <span class=\"review\">'+'270 reviews'+'</span>'+\r\n '</div>'+\r\n '<p class=\"description\">' + $res[\"dt1\"][$i].Description +'</p>'+\r\n '<div class=\"action\">'+\r\n '<a class=\"button btn-small\" onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\">' + 'SELECT' + '</a>' +\r\n //'<a title=\"View all\" onclick=\"FnDetailsPage(' + $res[\"dt1\"][$i].Id + ')\" class=\"pull-right button uppercase\">' + 'select' + '</a>' +\r\n '<a class=\"button btn-small yellow popup-map\" href=\"#\" data-box=\"48.856614, 2.352222\">'+'VIEW ON MAP'+'</a>'+\r\n '</div>'+\r\n '</div>'+\r\n '</article>'+\r\n '</li>');\r\n\r\n\r\n }\n }\r\n });\r\n}", "getImageByUserId(userId) {\r\n this.sql_getImageByUserId = `SELECT A.id, A.user_id, B.full_name, B.email_id, A.image, A.created, \r\n A.last_modified \r\n FROM user_image_tb A, user_tb B WHERE A.user_id = B.id AND A.user_id = ${userId}\r\n ORDER BY A.id ASC`;\r\n return this.apdao.all(this.sql_getImageByUserId);\r\n }", "function getAllUserImages(req, res, next) {\n db\n .any(\"SELECT img_url FROM users JOIN images ON users.id = images.user_id\")\n .then(function(data) {\n res.status(200).json({\n status: \"success\",\n data: data,\n message: \"Fetched all images for all users\"\n });\n })\n .catch(function(err) {\n return next(err);\n });\n}", "function getOpportunitySource(req, res) {\n if (!validator.isValid(req.body.companyId)) {\n res.json({code: Constant.ERROR_CODE, message: Constant.REQUIRED_FILED_MISSING});\n } else {\n source.find({companyId: req.body.companyId, moduleType: req.body.moduleType, deleted: false})\n .collation({locale: \"en\"})\n .sort({sourceName: 1})\n .exec(function(err, laborRatelist) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: laborRatelist});\n }\n\n });\n }\n}", "function loadDetails(place) {\n var photos = [];\n place.photos.forEach(function(photo) {\n photo.url = photo.getUrl({\n maxWidth: 300\n });\n photos.push(photo);\n });\n\n /* this is for handlebars to know where to place it in the html file */\n var html = detailsTemplate(place);\n $('#location-details-pane').html(html);\n}", "function getSingleImageInfo(req, res, next) {\n db\n .any(\"SELECT user_id AS image_owner_id, img_id, img_url, img_likes, comments.id AS comment_id, comment, comments.username AS commenters_username, comment_timestamp FROM comments JOIN images ON (img_id = images.id) WHERE img_id=${img_id} ORDER BY comment_timestamp DESC\",\n { img_id: req.params.img_id } \n )\n .then(function(data) {\n res.status(200).json({\n status: \"success\",\n data: data,\n message: \"Fetched info for single image\"\n });\n })\n .catch(function(err) {\n return next(err);\n });\n}", "function addImagesToPoi(poi_oid) {\n\t\n\t// add images\n\tfor (var img of poi_img_list) {\n\t\tvar img2poi_params = \"?oid=\" + poi_oid + \"&new_img_oid=\" + img.data.$id + \"&display_name=\" + img.name;\n\t\t\n\t\tjQuery.ajax({\n\t url: updatePoi_url + img2poi_params,\n\t data: null,\n\t type: \"POST\",\n\t async: true,\n\t contentType: \"application/json;charset=utf-8\",\n\t success: function(data) {\n\n\t },\n\t error: function(xhr, status, err) {\n\n\t alert(\"Image \" + img.data.$id + \" couldn't be added to POI \" + poi_oid + \".\");\n\t }\n\t });\n\t}\n\t\n\t// refresh poi\n\tpois.clearLayers();\n getPois(m.map);\n\t\n\t// clear lists\n\timg_list = new Array();\n\tjQuery(\"#poi_img_table\").html(\"\");\n\tjQuery(\"#poi_img_table_header\").html(\"\");\n\tjQuery(\"#poi_img_upload_status\").html(\"\");\n}", "function showModal(storyId){\n storyId = storyId.id;\n var story = JSON.parse(localStorage.getItem(\"stories\")).find(function (item) {\n return (item.story_id === storyId);\n })\n\n var images = story.input_image;\n\n var modal = document.getElementById(\"modal\");\n\n for (var i=0; i<images.length; i++){\n var modalImg = document.getElementById(\"img\"+(i+1));\n modal.style.display = \"block\";\n modalImg.src = images[i];\n\n }\n\n}", "componentDidMount() {\n fetch('/techniques/' + this.state.id)\n .then(res => res.json())\n .then(data => {\n //Fetch the ID so it can be used to fetch the images\n let id = data[0].id;\n if(id !== undefined){\n fetch('/techniques/' + id + '/images')\n .then(res => res.json())\n .then(data => this.setState({images: data}));\n }\n //Set the technique object asynchronously\n this.setState({technique: data[0]});\n });\n }", "function startLoadingImage(table){\t\n\tvar tab = ge(table+'_table');\n\ttab.rows[0].firstChild.innerHTML = \"<img src=\\'\" + easyCrudPath + \"css/img/loading2.gif\\' ></img>\";\t\n}", "function init() {\n imageContainers = [];\n if (product_id && !$model) {\n // Should look up the product by id and call render() when done()\n currentProduct = Alloy.createModel('product');\n currentProduct.id = product_id;\n currentProduct.ensureImagesLoaded('heroImage').done(function() {\n render();\n });\n } else {\n // Just render with what we have\n currentProduct.ensureImagesLoaded('heroImage').done(function() {\n render();\n }).fail(function() {\n logger.error('cannot get images!');\n });\n }\n}", "function load() {\n var apiurl_c = ENTRYPOINT + 'diseases/?type=c&top=5';\n var apiurl_d = ENTRYPOINT + 'diseases/?type=d&top=5';\n var apiurl_u = ENTRYPOINT + 'users/?type=status';\n\n personalAlert(\"CARGANDO \", \" -- Generando resultados...Cargando gráficas\", \"info\", 2000, true);\n\n rankingDead_db(apiurl_d);\n rankingContagion_db(apiurl_c);\n allUsers(apiurl_u);\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 }", "function populatePageSecondPart(tripId) {\n $.ajax({\n type: \"get\", url: \"/photos?tripId=\" + tripId,\n success: function (resultTwo) {\n for (var i = 0; i < resultTwo.length; i++) {\n $('<div class=\"col-md-4 photoImage\"> <img src=\"' + resultTwo[i]['photoLink'] + '\" alt=\"photo\" class=\"img-thumbnail\"> <h3>' + resultTwo[i]['title'] + '</h3></div>').insertAfter(\".googleMap\");\n }\n },\n\n error: function (error) {\n alert(\"The photos couldn't be loaded!\");\n }\n });\n }", "function loadData() {\n consolidatedresults.loaded = false;\n dataService.getConsolidatedResults()\n .then(function(response) {\n //handle the success condition here\n var data = response.data;\n consolidatedresults.realdata = data[0];\n consolidatedresults.col_names = data[1];\n consolidatedresults.loaded = true;\n // console.log(consolidatedresults.realdata);\n // console.log(consolidatedresults.col_names);\n });\n }", "function loadLatestImageByCategoryId(cell, cate_id, types){\n\tvar c_ads_library = Alloy.createCollection('categoryAds');\n\t \n\tif(types == \"popular\"){\n\t\tvar latestc = c_ads_library.getPopularAdsByCategory(cate_id, 1);\n\t}else{\n\t\tvar latestc = c_ads_library.getLatestAdsByCategory(cate_id, 0, 1);\n\t}\n\tconsole.log(latestc.length+\" latestc\");\n\tif(latestc.length > 0){\n\t\tvar adImage = Ti.UI.createImageView({\n \t\t\tdefaultImage: \"/images/warm-grey-bg.png\",\n\t\t\timage: latestc[0].img_path,\n\t\t\tcate_id: cate_id,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE\n\t\t});\n\t\tadImage.addEventListener(\"click\", goAds);\n \t\tcell.add(adImage);\n \t}else{\n \t\tvar adImage = Ti.UI.createImageView({\n \t\t\timage: \"/images/ComingSoon_2.png\",\n\t\t\tcate_id: cate_id,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE\n\t\t});\n \t\tcell.add(adImage);\n \t}\n}", "function loadExperiences(org) {\n self.loading = true;\n\n content.getExperiencesByOrg(org.id)\n .then(function(exps) {\n var expUserPromiseArray = [];\n\n data.appData.experiences = exps;\n data.experiences = exps;\n\n exps.forEach(function(exp) {\n expUserPromiseArray.push(account.getUser(exp.user)\n .then(function(user) {\n exp.user = user;\n }));\n });\n\n return $q.all(expUserPromiseArray);\n })\n .finally(function() {\n data.query = null;\n self.loading = false;\n self.action = 'experiences';\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 }", "getOpportunities() {\n firestore.onceGetNonValidatedOpportunities().then(snapshot => {\n let res = {};\n snapshot.forEach(doc => {\n res[doc.id] = doc.data();\n });\n this.setState(() => ({ opportunities: res }));\n })\n .catch(err => {\n console.log('Error getting documents', err);\n });\n }", "function LoadSuccess() {\n // Image: set properties\n that.Properties($i);\n // Image: all image loaded\n SetupAfterAllLoaded();\n }", "static fetchNeighborhoods () {\r\n return fetch(`${DBHelper.DATABASE_URL}/neighborhoods`).then(res => {\r\n return res.json().then(json => {\r\n return idb.cacheCollection('neighborhoods', json.neighborhoods).then(() => json.neighborhoods);\r\n });\r\n });\r\n }", "refreshWaypoints() {\n this.lazyImages.on('load', function() { /* on the 'load' event for any of the lazyImages */\n Waypoint.refreshAll(); /* let's refresh the main Waypoint object */\n });\n }", "function importInViewAndShowScore(data) {\n importInView.call(this, data);\n\n $('body').css(\"background\", \"url('img/6795655-gamer-wallpaper.jpg')\");\n table.getData();\n }", "function fetchData(url, select, img) {\n fetch(url) // First getting data\n .then(function (response) {\n return response.json();\n })\n .then(function (myJson) {\n addPokemonToDOM(myJson, select, img); // Add data to DOM\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "function loadProductImages(id){\n $('#product_detail_images').html('');\n $('#product_detail_thumbs').html('');\n var _token = $(\"input[name='_token']\").val();\n $.ajax({\n url: \"/product/load/images\",\n type:'POST',\n data: {_token:_token, id:id},\n dataType: 'json',\n success:function(response){\n $.each(response[0].images, function(key,value){\n $('#product_detail_images').append('<div class=\"lg-image\"><a href=\"/images/product/design/'+response[0].folder+'/'+value+'\" class=\"img-poppu\"><img src=\"/images/product/design/'+response[0].folder+'/'+value+'\" alt=\"product image\"></a></div>');\n $('#product_detail_thumbs').append('<div class=\"sm-image\"><img src=\"/images/product/design/'+response[0].folder+'/'+value+'\" alt=\"product image thumb\"></div>');\n });\n destroyCarousel();\n loadSlick();\n }\n });\n \n }", "async loadProperty() {\n await axios\n .post(`${this.host}/property/get-property`, {\n propertyId: window.location.pathname.split(\"/\")[2],\n })\n .then((res) => {\n this.state.id = res.data._id;\n let data = `\n <div class=\"images\">\n <div class=\"main-image-container\">\n <img class=\"img main-image\" src=\"/assets/img/alt/load-post.gif\" />\n </div>\n <div class=\"sub-images\">\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n <img class=\"img sub-image\" src=\"/assets/img/alt/load-post.gif\" />\n </div>\n </div>\n \n <div class=\"details\">\n <div class=\"preview-image-container\">\n <img class=\"preview-image\" />\n </div>\n <div class=\"row rwo-title\">\n <div class=\"title\">${res.data.title}</div>\n <div class=\"price\">Rs.${res.data.price}/Month</div>\n </div>\n <div class=\"row row-status\">\n <div class=\"status\">`;\n\n switch (res.data.property_status) {\n case \"0\":\n data += `<img class=\"btn\" title=\"NotAvailable\" src=\"/assets/icon/Available/NotAvailable_24px.png\"> Pending Approval`;\n break;\n case \"1\":\n data += `<img class=\"btn\" title=\"Available\" src=\"/assets/icon/Available/Available_24px.png\"> Available`;\n break;\n case \"2\":\n data += `<img class=\"btn\" title=\"Rejected\" src=\"/assets/icon/Available/rejected_24px.png\"> Rejected`;\n break;\n default:\n data += `<img class=\"btn\" title=\"Reserved\" src=\"/assets/icon/Available/reserved_24px.png\"> Reserved`;\n break;\n }\n\n data += `</div>\n <div class=\"favourite\" title=\"Add to favourite\"><img class=\"btn\" src=\"/assets/icon/Favourite/Heart_NotFilled_24px.png\"></div>\n <div class=\"share\" title=\"share\"><img class=\"btn\" src=\"/assets/icon/Share/share_24px.png\" id=\"share-post\"></div>\n </div>\n <div class=\"row\">\n <div class=\"description\">\n ${res.data.description}\n </div>\n </div>\n <div class=\"row\">\n <div class=\"features\">\n </div>\n </div>\n <div class=\"row\">\n <div class=\"contact-info\">\n <span class=\"show-contacts\"> <a>Show contacts </a></span>\n <div class=\"contacts\" id=\"contacts\">\n <span>Email: lakmal@gmail.com</span>\n <span>Mobile: 077 527 7373</span>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"action\">\n ${\n res.data.user_id != this.getUserId()\n ? res.data.reserved != 1\n ? '<button class=\"reserve\"> Reserve Now! </button>'\n : \"\"\n : \"\"\n }\n <button class=\"feedback\"> Feedback </button>\n <button class=\"map\"> On map 📌</button>\n </div>\n </div>\n </div>\n `;\n this._qs(\".container\").innerHTML = data;\n\n // load feature List\n this.loadFeatureList(JSON.parse(res.data.facilities));\n\n //Load the reserve component\n res.data.user_id != this.getUserId()\n ? res.data.reserved != 1\n ? this.loadReserve()\n : false\n : false;\n\n //loadComment\n this.loadComment();\n\n //Load map view component\n this.loadMapView();\n this.state.location = res.data.location;\n });\n }", "async GetImages(fetchParams) {\n if (this.state.lastCursor) {\n fetchParams.after = this.state.lastCursor;\n }\n\n CameraRoll.getPhotos(fetchParams).then(\n r => this.AppendImages(r)\n )\n }", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category';\n var category = 'nature';\n var size = '1920x1080';\n\n var source = baseUrl + '/' + category + '/' + size;\n\n buildElement(source)\n .then(render);\n }", "function loadData() {\n // STAND\n loadStandData();\n // PIT\n loadPitData();\n // IMAGES\n loadImageData();\n // NOTES\n loadNotesData();\n // PRESCOUTING\n loadPrescouting(\"./resources/prescout.csv\");\n\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 }", "async load(include) {\n const { Activity, Dining, Hotel } = this.dao;\n const query = ResortModel.buildQuery(this.dao, { where: { [this.idKey]: this.id } }, false);\n // check to see if we are including different associations\n if (include) {\n // include.forEach(i => {\n // if (i === GetTypes.Activities) {\n // queryInclude.push({\n // attributes: RAW_ACTIVITIES_ATTRIBUTES,\n // include: [{\n // attributes: ['name'],\n // model: Area\n // }],\n // model: Activity\n // });\n // }\n // });\n }\n if (this.instance) {\n await this.instance.reload(query);\n }\n else {\n this.instance = await Hotel.findOne(query);\n }\n if (!this.instance) {\n // let the caller handle not found\n this.instance = null;\n return false;\n }\n // lets reset the id to the internal one\n this.id = this.instance.get('id');\n // We need to handle counts separately, there is currently a bug with sequelize\n // where you cannot make multiple counts in a single fetch\n const activityCount = await Activity.count({ where: { locationId: this.instance.get('locationId') } });\n const diningCount = await Dining.count({ where: { locationId: this.instance.get('locationId') } });\n this.counts = { activity: activityCount, dining: diningCount };\n return true;\n }", "function initialize_listing_previews(){\n for (var i = 0; i < window.ST.poolToolRows; i++) {\n\n // Function in a loop. Do not use i in there!\n /*jshint -W083 */\n $('#rowheader' + i).on('mouseover', function(ev){\n if (ev.currentTarget.firstChild.firstChild){\n var id = ev.currentTarget.id;\n var text = ev.currentTarget.firstChild.firstChild.data;\n var ii = parseInt(id.substr(9,1));\n var alreadyThere = false;\n\n if (gon.source[ii].image && gon.source[ii].name === text){\n for(var j=0; j<window.ST.poolToolImages.length; j++){\n if (ii === window.ST.poolToolImages[j]){\n alreadyThere = true;\n }\n }\n window.ST.poolToolImages.push(ii);\n\n if(alreadyThere){\n $('#rowheader_image' + ii).show();\n }else{\n var img = $('<img id=\"rowheader_image'+ ii +'\" height=\"' + $(\".spacer\").height() + '\"/>').attr('src', gon.source[ii].image)\n // Function in a loop. Do not use i in there!\n /*jshint -W083 */\n .on('load', function(){\n if (!this.complete || typeof this.naturalWidth === \"undefined\" || this.naturalWidth === 0) {\n } else {\n $(\".spacer\").append(img);\n img.show();\n }\n });\n }\n }\n }\n });\n\n // Function in a loop. Do not use i in there.\n /*jshint -W083 */\n $('#rowheader'+i).on('mouseout', function(ev){\n var id = ev.currentTarget.id;\n var ii = parseInt(id.substr(9,1));\n\n $('#rowheader_image' + ii).hide();\n });\n }\n }", "function load(req, res, next, expenseId) {\n Expense.get(req.params.userId, expenseId)\n .then(expense => {\n req.expense = expense;\n return next();\n })\n .catch(e => next(e));\n}", "function loadPhotos() {\n\n for(let i = 0; i < 10; i++) {\n fetch(`https://picsum.photos/500/500?random=${i}`)\n .then(x => {\n \n gallery.innerHTML += `\n <img src=\"${x.url}\" alt=\"\">\n `\n });\n }\n}", "function loadList () {\n return fetch(apiUrl).then(function (response) {\n return response.json();\n }).then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url\n };\n add(pokemon);\n });\n }).catch(function (e) {\n window.alert(e);\n })\n }", "async fetchGallery(_,{ id }) {\n const galleries = await Gallery.find(id)\n return galleries.toJSON()\n }", "retrievePoliticianImages(id){\n var self = this;\n id = id.replace(/-/g, \" \");\n var args = \"state=\" + self.selected_state_id + \"&role=\" + self.selected_role + \"&district=\" + self.selected_district;\n get_state_politician_profile(args, self.loadPoliticianImages.bind(self));\n }", "async function loadDataImageDetailModal(imageId) {\n // Modal Elements\n const LOADING_TEXT = \"Loading...\";\n var modalDisplayImage = document.getElementById(\"imageDisplay\");\n modalDisplayImage.setAttribute('src', ''); // Clear out image source so the old image is not there still\n\n var modalImageId = document.getElementById(\"imageId\");\n modalImageId.innerText = LOADING_TEXT;\n\n // Activity Name\n var modalImageActivityName = document.getElementById(\"imageActivity\");\n modalImageActivityName.innerText = LOADING_TEXT;\n\n // List of tagged players\n var modalImageTaggedPlayers = document.getElementById(\"imageTaggedPlayers\");\n modalImageTaggedPlayers.innerText = LOADING_TEXT;\n\n // Event Name\n var modalImageEventName = document.getElementById(\"imageEvent\");\n modalImageEventName.innerText = LOADING_TEXT;\n\n var modalImageCheerCount = document.getElementById(\"imageCheerCount\");\n imageCheerCount.innerText = LOADING_TEXT;\n\n var modalImageCommentCount = document.getElementById(\"imageCommentCount\");\n modalImageCommentCount.innerText = LOADING_TEXT;\n\n var modalImageDate = document.getElementById(\"imageDate\");\n modalImageDate.innerText = LOADING_TEXT;\n\n var modalImageRnLink = document.getElementById(\"imageRecNetLink\");\n modalImageRnLink.innerText = LOADING_TEXT;\n\n var username = document.getElementById(\"txtUsername\").value;\n \n\n var userId = 0;\n var buttonFeedType = document.getElementById(\"btnFeedLibrary\");\n if (buttonFeedType.value != 2) {\n userId = await getUserId(username);\n }\n\n var userPhotoLibrary = await getUserPublicPhotoLibrary(userId);\n var imageData = {};\n var i = 0;\n for (i = 0; i < userPhotoLibrary.length; i++) {\n if (userPhotoLibrary[i].Id === imageId) {\n imageData = userPhotoLibrary[i];\n break;\n }\n };\n\n // Image Display\n if (modalDisplayImage) {\n var imageUrl = 'https://img.rec.net/' + imageData.ImageName;\n //console.log(imageUrl);\n modalDisplayImage.src = imageUrl;\n }\n\n // Image ID\n if (modalImageId) {\n var szImageId = imageData.Id;\n modalImageId.innerText = szImageId;\n }\n\n // Activity Name\n var roomData = await getRoomInfo(imageData.RoomId);\n if (modalImageActivityName) {\n if (roomData.length >= 1) {\n var szActivityName = roomData[0].Name;\n modalImageActivityName.innerText = '^' + szActivityName;\n } else if (roomData === 'null') {\n modalImageActivityName.innerText = 'Null';\n } else {\n modalImageActivityName.innerText = \"Unavailable, room is not public.\"\n }\n }\n\n // Event Name\n if (modalImageEventName) {\n var szEventName = imageData.PlayerEventId;\n if (szEventName === null || szEventName === undefined) {\n szEventName = \"No event data.\";\n }\n modalImageEventName.innerText = szEventName;\n }\n\n // Tagged Players\n if (imageData.TaggedPlayerIds.length > 0) {\n var playerInfoJson = await getUsernameFromId(imageData.TaggedPlayerIds);\n if (modalImageTaggedPlayers) {\n var szTaggedPlayers = \"\";\n var i = 0;\n playerInfoJson.forEach(item => {\n if (i == playerInfoJson.length - 1) {\n szTaggedPlayers = szTaggedPlayers + (item.displayName + \" (@\" + item.username + \") \\r\\n\");\n } else {\n szTaggedPlayers = szTaggedPlayers + (item.displayName + \" (@\" + item.username + \"), \\r\\n\");\n }\n });\n modalImageTaggedPlayers.innerText = szTaggedPlayers;\n }\n } else {\n modalImageTaggedPlayers.innerText = \"No players were tagged.\";\n }\n\n // Cheer Count\n if (modalImageCheerCount) {\n var szCheerCount = imageData.CheerCount;\n modalImageCheerCount.innerText = szCheerCount;\n }\n\n // Comment Count\n if (modalImageCommentCount) {\n var szCommentCount = imageData.CommentCount;\n modalImageCommentCount.innerText = szCommentCount;\n }\n\n // Image Date\n if (modalImageDate) {\n var szDate = imageData.CreatedAt;\n modalImageDate.innerText = moment(szDate).format('MMMM Do YYYY, h:mm a') + ' (' + moment(szDate, \"YYYYMMDD\").fromNow() + ')';\n }\n\n // RN Image Link\n if (modalImageRnLink) {\n var szUrl = \"https://rec.net/image/\" + imageData.Id;\n modalImageRnLink.innerText = szUrl;\n modalImageRnLink.setAttribute(\"onclick\", \"openImageInBrowser(\" + imageData.Id + \"); return false;\");\n }\n}", "function loadPlayers() {\n // Selects all of the data from the MySQL products table\n connection.query(\"SELECT Player, (MP/G)*(USGP)*(PER/4 + TSP/3 + 3PAR/4 + FTR/4 + TRBP/3 + ASTP/3 + STLP/4 + BLKP/4 - TOVP/4) + 100*(OWS + DWS/2 + WS + WS48) + 20*(OBPM + DBPM/2 + BPM + VORP) AS rawAdv FROM playersadvanced WHERE Tm ='HOU' OR Tm='GSW' ORDER BY rawAdv DESC LIMIT 200\", function(err, res) {\n if (err) throw err;\n\n // Draw the table in the terminal using the response\n console.table(res);\n });\n}", "function preloadFood() {\n for (let i = 0; i < numImgFood; i++) {\n // Add the loaded images to the images array.\n imgFood.push(loadImage(`assets/images/food/food${i}.png`));\n }\n}", "function loadListFunctionality() {\n return fetch(API_URL)\n .then(function (response) {\n return response.json();\n })\n .then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url,\n };\n pokemonRepository.add(pokemon);\n });\n })\n .catch(function (e) {\n console.error(e);\n });\n}", "async function loadingImg() {\r\n let img = await prom; // continuation of function will halt till prom is resolved\r\n\r\n let id = self.createID()\r\n self.fill_ID_ImageHash(id,img)\r\n img.id = id\r\n \r\n // now we can set options for image, or do something else with it\r\n if (ops) {\r\n img.set(ops)\r\n };\r\n\r\n\r\n if (canv) {\r\n canv.add(img);\r\n } else {\r\n self.canvas.add(img)\r\n }\r\n\r\n if (cb) {\r\n cb(img)\r\n\r\n };\r\n\r\n //return img\r\n }", "function loadImageSource(provider) {\r\n return new Promise(function(resolve, reject) {\r\n // Temporarily grab images from redditbooru\r\n require('./js/service-connectors/' + provider + '.js', function(provider) {\r\n provider().then(function(data) {\r\n images = data;\r\n lightbox.setData(data);\r\n imageGrid.render(images);\r\n });\r\n });\r\n });\r\n }", "async getAllResults() {\n const results = await dbContext.Results.find().populate('profile', 'name picture').populate('game', 'name')\n return results\n }", "function loadList() {\n return fetch(apiUrl).then(function (response) {\n return response.json();\n }).then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url\n };\n add(pokemon);\n });\n }).catch(function (e) {\n console.error(e);\n });\n }", "function listFotos(id){\r\n fetch(\"/Trabalho_F/php/getPhotosP.php?\"+\"user=\"+id).then(function(resp){\r\n return resp.json();\r\n }).then(function(data){\r\n // obter grid\r\n var grid = document.getElementById(\"images-profile\");\r\n if(data.imagens ==\"noImages\"){\r\n var ups = document.createElement(\"h5\");\r\n ups.classList=\"lead\";\r\n ups.innerHTML=\"No photos avaible\";\r\n grid.appendChild(ups);\r\n }\r\n else if(data.imagens.length>0){\r\n \r\n for(var i=0;i<data.imagens.length;i++ ){\r\n\r\n var cards = document.createElement(\"div\");\r\n cards.className=\"col-md-5 center-block\";\r\n \r\n var content = document.createElement(\"div\");\r\n content.className=\"card mb-5 shadow-sm\";\r\n\r\n var head = document.createElement(\"div\");\r\n head.className=\"card-header\";\r\n\r\n var btnDelete = document.createElement(\"btn\");\r\n btnDelete.type=\"button\";\r\n btnDelete.id=data.imagens[i].id_imagem;\r\n btnDelete.className=\"btn btn-sm btn-warning\";\r\n btnDelete.addEventListener(\"dblclick\", function(event){\r\n event.preventDefault();\r\n $.get(\"/Trabalho_F/php/deletePhoto.php?\",{id:this.id});\r\n location.reload();\r\n })\r\n\r\n var span = document.createElement(\"span\");\r\n span.innerHTML=\"Delete Image\";\r\n btnDelete.appendChild(span);\r\n head.appendChild(btnDelete);\r\n content.appendChild(head);\r\n\r\n var img_display = document.createElement(\"img\");\r\n img_display.className = \"bd-placeholder-img card-img-top\";\r\n var path_img = data.imagens[i].url_image;\r\n var imgs = path_img.replace('c:/wamp64/www','');\r\n img_display.src=imgs;\r\n img_display.width=\"100%\";\r\n img_display.height=\"500\";\r\n img_display.preserveAspectRatio=\"xMidYMid slice\";\r\n img_display.focusable=\"false\";\r\n\r\n content.appendChild(img_display);\r\n\r\n var card = document.createElement(\"div\");\r\n card.className=\"card-body\";\r\n\r\n var descs = document.createElement(\"p\");\r\n descs.className=\"card-text\";\r\n descs.innerHTML=data.imagens[i].descriptions;\r\n card.appendChild(descs);\r\n\r\n var locBtns = document.createElement(\"div\");\r\n locBtns.className=\"d-flex justify-content-between align-items-center\";\r\n\r\n var btns = document.createElement(\"div\");\r\n btns.className=\"btn-group\";\r\n\r\n var btnUp = document.createElement(\"btn\");\r\n btnUp.type=\"button\";\r\n btnUp.id=data.imagens[i].id_imagem;\r\n btnUp.addEventListener(\"click\",function(event){\r\n event.preventDefault()\r\n if(this.className==\"btn btn-sm btn-outline-success\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:0})\r\n .done(function(data){\r\n if(data==\"Upvote\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints+1;\r\n }\r\n }\r\n }\r\n })\r\n this.className=\"btn btn-sm btn-success\";\r\n var aux = document.getElementsByClassName(\"btn btn-sm btn-danger\");\r\n for(var x = 0; x < aux.length; x++){\r\n if(aux[x].id==this.id){\r\n aux[x].className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n }\r\n }\r\n else if(this.className==\"btn btn-sm btn-success\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:1})\r\n .done(function(data){\r\n if(data==\"Pontuacao anulada\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints-1;\r\n }\r\n }\r\n }\r\n })\r\n this.className=\"btn btn-sm btn-outline-success\";\r\n }\r\n })\r\n\r\n var btnDown = document.createElement(\"btn\");\r\n btnDown.type=\"button\";\r\n btnDown.id=data.imagens[i].id_imagem\r\n btnDown.addEventListener(\"click\",function(event){\r\n event.preventDefault()\r\n if(this.className==\"btn btn-sm btn-outline-danger\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:2})\r\n .done(function(data){\r\n if(data==\"Downvote\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints-1;\r\n }\r\n }\r\n } \r\n })\r\n this.className=\"btn btn-sm btn-danger\";\r\n var aux = document.getElementsByClassName(\"btn btn-sm btn-success\");\r\n for(var x = 0; x < aux.length; x++){\r\n if(aux[x].id==this.id){\r\n aux[x].className=\"btn btn-sm btn-outline-success\";\r\n }\r\n }\r\n }\r\n else if(this.className==\"btn btn-sm btn-danger\"){\r\n var ids=this.id;\r\n $.get(\"/Trabalho_F/php/action_react.php?\",{id:this.id,tipo:1})\r\n .done(function(data){\r\n if(data==\"Pontuacao anulada\"){\r\n var leads = document.getElementsByClassName(\"pontos\");\r\n for(var x = 0; x < leads.length; x++){\r\n if(leads[x].id==ids){\r\n var pt = leads[x].innerHTML;\r\n var ints = parseInt(pt);\r\n leads[x].innerHTML=ints+1;\r\n }\r\n }\r\n }\r\n })\r\n this.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n })\r\n\r\n \r\n var iconDown = document.createElement(\"object\");\r\n iconDown.data=\"/Trabalho_F/icons/arrow-down.svg\";\r\n iconDown.type=\"image/svg+xml\";\r\n iconDown.width=\"24\";\r\n iconDown.height=\"24\";\r\n var iconUp = document.createElement(\"object\");\r\n iconUp.data=\"/Trabalho_F/icons/arrow-up.svg\";\r\n iconUp.type=\"image/svg+xml\";\r\n iconUp.width=\"24\";\r\n iconUp.height=\"24\";\r\n\r\n btnUp.appendChild(iconUp);\r\n btnDown.appendChild(iconDown);\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'GET',\r\n url: \"/Trabalho_F/php/getReact.php?\"+\"photo=\"+data.imagens[i].id_imagem,\r\n success: function(datas) {\r\n var obj = JSON.parse(datas);\r\n if(obj==1){\r\n btnUp.className=\"btn btn-sm btn-outline-success\";\r\n btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n else if(obj.react.ponto == 1){\r\n btnUp.className=\"btn btn-sm btn-success\";\r\n btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n else if(obj.react.ponto == -1){\r\n btnUp.className=\"btn btn-sm btn-outline-success\";\r\n btnDown.className=\"btn btn-sm btn-danger\";\r\n }\r\n else{\r\n btnUp.className=\"btn btn-sm btn-outline-success\";\r\n btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n }\r\n }\r\n });\r\n\r\n // $.get(\"/Trabalho_F/php/getReact.php?\"+\"photo=\"+data.imagens[i].id_imagem)\r\n // .done(function (data) {\r\n // if(data==1){\r\n // btnUp.className=\"btn btn-sm btn-outline-success\";\r\n // btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n // }\r\n // else if(data.react.ponto == 1){\r\n // btnUp.className=\"btn btn-sm btn-success\";\r\n // btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n // }\r\n // else if(data.react.ponto == -1){\r\n // btnUp.className=\"btn btn-sm btn-outline-success\";\r\n // btnDown.className=\"btn btn-sm btn-danger\";\r\n // }\r\n // else{\r\n // btnUp.className=\"btn btn-sm btn-outline-success\";\r\n // btnDown.className=\"btn btn-sm btn-outline-danger\";\r\n // }\r\n // })\r\n // .fail(function (xhr) {\r\n // console.log(xhr);\r\n // });\r\n\r\n\r\n btns.appendChild(btnUp);\r\n btns.appendChild(btnDown);\r\n\r\n locBtns.appendChild(btns);\r\n\r\n var pontos = document.createElement(\"p\");\r\n pontos.className=\"lead pontos\";\r\n pontos.id=data.imagens[i].id_imagem;\r\n pontos.innerHTML=data.imagens[i].pontos;\r\n\r\n locBtns.appendChild(pontos);\r\n\r\n var time = document.createElement(\"p\");\r\n time.className=\"text-muted\";\r\n time.innerHTML=data.imagens[i].dates;\r\n\r\n locBtns.appendChild(time);\r\n\r\n card.appendChild(locBtns);\r\n\r\n content.appendChild(card);\r\n\r\n cards.appendChild(content);\r\n\r\n grid.appendChild(cards);\r\n\r\n } \r\n }\r\n })\r\n}", "function loadAll(){\n\tchangeSeason()\n\tgetAnimeData()\n\tgetCharacterData()\n\tgetEpisodeData()\n\tgetImageData()\n\tgetVideoData()\n}", "function getPhotos() {\n imageCount = 0;\n ready = false;\n loader.hidden = false;\n if (random) {\n getRandomPhotos();\n } else {\n getSearchResults(query);\n }\n}", "function displayPhoto(data, howMuch) {\n var limiter = 0;\n\n if (howMuch && data.items.length > howMuch) {\n limiter = howMuch;\n show(\"data>howMuch\");\n show(limiter);\n } else {\n limiter = data.items.length;\n show(\"NO\");\n }\n\n for (var i = 0; i < limiter; i++) {\n\n //on stock les infos voulues pour y voir plus clair\n var photoInfos = data.items[i];\n var newPhoto = {\n id: i,\n title: photoInfos.title,\n media: photoInfos.media,\n tags: photoInfos.tags\n };\n\n // show(newPhoto);\n\n // on clone notre patron html pour faire une nouvelle photo\n var newPhotoHTML = $('#photoPatron').clone();\n\n // on viens modifier et injecter le contenu dans notre nouvelle photo\n newPhotoHTML.attr(\"id\", newPhoto.id);\n newPhotoHTML.addClass('grid-item');\n newPhotoHTML.find('img').attr('src', newPhoto.media.m);\n newPhotoHTML.find('img').css('opacity', 1);\n\n\n $(grid).prepend(newPhotoHTML);\n // add and lay out newly prepended items\n // .masonry('prepended', newPhotoHTML);\n\n }\n // $grid.imagesLoaded().progress(function(instance, image) {\n // var result = image.isLoaded ? 'loaded' : 'broken';\n // console.log('image is ' + result + ' for ' + image.img.src)\n // $grid.masonry('layout');\n // sr.reveal('.grid-item');\n // });\n $grid.imagesLoaded(function(instance) {\n $('#loadingDiv').hide();\n // $('.grid-item').find('img').css('opacity', 1);\n $grid.masonry('reloadItems');\n $grid.masonry('layout');\n });\n\n // $grid.masonry('reloadItems');\n // layout Masonry after each image loads\n\n\n }", "async function getOpportunity (req, res) {\n res.send(await service.getOpportunity(req.authUser, req.params.opportunityId))\n}", "function getLoadedImages() {\r\n return images;\r\n }" ]
[ "0.55160207", "0.53758043", "0.5371903", "0.53637475", "0.52977395", "0.5246795", "0.5237815", "0.5207772", "0.52024066", "0.5176507", "0.5169728", "0.51442975", "0.5142956", "0.51342154", "0.51328886", "0.5105961", "0.50976783", "0.50931156", "0.5087872", "0.5065087", "0.50606936", "0.50584346", "0.5051945", "0.50352675", "0.5008759", "0.5008281", "0.49946186", "0.49924183", "0.4981991", "0.4978847", "0.49787432", "0.4973643", "0.49611074", "0.49551204", "0.4953927", "0.4939073", "0.49384737", "0.49380377", "0.4926511", "0.49137145", "0.49061674", "0.48988116", "0.4896441", "0.4887778", "0.48756468", "0.48694277", "0.486123", "0.4857515", "0.4847191", "0.48463693", "0.48460382", "0.48441735", "0.48419166", "0.48383588", "0.48266944", "0.48204577", "0.48177245", "0.4814952", "0.4814144", "0.4805192", "0.48035046", "0.47931802", "0.47905782", "0.47863975", "0.4786207", "0.47853383", "0.47836116", "0.47779557", "0.4773812", "0.4773411", "0.47729912", "0.4772985", "0.47616112", "0.4759858", "0.47552767", "0.4755026", "0.4748209", "0.47420073", "0.47363627", "0.47344977", "0.4734483", "0.47309744", "0.47304225", "0.47276172", "0.47267595", "0.4725869", "0.47256228", "0.47208196", "0.47204348", "0.47155657", "0.4712807", "0.47089463", "0.47075036", "0.47057095", "0.47056678", "0.4704443", "0.47028834", "0.4700221", "0.46987677", "0.46981665", "0.46977744" ]
0.0
-1
Load opportunity applications from database
getApplication (opportunityId, personId, forceReload) { var d = $q.defer(); if(!this.loadedOpportunityApplications[`${opportunityId}-${personId}`] || forceReload === true) { $http.get(`/api/opportunity_applications/${opportunityId}/${personId}`) .then(response => { var application = response.data; this.loadedOpportunityApplications[`${opportunityId}-${personId}`] = application; d.resolve(application); }) .catch(err => { d.reject(err); }); } else { d.resolve(this.loadedOpportunityApplications[`${opportunityId}-${personId}`]); } return d.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEmployeeJobApplication(firstname) {\n\treturn Employee.findOne({firstname: firstname})\n\t .populate(\"applications\").exec((err, posts) =>{\n console.log(\"Populated Employee\" + posts)\n }\n\t \n)\n}", "function loadCurrentApplication() {\n ApplicationsService\n .loadCurrent($stateParams.companyId, $stateParams.appId)\n .then(function resolve(response) {\n vm.current = response.data.app;\n });\n }", "function loadData(applicationName) {\n console.log(\"Loading \" + applicationName + \" options, mappings and tabs...\")\n\n var promises = [\"options\", \"mappings\", \"tabs\"].map(function(objectName) {\n return requestJSON(applicationName, objectName);\n });\n\n $q.all(promises).then(function(data) {\n console.log(\"All data loaded\")\n dataManager.initializeDataStructuresIfAllLoaded();\n })\n\n }", "function loadPartner() {\n \tGisMap.Util.MAX_APP_FILES = application.partner_sources.length;\n \tGisMap.Util.LOADED_APP_FILES = 0;\n if (application.partner_sources.length == 0) {\n GisMap.Core.injectHtml(STARTAPPLICATION);\n return;\n }\n for (var file in application.partner_sources) {\n var load = GisMap.Util.loadPartnerFile(application.partner_sources[file], function (complete) {\n if (complete)\n GisMap.Core.injectHtml(STARTAPPLICATION);\n \n \n })\n }\n }", "loadMyApplications(forceReload) {\n var d = $q.defer();\n if(this.myApplications.length === 0 || forceReload === true) {\n $http.get('/api/opportunity_applications/me')\n .then(response => {\n this.myApplications = response.data;\n for(var application of this.myApplications) {\n application.ExpirationDate = new Date(application.opportunity.ExpirationDate).getTime();\n }\n d.resolve(this.myApplications);\n })\n .catch(err => d.reject(err));\n } else {\n d.resolve(this.myApplications);\n }\n return d.promise;\n }", "data() {\n return Applications.findOne(this.params._id);\n }", "static async getApplications(){\n let appQuery = `SELECT A.*, B.ID AS JOBID, B.ACTIVE FROM APPLICATIONS AS A \n INNER JOIN JOBOFFERS AS B ON A.JOBID=B.ID WHERE ACTIVE=1`;\n try{\n let client = await pool.connect();\n let result = await client.query(appQuery);\n client.release();\n return result.rows;\n } catch(err){\n console.log(err);\n }\n }", "static async getAll() {\n const applicationsData = await db.applications.getAll();\n const applications = applicationsData.map((data) => new Application(data));\n const applicationsExended = Promise.all(applications.map(async (application) => {\n const status = await Status.getById(application.statusId);\n application.setStatus(status);\n return application;\n }));\n return applicationsExended;\n }", "function loadLDB() {\n\t\t\tconsole.log(\"loadLDB()\");\n\t\t\tif (vm.results.length == 0) { // this works coming from create\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (vm.selectedIndex < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// api get object by primary key\n\t\t\tconsole.log(\"vm.results[vm.selectedIndex].logicalDBKey: \" + vm.results[vm.selectedIndex].logicalDBKey); //this works from create\n\t\t\tLDBGetAPI.get({ key: vm.results[vm.selectedIndex].logicalDBKey }, function(data) { // this works from create\n\n\t\t\t\tvm.apiDomain = data;\n\t\t\t\tvm.apiDomain.logicalDBKey = vm.results[vm.selectedIndex].logicalDBKey; // this works from create\n\t\t\t\tselectLDB(vm.selectedIndex);\n\t\t\t\taddAdbRow()\n\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"Error retrieving data object.\");\n\t\t\t});\n\t\t}", "getApplicationsForUser(userId) {\n return this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).find({ userId: userId });\n }", "async listApplications() {\n let params = {\n TableName: process.env.APPLICATIONS_TABLE\n };\n let length = 0;\n let docClient = new AWS.DynamoDB.DocumentClient(this.config);\n try {\n let result = await docClient.scan(params).promise();\n length += result.Items.length;\n if (length < 1){\n return Promise.reject({\n code: 404,\n error: 'NotFoundException',\n message: 'No applications are registered with the solution.'\n });\n } else {\n let results = [];\n result.Items.forEach(function(item) {\n results.push({\n 'ApplicationId': item.application_id,\n 'ApplicationName': item.application_name,\n 'Description': item.description,\n 'UpdatedAt': item.updated_at,\n 'CreatedAt': item.created_at\n }); \n });\n return Promise.resolve({\n \"Applications\": results,\n \"Count\": length\n });\n }\n } catch (err) {\n console.log(JSON.stringify(err));\n return Promise.reject({\n code: 500,\n error: 'InternalFailure',\n message: 'Error occurred while attempting to retrieve applications',\n });\n }\n }", "function load(app, config, index) {\n \n // admin database loading\n logger.debug('DAO count in admin database config : %d', admin_database_config.length);\n \n var admin_count = 0;\n\tfor (var i = 0; i < admin_database_config.length; i++) {\n\t\tvar curItem = admin_database_config[i];\n\t\t\n if (curItem.database_index == index) {\n var filename = path.join(__dirname, admin_folder, curItem.file);\n //logger.debug('filename #' + i + ' : ' + filename);\n \n if (fs.existsSync(filename + '.js')) {\n var curSchema = require(filename);\n logger.debug('DAO [%s] loaded -> %s.%s', curItem.id, config.db[index].name, curItem.name);\n\n // add it as attribute\n database_oracle[curItem.name] = curSchema;\n\n admin_count += 1;\n } else {\n logger.warn('No %s file for method %s . -> not loaded.', filename + '.js', curItem.method);\n } \n }\n\t}\n\t\n logger.debug('DAO loaded for admin database #' + index + ' : %d', admin_count);\n\t\n \n // database loading\n logger.debug('DAO count in database config : %d', database_config.length);\n \n var count = 0;\n\tfor (var i = 0; i < database_config.length; i++) {\n\t\tvar curItem = database_config[i];\n\t\t\n if (curItem.database_index == index) {\n var filename = path.join(__dirname, database_folder, curItem.file);\n //logger.debug('filename #' + i + ' : ' + filename);\n \n if (fs.existsSync(filename + '.js')) {\n var curSchema = require(filename);\n logger.debug('DAO [%s] loaded -> %s.%s', curItem.id, config.db[index].name, curItem.name);\n\n // add it as attribute\n database_oracle[curItem.name] = curSchema;\n\n admin_count += 1;\n } else {\n logger.warn('No %s file for method %s . -> not loaded.', filename + '.js', curItem.method);\n } \n }\n\t}\n\t\n logger.debug('DAO loaded for database #' + index + ' : %d', count);\n\t\n \n // add it to app\n\tapp.set(config.db[index].name, database_oracle);\n\tlogger.debug('database object is added to app as [' + config.db[index].name + '] attribute.');\n}", "async getGamesWithApplication ({ request, auth, response }) {\n const user = auth.current.user\n try {\n const applics = await Application.all()\n return response.json({\n status: 'success',\n data: applics\n })\n } catch (error) {\n return response.status(400).json({\n status: 'error',\n message: 'Tivemos um problema. Por favor tente novamente.'\n })\n }\n }", "function loadExperiences(org) {\n self.loading = true;\n\n content.getExperiencesByOrg(org.id)\n .then(function(exps) {\n var expUserPromiseArray = [];\n\n data.appData.experiences = exps;\n data.experiences = exps;\n\n exps.forEach(function(exp) {\n expUserPromiseArray.push(account.getUser(exp.user)\n .then(function(user) {\n exp.user = user;\n }));\n });\n\n return $q.all(expUserPromiseArray);\n })\n .finally(function() {\n data.query = null;\n self.loading = false;\n self.action = 'experiences';\n });\n }", "getAllApplications () : Promise<Array<AccountApplication>> {\n return this.makeRequest(\"applications\")\n }", "function loadPrograms(){\n\tconsole.log(\"attempting to load programs\");\n\n\t//request to load programs table from database\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'Programs'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tprograms=data;\n\t\t\tnumLoadedTables++;\n\t\t\tcheckTablesLoaded();\n\t\t}\n\t});\n}", "function findApplicantProfiles() {\n return db(\"applicant_profiles\");\n}", "function getJobApplicants(req, res, next){\n db.any(\n \"SELECT * FROM Applications INNER JOIN ApplicantUsers on ApplicantUsers.id = Applications.applicant_id where Applications.job_id = $1;\"\n , [req.params.job_id] )\n .then(function(data) {\n res.rows= data\n console.log('successfully getting current applicants for the job', data)\n next();\n })\n .catch(function(error){\n console.error(error);\n })\n}", "function requestApplications(success, failure) {\n if (!self.currentOrganization) {\n failure();\n }\n apiGetRequest(\"/management/organizations/\" + self.currentOrganization + \"/applications\", null, success, failure);\n }", "function fetchAppList(error, apps) {\n if(error) {\n console.log(error);\n return;\n }\n\n if(apps && apps.length > 0) {\n var rendered = Meteor.render(function() {\n return Template.appList({ apps: apps });\n });\n document.getElementById(\"apps-list\").innerHTML = '';\n document.getElementById(\"apps-list\").appendChild(rendered);\n\n if(typeof Session.get(\"activeApp\") == \"undefined\" ||\n Session.get(\"activeApp\") === null) {\n Session.set(\"activeApp\", App.fetchNameForId(apps[0]));\n Session.set(\"activeAppId\", apps[0]);\n }\n }\n}", "getAppAutomations(appId) {\n return this.apiBase.executeRequestToPath('/we/api/v1/apps/' + appId + '/workflow/flows/', this.constsants.GET).then(function(requestResponse) {\n let automations = JSON.parse(requestResponse.body);\n return automations;\n }).catch(function(error) {\n browser.logger.error('Error in getAppAutomations function:' + JSON.stringify(error));\n return Promise.reject(error);\n });\n }", "@action setup_apps() {\n this._applications_to_configure.forEach((app_conf) => {\n if ( !app_conf.name ) {\n throw new TypeError(`Apps need a name as part of their configuration! Looked inside: ${JSON.stringify(app_conf)}`)\n }\n\n // Parse its routes into our router\n // TideStore (.. which is badly named... its technically just a rendering engine).\n // will end up using the context to determine which layout to use during a render\n for (let route of app_conf.routes) {\n route.context.app_label = app_conf.name;\n this.router.set(route);\n }\n\n // Give the application some of its own configured data\n app_conf.app.store = app_conf.store;\n app_conf.app.tide = this;\n\n if(this._apps.has(app_conf.name)){\n throw new ConfigurationError(`The application named ${app_conf.name} was listed twice.`)\n }\n\n // Set the completed app in our table\n this._apps.set(app_conf.name, app_conf);\n });\n\n // Now that all the apps are in the listing\n // Let it complete them complete their initialization\n this.apps().map(app_conf => {\n let initial = this.initial_data[app_conf.name] || {};\n console.log(`[Tide] Initial for ${app_conf.name}`, initial);\n app_conf.ready(initial)\n })\n }", "getApplicationsForGrant(grantId) {\n return this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).find({ grantId: grantId });\n }", "function listApplications() {\n var result = [], k;\n for (k in apps)\n result.push(k);\n return result;\n }", "function loadApps() {\n\t\t\t\tEnvironment.logDebug(\"Server Starting-3\");\n\t\t\t\trequire('fs').readdirSync('./routes').forEach(function serverLoadApps(file) {\n\t\t\t\t\t// only load javascript files\n\t\t\t\t\tif (file.indexOf(\".js\") > -1) {\n\t\t\t\t\t\tconsole.log('BURP '+file);\n\t\t\t\t\t\tstartApp(file);\n\t\t\t\t\t}\n\t\t\t });\n\t\t\t}", "load() {\n\t\treturn models.Enviroment.findAll({\n\t\t\twhere: {\n\t\t\t\tis_active: true\n\t\t\t},\n\t\t\tinclude: [models.Unit, models.User, models.EnviromentType]\n\t\t})\n\t}", "getApplicationsList(params) {\n return this.createRequest('/', params, 'get');\n }", "function load() {\n listModel.clear();\n var jsonObject = JSON.parse(listModel.source);\n var apps = jsonObject.apps\n for (var app in apps) {\n // Provide the file scheme to the icon for reliable loading of the icon. Without\n // it the path can be interpreted as a relative path to a resource file bundled\n // with the binary\n listModel.append({icon: \"file://\" + apps[app].icon, appId: apps[app].id});\n }\n}", "getAutomations(appId) {\n let url = super.constructUrl(this.API.GET_AUTOMATIONS, [appId]);\n return super.get(url);\n }", "function loadData(){\n\t\tvar getData = $.getJSON( \"dev/data/shooting_incidents.json\", function() {\n\t\t})\n\t\t\t.done(function(data){\n\t\t\t\tmapData = data;\n\t\t\t\tviewModel = new AppViewModel();\n\t\t\t\tko.applyBindings(viewModel);\n\t\t\t})\n\t\t\t.fail(function(msg){\n\t\t\t\tconsole.log('error: ' + msg);\n\t\t\t});\n\t}", "function loadApps(N, applications) {\n N.apps = [ N.mainApp ];\n\n // Try load each enabled application and push to the array of loaded apps\n _.forEach(applications, appDef => loadApp(N, getAppName(appDef)));\n}", "async Applications() {\n try {\n return await this.MakeRequest(`${this.Config.baseUrl}/applications.json`);\n } catch (ex) {\n console.log('Applications Error', ex.message);\n return null;\n }\n }", "function LoadApp(element) {\n $.ajax({\n type: \"Get\",\n url: \"/Applications/LoadApplication\",\n success: function (data) {\n //debugger;\n Apps = data;\n var $option = $(element);\n $option.empty();\n $option.append($('<option/>').val('0').text('Select Application').hide());\n $.each(Apps, function (i, val) {\n //debugger;\n $option.append($('<option/>').val(val.id).text(val.name));\n });\n }\n });\n}", "function getAppsFromBody() {\n vm.appsFound = appDetector.getAppsFromBody(vm.domainRequest.body);\n }", "function queryAndStoreApplicationsFlow (queryObj) {\n return flow([\n \tapp.locals.shaid.getApplications.bind(null, queryObj),\n \thelper.storeApps.bind(null, false)\n ], {method: 'waterfall', eventLoop: true});\n}", "async getAppsForStrategy(strategyName) {\n const rows = await this.db.select(COLUMNS).from(TABLE);\n return rows\n .map(mapRow)\n .filter(apps => apps.filter(app => app.strategies.includes(strategyName)));\n }", "static async getProcesses(data) {\n try {\n return await database.processes.findAll({\n where: { projectId: data.projectId }, include: [{model: database.files_mains}]\n });\n } catch (error) {\n throw error;\n }\n }", "async function loadCoreData() {\n await Promise.all([\n loadExercises(),\n loadCategories(),\n loadSessions(),\n ]);\n}", "function resumeInitApp() {\n // this needs the db to exist\n setLoadMessage('Initializing Handlers');\n initGlobalUIHandlers();\n\n // sections\n setLoadMessage('Loading Sections');\n loadSections();\n $('.app-version-number').text(app.getVersion());\n\n // populate some menus\n setLoadMessage('Populating Menus');\n globalDBUpdate();\n\n removeLoader();\n}", "function dashboardApps(data) {\n return logCollection.find(dataField).sort({ \"_id\": -1 }).skip(toSkip).limit(countLimit).toArray()\n .then(logAppList => {\n return logCollection.find(dataField).count()\n .then(logListCount => {\n var result = []\n if (logListCount) {\n for (var i = 0; i < logListCount; i++) {\n var getResult = {\n \"_id\": logAppList[i]._id,\n \"app_id\": logAppList[i].app_id,\n \"comp_id\": logAppList[i].comp_id,\n \"issues\": logAppList[i].issues,\n \"type\": logAppList[i].type,\n \"platform\": logAppList[i].platform,\n \"device\": logAppList[i].device,\n \"version\": logAppList[i].version,\n \"created_dateTime\": logAppList[i].created_dateTime\n }\n result.push(getResult)\n }\n var finalRes = {\n \"logList\": result,\n \"count\": logListCount\n }\n return finalRes; // Final Result for Loglist for Particular App \n\n } else {\n var err = { \"error\": \"log List not found\" };\n return err;\n }\n });\n\n }).catch(err => {\n return err;\n });\n }", "function getParticularApp(req, res) {\n var id = req.params.id\n dbconn.getAppointsForEach(id, (err, result) => {\n if (err) {\n console.log(err)\n } else {\n if (result.length > 0) {\n console.log(result)\n res.send(result)\n } else {\n res.send(\"No Data Found\")\n }\n }\n })\n}", "resolve(parent, args) {\n return _.find(applications, {id: args.id})\n }", "function findAppInSelectedModel(gid, aid,fromInstance) {\n\tvar self = this;\n\tvar _group = self.findGroupByPath(gid,fromInstance);\n\tvar _app = _.find(_group.apps, function(app) {\n\t\treturn app.id == aid;\n\t});\n\treturn _app;\n}", "function addApresentacao(app) {\n db.transaction(function (tx) {\n tx.executeSql('INSERT INTO apresentacao(id,tema,data,hora,aluno, orientador, sobre, local, campus) values (\"' + app.id + '\",\"' + app.tema + '\",\"' + app.data + '\",\"' + app.hora + '\",\"' + app.aluno + '\",\"' + app.orientador + '\",\"' + app.sobre + '\",\"' + app.local + '\",\"' + app.campus + '\")')\n },\n function (err) {\n console.log(err);\n },\n function () {\n });\n}", "function fetchUserApplication(domainQuery, opportunityKey, userKey) {\n return domainQuery.getCurrent(__WEBPACK_IMPORTED_MODULE_0__domain__[\"h\" /* USER_APPLICATION */], { userKey, opportunityKey });\n}", "function loadPrograms(){\n\tconsole.log(\"attempting to load programs\");\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'Programs'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tprograms=data;\n\t\t\t\n\t\t\tvar x = document.getElementById(\"program-select\");\n\t\t\t\n\t\t\tfor(var i=0;i<programs.length;i++)\n\t\t\t{\n\t\t\t\tvar option = document.createElement(\"option\");\n\t\t\t\toption.text = programs[i].program_name;\n\t\t\t\toption.value = programs[i].program_id;\n\t\t\t\tx.add(option);\n\t\t\t}\n\t\t}\n\t});\n}", "function getApplicationDetails(username) {\n let appl = {};\n return Db.transaction(t => {\n return Person.findAll({\n attributes: ['firstname', 'lastname', 'username', 'email'],\n include: [\n {\n model: Availability,\n required: true,\n }, {\n model: ApplicationStatus,\n required: true\n }, {\n model: Competence, \n required: true,\n }\n ],\n where: { \n username: username\n }, transaction: t\n }).then(res => {\n appl = res;\n })\n }).then(result => {\n //application hopefully has all the info we need\n console.log(\"Application: \"+JSON.stringify(appl))\n return appl;\n })\n .catch(err => {\n \n throw Error(\"Fetching application details failed: \" + err)\n })\n}", "function loadApplication() {\n console.log(\"Application loaded\");\n // Load directly to the main menu\n configureUI(displayMainMenu());\n\n}", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) {\n return apps[name];\n });\n }", "function addApps(){\n for (var i=0; i<apps.length; i++){\n addApp(apps[i]);\n }\n}", "function getAllApplications($scope){\n\tmyCuiJs.getApplications()\n\t\t.then(function(response) {\n\t\t\t$scope.appList = [];\n\t\t\tresponse.forEach(function(fetchedAppFromList) { // pushes all the applications into \"applist\" array\n\t\t\t\t$scope.appList.push(fetchedAppFromList);\n\t\t\t\t$scope.$apply();\n\t\t\t});\n\t\t})\n}", "async indexAll(){\n return Appointment.findAll();\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(name => apps[name]);\r\n }", "function loadData() {\r\n // load projects\r\n failureReportMode.projectOpts.clear();\r\n var projectMap = {};\r\n for (var i = 0; i < employeeInfo.projectRole.length; i++) {\r\n var project = employeeInfo.projectRole[i][0];\r\n if (projectMap[project] == null && project != \"\") {\r\n projectMap[project] = 1;\r\n failureReportMode.projectOpts.push({\r\n value: project,\r\n label: project\r\n });\r\n }\r\n }\r\n\r\n }", "function appLoaded() {\n var lang = fetchLanguage(),\n data = fetchData();\n\n $.when(lang, data).then(startApp, appStartError);\n}", "async getNativeApplications () {\n const cauldron = await this.getCauldron()\n return cauldron.nativeApps\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) {\n return apps[name];\n });\n }", "function loadData() {\n bootcampsFactory.getAllBootcamps()\n .success(function(model) {\n $scope.bootcamps = model.Bootcamps;\n $scope.locations = model.Locations;\n $scope.technologies = model.Technologies;\n })\n .error(function(status) {\n alert(\"Error! Status: \" + status);\n });\n }", "async load () {\n const startables = await this.db.startables.toArray()\n this.store.setStartables(startables)\n\n const rows = await this.db.favourites.get('favourites')\n\n if (rows) {\n this.store.setFavourites(rows.favourites)\n }\n }", "function configLoadApp()//app\n{\n\tapplication_0();\n\tvar appul=document.getElementById(\"appul\");\n\tvar appArr=application;\n\tfor(var i=0;i<appArr.length;i++)\n\t{\n\t\tvar liElement=document.createElement(\"LI\")\n\t\tvar aElement=document.createElement(\"A\")\n\t\tvar imgElement=document.createElement(\"IMG\")\n\t\tvar imgnum=appArr[i][3];\n\t\tif(imgnum==\"\"||imgnum==undefined)\n\t\t{\n\t\t\timgnum=2\n\t\t}\n\t\telse\n\t\t{\n\t\t\timgnum=parseInt(imgnum)\n\t\t}\n\t\timgElement.src=\"images/menuicon\"+imgnum+\".gif\"\n\t\taElement.appendChild(imgElement);\n\t\taElement.href=\"#\"\n\t\taElement.hidefocus=\"true\";\n\t\taElement.innerHTML=aElement.innerHTML+appArr[i][0]\n\t\tliElement.appendChild(aElement);\n\t\tliElement.onclick=new Function(\"selectApp(this,\"+i+\")\")\n\t\tif(appArr[i][1]==1)\n\t\t{\n\t\t\tlastApp=liElement;\n\t\t\tliElement.className=\"Selected\"\n\t\t}\n\t\t\n\t\tappul.appendChild(liElement);\n\t}\n\t\n\tvar liElement=document.createElement(\"LI\")\n\tvar aElement=document.createElement(\"A\")\n\taElement.href=\"#\"\n\taElement.innerText=\">\"\n\tliElement.appendChild(aElement);\n\tliElement.onclick=showAppAfter\n\tliElement.style.display=\"none\"\n\tappul.appendChild(liElement);\n\tdocument.getElementById(\"mainFrame\").src=application[0][2]\n\tcheckAppW()\n}", "function getApps() {\n\t // Make a copy so caller cannot mutate the apps list.\n\t return Object.keys(apps_).map(function (name) {\n\t return apps_[name];\n\t });\n\t }", "function getDBs() {\n\n $(\"#loading\").hide();\n\n $.get(\"/ia/loadDb\", function(data) {\n populateCollectionList(data);\n });\n\n\n}", "async loadDatabase() {\n this.__db =\n (await qx.tool.utils.Json.loadJsonAsync(this.__dbFilename)) || {};\n }", "function adminAppsView(){\n\tremoveClass('active');\n\tdocument.getElementById('nav-option-applications').className='active';\n\t\n\tvar local_session = get_local_simulation();\n\tvar applications = local_session.apps;\n\tvar app_map = mapDevicestoApp( applications);\n\tconsole.log(app_map);\n\tvar html = viewAdminApplicationsTemplate(app_map);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n}", "function fetchInstalledApps() {\n\tlet addedApps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__appStore__[\"a\" /* getStore */])().getValue({\n\t\tfield: \"apps\"\n\t});\n\n\tlet installed = [];\n\tif (apps.length > 0) installed.push([apps[0].appId]);\n\n\t__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__appStore__[\"a\" /* getStore */])().setValue({\n\t\tfield: \"installed\",\n\t\tvalue: installed\n\t});\n}", "function doGetAllRootApp() {\n\treturn new Promise(function(resolve, reject) {\n\t\tconst pool = require('../app/db/dbpool.js').getPool();\n\t\t//let hoses = await tempDB.hospitals.findAll({ attributes: ['id', 'Hos_RootPathUri'], raw: true });\n\t\tpool.connect().then(client => {\n\t\t\tclient.query('BEGIN');\n\t\t\tvar sqlCmd = 'select \"id\", \"Hos_Name\", \"Hos_RootPathUri\" from \"hospitals\"';\n\t\t\tclient.query(sqlCmd, []).then(res => {\n\t\t\t\tif (res.rowCount > 0){\n\t\t\t\t\tclient.query('COMMIT');\n\t\t\t\t\tresolve(res.rows);\n\t\t\t\t} else {\n\t\t\t\t\tresolve({});\n\t\t\t\t}\n\t\t\t}).catch(err => {\n\t\t\t\tclient.query('ROLLBACK');\n\t\t\t\treject(err.stack)\n\t\t\t});\n\t\t\tclient.release();\n\t\t});\n\t});\n}", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "function initApp(appname) {\n return new Promise(function( resolve, reject ) {\n return RPCCall(0,'load',[appname]).then( function() {\n resolve( cache[0] ); // return the apploader\n } );\n } );\n}", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\r\n }", "async function listAppdata() {\n // Get credentials and build service\n // TODO (developer) - Use appropriate auth mechanism for your app\n\n const {GoogleAuth} = require('google-auth-library');\n const {google} = require('googleapis');\n\n const auth = new GoogleAuth({\n scopes: 'https://www.googleapis.com/auth/drive.appdata',\n });\n const service = google.drive({version: 'v2', auth});\n try {\n const res = await service.files.list({\n spaces: 'appDataFolder',\n fields: 'nextPageToken, items(id, title)',\n pageSize: 100,\n });\n res.data.items.forEach(function(file) {\n console.log('Found file:', file.title, file.id);\n });\n return res.data.items;\n } catch (err) {\n // TODO(developer) - Handle error\n throw err;\n }\n}", "function addApresentacao(app){\n db.transaction(function(tx){\n tx.executeSql('INSERT INTO apresentacao(id,tema,data,hora,aluno, orientador, sobre, local, campus) values (\"'+app.id+'\",\"'+app.tema+'\",\"'+app.data+'\",\"'+app.hora+'\",\"'+app.aluno+'\",\"'+app.orientador+'\",\"'+app.sobre+'\",\"'+app.local+'\",\"'+app.campus+'\")')\n },\n function(err){\n console.log(err);\n },\n function(){\n });\n}", "function loadData(){\n\t\tloadParetoData();\n\t\tloadConstraints();\n\t\t\n\t}", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) { return apps_[name]; });\n }", "function loadAgenda() {\n\n fetch('/agenda.json')\n .then(function(resp) {\n return resp.json();\n })\n .then(function(j) {\n\n agenda = j\n agendaLoaded(j)\n\n })\n}", "load(callback) {\n const selectTodoItems = \"SELECT * FROM todo_items\";\n this.dbConnection.query(selectTodoItems, function (err, results, fields) {\n if (err) {\n callback(err);\n return;\n }\n\n callback(null, results);\n });\n }", "_loadApp() {\n const schema = schemaHelper.generateSchema(\n this._ant,\n this._graphQL,\n this._config.model\n );\n\n if (schema) {\n this._schema = schema;\n\n this._app.use('/', graphqlHTTP({\n schema,\n graphiql: true\n }));\n } else {\n logger.error('Could not load the GraphQL API because the model is empty');\n }\n\n if (\n this._graphQL &&\n this._graphQL.directiveController.loadingErrors.length\n ) {\n logger.error(\n 'There were some errors when loading the GraphQL directives:'\n );\n for (\n const loadingError of this._graphQL.directiveController.loadingErrors\n ) {\n logger.error(loadingError);\n }\n }\n }", "static async getApplicationById(id){\n let appQuery = 'SELECT * FROM APPLICATIONS WHERE ID=$1';\n let params = [id];\n try{\n let client = await pool.connect();\n let result = await client.query(appQuery, params);\n client.release();\n return result.rows[0];\n } catch(err){\n console.log(err);\n }\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps_).map(function (name) {\n return apps_[name];\n });\n }" ]
[ "0.58995456", "0.5616329", "0.55552274", "0.5461304", "0.5388441", "0.53872836", "0.5376514", "0.53718174", "0.5323144", "0.53102446", "0.5290349", "0.52407265", "0.52389294", "0.522918", "0.5194129", "0.5190767", "0.5157819", "0.5151134", "0.5119506", "0.5103304", "0.51029354", "0.5091979", "0.5050915", "0.5041788", "0.50379914", "0.50226814", "0.5001921", "0.49892467", "0.4935813", "0.4906453", "0.49037454", "0.48989195", "0.48961836", "0.48828194", "0.48441488", "0.480604", "0.47754654", "0.47725552", "0.4763627", "0.47559586", "0.47547525", "0.47519004", "0.47448385", "0.47448373", "0.47431207", "0.47388697", "0.4738063", "0.47319478", "0.47236773", "0.47229317", "0.46931538", "0.46825123", "0.46802002", "0.46802002", "0.46802002", "0.46802002", "0.46802002", "0.46802002", "0.46765465", "0.46747816", "0.4657406", "0.46572974", "0.4657009", "0.4657009", "0.4657009", "0.4657009", "0.4657009", "0.4657009", "0.4657009", "0.4657009", "0.46468508", "0.46439284", "0.46427497", "0.46334434", "0.46289527", "0.4610785", "0.46062374", "0.4604308", "0.46007675", "0.4599813", "0.45933592", "0.45906413", "0.4589719", "0.4589719", "0.4589719", "0.45820826", "0.45802853", "0.45712292", "0.4570526", "0.4570526", "0.4570526", "0.4570526", "0.4570526", "0.4570526", "0.4570526", "0.45666692", "0.45611253", "0.4557265", "0.4556533", "0.45512322" ]
0.5785937
1
Opens a view with opportunities
open(OpportunityId, OpportunityTitle, forceReload) { $state.go('opportunities.view', { OpportunityId: OpportunityId, PrettyURL: Util.convertToSlug(OpportunityTitle), forceReload: forceReload || false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "open( viewName, options ){\n _history.push( this.current );\n _options.push( _currentOptions );\n\n viewport.replace( viewName, options );\n }", "view(options) {\n return this.wizardInvokeService.openWizard(Object.assign(options, {\n title: this._buildTitle(options.service.entityName, 'wizard_view_caption'),\n isNew: false,\n readonly: true,\n commitOnClose: false\n }));\n }", "function viewActivitySite(row, attribute) {\n window.open(location.origin + \"/gb.html#!/\"+row.id);\n }", "function openView(id){\n dispatch(changeView(id));\n }", "function openMyRoster() {\n\tvar my_Roster = Alloy.createController('my_Roster').getView();\n\tmy_Roster.open();\n\t$.explore.close();\n}", "function viewProject(elmnt){\n var title = projects[elmnt.id].title;\n var desc = projects[elmnt.id].desc;\n var date = projects[elmnt.id].date;\n var products = projects[elmnt.id].products;\n displayModal(title, desc, date, products, elmnt.id);\n}", "function openTournament(tournamentId) {\n console.log(\"In function, id=: \" + tournamentId);\n window.location.href = '../tournament/tournament.html?id=' + tournamentId;\n}", "function open() {\n openModal($scope.selectedTaskId, $scope.selectedUserName);\n }", "function openWindow(e) {\n\t$.tab.open(Alloy.createController(e.url, e.data).getView());\n}", "function openWindow(e) {\n\t$.tab.open(Alloy.createController(e.url, e.data).getView());\n}", "function openProposedObjectiveModal(){\n $(\"#obj-modal-type\").val('propose');\n\tsetObjectiveModalContent('', '', '', getToday(), 0, 2);\n\tshowObjectiveModal(true);\n}", "function openTaskView() {\n withUniqueClass(\n requireCursor(),\n ['content', 'task_list_item__body'],\n all,\n click,\n );\n }", "openInSharePoint(){\n if(this.docPathURL != null){\n window.open(this.docPathURL);\n }\n }", "openAppShowcase() {\n\t\tthis.props.viewAppShowcase(this.state.id);\n\t}", "requestView(){\t\t\n\t\tthis.trigger('requestView');\n\t}", "function open() {\n if (selectedFinanceCubeId != 0 && $scope.selectedDataEntryProfileId != 0) {\n openModal(selectedFinanceCubeId, $scope.selectedDataEntryProfileId);\n }\n }", "function viewAgency(agency_id) {\n console.log('view details clicked ', agency_id);\n $http.get('/agencies/' + agency_id).then(function(response) {\n agency.selected = response.data;\n console.log('Agency record back from db: ', agency.selected);\n });\n }", "function open_OxOst_site()\n{\n location.href = \"../../Oxfords/OxfordOst/Overview.html\";\n}", "open() {\n super.open(this.pageUrl);\n }", "function runAddonsViewUrl(view, isNewWindow, addParam){\r\n \t\r\n \tvar itemID = g_objItems.getSelectedItemID();\r\n\t\tif(itemID == null)\r\n\t\t\treturn(false);\r\n\r\n\t\tvar objItem = g_objItems.getSelectedItem();\r\n\t\tif(objItem.length == 0)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tvar urlEdit = objItem.data(\"urledit\");\r\n\t\t\r\n\t\tif(urlEdit){\r\n\t\t\tvar urlViewEdit = urlEdit;\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tvar urlViewEdit = g_ucAdmin.getUrlView(view, \"id=\"+itemID);\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif(addParam)\t\t\r\n\t\t\turlViewEdit += \"&\"+addParam;\r\n\t\t\t\t\r\n\t\tif(isNewWindow === true){\r\n\t\t\twindow.open(urlViewEdit);\r\n\t\t}else{\r\n\t\t\tlocation.href = urlViewEdit;\r\n\t\t}\r\n \t\r\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "function onShowContracts(){\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause(\"eq.eq_id\",$(\"wr.eq_id\").value,'=');\n\tView.openDialog(\"ab-helpdesk-request-equipment.axvw\", restriction, false); \n}", "function openEditUser() {\n routingBase.goToCurrentState('userDetails');\n }", "function viewHtml() {\n var entry = ProjectManager.getSelectedItem();\n if (entry === undefined) {\n entry = DocumentManager.getCurrentDocument().file;\n }\n var path = entry.fullPath;\n var w = window.open(path);\n w.focus();\n }", "function openProviderProfile(resouceId,vendorId){\r\n \t\t\tvar url = \"/MarketFrontend/providerProfileInfoAction_execute.action?resourceId=\"\r\n \t\t\t\t\t+ resouceId + \"&companyId=\" + vendorId + \"&popup=true\";\r\n \t\t\tnewwindow = window\r\n \t\t\t\t\t.open(url, '_publicproviderprofile',\r\n \t\t\t\t\t\t\t'resizable=yes,scrollbars=yes,status=no,height=700,width=1000');\r\n \t\tif (window.focus) {\r\n \t\t\tnewwindow.focus();\r\n \t\t\t}\r\n \t}", "function openRuleView() {\n return openInspectorSideBar(\"ruleview\");\n}", "async show({ params, request, response, view }) {\n }", "function openCase() {\n var ef = {};\n ef[\"entityName\"] = \"incident\";\n if (phone.currentCase) {\n ef[\"entityId\"] = phone.currentCase;\n }\n Microsoft.CIFramework.openForm(JSON.stringify(ef));\n}", "function projectPendInvReport() {\n window.open(\n 'Report?' +\n 'id=' +\n projectID +\n '&type=Project PendInv Report ' +\n '~' +\n $('#pendingInvoiceSelector2').val()\n );\n}", "function viewEvent(event) {\n sendLog('View Event');\n getAnalysts(event.id)\n selectEvent(event);\n handleShow();\n }", "function popup_view(type,seq)\n{\n\tif(type == 'defect')\n\t{\n\t\tvar obj ={\n\t\t\ttarget : 'popup_view',\n\t\t\tdf_seq : seq,\n\t\t\tpr_seq : project_seq\n\t\t};\n\t\tget_defect_view_panel(obj);\n\t}else if(type == 'testcase'){\n\t\tvar obj ={\n\t\t\ttarget : 'popup_view',\n\t\t\ttl_seq : seq,\n\t\t\tpr_seq : project_seq\n\t\t};\n\t\tget_testcase_view_panel(obj);\n\t}else{\n\t\tExt.getCmp('popup_view').update('');\n\t\treturn;\n\t}\n\tExt.getCmp('popup_view').show();\n}", "function View() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"view\",\n message: \"what would you like to view?\",\n choices: [\"Department\", \"Role\", \"Employee\", \"Back\"],\n },\n ])\n .then((res) => {\n switch (res.view) {\n case \"Department\":\n console.log(\"VIEW department function goes here\");\n viewDept();\n break;\n case \"Role\":\n console.log(\"View role function goes here\");\n viewRole();\n break;\n case \"Employee\":\n viewEmployee();\n break;\n case \"Back\":\n initPrompt();\n break;\n }\n });\n}", "async show({ params, request, response, view }) {}", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "function openModal(index) {\n $scope.oModal.show();\n googleMaps();\n //Sets the modal toggle button positions per selected user driver route\n for (i = 0; i < vm.routes.length; i++) {\n if (vm.routes[i]._id == vm.originationId && index == 1) {\n vm.routes[i].myStartRoute = true;\n vm.calculateAndDisplayRoute(vm.routes[i], vm.directionsService, vm.directionsDisplay);\n } else if (vm.routes[i]._id == vm.returnId && index == 2) {\n vm.routes[i].myStartRoute = true;\n vm.calculateAndDisplayRoute(vm.routes[i], vm.directionsService, vm.directionsDisplay);\n } else {\n vm.routes[i].myStartRoute = false;\n };\n };\n }", "function openTermsOfUse() {\n\t\t\t$window.open('/CustPortal/terms_of_service.html', 'Terms Of Service', 'scrollbars=yes,width=1000,height=700');\n\t\t}", "function openProject(e){\n var evt = e || window.Event;\n var target = evt.target || evt.srcElement;\n var win;\n \n if(target.id == \"restoreview\"){\n win = window.open(\"http://waldo2.dawsoncollege.qc.ca/1337762/\", \"_blank\"); \n }\n else{\n win = window.open(\"./projects/\" + target.id + \"/index.html\", \"_blank\") \n }\n \n //puts the focus on the window that was oppened\n win.focus();\n}", "open () {\n return super.open('/index.php?controller=order');\n }", "function orden(obj, idLamp) {\n// alert(idLamp);\n\twindow.open(\"admin/orden.php?id=\"+idLamp,'','width=600,height=400,toolbar=no,location=no,left=200,top=200');\n}", "function doOpenDocument() {\n var presenter = new mindmaps.OpenDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.OpenDocumentView(), filePicker);\n presenter.go();\n }", "function viewDetail(row, attribute) {\n location.href = configs.path.gbActivity + '/' + row.id;\n }", "openFindInPage() {\n this.controller.openFindInPage();\n }", "techniquesClicked (){\n this.techniques.addEventListener('click',()=>{\n window.open(\"././links/advance_techniques/techniques.htm\");\n },false);\n }", "openRoutes() {\n const { can_edit } = this.state;\n if (can_edit) {\n this.toggleRouteModal();\n const { user, item } = this.props.navigation.state.params;\n const {\n rep_code, company_code, sbu_code, user_type\n } = user;\n const { date } = item;\n const data = {\n rep_code,\n company_code,\n sbu_code,\n user_type,\n date,\n };\n this.props.loadTourPlanRoutes(data);\n }\n }", "function handleClick(index) {\n control.openDetailView(\n data.getTableId(),\n index,\n 'tables/femaleClients/html/femaleClients_detail.html');\n}", "function lead(id) \n\t\t{\n\t\t\tpreviewPath = \"../leads_information.php?id=\"+id;\n\t\t\twindow.open(previewPath,'_blank','width=700,height=800,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no');\n\t\t}", "function openDetail () {\n\t\t\t$state.go('about.detail');\n\t\t}", "function viewBook() {\n window.open(props.link, '_blank');\n }", "open() {\n this._open();\n }", "function viewCalander () {\r\n\t try {\r\n var myParentWindow = window.opener;\r\n myParentWindow.viewCalanderWindow(getParamsForCalendar());\r\n } \r\n catch (e) {\r\n\t\tvar width = screen.width - 150;\r\n\t\tvar height = screen.height - 150;\t\r\n\t var win = window.open($(\"#contextPath\").val() + \"/reservations/viewCalendar.action?\" + getParamsForCalendar(), \"ReservationCalendar\", \"left=50,top=0,width=\" + width + \",height=\" + height + \",toolbar=0,resizable=1,menubar=0,scrollbars=1,location=no\");\r\n\t\twin.focus();\r\n }\r\n}", "function fnView(strUrl)\n{\n $(\"#\"+gridTableId).delegate('a.view', 'click', function (e) {\n e.preventDefault();\t\t\n\t\t$('#frmForm').bootstrapValidator(\"resetForm\",true);\n iActiveID=$(this).attr(\"row-id\");\n clearForm(\"frmForm\");\n\t\t$(\"#display_img\").removeClass('hide');\n\t\t$('#langFormTabs a:first').tab('show').trigger('click');\n\t\t$(\"#langFormTabs\").find('i.fa-times').hide()\n\t\t$(\"#youtube_form\").addClass('hide');\n\t\t$(\"#sms_form\").addClass('hide');\n populateEditEntries(iActiveID,strUrl);\n glbControlEnable(false);\n });\n}", "open () {\n return super.open('customer/account/create');\n }", "function showFlow() {\r\n\t\tif (issueheadPanel.selModel.hasSelection()) {\r\n\t\t\tvar record = issueheadPanel.getSelectionModel().getSelected();\r\n\t\t\tvar entryId = record.get(\"workFlowNo\");\r\n\t\t\tif (entryId == null) {\r\n\t\t\t\tExt.Msg.alert(\"提示\", \"流程未启动!\");\r\n\t\t\t} else {\r\n\t\t\t\tvar url = application_base_path + \"workflow/manager/show/show.jsp?entryId=\"\r\n\t\t\t\t\t\t+ entryId;\r\n\r\n\t\t\t\twindow.open(url);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tExt.Msg.alert(\"提示\", \"请先选择要查看的记录!\");\r\n\t\t}\r\n\t}", "function openCase() {\n var ef = {};\n ef[\"entityName\"] = \"incident\";\n Microsoft.CIFramework.getFocusedSession().then((sessionId) => {\n\n var sessionI = phone.listOfSessions.get(sessionId);\n\n if (sessionI.currentCase) {\n ef[\"entityId\"] = sessionI.currentCase;\n }\n else {\n return;\n }\n var input = {\n templateName: \"entityrecord\",\n templateParameters: {\n entityName: \"incident\",\n entityId: ef[\"entityId\"]\n },\n isFocused: true\n }\n Microsoft.CIFramework.createTab(input);\n });\n}", "_uiOpenMortgageModal () {\n this.uiService.openMortgageModal(this.mapData, this.playersData[this.playerName]);\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 }", "async openViews() {\r\n // Make this module has a view to open\r\n if (!this.getConfig().viewClass)\r\n return;\r\n // Get the location manager to open this module with\r\n if (!this.locationManager)\r\n this.locationManager = await this.request({ type: locationManager_type_1.LocationManagerType });\r\n // Get the location from the settings\r\n let locations = this.settings.location;\r\n if (!locations)\r\n locations = [];\r\n else if (!(locations instanceof Array))\r\n locations = [locations];\r\n // Use the location manager to open this module in all the specified locations\r\n const openingPromises = locations.map(location => this.locationManager.openModule(this.getID(), location));\r\n await Promise.all(openingPromises);\r\n // Setup listeners for location changes\r\n this.getSettingsObject().on(\"change\", async (prop, value, oldValue) => {\r\n if (prop == \"location\") {\r\n const newLocations = value instanceof Array ? value : value ? [value] : [];\r\n const oldLocations = oldValue instanceof Array ? oldValue : oldValue ? [oldValue] : [];\r\n // Close all removed locations\r\n const closePromises = oldLocations.map(location => !newLocations.includes(location) &&\r\n this.locationManager.closeModule(this.getID(), location));\r\n // Open all added locations\r\n const openPromises = newLocations.map(location => !oldLocations.includes(location) &&\r\n this.locationManager.openModule(this.getID(), location));\r\n // Await all changes\r\n await Promise.all([...closePromises, ...openPromises]);\r\n }\r\n }, \"openViews\");\r\n }", "function breakupOfSanctionedBudget(propID,versionID,collaboratorID,instName)\n{\n\nvar str=\"/ICMR/app_srv/icmr/mm01/jsp/view_crp_budget_institutewise.jsp?strProposalId=\"+propID+\"&strVersionId=\"+versionID+\"&collaboratorID=\"+collaboratorID+\"&instName=\"+instName;\nwindow.open(str,'new','scrollbars,width=900,height=400,left=130,top=200');\n}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function directUserFromViewInfo() {\n if (nextStep == \"Departments\") {\n viewDepartments();\n }\n if (nextStep == \"Roles\") {\n viewRoles();\n }\n if (nextStep == \"Employees\") {\n viewEmployees();\n }\n if (nextStep == \"All Information\") {\n viewAll();\n } \n }", "function openEditor(event) {\n console.log('open editoe');\n get_shop_edit_data('edit_store');\n event.preventDefault();\n var edit_window = document.getElementById('table_editor');\n document.getElementsByClassName('sales-data')[0].style.opacity = .5;\n edit_window.classList.add('active');\n //edit_window.style.display = 'block';\n}", "function Opportunity($state, $stateParams, opportunityManager, opportunitySharedData, $mdDialog, $mdMedia, parentModel, progressBarFactory, toastFactory, pageStructureFactory) {\n\n\t\t/*jshint validthis: true */\n\n\t\tvar vm = this;\n\t\tvm.opportunity = {\n\t\t\tself: {}\n\t\t};\n\t\tvm.opportunity.self.contacts = [];\n\n\t\t/*** Dialog box controllers***/\n\t\tfunction leadSelectionDialogController($scope, $mdDialog, parentModel, opportunityManager) {\n\t\t\t$scope.fields = vm.fields;\n\t\t\t$scope.leadsList = [];\n\n\t\t\t$scope.checkVariable = \"Here\";\n\t\t\tparentModel.inflateUiGrid($scope);\n\t\t\t$scope.hide = function() {\n\t\t\t\t$mdDialog.hide();\n\t\t\t};\n\t\t\t$scope.cancel = function() {\n\t\t\t\t$mdDialog.cancel();\n\t\t\t};\n\t\t\t$scope.selectLead = function(row) {\n\t\t\t\tvm.selectLead(row.entity);\n\t\t\t\t$mdDialog.hide();\n\t\t\t}\n\t\t\t$scope.answer = function(answer) {\n\t\t\t\t$mdDialog.hide(answer);\n\t\t\t};\n\t\t\t$scope.vm = $scope;\n\t\t};\n\n\t\tfunction confirmationDialogController($scope, $mdDialog) {\n\t\t\t$scope.model = vm.opportunity.self;\n\t\t\t$scope.fields = vm.fields;\n\t\t\t$scope.hide = function() {\n\t\t\t\t$mdDialog.hide();\n\t\t\t};\n\t\t\t$scope.cancel = function() {\n\t\t\t\t$mdDialog.cancel();\n\t\t\t};\n\t\t\t$scope.save = function(answer) {\n\t\t\t\tvm.createOpportunity(vm.opportunity);\n\t\t\t\t$mdDialog.hide(answer);\n\t\t\t};\n\t\t\t$scope.answer = function(answer) {\n\t\t\t\t$mdDialog.hide(answer);\n\t\t\t};\n\t\t}\n\n\n\t\tif ($state.current.name === 'home.opportunity.viewAll') {\n\n\t\t\tconsole.log(\"VIEW ALL OPPORTUNITIES\");\n\n\t\t\tvm.opportunitiesList = [];\n\n\t\t\tpageStructureFactory.getLayout('opportunity_viewAll')\n\t\t\t\t.then(\n\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\tvm.opportunityFields = response.data;\n\t\t\t\t\t},\n\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\talert(\"Oops! Something went wrong.\\n Try reloading the page\");\n\t\t\t\t\t});\n\n\t\t\topportunityManager.inflateUiGrid(vm);\n\n\t\t\tvm.openViewOpportunity = function(row) {\n\t\t\t\tconsole.log(\"Inside openViewOpportunity\");\n\t\t\t\topportunityManager.openViewOpportunity(row.entity.opportunityId);\n\t\t\t};\n\n\t\t\tvm.openEditOpportunity = function(row) {\n\t\t\t\tconsole.log(\"Inside openEditOpportunity\");\n\t\t\t\topportunityManager.openEditOpportunity(row.entity.opportunityId);\n\t\t\t};\n\n\t\t\tvm.openDeleteOpportunity = function(row) {\n\t\t\t\tconsole.log(\"Inside openDeleteOpportunity\");\n\t\t\t\topportunityManager.openDeleteOpportunity(row.entity.opportunityId);\n\t\t\t};\n\n\t\t\tvm.openCreateOpportunity = function() {\n\t\t\t\tconsole.log(\"Inside openCreateOpportunity\");\n\t\t\t\topportunityManager.openCreateOpportunity();\n\t\t\t};\n\t\t}\n\n\t\tif (($state.current.name === 'home.opportunity.create') || ($state.current.name === 'home.opportunity.QuickCreate')) {\n\n\t\t\tif ($state.current.name === 'home.opportunity.QuickCreate') {\n\t\t\t\tconsole.log(\"CREATE QUICK OPPORTUNITY\");\n\n\t\t\t\tvm.opportunity = {\n\t\t\t\t\tself: {}\n\t\t\t\t};\n\t\t\t\tvm.opportunity.self.contacts = [];\n\n\t\t\t\tpageStructureFactory.getLayout('opportunity_CRUD')\n\t\t\t\t\t.then(\n\t\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\t\tvm.opportunityFields = response.data;\n\t\t\t\t\t\t\tvm.opportunity.self.opportunityMode = \"QuickCreate\";\n\t\t\t\t\t\t\tvm.opportunity.self.contactMode = \"Create\";\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\t\talert(\"Oops! Something went wrong.\\n Try reloading the page\");\n\t\t\t\t\t\t});\n\n\t\t\t\tif ($stateParams.leadDetails != null) {\n\t\t\t\t\tconsole.log(\"$stateParams.leadDetails\");\n\t\t\t\t\tconsole.log($stateParams.leadDetails);\n\t\t\t\t\tvm.opportunity.self.leadId = $stateParams.leadDetails.leadId;\n\t\t\t\t\tvm.opportunity.leadDetails = $stateParams.leadDetails;\n\t\t\t\t}\n\n\t\t\t} else if ($state.current.name === 'home.opportunity.create') {\n\t\t\t\tconsole.log(\"CREATE OPPORTUNITY\");\n\n\t\t\t\tvm.opportunity = {\n\t\t\t\t\tself: {}\n\t\t\t\t};\n\t\t\t\tvm.opportunity.self.contacts = [];\n\n\t\t\t\tpageStructureFactory.getLayout('opportunity_CRUD')\n\t\t\t\t\t.then(\n\t\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\t\tvm.opportunityFields = response.data;\n\t\t\t\t\t\t\tvm.opportunity.self.opportunityMode = \"Create\";\n\t\t\t\t\t\t\tvm.opportunity.self.contactMode = \"Create\";\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\t\talert(\"Oops! Something went wrong.\\n Try reloading the page\");\n\t\t\t\t\t\t});\n\n\t\t\t\tvm.selectLead = function(lead) {\n\t\t\t\t\tconsole.log(\"Inside selectLead()\");\n\t\t\t\t\tvm.opportunity.self.leadId = lead.leadId;\n\t\t\t\t\tvm.opportunity.leadDetails = lead;\n\t\t\t\t}\n\n\t\t\t\tvm.selectLeadDialog = function(ev) {\n\t\t\t\t\tconsole.log(\"Inside selectLeadDialog()\");\n\t\t\t\t\t$mdDialog.show({\n\t\t\t\t\t\tcontroller: leadSelectionDialogController,\n\t\t\t\t\t\ttemplateUrl: 'leadSelectDialogBox.html',\n\t\t\t\t\t\tparent: angular.element(document.body),\n\t\t\t\t\t\tclickOutsideToClose: true\n\t\t\t\t\t})\n\t\t\t\t\tvm.fields = JSON.parse(opportunitySharedData.getLayout('lead_viewAll'));\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvm.confirmDetailsDialog = function(lead) {\n\t\t\t\tconsole.log(\"Inside confirmDetailsDialog()\");\n\t\t\t\t$mdDialog.show({\n\t\t\t\t\tcontroller: confirmationDialogController,\n\t\t\t\t\ttemplateUrl: 'confirmationDialogueBox.html',\n\t\t\t\t\tparent: angular.element(document.body),\n\t\t\t\t\tclickOutsideToClose: true\n\t\t\t\t})\n\t\t\t\tvm.fields = JSON.parse(opportunitySharedData.getLayout('SummaryDialog'));\n\t\t\t};\n\n\t\t\tvm.addContact = function(opportunity) {\n\t\t\t\tconsole.log(\"vm.opportunityFields\");\n\t\t\t\tconsole.log(vm.opportunityFields);\n\t\t\t\tconsole.log(\"Inside addContact()\");\n\t\t\t\tif (vm.opportunity.self.contacts.indexOf(opportunity.self.tempContact) == -1) {\n\t\t\t\t\tvm.opportunity.self.contacts.push(opportunity.self.tempContact);\n\t\t\t\t\tvm.resetTempContact();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvm.updateContact = function(opportunity) {\n\t\t\t\tvm.resetTempContact();\n\t\t\t\tvm.opportunity.self.contactMode = \"Create\";\n\t\t\t}\n\n\t\t\tvm.createOpportunity = function(opportunity) {\n\t\t\t\tconsole.log(\"Inside createOpportunity()\");\n\t\t\t\tconsole.log(opportunity);\n\t\t\t\topportunityManager.createOpportunity(opportunity);\n\t\t\t}\n\t\t}\n\n\t\tvm.setTempContact = function(contact) {\n\t\t\tvm.opportunity.self.tempContact = contact;\n\t\t\tvm.opportunity.self.contactMode = \"Update\";\n\t\t}\n\n\t\tvm.resetTempContact = function() {\n\t\t\tconsole.log(vm.opportunity.self);\n\t\t\tfor (var key in vm.opportunity.self.tempContact) {\n\t\t\t\tif (key != \"$$hashKey\") {\n\t\t\t\t\tvar fieldID = document.querySelector('[ng-model=\"model.self.tempContact.' + key + '\"]').id;\n\t\t\t\t\tvm.opportunityFields[1].form[fieldID].$setUntouched();\n\t\t\t\t\tvm.opportunityFields[1].form[fieldID].$setPristine();\n\t\t\t\t}\n\t\t\t}\n\t\t\tvm.opportunity.self.tempContact = {};\n\n\t\t\tif (vm.opportunity.self.contactMode == \"Update\")\n\t\t\t\tvm.opportunity.self.contactMode = \"Create\";\n\n\t\t}\n\n\t\tif ($state.current.name === 'home.opportunity.edit') {\n\t\t\tconsole.log(\"EDIT OPPORTUNITY\");\n\t\t\tvm.opportunity = {};\n\n\t\t\tpageStructureFactory.getLayout('opportunity_CRUD')\n\t\t\t\t.then(\n\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\tvm.opportunityFields = response.data;\n\n\t\t\t\t\t\tif ($stateParams.opportunity != null) {\n\t\t\t\t\t\t\tconsole.log(\"$stateParams.opportunity\");\n\t\t\t\t\t\t\tconsole.log($stateParams.opportunity);\n\t\t\t\t\t\t\tvm.opportunity = $stateParams.opportunity;\n\t\t\t\t\t\t\tvm.opportunity.self.opportunityMode = \"Update\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t},\n\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\talert(\"Oops! Something went wrong.\\n Try reloading the page\");\n\t\t\t\t\t});\n\n\t\t\tvm.updateOpportunity = function(opportunity) {\n\t\t\t\tconsole.log(\"Inside updateOpportunity()\");\n\t\t\t\tconsole.log(opportunity);\n\t\t\t\topportunityManager.updateOpportunity(opportunity);\n\t\t\t};\n\n\t\t}\n\n\t\tif ($state.current.name === 'home.opportunity.view') {\n\t\t\tconsole.log(\"VIEW OPPORTUNITY\");\n\t\t\tvm.opportunity = {};\n\n\t\t\tpageStructureFactory.getLayout('opportunity_CRUD')\n\t\t\t\t.then(\n\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\tvm.opportunityFields = response.data;\n\n\t\t\t\t\t\tif ($stateParams.opportunity != null) {\n\t\t\t\t\t\t\tconsole.log(\"$stateParams.opportunity\");\n\t\t\t\t\t\t\tconsole.log($stateParams.opportunity);\n\t\t\t\t\t\t\tvm.opportunity = $stateParams.opportunity;\n\t\t\t\t\t\t\tvm.opportunity.self.opportunityMode = \"View\";\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\talert(\"Oops! Something went wrong.\\n Try reloading the page\");\n\t\t\t\t\t});\n\n\t\t}\n\n\t\tif ($state.current.name === 'home.opportunity.delete') {\n\t\t\tconsole.log(\"DELETE OPPORTUNITY\");\n\n\t\t\tpageStructureFactory.getLayout('opportunity_CRUD')\n\t\t\t\t.then(\n\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\tvm.opportunityFields = response.data;\n\n\t\t\t\t\t\tif ($stateParams.opportunity != null) {\n\t\t\t\t\t\t\tconsole.log(\"$stateParams.opportunity\");\n\t\t\t\t\t\t\tconsole.log($stateParams.opportunity);\n\t\t\t\t\t\t\tvm.opportunity = $stateParams.opportunity;\n\t\t\t\t\t\t\tvm.opportunity.self.opportunityMode = \"Delete\";\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\talert(\"Oops! Something went wrong.\\n Try reloading the page\");\n\t\t\t\t\t});\n\n\t\t\tvm.deleteOpportunity = function(opportunity) {\n\t\t\t\tconsole.log(\"Inside deleteOpportunity()\");\n\t\t\t\tconsole.log(opportunity);\n\t\t\t\topportunityManager.deleteOpportunity(opportunity.self.opportunityId);\n\t\t\t};\n\n\t\t}\n\t}", "function viewIssue() {\n getTicketDetails(\n function (data) {\n client.interface.trigger(\"showModal\", {\n title: \"Github Issue Details\",\n template: \"./modal/modal.html\",\n data: data.ticket,\n });\n },\n function (error) {\n console.error(error);\n }\n );\n}", "function SearchPOView() {\n ngDialog.openConfirm({\n template: '../templates/_searchPOViewDialog.html',\n closeByEscape:true,\n className: 'ngdialog-theme-plain custom-width',\n preCloseCallback: 'preCloseCallbackOnScope',\n scope: $scope\n });\n }", "function OrganizationAlipayDetailView() {\n BaseView.apply(this, arguments);\n }", "function openContactDetails() {\n\t\tconst contactId = Number(this.id);\n\t\tupdateContactDetails(contactId);\n\t\tmodal.style.display = \"block\";\n\t}", "async viewProjDetails({\n view,\n params\n }) {\n const service = await Service.find(params.id)\n return view.render('/services/serviceview', {\n service: service.toJSON()\n })\n }", "function showMyTeamDetails(context) {\n const myTeamId = sessionStorage.getItem('teamId');\n context.redirect(`#/catalog/:${myTeamId}`);\n }", "function viewModal (data, templateUrl, title, controllerName, controllerAs) {\n \n controllerName = controllerName ? controllerName : 'DefaultViewCtrl';\n controllerAs = controllerAs ? controllerAs : 'view';\n\n data.modalTitle = title;\n\n return $modal.open({\n\n templateUrl: templateUrl,\n controller: controllerName,\n controllerAs: controllerAs,\n resolve: {\n\n data: function () {\n\n return data;\n\n }\n\n }\n\n});\n\n\n }", "function addNewItem() { switchToView('edit-form'); }", "function viewDetails(object) {\n if (target.value == 'person') {\n $('#person-edit-model').modal('show');\n setEditValuesPerson(object.target.id);\n } else if (target.value == 'company') {\n $('#company-edit-model').modal('show');\n setEditValuesCompany(object.target.id);\n } else {\n return;\n }\n}", "function showTargetView(data){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar mailingSetName = view.mailingSetName;\n\t\tvar $content = $e.find(\".viewEmailsPicker-content\");\n\t\t$content.empty();\n\t\t$content.html(data.data);\n\t}", "function open_add_plant_modal(open) {\n\t$(\"#add-plant\").css(\"display\", open ? \"block\" : \"none\");\n}", "function open(dialog) {\n\t\n}", "function viewInfoPrompt () {\n return inquirer.prompt ([\n {\n type: \"list\",\n name: \"itemToView\",\n message: \"What would you like to view?\",\n choices: [\n \"Departments\", \n \"Roles\",\n \"Employees\",\n \"All Information\"\n ]\n }\n ])\n\n }", "function viewImage() { \n var imageId = view.popup.selectedFeature.attributes.sheetId; \n viewer.open( \"https://collections.lib.uwm.edu/digital/iiif/agdm/\" + imageId + \"/\");\n $('#imageModal').modal('show');\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}", "open () {\n return super.open('parkcalc');\n }", "function openSearch() {\n\tAlloy.createController(\"search/index\");\n}", "function openSearch() {\n\tAlloy.createController(\"search/index\");\n}", "function _openPointCardModal() {\n return _openGenericModal({\n templateUrl: 'modules/core/views/modal/usePointcardModal.client.view.html',\n controller: 'usePointcardCtrl'\n });\n }", "open() {\n super.open('user/login');\n }", "function openComputedView() {\n return openInspectorSideBar(\"computedview\");\n}", "function showHistoryOfRelease(instituteID,instituteName,strProposalId,strVersionId)\n{\nvar str = \"/ICMR/app_srv/icmr/mm02/jsp/view_release_budget_history.jsp?instituteID=\"+instituteID+\"&isSingleInstitute=yes&instituteName=\"+instituteName+\"&strProposalId=\"+strProposalId+\"&strVersionId=\"+strVersionId; \n window.open(str, 'new', 'scrollbars,width=1100,height=450,top=175,left=175');\n\n}", "handleViewDetailsClick() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.location.Id,\n objectApiName: LOCATION_OBJECT.objectApiName,\n actionName: 'view'\n }\n });\n }", "function viewClosedTickets() {\n var upload_url = baseURL + nlapiResolveURL('suitelet', 'customscript_sl_edit_closed_ticket', 'customdeploy_sl_edit_closed_ticket');\n window.open(upload_url, \"_self\", \"height=750,width=650,modal=yes,alwaysRaised=yes\");\n}", "@action\n openInstance(instanceId, viewMode = \"view\"){\n this.togglePreviewInstance();\n if (viewMode === \"edit\" && !browseStore.isFetched.lists && !browseStore.isFetching.lists) {\n browseStore.fetchLists();\n }\n historyStore.updateInstanceHistory(instanceId, \"viewed\");\n if(this.openedInstances.has(instanceId)){\n this.openedInstances.get(instanceId).viewMode = viewMode;\n this.syncStoredOpenedTabs();\n } else {\n this.openedInstances.set(instanceId, {\n currentInstancePath: [],\n viewMode: viewMode,\n paneStore: new PaneStore()\n });\n const instance = this.createInstanceOrGet(instanceId);\n instance.fetch();\n this.setCurrentInstanceId(instanceId, instanceId, 0);\n this.syncStoredOpenedTabs();\n }\n }", "function openSenateWin(urlToOpen) {\n\twindow.open(urlToOpen);\t\n}", "function openModal(item) {\n if(item.type == \"artist\"){\n getAlbums(item.id);\n } else {\n getTracks(item.id);\n }\n vm.showModal = item;\n }", "function showDetail() {\n showModal('detail.html');\n}", "function _openRedeemPointCardModal() {\n return _openGenericModal({\n templateUrl: 'modules/core/views/modal/redeemPointcardModal.client.view.html',\n controller: 'redeemPointcardCtrl'\n });\n }", "function View() {\n }" ]
[ "0.60245764", "0.5902084", "0.588091", "0.58751684", "0.58528507", "0.5825909", "0.57534933", "0.5625358", "0.56178623", "0.56178623", "0.55248815", "0.5524539", "0.55118287", "0.5497018", "0.54535663", "0.5450773", "0.54503196", "0.542854", "0.54111236", "0.53768754", "0.5376439", "0.5376439", "0.5376439", "0.5376439", "0.5376439", "0.5376439", "0.5376439", "0.53622365", "0.53578657", "0.53412795", "0.53365767", "0.5332254", "0.53270787", "0.5325259", "0.53225595", "0.53175074", "0.53135854", "0.5294813", "0.52944005", "0.5290221", "0.5283164", "0.52789193", "0.5274056", "0.5269839", "0.5263141", "0.5258", "0.5257021", "0.52546513", "0.5245314", "0.5232967", "0.52269757", "0.5225713", "0.52125716", "0.52019143", "0.5201389", "0.52006847", "0.5194045", "0.51913494", "0.5186211", "0.5184427", "0.51791334", "0.5171831", "0.5165418", "0.51509386", "0.51464415", "0.51464415", "0.51464415", "0.5141538", "0.5137029", "0.5127056", "0.51234436", "0.511915", "0.51172173", "0.51161253", "0.51136374", "0.5110402", "0.5106361", "0.5102574", "0.5102472", "0.5094024", "0.5091892", "0.5090619", "0.5085876", "0.5085205", "0.5084806", "0.50784594", "0.5076", "0.5076", "0.5074077", "0.50735104", "0.5070713", "0.5063217", "0.50611603", "0.50590265", "0.50527537", "0.5051502", "0.50499815", "0.5047986", "0.50474215", "0.50473094" ]
0.67139226
0
Load my opportunity applications from database
loadMyApplications(forceReload) { var d = $q.defer(); if(this.myApplications.length === 0 || forceReload === true) { $http.get('/api/opportunity_applications/me') .then(response => { this.myApplications = response.data; for(var application of this.myApplications) { application.ExpirationDate = new Date(application.opportunity.ExpirationDate).getTime(); } d.resolve(this.myApplications); }) .catch(err => d.reject(err)); } else { d.resolve(this.myApplications); } return d.promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEmployeeJobApplication(firstname) {\n\treturn Employee.findOne({firstname: firstname})\n\t .populate(\"applications\").exec((err, posts) =>{\n console.log(\"Populated Employee\" + posts)\n }\n\t \n)\n}", "function loadCurrentApplication() {\n ApplicationsService\n .loadCurrent($stateParams.companyId, $stateParams.appId)\n .then(function resolve(response) {\n vm.current = response.data.app;\n });\n }", "getApplication (opportunityId, personId, forceReload) {\n var d = $q.defer();\n if(!this.loadedOpportunityApplications[`${opportunityId}-${personId}`] || forceReload === true) {\n $http.get(`/api/opportunity_applications/${opportunityId}/${personId}`)\n .then(response => {\n var application = response.data;\n this.loadedOpportunityApplications[`${opportunityId}-${personId}`] = application;\n d.resolve(application);\n })\n .catch(err => {\n d.reject(err);\n });\n } else {\n d.resolve(this.loadedOpportunityApplications[`${opportunityId}-${personId}`]);\n }\n return d.promise;\n }", "data() {\n return Applications.findOne(this.params._id);\n }", "function loadData(applicationName) {\n console.log(\"Loading \" + applicationName + \" options, mappings and tabs...\")\n\n var promises = [\"options\", \"mappings\", \"tabs\"].map(function(objectName) {\n return requestJSON(applicationName, objectName);\n });\n\n $q.all(promises).then(function(data) {\n console.log(\"All data loaded\")\n dataManager.initializeDataStructuresIfAllLoaded();\n })\n\n }", "function loadPartner() {\n \tGisMap.Util.MAX_APP_FILES = application.partner_sources.length;\n \tGisMap.Util.LOADED_APP_FILES = 0;\n if (application.partner_sources.length == 0) {\n GisMap.Core.injectHtml(STARTAPPLICATION);\n return;\n }\n for (var file in application.partner_sources) {\n var load = GisMap.Util.loadPartnerFile(application.partner_sources[file], function (complete) {\n if (complete)\n GisMap.Core.injectHtml(STARTAPPLICATION);\n \n \n })\n }\n }", "function loadLDB() {\n\t\t\tconsole.log(\"loadLDB()\");\n\t\t\tif (vm.results.length == 0) { // this works coming from create\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (vm.selectedIndex < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// api get object by primary key\n\t\t\tconsole.log(\"vm.results[vm.selectedIndex].logicalDBKey: \" + vm.results[vm.selectedIndex].logicalDBKey); //this works from create\n\t\t\tLDBGetAPI.get({ key: vm.results[vm.selectedIndex].logicalDBKey }, function(data) { // this works from create\n\n\t\t\t\tvm.apiDomain = data;\n\t\t\t\tvm.apiDomain.logicalDBKey = vm.results[vm.selectedIndex].logicalDBKey; // this works from create\n\t\t\t\tselectLDB(vm.selectedIndex);\n\t\t\t\taddAdbRow()\n\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"Error retrieving data object.\");\n\t\t\t});\n\t\t}", "function findApplicantProfiles() {\n return db(\"applicant_profiles\");\n}", "function loadExperiences(org) {\n self.loading = true;\n\n content.getExperiencesByOrg(org.id)\n .then(function(exps) {\n var expUserPromiseArray = [];\n\n data.appData.experiences = exps;\n data.experiences = exps;\n\n exps.forEach(function(exp) {\n expUserPromiseArray.push(account.getUser(exp.user)\n .then(function(user) {\n exp.user = user;\n }));\n });\n\n return $q.all(expUserPromiseArray);\n })\n .finally(function() {\n data.query = null;\n self.loading = false;\n self.action = 'experiences';\n });\n }", "getApplicationsForUser(userId) {\n return this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).find({ userId: userId });\n }", "static async getApplications(){\n let appQuery = `SELECT A.*, B.ID AS JOBID, B.ACTIVE FROM APPLICATIONS AS A \n INNER JOIN JOBOFFERS AS B ON A.JOBID=B.ID WHERE ACTIVE=1`;\n try{\n let client = await pool.connect();\n let result = await client.query(appQuery);\n client.release();\n return result.rows;\n } catch(err){\n console.log(err);\n }\n }", "async getGamesWithApplication ({ request, auth, response }) {\n const user = auth.current.user\n try {\n const applics = await Application.all()\n return response.json({\n status: 'success',\n data: applics\n })\n } catch (error) {\n return response.status(400).json({\n status: 'error',\n message: 'Tivemos um problema. Por favor tente novamente.'\n })\n }\n }", "static async getAll() {\n const applicationsData = await db.applications.getAll();\n const applications = applicationsData.map((data) => new Application(data));\n const applicationsExended = Promise.all(applications.map(async (application) => {\n const status = await Status.getById(application.statusId);\n application.setStatus(status);\n return application;\n }));\n return applicationsExended;\n }", "load() {\n\t\treturn models.Enviroment.findAll({\n\t\t\twhere: {\n\t\t\t\tis_active: true\n\t\t\t},\n\t\t\tinclude: [models.Unit, models.User, models.EnviromentType]\n\t\t})\n\t}", "function getJobApplicants(req, res, next){\n db.any(\n \"SELECT * FROM Applications INNER JOIN ApplicantUsers on ApplicantUsers.id = Applications.applicant_id where Applications.job_id = $1;\"\n , [req.params.job_id] )\n .then(function(data) {\n res.rows= data\n console.log('successfully getting current applicants for the job', data)\n next();\n })\n .catch(function(error){\n console.error(error);\n })\n}", "function load(app, config, index) {\n \n // admin database loading\n logger.debug('DAO count in admin database config : %d', admin_database_config.length);\n \n var admin_count = 0;\n\tfor (var i = 0; i < admin_database_config.length; i++) {\n\t\tvar curItem = admin_database_config[i];\n\t\t\n if (curItem.database_index == index) {\n var filename = path.join(__dirname, admin_folder, curItem.file);\n //logger.debug('filename #' + i + ' : ' + filename);\n \n if (fs.existsSync(filename + '.js')) {\n var curSchema = require(filename);\n logger.debug('DAO [%s] loaded -> %s.%s', curItem.id, config.db[index].name, curItem.name);\n\n // add it as attribute\n database_oracle[curItem.name] = curSchema;\n\n admin_count += 1;\n } else {\n logger.warn('No %s file for method %s . -> not loaded.', filename + '.js', curItem.method);\n } \n }\n\t}\n\t\n logger.debug('DAO loaded for admin database #' + index + ' : %d', admin_count);\n\t\n \n // database loading\n logger.debug('DAO count in database config : %d', database_config.length);\n \n var count = 0;\n\tfor (var i = 0; i < database_config.length; i++) {\n\t\tvar curItem = database_config[i];\n\t\t\n if (curItem.database_index == index) {\n var filename = path.join(__dirname, database_folder, curItem.file);\n //logger.debug('filename #' + i + ' : ' + filename);\n \n if (fs.existsSync(filename + '.js')) {\n var curSchema = require(filename);\n logger.debug('DAO [%s] loaded -> %s.%s', curItem.id, config.db[index].name, curItem.name);\n\n // add it as attribute\n database_oracle[curItem.name] = curSchema;\n\n admin_count += 1;\n } else {\n logger.warn('No %s file for method %s . -> not loaded.', filename + '.js', curItem.method);\n } \n }\n\t}\n\t\n logger.debug('DAO loaded for database #' + index + ' : %d', count);\n\t\n \n // add it to app\n\tapp.set(config.db[index].name, database_oracle);\n\tlogger.debug('database object is added to app as [' + config.db[index].name + '] attribute.');\n}", "function load() {\n listModel.clear();\n var jsonObject = JSON.parse(listModel.source);\n var apps = jsonObject.apps\n for (var app in apps) {\n // Provide the file scheme to the icon for reliable loading of the icon. Without\n // it the path can be interpreted as a relative path to a resource file bundled\n // with the binary\n listModel.append({icon: \"file://\" + apps[app].icon, appId: apps[app].id});\n }\n}", "function loadPrograms(){\n\tconsole.log(\"attempting to load programs\");\n\n\t//request to load programs table from database\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'Programs'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tprograms=data;\n\t\t\tnumLoadedTables++;\n\t\t\tcheckTablesLoaded();\n\t\t}\n\t});\n}", "@action setup_apps() {\n this._applications_to_configure.forEach((app_conf) => {\n if ( !app_conf.name ) {\n throw new TypeError(`Apps need a name as part of their configuration! Looked inside: ${JSON.stringify(app_conf)}`)\n }\n\n // Parse its routes into our router\n // TideStore (.. which is badly named... its technically just a rendering engine).\n // will end up using the context to determine which layout to use during a render\n for (let route of app_conf.routes) {\n route.context.app_label = app_conf.name;\n this.router.set(route);\n }\n\n // Give the application some of its own configured data\n app_conf.app.store = app_conf.store;\n app_conf.app.tide = this;\n\n if(this._apps.has(app_conf.name)){\n throw new ConfigurationError(`The application named ${app_conf.name} was listed twice.`)\n }\n\n // Set the completed app in our table\n this._apps.set(app_conf.name, app_conf);\n });\n\n // Now that all the apps are in the listing\n // Let it complete them complete their initialization\n this.apps().map(app_conf => {\n let initial = this.initial_data[app_conf.name] || {};\n console.log(`[Tide] Initial for ${app_conf.name}`, initial);\n app_conf.ready(initial)\n })\n }", "async listApplications() {\n let params = {\n TableName: process.env.APPLICATIONS_TABLE\n };\n let length = 0;\n let docClient = new AWS.DynamoDB.DocumentClient(this.config);\n try {\n let result = await docClient.scan(params).promise();\n length += result.Items.length;\n if (length < 1){\n return Promise.reject({\n code: 404,\n error: 'NotFoundException',\n message: 'No applications are registered with the solution.'\n });\n } else {\n let results = [];\n result.Items.forEach(function(item) {\n results.push({\n 'ApplicationId': item.application_id,\n 'ApplicationName': item.application_name,\n 'Description': item.description,\n 'UpdatedAt': item.updated_at,\n 'CreatedAt': item.created_at\n }); \n });\n return Promise.resolve({\n \"Applications\": results,\n \"Count\": length\n });\n }\n } catch (err) {\n console.log(JSON.stringify(err));\n return Promise.reject({\n code: 500,\n error: 'InternalFailure',\n message: 'Error occurred while attempting to retrieve applications',\n });\n }\n }", "function fetchAppList(error, apps) {\n if(error) {\n console.log(error);\n return;\n }\n\n if(apps && apps.length > 0) {\n var rendered = Meteor.render(function() {\n return Template.appList({ apps: apps });\n });\n document.getElementById(\"apps-list\").innerHTML = '';\n document.getElementById(\"apps-list\").appendChild(rendered);\n\n if(typeof Session.get(\"activeApp\") == \"undefined\" ||\n Session.get(\"activeApp\") === null) {\n Session.set(\"activeApp\", App.fetchNameForId(apps[0]));\n Session.set(\"activeAppId\", apps[0]);\n }\n }\n}", "function loadData(){\n\t\tvar getData = $.getJSON( \"dev/data/shooting_incidents.json\", function() {\n\t\t})\n\t\t\t.done(function(data){\n\t\t\t\tmapData = data;\n\t\t\t\tviewModel = new AppViewModel();\n\t\t\t\tko.applyBindings(viewModel);\n\t\t\t})\n\t\t\t.fail(function(msg){\n\t\t\t\tconsole.log('error: ' + msg);\n\t\t\t});\n\t}", "getApplicationsForGrant(grantId) {\n return this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).find({ grantId: grantId });\n }", "getAllApplications () : Promise<Array<AccountApplication>> {\n return this.makeRequest(\"applications\")\n }", "getAppAutomations(appId) {\n return this.apiBase.executeRequestToPath('/we/api/v1/apps/' + appId + '/workflow/flows/', this.constsants.GET).then(function(requestResponse) {\n let automations = JSON.parse(requestResponse.body);\n return automations;\n }).catch(function(error) {\n browser.logger.error('Error in getAppAutomations function:' + JSON.stringify(error));\n return Promise.reject(error);\n });\n }", "function listApplications() {\n var result = [], k;\n for (k in apps)\n result.push(k);\n return result;\n }", "async load () {\n const startables = await this.db.startables.toArray()\n this.store.setStartables(startables)\n\n const rows = await this.db.favourites.get('favourites')\n\n if (rows) {\n this.store.setFavourites(rows.favourites)\n }\n }", "function loadData() {\n bootcampsFactory.getAllBootcamps()\n .success(function(model) {\n $scope.bootcamps = model.Bootcamps;\n $scope.locations = model.Locations;\n $scope.technologies = model.Technologies;\n })\n .error(function(status) {\n alert(\"Error! Status: \" + status);\n });\n }", "function loadApps() {\n\t\t\t\tEnvironment.logDebug(\"Server Starting-3\");\n\t\t\t\trequire('fs').readdirSync('./routes').forEach(function serverLoadApps(file) {\n\t\t\t\t\t// only load javascript files\n\t\t\t\t\tif (file.indexOf(\".js\") > -1) {\n\t\t\t\t\t\tconsole.log('BURP '+file);\n\t\t\t\t\t\tstartApp(file);\n\t\t\t\t\t}\n\t\t\t });\n\t\t\t}", "function LoadApp(element) {\n $.ajax({\n type: \"Get\",\n url: \"/Applications/LoadApplication\",\n success: function (data) {\n //debugger;\n Apps = data;\n var $option = $(element);\n $option.empty();\n $option.append($('<option/>').val('0').text('Select Application').hide());\n $.each(Apps, function (i, val) {\n //debugger;\n $option.append($('<option/>').val(val.id).text(val.name));\n });\n }\n });\n}", "getAutomations(appId) {\n let url = super.constructUrl(this.API.GET_AUTOMATIONS, [appId]);\n return super.get(url);\n }", "async Applications() {\n try {\n return await this.MakeRequest(`${this.Config.baseUrl}/applications.json`);\n } catch (ex) {\n console.log('Applications Error', ex.message);\n return null;\n }\n }", "function getParticularApp(req, res) {\n var id = req.params.id\n dbconn.getAppointsForEach(id, (err, result) => {\n if (err) {\n console.log(err)\n } else {\n if (result.length > 0) {\n console.log(result)\n res.send(result)\n } else {\n res.send(\"No Data Found\")\n }\n }\n })\n}", "function requestApplications(success, failure) {\n if (!self.currentOrganization) {\n failure();\n }\n apiGetRequest(\"/management/organizations/\" + self.currentOrganization + \"/applications\", null, success, failure);\n }", "function findAppInSelectedModel(gid, aid,fromInstance) {\n\tvar self = this;\n\tvar _group = self.findGroupByPath(gid,fromInstance);\n\tvar _app = _.find(_group.apps, function(app) {\n\t\treturn app.id == aid;\n\t});\n\treturn _app;\n}", "function getAppsFromBody() {\n vm.appsFound = appDetector.getAppsFromBody(vm.domainRequest.body);\n }", "static async getProcesses(data) {\n try {\n return await database.processes.findAll({\n where: { projectId: data.projectId }, include: [{model: database.files_mains}]\n });\n } catch (error) {\n throw error;\n }\n }", "function addApresentacao(app) {\n db.transaction(function (tx) {\n tx.executeSql('INSERT INTO apresentacao(id,tema,data,hora,aluno, orientador, sobre, local, campus) values (\"' + app.id + '\",\"' + app.tema + '\",\"' + app.data + '\",\"' + app.hora + '\",\"' + app.aluno + '\",\"' + app.orientador + '\",\"' + app.sobre + '\",\"' + app.local + '\",\"' + app.campus + '\")')\n },\n function (err) {\n console.log(err);\n },\n function () {\n });\n}", "async indexAll(){\n return Appointment.findAll();\n }", "function loadManagerMenu() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Load the possible manager menu options, pass in the products data\n loadManagerOptions(res);\n });\n}", "async function loadCoreData() {\n await Promise.all([\n loadExercises(),\n loadCategories(),\n loadSessions(),\n ]);\n}", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "function fetchUserApplication(domainQuery, opportunityKey, userKey) {\n return domainQuery.getCurrent(__WEBPACK_IMPORTED_MODULE_0__domain__[\"h\" /* USER_APPLICATION */], { userKey, opportunityKey });\n}", "function getEasyLoadRecordsFromDb(){\n\t\t$http.get(\"/easyloadList\").then(\n\t\t\t\tfunction(res){\n\t\t\t\t\t$scope.easyLoadRecords = res.data;\n\t\t\t\t\tconsole.log(\"data found from data base\");\n\t\t\t\t\tconsole.log(res);\n\t\t\t\t},\n\t\t\t\tfunction(err){\n\t\t\t\t\tconsole.log(\"data not found from database something wrong\");\n\t\t\t\t})\n\t}", "function getApplicationDetails(username) {\n let appl = {};\n return Db.transaction(t => {\n return Person.findAll({\n attributes: ['firstname', 'lastname', 'username', 'email'],\n include: [\n {\n model: Availability,\n required: true,\n }, {\n model: ApplicationStatus,\n required: true\n }, {\n model: Competence, \n required: true,\n }\n ],\n where: { \n username: username\n }, transaction: t\n }).then(res => {\n appl = res;\n })\n }).then(result => {\n //application hopefully has all the info we need\n console.log(\"Application: \"+JSON.stringify(appl))\n return appl;\n })\n .catch(err => {\n \n throw Error(\"Fetching application details failed: \" + err)\n })\n}", "function loadAgenda() {\n\n fetch('/agenda.json')\n .then(function(resp) {\n return resp.json();\n })\n .then(function(j) {\n\n agenda = j\n agendaLoaded(j)\n\n })\n}", "loadData() {\n this.hvacData = HVACDataLoader.getHVACData(this);\n if (this.hvacData.getBuildingList().length > 0) this.selectBuilding(this.hvacData.getBuildingList()[0]);\n }", "function loadData() {\r\n // load projects\r\n failureReportMode.projectOpts.clear();\r\n var projectMap = {};\r\n for (var i = 0; i < employeeInfo.projectRole.length; i++) {\r\n var project = employeeInfo.projectRole[i][0];\r\n if (projectMap[project] == null && project != \"\") {\r\n projectMap[project] = 1;\r\n failureReportMode.projectOpts.push({\r\n value: project,\r\n label: project\r\n });\r\n }\r\n }\r\n\r\n }", "function resumeInitApp() {\n // this needs the db to exist\n setLoadMessage('Initializing Handlers');\n initGlobalUIHandlers();\n\n // sections\n setLoadMessage('Loading Sections');\n loadSections();\n $('.app-version-number').text(app.getVersion());\n\n // populate some menus\n setLoadMessage('Populating Menus');\n globalDBUpdate();\n\n removeLoader();\n}", "function getDBs() {\n\n $(\"#loading\").hide();\n\n $.get(\"/ia/loadDb\", function(data) {\n populateCollectionList(data);\n });\n\n\n}", "function loadStoredAirports() {\n let loadedAirports = JSON.parse(localStorage.getItem('airports'));\n checkloadedAirports(loadedAirports);\n}", "getApplicationsList(params) {\n return this.createRequest('/', params, 'get');\n }", "async getAppsForStrategy(strategyName) {\n const rows = await this.db.select(COLUMNS).from(TABLE);\n return rows\n .map(mapRow)\n .filter(apps => apps.filter(app => app.strategies.includes(strategyName)));\n }", "async loadDatabase() {\n this.__db =\n (await qx.tool.utils.Json.loadJsonAsync(this.__dbFilename)) || {};\n }", "function loadPrograms(){\n\tconsole.log(\"attempting to load programs\");\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'Programs'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tprograms=data;\n\t\t\t\n\t\t\tvar x = document.getElementById(\"program-select\");\n\t\t\t\n\t\t\tfor(var i=0;i<programs.length;i++)\n\t\t\t{\n\t\t\t\tvar option = document.createElement(\"option\");\n\t\t\t\toption.text = programs[i].program_name;\n\t\t\t\toption.value = programs[i].program_id;\n\t\t\t\tx.add(option);\n\t\t\t}\n\t\t}\n\t});\n}", "function loadData(){\n\t\tloadParetoData();\n\t\tloadConstraints();\n\t\t\n\t}", "load(callback) {\n const selectTodoItems = \"SELECT * FROM todo_items\";\n this.dbConnection.query(selectTodoItems, function (err, results, fields) {\n if (err) {\n callback(err);\n return;\n }\n\n callback(null, results);\n });\n }", "function loadApplication() {\n console.log(\"Application loaded\");\n // Load directly to the main menu\n configureUI(displayMainMenu());\n\n}", "async loadApp(){\n\n //Pick the fonts from the project '\"root\"/assets/fonts/' folder and assign the names 'cabin' and 'confortaa' that can be used in 'fontFamily' style props:\n await Expo.Font.loadAsync({\n cabin: require('../../assets/fonts/Cabin-Regular.ttf'),\n comfortaa: require('../../assets/fonts/Comfortaa-Bold.ttf'),\n PlantIO_Icons: require('../../assets/icons/pio-ui-icons.ttf')\n })\n\n //Check if user is logged in:\n checkSession()\n .then((r)=>{let s = this.state; s.signed = r; this.setState(s);})\n .catch((error)=>alert(error));\n\n //Fetch Modules List from the Plant IO API and stores in AsyncStorage to be used all over the app:\n await fetchDataFromPlantIOAPI();\n await fetchDataFromClimatempoAPI();\n\n //When everything is loaded, set isReady to true, thus, redirecting the app to the main routes:\n let s = this.state;\n s.isReady = true\n this.setState(s);\n }", "retreiveAppDemos(path) {\n var _this = this;\n this.setState({ allAppsData: [], appsLoaded: false })\n //Get list of apps, and put the data in the state\n firebase.database().ref(path).once('value').then(function (snapshot) {\n\n if (snapshot.val() === null) {\n _this.setState({\n appsLoaded: true\n })\n } else {\n var allAppsData = snapshot.val();\n var apps = [];\n Object.keys(allAppsData).map(function (key, index) {\n allAppsData[key][\"key\"] = key;\n apps.push(allAppsData[key])\n\n });\n _this.setState({ allAppsData: apps, appsLoaded: true })\n\n }\n\n });\n }", "function adminAppsView(){\n\tremoveClass('active');\n\tdocument.getElementById('nav-option-applications').className='active';\n\t\n\tvar local_session = get_local_simulation();\n\tvar applications = local_session.apps;\n\tvar app_map = mapDevicestoApp( applications);\n\tconsole.log(app_map);\n\tvar html = viewAdminApplicationsTemplate(app_map);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n}", "function addApresentacao(app){\n db.transaction(function(tx){\n tx.executeSql('INSERT INTO apresentacao(id,tema,data,hora,aluno, orientador, sobre, local, campus) values (\"'+app.id+'\",\"'+app.tema+'\",\"'+app.data+'\",\"'+app.hora+'\",\"'+app.aluno+'\",\"'+app.orientador+'\",\"'+app.sobre+'\",\"'+app.local+'\",\"'+app.campus+'\")')\n },\n function(err){\n console.log(err);\n },\n function(){\n });\n}", "function readAppData()\n {\n nsmethods.readDataIntoApplication();\n }", "resolve(parent, args) {\n return _.find(applications, {id: args.id})\n }", "function get_offline_data() {\n var data = store.get(\"app_activities\", []);\n return data;\n}", "function queryAndStoreApplicationsFlow (queryObj) {\n return flow([\n \tapp.locals.shaid.getApplications.bind(null, queryObj),\n \thelper.storeApps.bind(null, false)\n ], {method: 'waterfall', eventLoop: true});\n}", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) {\n return apps[name];\n });\n }", "function addApps(){\n for (var i=0; i<apps.length; i++){\n addApp(apps[i]);\n }\n}", "function dashboardApps(data) {\n return logCollection.find(dataField).sort({ \"_id\": -1 }).skip(toSkip).limit(countLimit).toArray()\n .then(logAppList => {\n return logCollection.find(dataField).count()\n .then(logListCount => {\n var result = []\n if (logListCount) {\n for (var i = 0; i < logListCount; i++) {\n var getResult = {\n \"_id\": logAppList[i]._id,\n \"app_id\": logAppList[i].app_id,\n \"comp_id\": logAppList[i].comp_id,\n \"issues\": logAppList[i].issues,\n \"type\": logAppList[i].type,\n \"platform\": logAppList[i].platform,\n \"device\": logAppList[i].device,\n \"version\": logAppList[i].version,\n \"created_dateTime\": logAppList[i].created_dateTime\n }\n result.push(getResult)\n }\n var finalRes = {\n \"logList\": result,\n \"count\": logListCount\n }\n return finalRes; // Final Result for Loglist for Particular App \n\n } else {\n var err = { \"error\": \"log List not found\" };\n return err;\n }\n });\n\n }).catch(err => {\n return err;\n });\n }", "function showApplicationTable2() {\n\tvar User = getURLParameter(\"User\");\n\tvar Aid = getURLParameter(\"AID\");\n\tselectedItem = null;\n\tconnect(\"/hiwi/Clerk/js/showApplicationTable2\", \"User=\" + User + \"&AID=\"\n\t\t\t+ Aid, handleShowApplicationTable2Response);\n}", "get(id) {\n return this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).findOne({ id: id });\n }", "function loadApps(N, applications) {\n N.apps = [ N.mainApp ];\n\n // Try load each enabled application and push to the array of loaded apps\n _.forEach(applications, appDef => loadApp(N, getAppName(appDef)));\n}", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(name => apps[name]);\r\n }", "function loadJourneyBehaviourData()\n\t\t{\n\t\t\t/**\n\t\t\t * Make sure user is logged in\n\t\t\t */\n\t\t\tuserIsLoggedin();\n\t\t\t\n\t\t\tvar objRequest = {\n\t\t\t\t\tacrq: 'load-journey-behaviours',\n\t\t\t\t\tjourney_id: $scope.objJourney.id\n\t\t\t};\n\t\t\t\n\t\t\t$scope.objJourneyBehaviours = Array();\n\t\t\tvar $p = JourneysPageService.get(objRequest, \n\t\t\t\tfunction success(response) {\n\t\t\t\t\tlogToConsole(response);\n\t\t\t\t\t//check for errors\n\t\t\t\t\tif (typeof response.error != 'undefined' && response.error == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdoErrorAlert('Unable to load Journey Behaviours', '<p>Request failed with response: ' + response.response + '</p>');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}//end if\n\t\t\t\t\t\n\t\t\t\t\tangular.forEach(response.objData, function (objBehaviour, i) {\n\t\t\t\t\t\t$scope.objJourneyBehaviours.push(objBehaviour);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tfunction error(errorResponse) {\n\t\t\t\t\tlogToConsole(errorResponse);\n\t\t\t\t\tdoErrorAlert('Unable to complete request', '<p>An unknown error has occurred. Please try again.</p>');\n\t\t\t\t}\n\t\t\t);\n\t\t\t\n\t\t\t$scope.loadJourneyBehavioursProgress.addPromise($p);\n\t\t}", "static readAllFromDB(dbElementName) {\r\n\t\treturn DBHelper.openDB('restaurant-review-DB').then(db => {\r\n\t\t\treturn db\r\n\t\t\t\t.transaction(dbElementName)\r\n\t\t\t\t.objectStore(dbElementName)\r\n\t\t\t\t.getAll();\r\n\t\t});\r\n\t}", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function getApps() {\r\n // Make a copy so caller cannot mutate the apps list.\r\n return Object.keys(apps).map(function (name) { return apps[name]; });\r\n }", "function loadData() {\n\tvar camlQuery = new SP.CamlQuery();\n\t\n\tvar query = '<View><Query><OrderBy><FieldRef Name=\"Created\" Ascending=\"False\"></FieldRef></OrderBy></Query>'+\n\t\t\t\t'<ViewFields><FieldRef Name=\"SprintProgress\"/></ViewFields><RowLimit>'+ sprintHistoryLimit +'</RowLimit></view>';\n\tcamlQuery.set_viewXml(query);\n\tcollListItem = listReference.getItems(camlQuery);\n\n\tclientContext.load(collListItem);\n\tclientContext.executeQueryAsync(\n\tFunction.createDelegate(this, this.pageInit),\n\tFunction.createDelegate(this, this.showDataError));\n}", "function loadDBTable() {\n connection.query('SELECT * FROM products', function(err, res) {\n if (err) throw err;\n tablePrint(res); \n inquirerStart();\n });\n}", "function loadProjects() {\n reviewStudentAppService.loadProjects().then(function (data) {\n vm.projects = data;\n });\n }", "function showApps(mApps) {\n\t\tvar oTable = document.getElementById(\"apps\");\n\n\t\tfunction addCell(oRow, sText, sUrl) {\n\t\t\tvar oCell = document.createElement(\"td\"),\n\t\t\t\toTextNode = document.createTextNode(sText),\n\t\t\t\toContent = oTextNode;\n\n\t\t\tif (sUrl) {\n\t\t\t\toContent = document.createElement(\"a\");\n\t\t\t\toContent.setAttribute(\"href\", normalizeUrl(sUrl));\n\t\t\t\toContent.appendChild(oTextNode);\n\t\t\t}\n\t\t\toCell.appendChild(oContent);\n\t\t\toRow.appendChild(oCell);\n\t\t}\n\n\t\tif (!mApps) {\n\t\t\treturn;\n\t\t}\n\t\tObject.keys(mApps).forEach(function (sApp) {\n\t\t\tvar aLinks = mApps[sApp],\n\t\t\t\toRow = document.createElement(\"tr\");\n\n\t\t\taddCell(oRow, sApp);\n\t\t\taddCell(oRow, \"App\", aLinks[0]);\n\t\t\taddCell(oRow, \"(realOData)\", aLinks[1]);\n\t\t\taddCell(oRow, \"OPA\", aLinks[2]);\n\t\t\tif (aLinks.length > 3) {\n\t\t\t\taddCell(oRow, \"(realOData)\", aLinks[3]);\n\t\t\t}\n\t\t\toTable.appendChild(oRow);\n\t\t});\n\t}", "loadRelatedData(clientAppId = 'clodeo-admin-web') {\n return this.request.get(`entry-related-data?clientAppId=${clientAppId}`);\n }", "async getNativeApplications () {\n const cauldron = await this.getCauldron()\n return cauldron.nativeApps\n }", "static openDB(name) {\r\n\t\treturn idb.open(name, 1, function(upgradeDB) {\r\n\t\t\tif (!upgradeDB.objectStoreNames.contains('restaurants')) {\r\n\t\t\t\tupgradeDB.createObjectStore('restaurants', {\r\n\t\t\t\t\tkeyPath: 'id'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tfor (var i = 1; i <= 10; i++) {\r\n\t\t\t\tif (!upgradeDB.objectStoreNames.contains(`reviews-${i}`)) {\r\n\t\t\t\t\tupgradeDB.createObjectStore(`reviews-${i}`, {\r\n\t\t\t\t\t\tkeyPath: 'id'\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!upgradeDB.objectStoreNames.contains('reviews-on-hold')) {\r\n\t\t\t\tupgradeDB.createObjectStore('reviews-on-hold', {\r\n\t\t\t\t\tkeyPath: 'updatedAt'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!upgradeDB.objectStoreNames.contains('favorite-on-hold')) {\r\n\t\t\t\tupgradeDB.createObjectStore('favorite-on-hold', {\r\n\t\t\t\t\tkeyPath: 'id'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!upgradeDB.objectStoreNames.contains('all-favorites-on-hold')) {\r\n\t\t\t\tupgradeDB.createObjectStore('all-favorites-on-hold', {\r\n\t\t\t\t\tkeyPath: 'id'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function configLoadApp()//app\n{\n\tapplication_0();\n\tvar appul=document.getElementById(\"appul\");\n\tvar appArr=application;\n\tfor(var i=0;i<appArr.length;i++)\n\t{\n\t\tvar liElement=document.createElement(\"LI\")\n\t\tvar aElement=document.createElement(\"A\")\n\t\tvar imgElement=document.createElement(\"IMG\")\n\t\tvar imgnum=appArr[i][3];\n\t\tif(imgnum==\"\"||imgnum==undefined)\n\t\t{\n\t\t\timgnum=2\n\t\t}\n\t\telse\n\t\t{\n\t\t\timgnum=parseInt(imgnum)\n\t\t}\n\t\timgElement.src=\"images/menuicon\"+imgnum+\".gif\"\n\t\taElement.appendChild(imgElement);\n\t\taElement.href=\"#\"\n\t\taElement.hidefocus=\"true\";\n\t\taElement.innerHTML=aElement.innerHTML+appArr[i][0]\n\t\tliElement.appendChild(aElement);\n\t\tliElement.onclick=new Function(\"selectApp(this,\"+i+\")\")\n\t\tif(appArr[i][1]==1)\n\t\t{\n\t\t\tlastApp=liElement;\n\t\t\tliElement.className=\"Selected\"\n\t\t}\n\t\t\n\t\tappul.appendChild(liElement);\n\t}\n\t\n\tvar liElement=document.createElement(\"LI\")\n\tvar aElement=document.createElement(\"A\")\n\taElement.href=\"#\"\n\taElement.innerText=\">\"\n\tliElement.appendChild(aElement);\n\tliElement.onclick=showAppAfter\n\tliElement.style.display=\"none\"\n\tappul.appendChild(liElement);\n\tdocument.getElementById(\"mainFrame\").src=application[0][2]\n\tcheckAppW()\n}", "_loadApp() {\n const schema = schemaHelper.generateSchema(\n this._ant,\n this._graphQL,\n this._config.model\n );\n\n if (schema) {\n this._schema = schema;\n\n this._app.use('/', graphqlHTTP({\n schema,\n graphiql: true\n }));\n } else {\n logger.error('Could not load the GraphQL API because the model is empty');\n }\n\n if (\n this._graphQL &&\n this._graphQL.directiveController.loadingErrors.length\n ) {\n logger.error(\n 'There were some errors when loading the GraphQL directives:'\n );\n for (\n const loadingError of this._graphQL.directiveController.loadingErrors\n ) {\n logger.error(loadingError);\n }\n }\n }", "function appLoaded() {\n var lang = fetchLanguage(),\n data = fetchData();\n\n $.when(lang, data).then(startApp, appStartError);\n}", "function getAllApplications($scope){\n\tmyCuiJs.getApplications()\n\t\t.then(function(response) {\n\t\t\t$scope.appList = [];\n\t\t\tresponse.forEach(function(fetchedAppFromList) { // pushes all the applications into \"applist\" array\n\t\t\t\t$scope.appList.push(fetchedAppFromList);\n\t\t\t\t$scope.$apply();\n\t\t\t});\n\t\t})\n}", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }", "function getApps() {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(function (name) { return apps[name]; });\n }" ]
[ "0.5928228", "0.58357394", "0.56812173", "0.5674608", "0.56173736", "0.5557813", "0.5516382", "0.5513296", "0.54212123", "0.54178274", "0.540511", "0.5388905", "0.53515404", "0.5255603", "0.5241275", "0.52322733", "0.5218727", "0.52049106", "0.5202345", "0.51374143", "0.5092827", "0.507076", "0.5037193", "0.50345933", "0.5033961", "0.5022474", "0.5021564", "0.5021115", "0.5011955", "0.5007791", "0.49825984", "0.49818832", "0.49589765", "0.49557573", "0.49553287", "0.49527743", "0.49344262", "0.49207976", "0.4905491", "0.49020177", "0.48939243", "0.4880974", "0.4878373", "0.48783687", "0.48779026", "0.48725986", "0.4859679", "0.4856071", "0.48429605", "0.48414043", "0.48343587", "0.48305207", "0.48168132", "0.4810645", "0.4804173", "0.47847587", "0.47786286", "0.47737145", "0.47687227", "0.4768675", "0.47595885", "0.4752482", "0.47419828", "0.47417518", "0.47399414", "0.4738918", "0.47352836", "0.4731155", "0.4730529", "0.47303292", "0.47159728", "0.47139174", "0.47008812", "0.46975103", "0.46969837", "0.4694266", "0.4694266", "0.4694266", "0.4694266", "0.4694266", "0.4694266", "0.4692023", "0.46882284", "0.4683224", "0.46771473", "0.4670444", "0.46703932", "0.46695703", "0.46693057", "0.46682152", "0.46665546", "0.46646068", "0.46589303", "0.46589303", "0.46589303", "0.46589303", "0.46589303", "0.46589303", "0.46589303", "0.46589303" ]
0.5407379
10
Load my opportunity posts from database
loadMyPosts(forceReload) { if(this.myPosts.length === 0 || forceReload === true) { $http.get('/api/opportunities/me') .then(response => { this.myPosts = response.data; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPost() {\n return API.get(\"posts\", `/posts/${id}`);\n }", "function loadItemPostData(){\n return post_model.get([ctrl.editedItem.post_id]).then(function(){\n var p = post_model.list[ctrl.editedItem.post_id].datum;\n\n ctrl.editedPost = {\n id: p.id,\n content: p.content,\n link: p.link,\n link_title: p.link_title,\n link_desc: p.link_desc,\n picture: p.picture,\n attachments: p.docs ? p.docs.concat(p.images||[], p.audios||[], p.videos||[]):[]\n };\n });\n }", "function loadPosts() {\n\n\n}", "function loadPosts() {\n return API.get(\"posts\", \"/publicposts\");\n }", "function loadPosts() {\n\t\tlet posts = new wp.api.collections.Posts();\n\n\t\tposts.fetch({ data: { per_page: 5, orderby: 'title', order: 'desc' } }).done( () => {\n\t\t\t\tclearPosts();\n\t\t\t\tposts.each( post => loadPost( post.attributes ) );\n\t\t});\n\t}", "function loadStoredPosts(postBuilder, completion) {\n db.select_all('posts', {order:{'id': 'desc'}, limit:30}, function(posts) {\n $posts = posts;\n $.each(posts, function() {\n $uids[this.uid] = true;\n postBuilder(this);\n });\n completion(true);\n });\n }", "async init() {\n this.postId = this.router.params.id;\n\n this.postSharedKey = 'posts.' + this.postId;\n\n this.postsService.increaseViews(this.postId);\n\n if (this.shareable.isSharing(this.postSharedKey)) {\n this.setPost(this.shareable.getShared(this.postSharedKey))\n } else {\n this.isLoading = true;\n }\n\n this.db.get(`post.${this.postId}`, e => {\n return this.postsService.get(this.postId);\n }, this.db.recache).then(response => {\n let { record } = response;\n\n this.setPost(record);\n });\n }", "function loadPosts() {// 02\n $.get({ // send get to take all posts\n url: apiBaseUrl + 'posts',\n headers: authorizationHeader\n })\n .then(fillDropDownMenu)\n .catch(renderError);\n }", "function loadPosts() {\n // Note: \"posts\" is the [API] -> [endpoint] -> [name] in src -> index.js\n return API.get(\"posts\", `/searching/all/${name}`);\n }", "function loadPosts() {\n API.userPosts(pathParams.user_id)\n .then(res =>\n setPosts(res.data)\n )\n .catch(err => console.log(err));\n }", "getPost() {\n\t\t// fetch all posts from the server\n\t\tfetch(postURL)\n\t\t\t.then(response => response.json())\n\t\t\t// put them into this.posts and store them there\n\t\t\t.then(data => {\n\t\t\t\tthis.posts = data;\n\t\t\t\treturn data;\n\t\t\t})\n\t\t\t// Use .showPost() to display posts\n\t\t\t.then(data => this.showPost(data));\n\t}", "function loadPosts() {\n\t\tvm.posts = []\n\t\tapiService.getPosts().$promise.then(function(result) {\n\t\t\tresult.posts.forEach(function(post) {\n\t\t\t\tvm.posts.push(post)\n\t\t\t})\n\t\t})\n\t\tUserService.posts = vm.posts\n\t}", "loadPosts() {\n // 5) call getPosts with the user's id */\n // 6) use the response.data object to set \"posts\" field on the state\n }", "function loadData() {\n fetch(postLink)\n .then(e => e.json())\n .then(showData);\n}", "function loadBlogPosts() {\n console.log(`loading...`);\n fetchPosts().then((data) => {\n removeLoadingState();\n appendPosts(data.items);\n });\n}", "async function loadPost(id) {\n const post = await fetch(`/post.json?id=${id}`);\n setPost(post);\n\n const comments = await fetch(`/comments.json&post_id=${id}`);\n setComments(comments);\n}", "function fetch(id) {\n var query = {};\n \n if (id)\n query.postId = id;\n\n Store[id ? 'post' : 'hot'].get(query, success, fail);\n\n function success(data) {\n if (id) {\n data.postId = id;\n return setup([data]);\n }\n\n if (!data.collections)\n return fail();\n\n // Setup a few slides\n setup(data.collections);\n\n // Save all data to cache\n Store.save('collections', data);\n }\n\n function fail(err) {\n $ionicLoading.show({\n template: '<i class=\"icon ion-ios-close-outline\"></i> 网络连接失败...请稍后再试'\n });\n return false;\n }\n }", "function loadFullPost(index) {\n console.log('loadFullPost INITIATED');\n if (index in localBlogCache) printFullPost(localBlogCache[index]);\n else {\n httpGetAsync('fetchBlog/' + index, function(data) {\n printFullPost(data);\n });\n }\n function printFullPost(data) {\n insertAndExecute('post-list', data)\n }\n}", "async fetchPost(_, { id }) {\n\n return await Post.findById(id);\n\n }", "function loadPosts(){\n $.ajax({\n type: \"GET\",\n url: \"/election/getVotablePosts\",\n cache: false,\n success: function(response){\n allPosts = response;\n response.forEach(loadThisPost);\n }\n });\n}", "populateGhostData () {\n this.populateMeta();\n this.readPosts();\n }", "function loadPosts() {\n const postsCollection = firebase.firestore().collection(\"postagens\");\n container.querySelector(\"#lista-feed\").innerHTML = \"Carregando...\";\n postsCollection.get().then((querySnapshot) => {\n container.querySelector(\"#lista-feed\").innerHTML = \"\";\n querySnapshot.forEach((doc) => {\n const post = { id: doc.id, data: doc.data() };\n const componente = postTemplate(post);\n console.log(componente)\n container.querySelector(\"#lista-feed\").appendChild(componente);\n });\n });\n }", "populatePosts (postObj) {\n this.ghostObj['data']['posts'].push(postObj);\n }", "async getPost () {\n\t\tconst postId = this.model.get('postId');\n\t\tif (!postId) { return; }\n\t\tconst post = await this.data.posts.getById(postId);\n\t\tif (!post) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'post' });\n\t\t}\n\t\tthis.responseData.post = post.getSanitizedObject({ request: this });\n\t}", "async getPost () {\n\t\tconst postId = this.model.get('postId');\n\t\tif (!postId) { return; }\n\t\tconst post = await this.data.posts.getById(postId);\n\t\tif (!post) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'post' });\n\t\t}\n\t\tthis.responseData.post = post.getSanitizedObject({ request: this });\n\t}", "static get all() {\n return new Promise(async (resolve, reject) => {\n try {\n const postsData = await db.query(`SELECT * FROM thoughts;`)\n const posts = postsData.rows.map(p => new Post(p))\n resolve(posts);\n } catch (err) {\n reject(\"Sorry No Posts Found\")\n }\n })\n }", "async function loadPost(id) {\n const post = fetch(`/post.json?id=${id}`);\n const comments = fetch(`/comments.json&post_id=${id}`);\n\n setPost(await post);\n setComments(await comments);\n}", "async getPost () {\n\t\tthis.post = await this.data.posts.getById(this.message.postId);\n\t\tif (!this.post) {\n\t\t\tthrow `post ${this.message.postId} not found`;\n\t\t}\n\t}", "loadData(name) {\n const { loadPosts, reset, resetPostComments } = this.props\n reset()\n resetPostComments()\n loadPosts(name)\n }", "function loadPosts() {\n return (dispatch, getState) => {\n const { posts } = getState();\n if (posts.data != null) {\n return;\n }\n return dispatch(fetchPosts());\n };\n}", "function load_posts() {\n document.querySelector('#form-view').style.display = 'block';\n document.querySelector('#post-list').style.display = 'block';\n document.querySelector('#post-list').innerHTML = '';\n document.querySelector('#profile-view').style.display = 'none'; \n document.querySelector('#profile-view').innerHTML = ''; \n\n fetch('/show')\n .then(response => response.json())\n .then(posts => {\n paginate_posts(posts);\n });\n}", "function getPosts() {\n\tvar snippet = {\n\t\tquery : {},\n\t\tfields: \"title,category,thumbnail\"\n\t}\n\t// for unpublished\n\t// snippet.query = {published: false, nextKey: '-K_W8zLX65ktmaKwf1Yx'}\n\n\trimer.post.find(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}", "async getPosts() {\n try {\n const posts = await Post.find().sort({ createdAt: -1 });\n return posts;\n } catch (err) {\n console.log(` An error as occurred while fetching the posts ${JSON.stringify(err)} `);\n throw new Error(err);\n }\n }", "async getPostById(req, res){\n // Pegar o postId\n const {postId} = req.params\n \n // Buscar o post e popular em eventId\n const post = await Posts.findById(postId).populate('eventId')\n console.log(post)\n // Verificar se encontrou\n if(!post){\n return res.status(404).json({error: 'post not found'})\n }\n // Enviar\n return res.status(200).json(post)\n }", "function getPosts() {\n $.get('/api/posts/', function (data) {\n var postsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n\n newPost = data[i];\n\n postsToAdd.push(createPostDiv(newPost));\n renderPost(postsToAdd);\n }\n });\n }", "async getPosts(){\n const postData = await this.getPostData()\n\n return postData\n }", "function getPosts() {\n Post\n // remote method that returns `posts` array with username\n .findAll()\n .$promise\n .then(function(results) {\n vm.posts = results.posts;\n });\n }", "function initDb() {\n var db = {};\n // Get all posts first\n var posts = getPosts.call(this);\n db.posts = posts;\n this.db = db;\n}", "function getPost() {\n Post\n // call remote method to protect user's email\n .findSingle({id: $stateParams.id})\n .$promise\n .then(function(result) {\n vm.newPost = result.post;\n });\n }", "async getPost () {\n\t\tthis.post = await this.request.data.posts.getById(this.id);\n\t\tif (!this.post) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'post' });\n\t\t}\n\t\tif (this.post.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('alreadyDeleted');\n\t\t}\n\t}", "function loadGrid()\n\t{\n\t\tpostgrid = new socialCuratorGrid(jQuery('[data-social-curator-post-grid]'));\n\t\tpostgrid.init();\n\t}", "function loadPosts(all_posts, the_start, the_finish) {\n $.get(\"posts/posts.xml\", function(posts){\n $(posts).find('post').each(function() {\n all_posts.push( buildPostObj( $(this) ) );\n });\n }).complete(function() {\n // remove loading icons\n $('.fa-stack').remove();\n // build posts from start to finish\n all_posts.sort(date_sort_desc);\n buildPosts(all_posts, the_start, the_finish);\n });\n}", "function refetchPost(){\n props.fetchPost(props.post.id)\n }", "function loadPosts() {\n db.collection(\"posts\").get().then(function(querySnapshot) {\n querySnapshot.forEach(function(doc){\n createPost(doc);\n });\n });\n}", "function loadPost(req, res, next, id) {\n News.getSingle(id)\n .then((post) => {\n req.post = post; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}", "function vB_AJAX_PostLoader(postid)\n{\n\tthis.postid = postid;\n\tthis.container = fetch_object('edit' + this.postid);\n}", "async getPost () {\n\t\tif (this.model.get('providerType')) {\n\t\t\treturn;\t// only applies to CodeStream posts\n\t\t}\n\t\tconst postId = (\n\t\t\t(this.codemark && this.codemark.get('postId')) ||\n\t\t\t(this.review && this.review.get('postId'))\n\t\t);\n\t\tif (!postId) { return; } // shouldn't happen\n\t\tthis.post = await this.data.posts.getById(postId);\n\t\tif (!this.post) { return; } // shouldn't happen\n\t\tthis.responseData.post = this.post.getSanitizedObject({ request: this });\n\t}", "function loadThisPost(post, ind, all){\n var postid = post[\"PostID\"];\n numCandsPerPost[postid] = post.Candidates.length;\n $(\"#postsTable>tbody\").append(\"<tr><td align='center' id='post\"+postid+\"'></td></tr>\");\n $(\"#post\"+postid).load(\"candidatePanel.html\", function(){\n $(\"#post\"+postid+\">#candidatePanel>.postname\").html(post[\"PostName\"])\n post[\"Candidates\"].forEach(function(candidate, cid, allC){\n cid = cid+1;\n var candid = \"post\"+postid+\"-cand\"+cid;\n $('#post'+postid+'>#candidatePanel').append(\"<div id='\"+candid+\"'></div>\");\n $('#'+candid).load(\"election/getCandidateCard/\"+candidate, function(){\n $('#'+candid+' #voteButton').on('click', function() {\n // If this button is clicked, it calls the vote() function with itself as the parameter.\n vote(this);\n });\n });\n });\n });\n}", "async function fetchPostItem() {\n const response = await axios.get(\n `http://localhost:2030/api/posts/${router.query.id}`\n );\n setItem(response.data);\n }", "function getAllPosts() {\n db.many(`\n select * from posts;\n `)\n .then((posts) => {\n posts.forEach((posts) => {\n console.log(posts.url);\n })\n })\n .catch((e) => {\n console.log(e);\n })\n}", "function getPost() {\n Post\n // call remote method to protect user's email\n .findSingle({id: $stateParams.id})\n .$promise\n .then(function(result) {\n vm.post = result.post;\n });\n }", "function get_post() {\n $( '.navigation-list a' ).removeClass( 'current' );\n $(this).addClass( 'current' ).append( '<img class=\"ajax-loader\" src=\"https://d30y9cdsu7xlg0.cloudfront.net/png/1017000-200.png\" />' );\n $( '.main-area' ).addClass( 'loading' );\n\n var post_id = $(this).attr( 'data-id' );\n // Create REST API request.\n var json_url = rest_url + 'posts/' + post_id + '?_embed=true';\n\n $.ajax({\n dataType: 'json',\n url: json_url\n })\n .done( function( object ) {\n // Get the post data.\n the_post_data( object );\n })\n .fail( function( object ) {\n $( '.site-header' ).append( '<div class=\"error\">That didn&rsquo;t work. Try selecting a different post link.</div>' );\n console.log( 'ERROR: Single Post error.' );\n })\n .always( function() {\n $( '.ajax-loader' ).remove();\n $( '.loading' ).removeClass( 'loading' );\n console.log( 'Single Post AJAX complete.' );\n });\n }", "loadPosts() {\n if (this.props.thread.posts) {\n return (\n Object.keys(this.props.thread.posts).map(key =>\n <Post\n key={key}\n arraykey={key}\n post={this.props.thread.posts[key]}\n username={this.props.username}\n userid={this.props.userid}\n opname={this.props.thread.postername}\n opid={this.props.thread.posterid}\n updatePost={this.updatePost}\n deletePost={this.deletePost}\n />\n ))\n }\n }", "function getPostDetail() {\n var postId = Utils.getParameterByName(\"id\");\n\n Stamplay.Object(\"post\").get({ _id : postId})\n .then(function(res) {\n var post = res.data[0];\n var viewData = {\n id : post._id,\n url : post.url,\n shortUrl : Utils.getHostname(post.url),\n title : post.title,\n dt_create : Utils.formatDate(post.dt_create),\n votesLength : post.actions.votes.users_upvote.length\n }\n Utils.renderTemplate('post-detail', viewData, '#postcontent');\n\n post.actions.comments.forEach(function (comment) {\n var viewData = {\n displayName: comment.displayName,\n dt_create: Utils.formatDate(comment.dt_create),\n text: comment.text\n }\n Utils.renderTemplate('post-comment', viewData, '#postcomments');\n })\n\n }).catch(function (err) {\n console.log('error', err);\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}", "allPostByUser(req, res) {\n const userId = req.params.id\n let posts = postModel.find({ postedBy: userId }).populate(\"postedBy\", \"_id name profile_pic\").sort({ _id: -1 });\n posts.exec((err, posts) => {\n if (err) { console.log(err) };\n return res.json({ posts })\n })\n }", "function populatePosts() {\n $.ajax({\n // sends a request to get the posts from the db\n url: \"/get/posts\",\n method: \"GET\",\n success: function(result) {\n // updates text with result from request\n results = JSON.parse(result);\n let displayedResult = '';\n // iterates through each post and adds it to the result\n for (i in results) {\n displayedResult += generatePosts(results[i], i);\n }\n // sets the inner html to the posts html generated in generatePosts()\n postsContent.innerHTML = displayedResult;\n }\n });\n}", "load() {\r\n // load item id, then load page data from new pages api\r\n return this.getItem(\"Id\", \"CommentsDisabled\").then(item => {\r\n return (new SharePointQueryable(this, `_api/sitepages/pages(${item.Id})`)).get().then(pageData => {\r\n this.commentsDisabled = item.CommentsDisabled;\r\n return this.fromJSON(pageData);\r\n });\r\n });\r\n }", "function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}", "function singlePost() {\n // get post id from data-id attr\n var dataId = $(this).attr('data-id');\n // assign posts object to a variable\n var posts = memory.posts;\n // loop through posts object\n for (var i = 0; i < posts.length; i++) {\n // get post id:s from posts object\n var postId = memory.posts[i].id;\n // check if we have the same post id that came form data-id attr\n if (dataId == postId) {\n // call displaySinglePost method\n memory.posts[i].dispalySinglePost();\n }\n }\n }", "function getAllPosts() {\n return db.execute('SELECT * FROM post ORDER BY timeposted DESC;');\n}", "function init() {\n\t\tloadPosts();\n\t}", "async function init() {\n const id = getNewPostId(posts);\n const post = { id : id, title : 'Cat Food, Un-Natural Flavors', body : 'Cat, bla...'};\n\n await createPost(post);\n getPosts();\n}", "function getPost(id) {\n return db.execute(`SELECT * FROM post WHERE postID = '${id}'`)\n .then(([data]) => {\n const post = {\n postID: data[0].postID,\n title: data[0].title,\n details: data[0].details,\n creatorID: data[0].creatorID,\n tags: data[0].tags,\n replyCount: data[0].replyCount,\n timePosted: data[0].timePosted,\n // replyList: replyModel.getReplyList(this),\n };\n return post;\n });\n}", "function reloadPost(postid){\n var post;\n allPosts.forEach(function(el,ind,all){\n if(el[\"PostID\"]==postid){\n post = el;\n }\n });\n votesCandidateNames[parseInt(postid)] = [];\n votesCandidatePublicKeys[parseInt(postid)] = [];\n $(\"#post\"+postid).load(\"candidatePanel.html\", function(){\n $(\"#post\"+postid+\">#candidatePanel>.postname\").html(post[\"PostName\"])\n post[\"Candidates\"].forEach(function(candidate, cid, allC){\n cid = cid+1;\n var candid = \"post\"+postid+\"-cand\"+cid;\n $('#post'+postid+'>#candidatePanel').append(\"<div id='\"+candid+\"'></div>\");\n $('#'+candid).load(\"election/getCandidateCard/\"+candidate, function(){\n $('#'+candid+' #voteButton').on('click', function() {\n vote(this);\n });\n });\n });\n });\n}", "getPosts(id) {\n let posts = this.postCache.get(id)\n //this.set({posts: posts})\n if (posts == null) {\n this.postCache.set(id, [])\n this.readFile(`/feeds/${id}.json`).then(meta => {\n this.postCache.set(id, meta.posts)\n //this.set({posts: meta.posts})\n }, err => {})\n }\n }", "function loadPosts () {\n\n var key = \"api_key=iSCTzggSVfQGj4CkKfEmBSShk0T7J0qtj6dBMwb4b1ixavvS1h\";\n var api = \"https://api.tumblr.com/v2/blog/sergeymisharin.tumblr.com/\";\n\n $.getJSON(api + \"posts/text?callback=?&filter=text&limit=3&offset=0&\" + key,function(data) {\n $.each(data.response.posts, function(i, item) {\n var content = item.body;\n var divWithContent = '<div class=\"col-sm-6\">' + content + '</div>';\n $(\".space_weather\").append(divWithContent);\n });\n\n });\n }", "fetchAll(params) {\n return api.get('posts', params).then(response => ({\n posts: _.map(_.filter(response.data, filterPosts), post => new Post(post)),\n paging: response.paging\n }));\n }", "async getSponsoredMain() {\n let { firstObject:post } = await this.store.query('article', {\n sponsored_content: true,\n show_as_feature: true,\n limit: 1,\n });\n\n if (!post) {\n return;\n }\n const ageInHours = moment().diff(post.publishedMoment, 'hours');\n if (ageInHours >= 24 && ageInHours <= 48) {\n return post;\n }\n }", "getPosts() {\r\n return this.posts;\r\n }", "async function loadPosts() {\n try {\n // calling the function getDataAsync, implemented in fetch.js, that does a JS Fetch to the API endpoint\n const postsAndComments = await getDataAsync(`${BASE_URL}home`);\n displayPostsAndComments(postsAndComments);\n \n } // catch and log any errors\n catch (err) {\n console.log(err);\n }\n}", "function seedBlogPostData() {\n console.info('seeding blogpost data');\n const seedData = [];\n\n for (let i=1; i<=10; i++) {\n seedData.push(generateBlogPostData());\n }\n return BlogPost.insertMany(seedData);\n}", "function getPostById() {\n\tvar snippet = {\n\t\tquery: {\"id\": \"-K_W8zLX65ktmaKwf1Yx\", published: false},\n\t\tfields: \"title,category,thumbnail\"\n\t}\n\trimer.post.findOne(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}", "function seedBlogpostData() {\n console.info('seeding blogpost data');\n const seedData = [];\n\n for (let i = 1; i <= 10; i++) {\n seedData.push(generateBlogpostData());\n }\n\n return BlogPost.insertMany(seedData);\n}", "get posts() {\r\n return new Posts(this);\r\n }", "static showPost(cityId, postId) {\n return fetch(`${url}/${cityId}/posts/${postId}`)\n .then((response) => response.json())\n }", "allposts( state, data ){\n return state.post = data\n }", "function seedBlogPostData() {\n console.info('seeding BlogPost data');\n const seedData = [];\n\n for (let i=1; i<=10; i++) {\n seedData.push(generateBlogPostData());\n }\n // this will return a promise\n return BlogPost.insertMany(seedData);\n}", "function init() {\n\tloadPostData();\n}", "function seedBlogPostData() {\n console.info('seeding blog post data');\n const seedData = [];\n\n for (let i = 1; i <= 10; i++) {\n seedData.push(generateBlogPostData());\n }\n // this will return a promise\n return BlogPost.insertMany(seedData);\n}", "function init() {\n getPosts();\n }", "list(req, res, next) {\n PostModel.find((err, posts) => {\n res.render('posts', { posts });\n }); //end of PostModel.find\n }", "function loadPosts() {\n fetch('http://jsonplaceholder.typicode.com/posts')\n .then(function(response) {\n return response.json();\n })\n .then(function(posts) {\n console.log(posts);\n let htmlTemplate = \"\";\n for (let post of posts) {\n htmlTemplate += `\n <article>\n <h4>${post.title}</h4>\n <p>${post.body}</p>\n </article>\n `;\n }\n document.querySelector(\"#posts\").innerHTML = htmlTemplate;\n });\n}", "async function showPosts() {\n const posts = await getPosts();\n\n posts.forEach((post) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = `\n <div class=\"post-number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <div class=\"post-body\">${post.body}</div>\n </div>\n `;\n postsContainer.appendChild(postEl);\n // The Node.appendChild() method adds a node to the end of the list of children of a specified parent node.\n // The fetch() method takes one mandatory argument, the path to the resource you want to fetch.\n // It returns a Promise that resolves to the Response to that request, whether it is successful or not\n });\n}", "function handlePosts() {\n\tvar posts = [\n\t\t{ id: 23, title: 'Daily JS News' },\n\t\t{ id: 52, title: 'Code Refactor City' },\n\t\t{ id: 105, title: 'The Brightest Ruby' },\n\t];\n\n\tposts.forEach(function (post) {\n\t\tsavePost(post);\n\t});\n}", "static async getFarmerPostsById(uid){\n const posts = await sql`\n SELECT * FROM post WHERE farmer_id=${uid} ORDER BY added_day DESC, title ASC;`\n return posts; \n }", "function GetPosts() {\n\n /// Fetch any blog posts.\n GetBlogPosts().then(function (discussions) {\n blogs = discussions;\n\n $(\"input[name = rpsChallengeChoice]\").attr('disabled', false);\n\n }, function (error) {\n console.error(\"Get Blog Failed: \" + error);\n });\n\n /// Fetch any comments.\n GetComments().then(function (discussions) {\n comments = discussions;\n\n $(\"input[name = rpsChallengeChoice]\").attr('disabled', false);\n\n }, function (error) {\n console.error(\"Get Comments Failed: \" + error);\n });\n }", "getPostDetails(id, post) {\n if (post) {\n let fullId = `${id}/${post.publishedAt.getFullYear()}/${post.id}`\n let deets = this.postCache.get(fullId)\n //this.set({post: deets})\n if (deets == null) {\n this.postCache.set(fullId, {})\n this.readFile(`/feeds/${fullId}.json`).then(obj => {\n this.postCache.set(fullId, obj)\n //this.set({post: obj})\n }, err => {})\n }\n }\n }", "setPostState(state,posts){\n state.loadData=posts\n }", "async function showPosts() {\n\tconst posts = await getPosts();\n\n\t// Get post one by one\n\tposts.forEach((post) => {\n\t\t// ! Create post container from api\n\t\tconst postEl = document.createElement('div');\n\t\tpostEl.classList.add('post');\n\t\tpostEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div>`;\n\n\t\t// ! Add the post data in to the post container\n\t\tpostContainer.appendChild(postEl);\n\t});\n}", "fetchPosts(context) {\n context.commit(\"SET_LOADING_STATUS\", \"loading\");\n }", "getAllPosts(state){\n return state.loadData\n }", "function seedBlogData(){\n console.info('seeding blog data');\n const seedData = [];\n for(let i = 1; i<=10; i++){\n seedData.push(generateBlogPost());\n }\n return BlogPost.insertMany(seedData);\n}", "function getPosts (cb) {\n var gardenId = $stateParams.id;\n console.log(gardenId)\n $http\n // '/api/posts/:gardenId'\n .get('/api/posts/' + gardenId)\n .then(function(response){\n var allPosts = response.data\n console.log(\"RESPNSE of posts:\", allPosts)\n vm.all = response.data\n // iterate through all posts to match id\n //Filter for matching post to garden on back end\n\n isUsersPost();\n })\n }", "loadData () {\n if ( this.props.match.params.id ) {\n // converting the last id to a number with the +\n if ( !this.state.loadedPost || (this.state.loadedPost && this.state.loadedPost.id !== +this.props.match.params.id) ) {\n axios.get( '/posts/' + this.props.match.params.id )\n .then( response => {\n // console.log(response);\n this.setState( { loadedPost: response.data } );\n } );\n }\n }\n }", "async function fetchBlogs() {\n try {\n const BlogData = await API.graphql(graphqlOperation(listBlogs))\n const Blog = BlogData.data.listBlogs.items\n SetBlogs(Blog)\n console.log(Blog)\n } catch (err) {\n console.log('error fetching blogs ')\n }\n }", "function loadPublishedPosts() {\n $.ajax({\n url: \"published\"\n }).success(function (posts) {\n // function to fill the published posts div here\n createHomePostDivs(posts, status);\n fillHomePostsDiv(posts);\n });\n}", "getPost(bid, pid, callback) {\n var request = gapi.client.request({\n method: 'GET',\n path: pathBlogs + '/' + bid + '/posts/' + pid\n })\n\n request.execute((result) => {\n const post = new Post(result.id, result.blog.id, result.title, result.published, result.updated, result.replies.totalItems, result.content)\n callback(post)\n })\n }", "function social_curator_grid_all_posts_loaded(items){}", "loadRelated(params) {\n return this.request.get('entry-related-data', params);\n }" ]
[ "0.69107467", "0.6662232", "0.628636", "0.6286278", "0.6281486", "0.6162624", "0.6062504", "0.59644926", "0.59407014", "0.59132844", "0.5899106", "0.58887494", "0.5865052", "0.5860184", "0.5839161", "0.57962114", "0.5794351", "0.57509637", "0.5725235", "0.57230496", "0.57086086", "0.5674875", "0.5657564", "0.56563795", "0.56563795", "0.56281346", "0.5615931", "0.5613422", "0.5586787", "0.55863607", "0.55717975", "0.55596066", "0.55391836", "0.55272615", "0.55200005", "0.5512976", "0.5497574", "0.5487282", "0.54803795", "0.5457979", "0.5454869", "0.5444631", "0.54445696", "0.5432124", "0.542862", "0.542745", "0.5424178", "0.54098576", "0.54074186", "0.5395877", "0.53661793", "0.53558004", "0.5353549", "0.5349244", "0.5342444", "0.5334371", "0.53339493", "0.53205305", "0.5319498", "0.5314531", "0.52841556", "0.52797633", "0.5277513", "0.52755886", "0.52702284", "0.52698696", "0.52656806", "0.5259438", "0.5258601", "0.5254023", "0.5253522", "0.5251371", "0.5250036", "0.52499914", "0.52497697", "0.5243418", "0.5233094", "0.5232894", "0.5226256", "0.522495", "0.5224668", "0.52177733", "0.5210655", "0.52098495", "0.5207963", "0.52075744", "0.52052027", "0.5198171", "0.5195824", "0.5186526", "0.5177566", "0.51743877", "0.5158825", "0.51536477", "0.5151975", "0.513166", "0.51290375", "0.5124811", "0.5124775", "0.512425" ]
0.57342064
18
Dynamically adjust the canvas to the window
function windowResized() { resizeCanvas(windowWidth, windowHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustCanvasSize() {\n CANVAS.width = CANVAS_WIDTH;\n CANVAS.height = window.innerHeight;\n}", "function windowResized(){\n canvas.resize(windowWidth, windowHeight - canvasadjust);\n}", "function resizeCanvas() {\n\tvar newHeight = window.innerHeight;\n\tvar newWidth = initWidth/initHeight * newHeight;\n\tcanvas.setWidth(newWidth);\n\tcanvas.setHeight(newHeight);\n\tcanvas.calcOffset();\n}", "function windowResized() {\n centerCanvas();\n}", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) - 150;\n\t\tcanvas.height = (window.innerHeight) - 100;\n\t\tredraw();\n\t}", "function resize_canvas() {\n\t\t\tcanvas_elem.width = window.innerWidth / 2;\n\t\t\tcanvas_elem.height = window.innerWidth / 2;\n\n\t\t\tupdate_needed = true;\n\t\t}", "canvasResize()\n {\n View.canvas.setAttribute(\"width\", this.floatToInt(window.innerWidth*0.95));\n View.canvas.setAttribute(\"height\",this.floatToInt(window.innerHeight*0.95));\n\n //update objects with the new size\n this.updateCharacterDim();\n this.updateVirusDim();\n this.updateSyringesDim();\n this.background.resize();\n\n }", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) * .67;\n\t\tcanvas.height = (window.innerHeight) * .69;\n\t\tredraw();\n\t}", "function resizeCanvas() {\n canvas.height = window.innerHeight * 0.95;\n canvas.width = window.innerWidth * 0.95;\n stage.update();\n }", "function resizeCanvas() {\n\tvar rect = setFlex.getBoundingClientRect()\n\tcanvas.width = rect.width - 20\n\tcanvas.height = rect.height - 20\n\tcanvasObj.canvasWidth = canvas.width\n\tcanvasObj.canvasHeight = canvas.height\n\twinObj.windowWidth = window.innerWidth\n\twinObj.windowHeight = window.innerHeight\n\tupdateWinCanvasDivs()\n\tdrawOnCanvas(canvas.width, canvas.height)\n}", "function resize() {\n ctx.canvas.width = window.outerWidth;\n ctx.canvas.height = window.outerHeight;\n}", "function doResize()\n{\n\tcanvas.width = window.innerWidth;\n\tcanvas.height = window.innerHeight;\n}", "function resize() {\n canvas.height = window.innerHeight\n canvas.width = window.innerWidth\n }", "function resize() {\n width = canvas.width = window.innerWidth;\n height = canvas.height = window.innerHeight - 60;\n }", "function windowResized() {\n repositionCanvas();\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight - 50);\n}", "function resizeCanvas()\r\n{\r\n\tvar canvas = getCanvas();\r\n\tcanvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n\t\r\n\tpaintClock();\r\n}", "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(canvasWidth, canvasHeight);\n canvasWidth = windowWidth-100;\n canvasHeight = windowHeight-120;\n background(240,100,15,0.2);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}//end windowResized", "function resizeCanvas() {\r\n winWidth = window.innerWidth;\r\n winHeight = window.innerHeight;\r\n cnvs.width = winWidth;\r\n cnvs.height = winHeight;\r\n\r\n // Create star field\r\n buildStars();\r\n}", "function windowResized() {\n resizeCanvas(canvasX, canvasY);\n}", "function canvas_resize()\n{\n canvas.style.width = window.innerWidth + 'px';\n canvas.style.height = window.innerHeight + 'px';\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight)\r\n}", "function resizeCanvas() {\n c.width = window.innerWidth;\n c.height = window.innerHeight; \n}", "fitCanvasToScreen() {\n this.canvas.width = window.innerWidth;\n this.canvas.height = window.innerHeight;\n this._rect = this.canvas.getBoundingClientRect(); // Update\n }", "function resizeCanvas() {\n //low level\n c.width = window.innerWidth;\n c.height = window.innerHeight;\n //update wrapper\n st.canvas.width = c.width;\n st.canvas.height = c.height;\n //update objects and redraw\n updateObjects();\n}", "resizeCanvas() {\n this.canvas.width = window.innerWidth;\n this.canvas.height = window.innerHeight;\n this.cx = this.ctx.canvas.width / 2;\n this.cy = this.ctx.canvas.height / 2;\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight)\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight)\n}", "function resizeCanvas() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n}", "resize() {\n if (this._isShutDown) return;\n this._canvas.width = window.innerWidth;\n this._canvas.height = window.innerHeight;\n this.redraw();\n }", "function resizeCanvas() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n redrawCanvas();\n }", "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "function windowResized() {\n resizeCanvas(canvasWidth, canvasHeight);\n}", "function windowResized(){\r\n createCanvas(windowWidth, windowHeight);\r\n leftBorder = 25;\r\n rightBorder = windowWidth - 25;\r\n topBorder = 25;\r\n bottomBorder = windowHeight - 25;\r\n textAlign(CENTER, CENTER);\r\n textSize(FONTSIZE);\r\n}", "function onResize() {\n canvas.width = window.innerWidth * 0.75;\n canvas.height = window.innerHeight;\n }", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "function windowResized() {\n resizeCanvas(canvasContainer.clientWidth, canvasContainer.clientHeight);\n}", "function resize() {\r\n ctx.canvas.width = window.innerWidth;\r\n ctx.canvas.height = window.innerHeight;\r\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n addModelButton.position(windowWidth - 150, 30);\n}", "function scaleToWindow() {\n if (window.innerWidth > window.innerHeight) {\n canvasContainerDiv.style.height = window.innerHeight*canvRatio+\"px\";\n canvasContainerDiv.style.width = canvasContainerDiv.style.height;\n } else {\n canvasContainerDiv.style.width = window.innerWidth*canvRatio+\"px\";\n canvasContainerDiv.style.height = canvasContainerDiv.style.width;\n }\n canvasPositionLeft = canvas.getBoundingClientRect().left + window.scrollX;\n canvasPositionTop = canvas.getBoundingClientRect().top + window.scrollY;\n}", "function sizer(){\n //update object\n å.screen.x = window.innerWidth;\n å.screen.y = window.innerHeight;\n //update canvas size\n canvas.width = å.screen.x;\n canvas.height = å.screen.y;\n}", "function fixCanvas() {\n var con = $(window),\n aspect = (0.9 / 1.6),\n width = con.innerWidth(),\n height = Math.floor(width * aspect);\n\n canvas.setWidth(1920).setHeight(1080);\n $(\"#c\").css(\"width\", width + \"px\").css(\"height\", height + \"px\");\n canvas.calcOffset();\n}", "function onResize() {\n canvas.width = window.innerWidth / 2;\n canvas.height = window.innerHeight;\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n radius = (width / 3)*0.5;\n}", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "function windowResize() {\n resiveCanvas(windowWidth, windowHeight);\n}", "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}", "function windowResized() {\n resizeCanvas(width, height);\n}", "function resize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}", "function resize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}", "function resizeCanvas() {\n \t\t\t\thtmlCanvas.width = window.innerWidth;\n \t\t\t\thtmlCanvas.height = window.innerHeight;\n \t\t\t\tredraw();\n \t\t\t}", "function fixCanvas(){\n CANVAS.width=400\n CANVAS.height=225\n CANVAS.style.width = \"400px\"\n CANVAS.style.height = \"225px\"\n}", "function windowresize()\n{\n\tvar ow = canvas.width, oh = canvas.height;\n\t// Fit canvases to screen\n\tvar h1 = window.innerHeight - document.getElementById('top_bar').offsetHeight - document.getElementById('input_fields').offsetHeight - 130;\n\tvar h2 = (window.innerWidth - document.getElementById('vis_selector').offsetWidth - 20) / 1024 * 600;\n\tcanvas.height = Math.min(h1,h2);\n\tcanvas.width = canvas.height * 1024 / 600;\n\tv_canvas.width = document.getElementById('vis_selector').clientWidth; //v_canvas.height * 500 / 560;\n\tv_canvas.height = canvas.height - document.getElementById('vis_selector').offsetHeight;\n\t\n\t// Reposition canvas buttons\n\tvar x = canvas.width / 2; var y = canvas.height / 2;\n\tbuttons['Start'].move(x, y + 50);\n\tbuttons['Restart'].move(x, y - 50);\n\tbuttons['Level Select'].move(x, y);\n\tbuttons['Quit'].move(x, y + 50);\n\tbuttons['Cancel'].move(x, y + 100);\n\tmove_level_buttons();\n\t\t\n\t// Spread out stars\n\tresize_starfield(ow, oh, canvas.width, canvas.height);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function ResizeCanvas() {\n paper.view.viewSize = [window.innerWidth-300, window.innerHeight];\n }", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight, false);\r\n}", "function windowResized() {\n\tresizeCanvas(innerWidth, innerHeight);\n}" ]
[ "0.79434544", "0.77352977", "0.7713235", "0.7712608", "0.7694596", "0.7667064", "0.76613593", "0.757525", "0.7518815", "0.7511717", "0.74886125", "0.74721533", "0.74686044", "0.74424773", "0.74312437", "0.7430374", "0.74183553", "0.73977965", "0.73977965", "0.7396391", "0.7395272", "0.7392689", "0.73737377", "0.73573357", "0.7353528", "0.7348628", "0.7333085", "0.73233557", "0.73173136", "0.730714", "0.730714", "0.7306782", "0.72898924", "0.72898924", "0.7286341", "0.72729397", "0.7267289", "0.72666216", "0.72581273", "0.72495836", "0.7246658", "0.7246658", "0.7246658", "0.7246658", "0.7235506", "0.72348493", "0.7232753", "0.7232423", "0.72282827", "0.72260445", "0.7225046", "0.72183883", "0.7211948", "0.72116625", "0.7209481", "0.7206597", "0.7192509", "0.7192509", "0.719058", "0.7182423", "0.7172694", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163703", "0.7163168", "0.7149467", "0.71398944" ]
0.7264743
45
This function is called before teh app is displayed, and sets the state for the productList
componentDidMount(){ this.getProductDataList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this.state = { products: [], displayProduct: false };\n }", "_stateChanged(state) {\n this._products = state.shop.products;\n }", "constructor() {\n super();\n this.state = {products: []}\n }", "componentWillMount(){\n this.setState({\n products: infoProduct\n })\n \n }", "constructor(props) {\n super(props);\n this.state = {\n error: null,\n isLoaded: false,\n products: []\n };\n }", "constructor(props) {\n super(props);\n \n this.state = {\n products: []\n };\n }", "SET_PRODUCTS(state, products) {\n state.products = products\n }", "addStateProducts(state, product) {\n\t\tstate.stateProductsList.push(product)\n\t}", "async function fetchProducts() {\n let json = await LoadProductSetup();\n //* Set local storage. Even if json is empty it just sets up the key to be used later.\n localStorage.setItem(\"products\", JSON.stringify(json));\n //* If the list is empty, I set the 'direct' to 1, meaning the Navigator component will direct to the NoTeams component\n if (!json.length) {\n setDirect(1);\n } else {\n setDirect(3);\n }\n }", "componentDidMount() {\n this.setProducts();\n }", "constructor(props){\n super(props);\n this.state ={\n products: []\n }\n}", "constructor(props) {\r\n super(props);\r\n /**\r\n * products - the list of products to be filtered for display\r\n */\r\n this.state = {\r\n products: undefined\r\n };\r\n }", "componentDidMount() {\n this.setState({ products: products });\n }", "function loadProducts() {\n // api call to get the products\n API.getProducts()\n .then(products => {\n // set product and filtered product state\n setProducts(products);\n setFilteredProducts(products);\n setProduct(products[0]);\n })\n .catch(err => console.log(err));\n}", "GET_PRODUCTS(state, products) {\n state.products = products\n }", "componentWillMount() {\r\n this.setState = {\r\n products: this.props.wishListItems().payload\r\n };\r\n }", "componentDidMount() {\n auth.getProducts().then((response) => {\n let allProducts = response.data\n console.log(\"------ Brings all products -------\");\n console.log(allProducts);\n console.log(\"------ Brings all products -------\");\n this.setState({\n products: allProducts\n })\n })\n }", "componentWillMount() {\n this.props.showProducts()\n }", "constructor(props, context) {\n\n super(props, context);\n\n console.log(FILE_NAME + \"In constructor\");\n\n\n this.initialState = {\n \n currentProduct: currentProduct,\n \n };\n this.state = this.initialState;\n }", "stateChanged(state) {\n this._products = state.song.songs;\n }", "componentDidMount () {\n this.setState({ products: this.context.products })\n }", "function updateProductList()\n{\n var itemSort = '';\n var itemFilter = '';\n\n if (typeof document.filterForm != 'undefined') {\n itemSort = document.filterForm.sortBy.value;\n itemFilter = document.filterForm.filterBy.value;\n }\n\n // pageProduct\n var prodList = createProductList(itemSort, itemFilter);\n\n updateItemContainer(prodList);\n}", "async componentDidMount() {\n const res = await axios.get('http://localhost:4000/api/products/');\n this.setState({\n products: res.data.products,\n filteredProducts: res.data.products\n });\n console.log(res.data.products);\n if (localStorage.getItem('cartItems')){\n this.setState({cartItems: JSON.parse(localStorage.getItem('cartItems'))})\n }\n }", "function loadProducts() {\n productAPI\n .getProducts()\n .then((res) => setProducts(res.data))\n .catch((err) => console.log(err));\n }", "function startApp() {\n displayProducts();\n}", "async componentDidMount() {\n\tconst data = await this.props.fetchProducts();\n\tthis.setState({products: data.products});\n }", "function updateProductList(){\r\n if(shop.products){\r\n container.innerHTML = '';\r\n for(var i = 0; i < shop.products.length; i++){\r\n container.append(productElement(shop.products[i]));\r\n }\r\n addBtnListener(editBtnclassName, function(index, id){\r\n editProduct(id);\r\n });\r\n addBtnListener(removeBtnclassName, function(index, id){\r\n shop.products.splice(getIndexById(id), 1);\r\n updateProductList();\r\n });\r\n }\r\n }", "function setProducts(){\n $scope.products=productFactory.products\n }", "function setProductInView() {\n $scope.presentPercentageOff = $scope.product.percentage_off ? true : false;\n $scope.presentOriginalPrice = $scope.product.original_price ? true : false;\n $scope.changePercentageOff();\n $scope.changeOriginalPrice();\n fillOptionMenus();\n setProductPhotos();\n }", "function loadProducts(){\n productService.products().then(function(data){\n all_products = data;\n setOptions();\n setupListeners();\n })\n}", "add(state, product) {\n\t state.productList.push(product)\n\t}", "function Homescreen(){\n\n const [products, setProducts] = useState([]) // first param - what we call this state // second param - function to manipulate the state\n\n useEffect(() =>{ // useEffect hook is called after render() i.e. after DOM updates to request data from backend\n const fetchProducts = async() => { // asnychronous function\n const {data} = await axios.get('/api/products') // 'data' variable is destrucutured so we can use it directly\n\n setProducts(data)\n }\n fetchProducts()\n }, [])\n return(\n <>\n <h1>Latest Products</h1>\n <Row>\n {/*creating a list*/}\n {products.map(product =>(\n <Col key = {product._id}>\n <Product product = {product} />\n </Col>\n ))}\n </Row>\n </>\n )\n}", "componentDidMount() {\n // get selected product id from ProductsScreen\n // called from navigate('Order', {product_id: item_id}) in ProductsScreen\n\n const product_id = this.props.navigation.getParam(\"product_id\");\n if (product_id != undefined) {\n // update the product_id variable in state\n this.setState({product_id: product_id});\n // refresh product detail\n this.performRefresh(product_id);\n }\n }", "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemChecked();\n }", "function showList() {\n\t\t\t$state.go('cart.list');\n\t\t}", "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemClicked();\n handleToggleHideFilter();\n handleSearchForItem();\n handleItemEditItemClicked();\n handleClearSearchClicked();\n}", "constructor() {\n super();\n\n this.state = {\n inputValue: \"1\",\n products: productsData,\n currentLink: window.location.href\n }\n }", "async componentWillMount() {\n let values = await AsyncStorage.getItem(\"products\");\n let products = await JSON.parse(values)\n this.setState({\n products: products,\n });\n }", "loadRecenProducts() {\n this.productProvider.getRecentProducts().then(recentProducts => {\n this.setState({ recentProducts, loading: false });\n }); \n }", "render() {\n const { products } = this.state;\n console.log(\"this.state.products\", this.state.products); //{} --> _proto_: Object\n return (\n <div className=\"\">\n <div className=\"description\">\n <h2>Hi ! This is the product list </h2>\n <div className=\"rowArticle\">\n <article>\n <img src=\"/img/shipping.png\" width=\"150\"></img>\n <h4>We deliver wherever you are</h4>\n </article>\n {/* <br/> */}\n <article>\n <img src=\"/img/credit-card-icon.png\" width=\"150\"></img>\n <h4>pay with any credit card</h4>\n </article>\n </div>\n\n <br />\n <h4> Do you need a cup to take your coffee in the morning? </h4>\n <h4> Or do you just want your cell phone to look amazing? </h4>\n <h4> find that and much more here! </h4>\n {/* we dont have yet the list products */}\n \n </div>\n\n \n {products.map((product) => (\n <Product key={product._id} product={product} />\n ))}\n </div>\n );\n }", "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemClicked();\n handleFilterToggle();\n handleFilterSubmit();\n}", "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemClicked();\n handleToggleCheckedItems ();\n handleSearchedItem ();\n}", "componentDidUpdate() {\n const products = JSON.stringify(this.state.products);\n if (products.length > 0) {\n localStorage.setItem(\"products\", products);\n }\n }", "async componentWillMount() {\n await this.listProducts();\n }", "getProductList() {\naxios.get('http://localhost:4000/products')\n.then((response) => {\nconsole.log(response);\nthis.setState({\nproducts: response.data\n});\n})\n.catch((error) => {\nconsole.log(error);\n})\n}", "async componentDidMount() {\n this.setState({\n products: await ProductsService.getProducts()\n });\n }", "componentDidMount() {\n\t this.setState({\n\t\t subCategoryId: this.props.match.params.category\n });\n API('productlist',this.state).then((result) => {\n let responseJson = result;\n if (responseJson.productData) {\n this.setState({\n productList: responseJson.productData,\n showLoading: false\n });\n } else {\n this.setState({\n showLoading: false\n });\n }\n });\n }", "handleProduct(e) {\n const initial = 2;\n if (e) {\n this.setState((prevState) => ({\n product: prevState.productList[e.target.value],\n }));\n } else {\n this.setState((prevState) => ({\n product: prevState.productList[initial],\n }));\n }\n }", "componentDidMount() {\n\n base.bindToState(`products/${this.state.selectedProduct}`, {\n context: this,\n state: \"item\",\n asArray: false\n });\n\n base.bindToState('products/', {\n context: this,\n state: \"products\",\n asArray: true\n });\n\n model\n .getItem(this.state.selectedProduct)\n .then(result => {\n this.setState({\n status: \"LOADED\",\n item: result\n });\n })\n .catch(() => {\n this.setState({\n status: \"ERROR\"\n });\n });\n\n model\n .getAllItems()\n .then(items => model.returnRecentlyBought(items, this.state.selectedProduct))\n .then(result => {\n this.setState({\n recently_bought: result\n });\n })\n .catch(() => {\n this.setState({\n status: \"ERROR\"\n });\n });\n\n }", "componentDidMount() {\n\t\t// Get Screen Width to Make it Fixed\n\t\tconst dim = Dimensions.get('screen');\n\t\tconst fixedWidth = (dim.width / 3) - 1;\n\t\tconst fixedWidthImage = fixedWidth - 15;\n\n\t\tthis.setState({\n\t\t\tcartList: this.props.cartList ? this.props.cartList : [], // Get Previous CartList\n\t\t\tscreenWidth: fixedWidth, // Set Screen Width\n\t\t\timageWidth: fixedWidthImage\n\t\t});\n\n\t\t//alert(JSON.stringify(this.state.cartList));\t\n\n\t\t// AsyncStorage - Save Data to Session Storage\n\t\tAsyncStorage.getItem('usernameTokenSession', (error, result) => {\n \tif (result) {\n \tlet resultParsed = JSON.parse(result);\n \tlet usernameSession = resultParsed.usernameSession;\n \tlet tokenSession = resultParsed.tokenSession;\n \tlet pageSession = resultParsed.pageSession;\n\n \tif (tokenSession == 'tokenLogout') {\n\t\t \t\t//alert(\"Please Login\");\n\n \t\t\t\tActions.login_page({pageSession: 'product_page', type:ActionConst.RESET}); // go to Login Page\n\t\t \t} else {\n\t\t \t\tthis.getProductContent(this.state.pageID); // Get Product Content\n\t\t \t}\n }\n })\n\t}", "constructor(props) {\n super(props);\n this.state = ({\n productDetails: {}\n });\n }", "addProduct(event) {\n event.preventDefault();\n\n let products;\n\n if (this.state.products) {\n products = this.state.products;\n } else {\n products = [];\n }\n\n let newProduct = {\n title: this.state.newProdTitle,\n imgUrl: this.state.newProdImgUrl,\n price: this.state.newProdPrice,\n description: this.state.newProdDescription,\n };\n\n products.push(newProduct);\n\n this.setState({\n products,\n newProdTite: \"\",\n newProdImgUrl: \"\",\n newProdPrice: \"\",\n newProdDescription: \"\",\n });\n }", "initial_state(){\n let fromLocalStorage = window.localStorage.getItem('vue-mini-shop')\n\n // If localStorage data is length\n if (fromLocalStorage !== null) {\n\n fromLocalStorage = JSON.parse(fromLocalStorage)\n\n // Destructuring First\n let { product: product, cart: cart } = fromLocalStorage\n\n productStore.set({ all: product.all })\n cartStore.set({ all: cart.all })\n }\n // When data in the local Storage is null\n else {\n productStore.set({\n all: [\n {\n name: \"Iphone 5 S\",\n img: './assets/img/mobile.jpg',\n price: 9000000,\n stocks: [\n { color: \"black\", stock: 30 },\n { color: \"silver\", stock: 20 },\n { color: \"gold\", stock: 10 },\n { color: \"rose gold\", stock: 5 },\n ],\n liked: false,\n detail: \"<p>This is the details of the Iphone, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\",\n categories: [ 'phone' ],\n comments: [\n { content: \"Waaah.. keren bingit Hpnya!\" },\n { content: \"Barangnya Sampai dengan Selamat Gan, Makasih. Packaging-nya juga bagus! Recommended banget deh pokoknya\" },\n ]\n },\n {\n name: \"Smart Phone Apple\",\n img: './assets/img/hi-tech-toys.jpg',\n price: 10500000,\n stocks: [\n { color: \"white\", stock: 50 },\n ],\n liked: false,\n detail: \"<p>This is the details of the Iphone, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\",\n categories: [ 'phone' ],\n comments: [\n { content: \"Pinter bingit Hpnya!\" },\n ]\n },\n {\n name: \"Flatty Phone With Earphone\",\n img: './assets/img/mobile-2.jpg',\n price: 7500000,\n stocks: [\n { color: \"white\", stock: 20 },\n { color: \"black\", stock: 10 },\n ],\n liked: false,\n detail: \"<p>This is the details of the Iphone, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\",\n categories: [ 'phone' ],\n comments: [\n { content: \"Earphonenya Mantabs Gan!\" },\n ]\n },\n {\n name: \"Book And Pen\",\n img: './assets/img/hi-tech-toys-2.jpg',\n price: 150000,\n stocks: [\n { color: \"brown\", stock: 150 },\n { color: \"silver\", stock: 15 },\n ],\n liked: false,\n detail: \"<p>This is the details of the Iphone, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\",\n categories: [ 'accessories' ],\n comments: [\n { content: \"Bukunya Elegan! Saya suka dengan Warnanya\" },\n ]\n },\n {\n name: \"An Ipad\",\n img: './assets/img/ipad.jpg',\n price: 10000000,\n stocks: [\n { color: \"black\", stock: 10 },\n { color: \"silver\", stock: 10 }\n ],\n liked: false,\n detail: \"<p>This is the details of the Ipad, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\",\n categories: [ 'pad' ],\n comments: [\n { content: \"Sukak banget sama yang warna Merah\" },\n { content: \"Barangnya Sampai dengan Selamat Gan, Makasih. Packaging-nya juga bagus! Recommended banget deh pokoknya\" },\n ]\n },\n\n\n {\n name: \"Mobile IOS\",\n img: './assets/img/ios.jpg',\n price: 13000000,\n stocks: [\n { color: \"gold\", stock: 10 },\n { color: \"black\", stock: 10 },\n { color: \"silver\", stock: 10 }\n ],\n liked: false,\n detail: \"<p>This is the details of the Mobile IOS, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\",\n categories: [ 'phone' ],\n comments: []\n },\n ],\n })\n } // else\n }", "UNSAFE_componentWillMount() {\n this.setState(\n {\n products: [],\n cartItems: localStorage.getItem(\"cartItems\") ? JSON.parse(localStorage.getItem(\"cartItems\")) : []\n }\n );\n }", "constructor(){\n //we need to call constructor of the parent class: super()\n super();\n this.state={\n products:[\n {\n price: 99,\n title: 'Watch',\n qty: 1,\n img:'https://images-na.ssl-images-amazon.com/images/I/61WixzlVuXL._UL1280_.jpg',\n id:1\n },\n {\n price: 999,\n title: 'Phone',\n qty: 1,\n img:'https://5.imimg.com/data5/QN/CD/MY-927781/telephone-instrument-500x500.jpeg',\n id:2\n },\n {\n price: 99999,\n title: 'Laptop',\n qty: 1,\n img:'http://cdn.mos.cms.futurecdn.net/6t8Zh249QiFmVnkQdCCtHK.jpg',\n id:3\n }\n ]\n }\n}", "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleItemSearch();\n handleDeleteItemClicked();\n handleEditItemClicked();\n handleToggleHideClick();\n handleUserInput();\n}", "componentDidMount() {\n this.loadProducts();\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 }", "static resetProductList() {\n return dispatch => {\n dispatch(actionDispatch(ActionType.RESET_PRODUCT_LIST));\n };\n }", "getProductDataList() {\n fetch('http://localhost:3000/products').then(res => res.json()).then((data) => {\n this.setState({productList: data})\n }).catch(console.log)\n }", "componentDidMount() {\n this.props.orderStore.loadProducts(this.props.userStore.pflUser, this.props.userStore.pflPass);\n this.resetStore();\n }", "componentDidMount(){\n console.log(1)\n\n // Para cambia los states \n this.setState({\n products : [\n { id: 1, name: 'Camisa ReactJS', precio: 30 },\n { id: 2, name: 'Camisa VueJS', precio: 30 },\n { id: 3, name: 'Camisa AngularJS', precio: 30 },\n ]\n })\n }", "function activate() {\n get_product_details();\n }", "function ShopPage() {\n\n // TODO Get cart from context\n const loggedUser = useSelector(state => state.user)\n const cartDispatcher = useDispatch()\n const removeCartHandler = (item) => cartDispatcher(removeCart(item))\n\n // Limit the amount, so that it wont go negative\n const decreaseAmountProduct = item => {\n if (item.amount > 0) cartDispatcher(reduceQty(item, loggedUser.user.uid))\n }\n const increaseAmountProduct = item => cartDispatcher(addQty(item, loggedUser.user.uid))\n\n const [products, setProducts] = useState([])\n\n useEffect(async () => {\n let ref = firebase.database().ref(\"products/\")\n ref.on('value', snapshot => {\n const state = snapshot.val()\n console.log(state)\n setProducts(state)\n })\n\n document.title = `Product | Shop`\n\n }, [])\n\n if (!products) return <div>loading...</div>\n\n return (\n <>\n <Navbar />\n <Container>\n <Thinking />\n <ProductList\n data={products}\n increaseAmountProduct={increaseAmountProduct}\n decreaseAmountProduct={decreaseAmountProduct}\n removeCartHandler={removeCartHandler} />\n </Container>\n <Footer />\n </>\n\n );\n}", "update_products(state) {\n Vue.http.get(Hunt.API_URL + '/products')\n .then(\n success => {\n state.products = success.body.data;\n if(state.products.length==0) {\n //Nothing to load anymore, so all loaded\n Bus.$emit('feature-list-loaded', null);\n }\n Bus.$emit('products_loaded');\n },\n fail => {\n if(fail.status===403) {\n Bus.$emit(\"goto-login\");\n }\n Hunt.toast(fail.data.message, 'error');\n console.log(fail);\n }\n );\n }", "async function loadProducts() {\n await axios\n .get('https://vast-atoll-02815.herokuapp.com/api/product')\n .then((data) => setProducts(data.data))\n setLoading(false)\n }", "function handleShoppingList() {\n SL.renderShoppingList();\n SL.handleNewItemSubmit();\n SL.handleItemCheckClicked();\n SL.handleDeleteItemClicked();\n}", "componentDidMount() {\n Axios.get('http://localhost:3001/product/getAllProducts')\n .then(response => {\n this.setState({ products: response.data.data }, () => {\n let data = [];\n this.state.products.map((item, index) => {\n let product = {\n value: item._id,\n label: item.productName\n }\n data.push(product)\n });\n this.setState({ options: data });\n })\n })\n }", "function ProductList() {\n const { products, likedProducts, setProducts, setLikedProducts } = useContext(ProductContext);\n const [showLikedProducts, setShowLikedProducts] = useState(false);\n\n /**\n * Show / Hide liked products area trigger\n */\n const handleToggleLikedProducts = () => {\n // Toggle liked items\n setShowLikedProducts(!showLikedProducts);\n\n // Click the liked button\n if (showLikedProducts) {\n setLikedProducts([]);\n\n const _products = JSON.parse(JSON.stringify(products));\n for (let index = 0; index < _products.length; index += 1) {\n const product = _products[index];\n product.liked = false;\n }\n setProducts(_products);\n }\n };\n\n /**\n * This function id product item component\n * @param {Boolean} condition - This is render condition\n * @param {Array} array - This is mapped array\n * @param {String} array - This is not found message\n */\n const renderProductItem = ({ condition, array, message }) => {\n return condition\n ? array.map(({ id, name, image, price, url, cargo, liked }) => (\n <ProductItem\n key={id}\n id={id}\n name={name}\n image={image}\n price={price}\n url={url}\n cargoType={cargo.type}\n cargoName={cargo.name}\n liked={liked}\n />\n ))\n : message;\n };\n\n const renderNoResultLikedProducts = () => {\n return (\n <NotFound>\n <p>\n Herhani bir ürün beğenmediniz. Ürün beğenmek için lütfen <strong>Beğendiklerim</strong> butonuna tıklayın.\n </p>\n </NotFound>\n );\n };\n\n /**\n * Liked Products Area\n */\n const renderLikedProducts = () => {\n return renderProductItem({\n condition: likedProducts.length > 0,\n array: likedProducts,\n message: renderNoResultLikedProducts(),\n });\n };\n\n /**\n * Main Products Area\n */\n const renderMainProducts = () => {\n return renderProductItem({\n condition: products !== null,\n array: products,\n message: 'Loading',\n });\n };\n\n return (\n <div className=\"container\">\n <Header>\n {likedProducts.length > 0 ? <Counter>\n <HeartIcon fill=\"#3498db\" />\n <span>\n <strong>{likedProducts.length}</strong> ürün\n </span>\n </Counter> : 'Ürün beğenmediniz'}\n\n <Title>İlginizi Çekebilecek Ürünler</Title>\n\n <Filter showLikedProducts={showLikedProducts}>\n <Button onClick={handleToggleLikedProducts}>Beğendiklerim</Button>\n </Filter>\n </Header>\n\n <Container hasLikedProducts={likedProducts.length > 0} showLikedProducts={showLikedProducts}>\n {showLikedProducts ? renderLikedProducts() : renderMainProducts()}\n </Container>\n </div>\n );\n}", "function loadProducts() {\n\t\tnewRecipe();\n RecipesService.getProducts().then(\n function(response) {\n $scope.products = response.data;\n\n $timeout(function() {\n $scope.loading = false;\n }, 100);\n },\n function(error) {\n \tconsole.warn(error);\n }\n );\n }", "async onLoadPage() {\n const fetch = await fetchApi(\"/products/\");\n this.setState({\n data: fetch.data.product\n });\n }", "componentDidMount() {\n this.getProductsList();\n }", "handleReset() {\n this.setState({\n products: this.state.orig_products.slice()\n });\n }", "function getProductState() {\n return {\n allProducts: ProductStore.getProducts()\n }\n}", "componentDidMount() {\n\t\tthis.getAllProducts();\n\t}", "new_product_added(state, product) {\n state.products.unshift(product);\n }", "constructor(props)\n {\n super(props);\n this.state={\n modalVisible:false,\n itemslist:[{\n name:\"No any items in the list\"\n }],\n status:''\n };\n this._loadItems = this._loadItems.bind(this);\n this._showmodal = this._showmodal.bind(this);\n\n\n }", "componentWillMount() {\n this.props.fetchAllProducts()\n }", "addProduct(e) {\n let { products, newProductData } = this.state\n products.push(newProductData)\n this.setState({ products, newProductModal: false, newProductData: {\n name: '',\n rate: '',\n quality: 1\n }});\n }", "handleProductClick(isOrder){\n //function for adding selected product into cart items array:\n function item_for_cart_items(product) {\n if (product===undefined){ //when cart is empty this value is undefined\n var item = { name : \"\", in_price : \"\", out_price : \"\", src : \"\", quantity : 0, total : 0 };\n }else{\n var item = { name : product.name, in_price : product.in_price, out_price : product.out_price,\n src : product.src, quantity : 1, total : product.out_price };\n } \n return item;\n }\n\n if(isOrder){\n var item = item_for_cart_items(this.state.product);\n if (window.items===undefined) window.items=[];\n window.items.push(item);\n\n this.updateQuantity();\n \n this.setState({\n showParam:'2',\n });\n}\nwindow.switch_caregory=false;\n}", "componentDidMount() { //nao clk o \"() => \", pq e uma funcao da proprio js\n this.loadProducts();\n \n }", "componentWillMount() {\n this.setState({\n productDetails: this.props.data\n });\n }", "constructor(props) {\n super(props);\n this.state = {\n products: [],\n product: {},\n cart: {},\n api: \"http://localhost:9000/Carts\",\n api2: \"http://localhost:9000/Wishlists\"\n };\n }", "componentDidMount() {\n fetch(\"http://localhost:3000/products\")\n .then(resp => resp.json())\n .then(data => {\n this.setState({ allProducts: data })\n })\n }", "componentWillMount() {\n const minPrice = this.getMinPrice(this.state.selectedSize);\n const cartItems= localStorage.getItem('cartItems') ? JSON.parse(localStorage.getItem('cartItems')) : {};\n const cartSize = localStorage.getItem('cartSize') ? JSON.parse(localStorage.getItem('cartSize')) : 0;\n this.setState({showPrice: minPrice.discounted_price, selectedSource: minPrice, cartItems: cartItems, cartSize});\n }", "constructor (props) {\n // with super() we call the constructor of the class we extend\n // otherwise we would just override the Component class constructor (we still want to use it!)\n super(props);\n\n // to give this class a state, we set it up with this.state\n // it is an object that can contain multiple properties\n // the value we give them in here will be the \"initial state\"\n this.state = {\n products: [],\n }\n }", "function init() {\n vm.products = orderService.getAll();\n }", "function setupProductList() {\n if(document.getElementById(\"productList\")) {\n for (productSku of Object.keys(products)) {\n\t // products[productSku].name\t\n\t $(\"#productList\").append(\n\t $(\"<a>\").attr(\"href\",\"product.html?sku=\" + productSku).append(\t \n $(\"<div>\").addClass(\"productItem\").append(\n\t $(\"<h2>\").addClass(\"productTitle\").text(products[productSku].name)\n\t ).append(\n\t\t $(\"<span>\").addClass(\"productPrice\").text(products[productSku].price)\n\t ).append(\n $(\"<img>\").addClass(\"productImage\").attr(\"src\", \"img/\" + products[productSku].img)\n\t )\n\t )\n\t );\n }\n }\n}", "constructor() {\n super();\n this.state = {\n list: [],\n item: \"\"\n };\n }", "setProducto(state, payload){\n state.productos = payload;\n }", "componentWillMount() {\n fetch(\"https://shawarma01.herokuapp.com/api/products\")\n .then((res) => res.json())\n .then((res) => {\n console.log(res);\n this.setState({\n products: res\n });\n })\n .done();\n }", "function ListProductsScreen({ navigation }) {\n //token authorize first , in async storage stored ;\n let {user}=useContext(AuthContext);\n let token = user.token;\n console.log('token');\n console.log(token);\n axios.defaults.headers.common['Authorization'] = 'Bearer '+token;\n const [fetchedproducts,setFetchedProducts]=useState([]);\n const[stores,setStores]=useState([]);\n const[selectedstore,setSelectedStore]=useState('Spinneys');\nconst[mycartitems,setMyCartItems]=useState([]);\n\n //search bar\n const [searchQuery, setSearchQuery] = React.useState('');\n const onChangeSearch = query => setSearchQuery(query);\n\nconst {logOut}=useAuth();\n\n\nasync function fetchStores(){\n API.getStores().then(res => {\n const result = res.data.stores;\n console.log(\"RESULT: \", result);\n if(res.data.success==false){\n }else{\n //setCategories(res.data.categories);\n \n setStores(res.data.stores);\n }\n}).catch(error => console.log(\"error\",error));\n}\n\n\n\n async function fetchProducts_customer_all(){\n try{\n API.getAllProducts_Images_AllStores().then(function (response) {\n const data = response;\n const results = data.data.products;\n const newProducts = {};\n \n setFetchedProducts(results);\n console.log('data fetched', results);\n }).catch(error => console.log(\"error\",error));\n }catch(e){\n \n }\n \n }\n \n function filterstores(){\n const filteredstores=fetchedproducts.filter(product => product.store_name.includes(selectedstore));\n return filteredstores;\n }\n //categories fetch and states \n const [fetchedcategories,setFetchedCategories]=useState([]);\n function fetchcategories_frombackend(){\n API.getCategories().then(res => {\n const result = res.data.categories;\n console.log(\"RESULT: \", result);\n if(res.data.success==false){\n }else{\n //setCategories(res.data.categories);\n let tempholder_categories=res.data.categories;\n tempholder_categories.unshift({id:0,name:'All'});//this will add to first of arry and push\n console.log('muttaed categ',tempholder_categories);\n setFetchedCategories(tempholder_categories);\n }\n }).catch(error => console.log(\"error\",error));\n }//end of fetchCategories from backend\n\n useFocusEffect(\n React.useCallback(() => {\n fetchProducts_customer_all();\n fetchcategories_frombackend();\n fetchStores();\n return () => {\n };\n }, [])\n );\n // onPress={() => navigation.navigate(routes.LISTING_DETAILS, item)\n//on add cart , \nconst[totalprice,setTotalPrice]=useState(0);\n\nfunction addto_mycart(item){\nlet newtotalprice=totalprice+item.price;\nsetTotalPrice(newtotalprice);\nlet altered_cart=mycartitems;\naltered_cart.push(item);\nsetMyCartItems(altered_cart);\nconsole.log('added');\nconsole.log(altered_cart);\n\n\n}\n return (\n \n <View style={styles.screen}>\n <View style={{\n flexDirection:'row'\n }}>\n <Searchbar\n placeholder=\"Search\"\n onChangeText={onChangeSearch}\n value={searchQuery}\n style={{\n marginBottom:10,\n flex:1,\n marginRight:10,\n width:'50%'\n }}\n />\n \n <Button icon=\"cart\"style={{\n width:'30%',\n height:'70%',\n \n marginLeft:'auto'\n }}color=\"purple\"\n mode=\"contained\" onPress={() => navigation.navigate('MyCart',\n {mycartitems:mycartitems,\n totalprice:totalprice\n \n }\n )}>\n My Cart\n </Button>\n </View>\n <FlatList\n data={stores}\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{paddingVertical:12}}\n keyExtractor={(listing) => listing.id.toString()}\n renderItem={({ item }) => (\n <TouchableOpacity style={{\n marginLeft:20,\n marginRight:20,\n borderRadius:20,\n backgroundColor:'purple',\n padding:10,\n marginBottom:20\n \n }}\n onPress={()=>{\n //alert('category chosen');\n setSelectedStore(item.name);\n }}>\n<Text>{item.name}</Text>\n </TouchableOpacity>\n )}\n />\n <FlatList\n data={filterstores().filter(product => product.name.includes(searchQuery))}\n keyExtractor={(listing) => listing.id.toString()}\n renderItem={({ item }) => (\n <Card_Paper\n title={item.name}\n item={item}\n subTitle={\"$\" + item.price}\n image={item.path}\n \n onPress={() => addto_mycart(item)}\n />\n )}\n />\n </View>\n );\n}", "constructor() {\n super();\n this.state = {\n list\n };\n }", "render() {\r\n const {Header, Separator, Product} = this;\r\n var that = this;\r\n /* var filteredarray = that.state.products.filter(product => \r\n \r\n product.type == \"Clothing\"\r\n )\r\n this.setState({filteredProducts : filteredarray})*/\r\n //console.log(states)\r\n function categoryPressed(index) {\r\n var newArray = []\r\n if(index == 0) {\r\n // console.log(this.state)\r\n newArray = that.state.products.filter(product => \r\n \r\n product.type == \"NewArrival\"\r\n )\r\n }\r\n if(index == 1) {\r\n // console.log(this.state)\r\n newArray = that.state.products.filter(product => \r\n \r\n product.type == \"Clothing\"\r\n )\r\n }\r\n if(index == 1) {\r\n // console.log(this.state)\r\n newArray = that.state.products.filter(product => \r\n \r\n product.type == \"Clothing\"\r\n )\r\n }\r\n if(index == 2) {\r\n // console.log(this.state)\r\n newArray = that.state.products.filter(product => \r\n \r\n product.type == \"Shoes\"\r\n )\r\n }\r\n if(index == 3) {\r\n // console.log(this.state)\r\n newArray = that.state.products.filter(product => \r\n \r\n product.type == \"Handbags\"\r\n )\r\n }\r\n\r\n that.setState({filteredProducts : newArray})\r\n }\r\n return (\r\n <SafeAreaView style={{flex: 1, backgroundColor: 'white'}}>\r\n <Header />\r\n <Separator />\r\n\r\n {/* CATEGORIES */}\r\n <View>\r\n <ScrollView\r\n horizontal\r\n contentContainerStyle={{paddingHorizontal: theme.appDims.boundary, paddingVertical: EStyleSheet.value('10rem')}}\r\n showsHorizontalScrollIndicator={false}>\r\n {this.state.categories.map((item, index) => {\r\n return (\r\n <TouchableOpacity\r\n key={index.toString()}\r\n style={{marginRight: EStyleSheet.value('16rem')}}\r\n onPress={() => categoryPressed(index)}>\r\n <Text\r\n style={{\r\n fontSize: EStyleSheet.value('14rem'),\r\n fontWeight: this.state.selectedCatogoryIndex == index ? '600' : '400',\r\n color: this.state.selectedCatogoryIndex == index ? 'black' : 'grey',\r\n }}>\r\n {item}\r\n </Text>\r\n </TouchableOpacity>\r\n );\r\n })}\r\n </ScrollView>\r\n <Separator />\r\n </View>\r\n\r\n {/* PRODUCTS */}\r\n <FlatList\r\n data={this.state.filteredProducts}\r\n renderItem={({item, index}) => <Product item={item} index={index} />}\r\n numColumns={1}\r\n keyExtractor={(item, index) => index.toString()}\r\n showsVerticalScrollIndicator={false}\r\n />\r\n </SafeAreaView>\r\n );\r\n }", "render() {\n const { products, product } = this.state;\n if (!this.state.loading) {\n console.log(products)\n return (\n \n <div className=\"ProductList\">\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n {/* ----------------------------------------------------------------------this is how you call the products information------------------ */}\n {/* <h2 className=\"ProductList-title\">Available Products ({this.state.products.length})</h2>\n */}\n <div className=\"ProductList-container\">\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <Container>\n\n <br></br>\n <br></br>\n <CardDeck>\n\n {this.state.products.map((product, index) => {\n\n return (\n\n\n <Card className=\"shadow-lg\" align=\"center\">\n <div className=\"ProductList-product\" key={product._id}>\n \n <Modal size=\"xl\" align=\"center\" show={this.state.openedModal === product._id} fade=\"false\" onHide={this.closeModal} >\n <div style={{ textAlign: \"center\" }}></div>\n <Card className=\" p-1 shadow-lg\" align=\"center\">\n <Container align=\"center\"> \n <Modal.Header className=\"modalHeader\" closeButton>\n\n\n<Modal.Title align=\"center\">\n <img src={logoImage}\n width=\"168\"\n height=\"44\"\n className=\"pr-2\"\n alt=\"\">\n </img> \n </Modal.Title>\n \n</Modal.Header>\n<Row><Col align=\"left\">\n<h3 align=\"center\">{product.name}</h3>\n\n\n</Col>\n</Row>\n<Row >\n <Col></Col>\n<div className=\"mx-auto\">\n <img image alt={product.name} display=\" block\"\n \n width= \"60%\" align=\"center\" src={`https://lit-crag-95157.herokuapp.com/${product.imageURL}`} className=\"thumbnail shadow-lg p-3 bg-white rounded\"></img>\n</div>\n </Row>\n\n <Row>\n\n\n {product.description}\n \n </Row>\n <Button align=\"center\"\n \n className=\"snipcart-add-item BuyButton\"\n data-item-id={product._id}\n data-item-name={product.name}\n data-item-price={product.price}\n data-item-url={product.url}\n data-item-description={product.description}\n data-item-payment-interval=\"Week\"\n data-item-payment-interval-count=\"1\">\n ADD TO CART ({product.price}$)\n </Button>\n \n \n \n \n </Container> \n </Card>\n </Modal> \n{/* <Link to={`/product/${product._id}`}>\n\n <h2>{product.name}</h2>\n </Link> */}\n \n \n <h3>{product.name}</h3>\n \n \n <Button size=\"sm\" color=\"danger\" onClick={() => this.openModal(product._id)}>\n Nutrition Info\n </Button>\n {/* <Button className={this.props.className} className=\"event m-1\" onClick={() => this.setState({ showProductModal: true })}>{product.name}</Button> */}\n <Card.Img src={`https://lit-crag-95157.herokuapp.com${product.imageURL}`} alt={product.name} height=\"330px\" className=\"thumbnail shadow-lg p-3 mb-4 bg-white rounded\" />\n \n <BuyButton product={product} />\n <br></br>\n {/* <Button onClick={() => this.setState({ showModal: true })}>Add an Item(Bike)</Button>\n <Modal align=\"center\" isOpen={this.state.showModal} fade=\"false\" toggle={() => this.setState({ showModal: false })}>\n <div style={{ textAlign: \"center\" }}> <h2>{product.name}</h2></div>\n </Modal> */}\n </div>\n </Card>\n\n\n );\n\n })}\n\n\n </CardDeck>\n </Container>\n \n </div>\n {/* <Modal show={this.state.handleshowproduct} onHide={this.handlecloseproduct}>\n \n hi</Modal> */}\n {/* <Modal show={this.state.handleShowproduct} onHide={this.handleCloseproduct}>\n <h3>testing</h3>\n </Modal> */}\n\n </div>\n \n )\n };\n\n\n return (<h2 className=\"ProductList-title\">Waiting for API...</h2>);\n }", "async componentDidMount() {\n try {\n const data = await fetch(productsEndpoint);\n const jsonData = await data.json();\n //Sets state to parsed json data\n this.setState({ products: jsonData }, () => {\n //logs to make sure state worked\n console.log(this.state.products);\n });\n } catch (err) {\n console.log(err);\n this.setState({ error: true });\n }\n }", "onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpdate();\n\t}", "constructor () {\n super();\n this.state = {\n list\n }\n }", "DETAIL_PRODUCT(state, product) {\n state.product = product\n }", "constructor(props) {\n super(props);\n console.log(\"************ 1.0 ProductDetails.constructor() method gets called ****************\");\n var imgBasUrl = \"https://s3.amazonaws.com/instadelibucket/\";\n // this.handleClick = this.handleClick.bind(this);\n this.state = {\n status:\"\",\n isLoaded:true,\n isOnLoad : this.props.isOnLoad,\n product: this.props.productV,\n productImages:this.props.productV.productImagesSet,\n variantKeys:this.props.productV.variantKeys,\n variantMap:\"\",\n productSpecificationSet:this.props.productV.productSpecificationSet,\n displayImgUrl: imgBasUrl + this.props.productV.imageUrl \n };\n console.log(\"************ 1.0 ProductDetails.constructor() method gets completed ****************\"+this.state.variantKeys);\n }", "componentDidMount() {\n fetch('http://localhost:3001/products')\n .then(response => response.json())\n .then(data => this.setState({products: data}))\n }" ]
[ "0.7609573", "0.7130011", "0.70411974", "0.68655294", "0.68365955", "0.6807096", "0.6763245", "0.675613", "0.6689169", "0.66659737", "0.6658431", "0.66581374", "0.66351545", "0.6608302", "0.6563982", "0.6523865", "0.65192217", "0.65185153", "0.6432068", "0.6377935", "0.6371505", "0.6343681", "0.62958145", "0.62815964", "0.62783366", "0.6258134", "0.62556815", "0.6254111", "0.6236075", "0.62173176", "0.620938", "0.61981905", "0.6197631", "0.61846083", "0.61822516", "0.61785036", "0.61602277", "0.6157448", "0.6148122", "0.6140103", "0.61393213", "0.61344445", "0.612727", "0.6123957", "0.6123764", "0.6116441", "0.6116322", "0.6114232", "0.6109227", "0.6094502", "0.60890394", "0.6076919", "0.6070175", "0.60693485", "0.6056632", "0.6048088", "0.6046627", "0.6045565", "0.60443026", "0.60430586", "0.60380256", "0.601973", "0.5999893", "0.59967995", "0.599288", "0.59920347", "0.5979267", "0.5977621", "0.5975129", "0.59704983", "0.5968473", "0.5958139", "0.5933553", "0.59261996", "0.59229183", "0.59145314", "0.59117836", "0.59077847", "0.59035945", "0.5892987", "0.5890744", "0.58857316", "0.58757716", "0.58721167", "0.58634824", "0.58487076", "0.5847716", "0.58401525", "0.58302903", "0.5828248", "0.582638", "0.58259284", "0.5819897", "0.58116627", "0.5810191", "0.5806732", "0.5803822", "0.5802037", "0.5801021", "0.580097", "0.57980776" ]
0.0
-1
query data from backend server
getProductDataList() { fetch('http://localhost:3000/products').then(res => res.json()).then((data) => { this.setState({productList: data}) }).catch(console.log) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "query(store, type, query) {\n let { backend, id } = query;\n return this.ajax(this._url(backend, id), 'GET', { data: { list: true } }).then(resp => {\n resp.id = id;\n resp.backend = backend;\n return resp;\n });\n }", "run(){\n let [q, ...args] = this._getQuery();\n return this.client._query(q, args, {emitter: this}).then(data => {\n this.emit('data', data);\n return data;\n });\n }", "query() { }", "function _loadRemoteData() {\n $scope.isLoading = true;\n\n QueryService.getAvailableQueries(\"offers\")\n .then(function(result) {\n serveResult(result);\n })\n .catch(function(error) {\n console.log(error);\n alert('wystąpil błąd...');\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n }", "function query_api(data){\n return $http.get('/api/base/search/', {params: data || {}}).success(function(data){\n $scope.results = $scope.display = data.objects;\n });\n }", "query(type, value) {\n this.modifyState({\n loading: true\n });\n API.object(type, value).then((res) => {\n this.apiResponded(res, 'queryResult');\n });\n }", "query(params)\n {\n return this.doRequest({method: 'GET'}, null, params);\n }", "function sendQuery(){\n \n if(APP && APP.network){\n var netStat = APP.network()\n , info = '';\n if(!netStat){\n info = '网络错误,请检查网络连接。'\n callError(info);\n return;\n }\n }\n \n var xhr = new XMLHttpRequest()\n , url = 'http://bistulib.dmdgeeker.com/search?key=' + context.key + '&match=' + context.match;\n \n xhr.onreadystatechange = function(){\n var response = null;\n if(xhr.readyState === 4){\n if((xhr.status >= 200 && xhr.status < 300)|| xhr.status === 304){\n response = xhr.responseText;\n pageState.success(response);\n }\n else {\n var serverError = '服务器出错了:' + xhr.status;\n callError(serverError);\n }\n }\n else {\n // pageState.loading();\n }\n };\n \n xhr.onprogress = function(evt){\n if(evt.lengthComputable){\n //loadProgress.innerText = Math.round(100*evt.loaded/evt.total) + '%';\n }\n };\n \n xhr.timeout = 70000;\n xhr.ontimeout = function(){\n var timeoutError = '加载超时,请检查网络连接。';\n callError(timeoutError);\n xhr.abort();\n };\n \n xhr.open('GET', url);\n xhr.send(null);\n }", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }", "getRequests() {\n return this.query(`SELECT * FROM request`);\n }", "function getData() {\n let name = qs(\"select\").value;\n let url = URL_BASE + name + \"/\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(genData)\n .catch(handleError);\n }", "function backendSearch(params) {\n\n $.post('/' + engine + '/points/get', params)\n .done(function (data) {\n\n logger.addItem('Engine: ' + engine);\n logger.addItem('Items found: ' + data.stats.found);\n logger.addItem('Query time (ms): ' + data.stats.time);\n clearOverlays();\n\n data.items.forEach(function (item) {\n addMarker(item.location.coordinates[1], item.location.coordinates[0], $map.data('gmap').map);\n });\n\n logger.render();\n });\n }", "function querySearch (query) {\n\t\t\t\t\t\t \t//var results = $rootScope.clients;\n\t\t\t\t\t\t\t var results = query ? $rootScope.clients.filter(createFilterFor(query)) : $rootScope.clients,\n\t\t\t\t\t\t deferred;\n\t\t\t\t \t\t\treturn results;\n\t\t\t\t\t\t\t \n//\t\t\t\t\t\t \tvar urlClients = protocol_url + appHost + \"/client/operator/list\"\n//\t\t\t\t\t\t\t var data = {domain:appFirmDomain}\n//\t\t\t\t\t\t return httpService.GET(urlClients,data).then(\n//\t\t\t\t\t\t \t\tfunction(response) {\n//\t\t\t\t\t\t \t\t\tvar results = response.data;\n//\t\t\t\t\t\t \t\t\treturn results;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t }", "async getResults(query, data) { // * Updated this function to run asynchronously\n if (!query) return [];\n if(this.options.endpoint !== undefined) { // ! Added this conditional to run the logic supplied on component construction\n data = await this.options.getUserData(query, this.options.endpoint, this.options.numOfResults);\n }\n // Filter for matching strings\n return data.filter((item) => {\n return item.text.toLowerCase().includes(query.toLowerCase());\n });\n }", "fetchData() {\n this.initLoading();\n\n this.setFilters(this.qs_url, this.generateBaseFilters());\n this.data.filters = this.getFilters(this.qs_url);\n\n let qs = this.setQuerySet(this.view, this.qs_url).filter(this.getFiltersPrepared(this.qs_url)).prefetch();\n this.setQuerySet(this.view, this.qs_url, qs);\n\n this.getInstancesList(this.view, this.qs_url).then(instances => {\n this.setLoadingSuccessful();\n\n this.setInstancesToData(instances);\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n\n }).catch(error => {\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "async query(query) {\n\n }", "query(store, type, query) {\n let url = this.buildURL(type.modelName, null, null, 'query', query);\n return this.ajax(url, 'GET');\n }", "function getCompanyQuery() {\n getData(getCompanyParams);\n}", "remoteDataQuery(value) {\n // Check if query should be applied now\n if (this.validExtension(value)) {\n return;\n }\n\n // Get file listing\n this.fileQueryFn(value, this.fileExt, this.fileOptions).subscribe(\n ({ data }) => {\n if (data.length) {\n this.setItems(data);\n }\n }\n );\n }", "function getPersonQuery() {\n getData(getPersonParams);\n}", "function actualQuery() {\n fetch(window.query_url)\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n items: result.items\n });\n },\n // Note: it's important to handle errors here\n // instead of a catch() block so that we don't swallow\n // exceptions from actual bugs in components.\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n )\n }", "function doQuery() {\n // Clear the results from a previous query\n resultsLyr.removeAll();\n /*********************************************\n *\n * Set the where clause for the query. This can be any valid SQL expression.\n * In this case the inputs from the three drop down menus are used to build\n * the query. For example, if \"Elevation\", \"is greater than\", and \"10,000 ft\"\n * are selected, then the following SQL where clause is built here:\n *\n * params.where = \"ELEV_ft > 10000\";\n *\n * ELEV_ft is the field name for Elevation and is assigned to the value of the\n * select option in the HTML below. Other operators such as AND, OR, LIKE, etc\n * may also be used here.\n *\n **********************************************/\n params.where = field + stateName.value;\n // executes the query and calls getResults() once the promise is resolved\n // promiseRejected() is called if the promise is rejected\n qTask.execute(params)\n .then(getResults)\n .otherwise(promiseRejected);\n }", "\"filter:database\"(queryPayload) {\n return queryDatabase(queryPayload, (data, attrs) => _.filter(data.results, attrs));\n }", "async function clickQueryInflux(req, res) {\n let queryArray = []\n let querySensor = req.body.sensor\n let fluxQuery;\n const queryApi = new InfluxDB({ url: process.env.URL, token: process.env.TOKENTWO }).getQueryApi(process.env.ORG);\n if (req.body.type === 'tempHum') {\n fluxQuery = `from(bucket:\"perm_data\") |> range(start: -1h) |> filter(fn: (r) => r._measurement == \"${querySensor}\") |> filter(fn: (r) => r._field == \"temperature\" or r._field == \"humidity\")`\n } else {\n fluxQuery = `from(bucket:\"perm_data\") |> range(start: -1h) |> filter(fn: (r) => r._measurement == \"${querySensor}\") |> filter(fn: (r) => r._field == \"EC\" or r._field == \"pH\")`\n }\n\n await queryApi.queryRows(fluxQuery, {\n next(row, tableMeta) {\n const o = tableMeta.toObject(row)\n queryArray.push(o);\n },\n error(error) {\n console.error(error)\n console.log('\\n Finished ERROR')\n },\n complete() {\n res.type('application/json').send(JSON.stringify(queryArray));\n console.log('\\nFinished SUCCESS')\n }\n })\n}", "runQuery() {\n this.props.client\n .query({\n query: getSelectedCountry,\n variables: { id: 1 }\n })\n .then(data => {\n console.log(data);\n });\n\n // this.props.client.mutate({})\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 }", "getAllQueries(req, callback) {\n var self = this;\n var reqObj = req.body;\n\n var errorResponseObj = {\n status: false,\n data: {},\n message: \"not able to list the queries data\",\n };\n var responseObject = {},\n queryTable = \"query\";\n\n var criteria = {\n condition: {\n sender_id: reqObj.userID,\n curriculumCode: reqObj.curriculumCode,\n status: reqObj.status ? reqObj.status : { $in: [0, 1, 2] },\n }\n };\n if (reqObj[\"limit\"]) {\n criteria[\"limit\"] = reqObj[\"limit\"];\n }\n self.apiServiceInstance.findDataAll(\n queryTable,\n criteria,\n function (err, queriesData) {\n if (queriesData) {\n responseObject[\"status\"] = true;\n responseObject[\"data\"] = queriesData;\n callback(null, responseObject);\n } else {\n errorResponseObj['error'] = err;\n callback(err, errorResponseObj);\n }\n }\n );\n }", "function getDataFromDb(req,res) {\r\n let SQL = 'SELECT * FROM digimon;';\r\n client.query(SQL).then((data)=>{\r\n res.render('digimonExam/favourite', {results:data.rows});\r\n }).catch((err)=>errorHandler(err,req,res));\r\n}", "function queryDatabase() {\n if (idb.isReady()) {\n idb.get(dbKeys.stations);\n idb.get(dbKeys.lastFrequency);\n }\n }", "readAllData(params, division_db, token) {\n const self = this;\n const deferred = Q.defer();\n // const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n // paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender,str_reason as Reason\n // from dbo.employee\n // LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID `;\n // const sql = ` use [${division_db}]; select dbo.employee.* from dbo.employee`;\n const sql = ` use [${division_db}]; select dbo.employee.* from dbo.employee`;\n\n self.db\n .request()\n .query(sql)\n .then(result => {\n deferred.resolve(result.recordset);\n })\n .catch(err => {\n console.trace(err); // todo : will do to logger later\n deferred.reject(err);\n });\n return deferred.promise;\n }", "function getData(req, res) {\n\n\tif(req.query.startTime != undefined && req.query.startTime != undefined) {\n\n\t\tlet starttime = new Date(req.query.startTime);\n\t\tlet endtime = new Date(req.query.endTime);\n\n\t\tlet sqlquery = \"SELECT * FROM benchmark WHERE create_time BETWEEN ? AND ? ORDER BY create_time desc\";\n\t\tlet values = [starttime, endtime];\n\n\t\tconnection.query(sqlquery, values, function(err, result) {\n\t\t\tif(err) {\n\t\t\t\tthrow err;\n\t\t\t\tres.send(\"Data not found.\")\n\t\t\t\tres.status(404);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tres.send(result);\n\t\t\t\tres.status(200);\n\t\t\t}\n\t\t})\n\t}\n\telse {\n\t\tconsole.log(\"Invalid query.\");\n\t\tres.send(\"Invalid query.\");\n\t\tres.status(400)\n\t}\n\n}", "function fetchData() {\n queryType=document.querySelector('#queryType').value;\n itemID=document.querySelector('#itemID').value;\n getFromSWAPI(queryType, itemID)\n}", "function ______MA_Query() {}", "static fetchData(store, props, host) {\n return store.dispatch(fetchListFromServer(props.location.query.search, host))\n }", "function getData(){\n return runSOQL('SELECT+name+from+Account');\n}", "function queryBackend(){\n let result;\n let url;\n // generate a random number\n let mustBeAboveDifficultyToUseAI = Math.random()*144+44;\n // always query the backend for the correct move if in suggestion view.\n let suggestMoveView = view_i == 1;\n // ai is used more often the lower the slider score is.\n let useAI = mustBeAboveDifficultyToUseAI > gameState.aiDifficulty || suggestMoveView;\n if (useAI) {\n url = \"https://play-tictactoe-ai.herokuapp.com/api/v1/turn/\"+turn+\"/board/\"+boardString\n } else {\n url = \"https://play-tictactoe-ai.herokuapp.com/api/v1/rand/turn/\"+turn+\"/board/\"+boardString\n }\n fetch(url, {\n headers: { \"Content-Type\": \"application/json\" }\n }).then(async response => {\n if (response.ok) {\n apiError = false;\n result = await response.json();\n apiReturnValue = { board: result.board, winner: result.winner}\n } else {\n apiError = true;\n }\n }).catch(() => (apiError = true));\n}", "function Query(port) {\n let http = require('http');\n\n //We need a function which handles requests and send response\n function handleRequest(request, response){\n let param = request.url.split(\"/\");\n let action = param[param.length - 1];\n if(action == \"serverInfo\") {\n let server_config = JSON.parse(g_server.config);\n let server_info = GetServer();\n\n let data = {\n name: server_info.serverName,\n maxPlayers: server_info.maxPlayers,\n serverMode: server_config.mode,\n serverMap: server_config.map,\n playersOnline: g_players.length\n };\n return response.end(JSON.stringify(data));\n return response.end(msg);\n }\n else if(action == \"playersList\") {\n let players = [];\n let msg = \"\";\n for(let p of g_players) {\n players.push({id: p.client.networkId, name: p.name});\n }\n return response.end(JSON.stringify(players));\n return response.end(msg);\n }\n return response.end(\"/serverInfo - Server info\\n/playerList - List of players\");\n }\n\n let server = http.createServer(handleRequest);\n server.listen(port, function(){\n console.log(\"Server listening on: http://localhost:%s\", port);\n });\n}", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "function QueryCollection() {\n\t\t}", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "async function queryInflux(req, res) {\n let queryArray = []\n let queryRange = req.body.queryString\n let querySensor = req.body.sensor\n let queryMeasurement = req.body.measurement\n const queryApi = new InfluxDB({ url: process.env.URL, token: process.env.TOKENTWO }).getQueryApi(process.env.ORG);\n const fluxQuery = `from(bucket:\"perm_data\") |> range(${queryRange}) |> filter(fn: (r) => r._measurement == \"${querySensor}\") |> filter(fn: (r) => r._field == \"${queryMeasurement}\")`\n\n await queryApi.queryRows(fluxQuery, {\n next(row, tableMeta) {\n const o = tableMeta.toObject(row)\n queryArray.push(o);\n },\n error(error) {\n console.error(error)\n console.log('\\n Finished ERROR')\n },\n complete() {\n res.type('application/json').send(JSON.stringify(queryArray));\n console.log('\\nFinished SUCCESS')\n }\n })\n}", "function getEasyLoadRecordsFromDb(){\n\t\t$http.get(\"/easyloadList\").then(\n\t\t\t\tfunction(res){\n\t\t\t\t\t$scope.easyLoadRecords = res.data;\n\t\t\t\t\tconsole.log(\"data found from data base\");\n\t\t\t\t\tconsole.log(res);\n\t\t\t\t},\n\t\t\t\tfunction(err){\n\t\t\t\t\tconsole.log(\"data not found from database something wrong\");\n\t\t\t\t})\n\t}", "function getDataForAllQuery(query, callback) {\n var queryResponse = {};\n if (query.query == 'DataFromDb') {\n queryResponse = {\n res: 'DataFromDb',\n metricId: query.metricId,\n queryResults: initialResults,\n channelId: initialResults.metric.channelId,\n startDate: query.startDate,\n endDate: query.endDate,\n metric: initialResults.metric\n }\n callback(null, queryResponse);\n }\n else {\n graph.get(query.query, function (err, fbQueryRes) {\n if (err) {\n if (err.code === 190)\n return res.status(401).json({error: 'Authentication required to perform this action'})\n else if (err.code === 4)\n return res.status(4).json({error: 'Forbidden Error'})\n else\n return res.status(500).json({error: 'Internal server error'})\n }\n\n else {\n queryResponse = {\n res: fbQueryRes,\n metricId: query.metricId,\n queryResults: initialResults,\n channelId: initialResults.metric.channelId,\n metric: initialResults.metric,\n startDate: query.startDate,\n endDate: query.endDate,\n }\n callback('', queryResponse);\n }\n })\n\n }\n }", "runQuery(value){\n let params = this.makeParams(value);\n\n // Cancel any pending request.\n let currentRequest = this.attr('request');\n if (currentRequest && currentRequest.state && currentRequest.state() === 'pending') {\n currentRequest.abort();\n }\n\n if (!this.attr('model') || !this.attr('model').findAll) {\n this.attr('error', new Error('You must provide a model attribute on a <next-record> component.'));\n console.error(this.attr('error'));\n return;\n }\n\n // Create the new request.\n let request = this.attr('model').findAll(params);\n this.attr('request', request);\n\n // When the request comes back, set the record on the configured `recordVarName`.\n request.then(response => {\n let recordVarName = this.attr('recordVarName');\n this.attr(recordVarName, response && response.length ? response[0] : null);\n });\n }", "function doGet(app){\n return errorWrap(async function(req, res) {\n try {\n const id = req.params.id;\n let copyQuery = Object.assign({}, req.query);\n if(id !== undefined){\n copyQuery.id = id;\n }\n\n //Obtain Results\n let results;\n if(req.params.db == 'sensor-types'){\n results = await app.locals.sensors.findSensorTypes(copyQuery);\n }else if(req.params.db === 'sensors'){\n results = await app.locals.sensors.findSensors(copyQuery);\n }else if(req.params.db === 'sensor-data'){\n copyQuery.sensorId = req.params.id;\n if(req.params.timestamp !== undefined){\n copyQuery.timestamp = req.params.timestamp;\n copyQuery._count = 1;\n }\n results = await app.locals.sensors.findSensorData(copyQuery);\n if(req.params.timestamp !== undefined && results.data[0] !== undefined && results.data[0].timestamp != req.params.timestamp){\n const err = `no data for timestamp ${req.params.timestamp}`\n throw [ new AppError('NOT_FOUND', err) ]; \n }\n }\n\n //HATEOAS for sensor-types and sensors \n if(req.params.db === 'sensor-types' || req.params.db === 'sensors'){\n let url;\n if(req.params.id != undefined){\n url = `${app.locals.base}\\/${req.params.db}\\/${req.params.id}`;\n }else{\n url = `${app.locals.base}\\/${req.params.db}`;\n }\n for(let element of results.data){\n element.self = `${app.locals.base}\\/${req.params.db}\\/${element.id}`;\n }\n let equery = encodeQuery(req.query);\n results.self = `${url}${equery}`;\n if(results.previousIndex > 0){\n req.query._index = results.previousIndex; \n equery = encodeQuery(req.query)\n results.prev = `${url}${equery}`;\n }\n if(results.nextIndex > 0){\n req.query._index = results.nextIndex; \n equery = encodeQuery(req.query)\n results.next = `${url}${equery}`;\n }\n }\n\n //HATEOAS for sensor-data\n if(req.params.db === \"sensor-data\"){\n let url = `${app.locals.base}\\/${req.params.db}\\/${req.params.id}`;\n for(let element of results.data){\n element.self = `${url}\\/${element.timestamp}`;\n }\n if(req.params.timestamp !== undefined){\n url = `${app.locals.base}\\/${req.params.db}\\/${req.params.id}\\/${req.params.timestamp}`;\n }\n let equery = encodeQuery(req.query);\n results.self = `${url}${equery}`;\n if(results.previousIndex > 0){\n req.query._index = results.previousIndex; \n equery = encodeQuery(req.query)\n results.prev = `${url}${equery}`;\n }\n if(results.nextIndex > 0){\n req.query._index = results.nextIndex; \n equery = encodeQuery(req.query)\n results.next = `${url}${equery}`;\n }\n }\n res.json(results);\n }\n catch(err) {\n let retError = {\n errors: []\n };\n retError.errors.push(mapError(err));\n let li = retError.errors.length -1;\n let stat = retError.errors[li].status;\n delete retError.errors[li].status;\n res.status(stat).json(retError);\n }\n });\n}", "function query() {\n $http\n .get('/api/cities')\n .then(function onSuccess(response) {\n vm.cities = response.data;\n });\n }", "function queryReadings() {\n\t\t\tdashboard.queryReadings();\n\t\t}", "function runQuery( queryString , res){\r\n var query = db.query( queryString, function(err, result){\r\n if(err){\r\n console.log('Error in query: ' + err);\r\n } else {\r\n sendJSON(result, res);\r\n } \r\n });\r\n}", "function runQuery(query) {\n connection.query(query, function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n // console.log response as JSON\n console.log(JSON.stringify(res[i]));\n }\n runSearch();\n });\n}", "queryUsers(params) {\n return axios.get('/user/query', {\n params: params\n }).then(ret => {\n return ret.data;\n });\n }", "static Search(req, res) {\n new mssql.ConnectionPool(config.config).connect().then((pool) => {\n return pool.request().query(`EXEC sp_search_agent`)\n }).then((fields) => {\n mssql.close()\n let rows = fields.recordset;\n res.json(rows);\n }).catch(err => {\n mssql.close()\n res.json(err)\n })\n }", "static async getApplications(){\n let appQuery = `SELECT A.*, B.ID AS JOBID, B.ACTIVE FROM APPLICATIONS AS A \n INNER JOIN JOBOFFERS AS B ON A.JOBID=B.ID WHERE ACTIVE=1`;\n try{\n let client = await pool.connect();\n let result = await client.query(appQuery);\n client.release();\n return result.rows;\n } catch(err){\n console.log(err);\n }\n }", "function getData(query, callback) {\n query.api_key = apiKey;\n query.limit = 100;\n\n $.getJSON(endpointURL, query, callback);\n }", "static async showAllFlights() {\n let flightQuery = 'SELECT * FROM flights';\n try {\n const client = await pool.connect();\n const result = await client.query(flightQuery);\n client.release();\n return result;\n } catch (error) {\n console.log(error);\n }\n }", "readActiveData(params, division_db, token) {\n const self = this;\n const deferred = Q.defer();\n // const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n // paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender\n // from dbo.employee\n // LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID `;\n\n const sql = ` use [${division_db}]; select dbo.employee.*,dbo.employee.StatusDate as HireDate,dbo.employee.InactiveDate as TermDate, dbo.employee.className as Country,dbo.classification.Description as Class,\n paychexID as paychexID,MiddleInit as MiddleInitial,independentContractor as IndependentContractor,doNotRehire as DoNotRehire,str_Gender as Gender, str_reason as Reason\n from dbo.employee\n LEFT JOIN dbo.classification ON dbo.employee.ClassificationID=dbo.classification.ClassificationID where NOT str_reason='TERMINATED' and Status='A' `;\n\n self.db\n .request()\n .query(sql)\n .then(result => {\n deferred.resolve(result.recordset);\n })\n .catch(err => {\n console.trace(err); // todo : will do to logger later\n deferred.reject(err);\n });\n return deferred.promise;\n }", "fetchData() {\n this.initLoading();\n this.getInstance(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n }).catch(error => {\n debugger;\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function getAllAdminsData() //3aaaaaaaaaaaaaaa4\n{\n var queryString = \"select * from Admins;\";\n\n $.ajax({\n type: \"POST\",\n url: serviceLink + \"/getAllAdmins\",\n async: false,\n dataType: \"json\",\n contentType: \"application/json\",\n data: JSON.stringify({ queryString: queryString }),\n\n success: function (data) {\n\n if(data.d === \"databaseError\")\n {\n alert(\"خطأ فى قاعدة البيانات\");\n }\n else\n {\n openViewAdmins(data.d);\n }\n\n },\n error: function (er) {\n alert('error:' + JSON.stringify(er));\n }\n });\n} //done", "function index() {\n\t\tdebug('index request');\n\t\t// query here plz\n\t\tvar query = table.select(table.star()).from(table).toQuery();\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('index resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.index, {\"error\": \"db error\"}); // TODO better specific error reporting\n\t\t\t} else {\n\t\t\t\tdebug(resp.rows);\n\t\t\t\temit(routes.index, resp.rows);\n\t\t\t}\n\t\t});\n\t}", "async fetchQueriedFilms() {\n try {\n const response = await axios.get(\n // need to verify request's url (url ok)\n BASE_URL +\n this.endPoint +\n API_KEY +\n '&language=en-US&page=' +\n `${this.localService.getPaginationPage()}&query=${this.query}`,\n );\n return response.data;\n } catch (error) {\n return error;\n }\n }", "function do_query(){\r\n\t\t\tthat.qh.handler(service, query, add_label);\r\n\t\t\tbtn.innerText = \"hide\" + enlbl;\r\n\t\t}", "function sendQuery(endPoint) {\n\t\tconst request = new Request(endPoint, {\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json; charset=utf-8\"\n\t\t\t}\n\t\t});\n\n\t\tfetch(request)\n\t\t\t.then(function(res) {\n\t\t\t\treturn res.json();\n\t\t\t})\n\t\t\t.then(function(data) {\n\t\t\t\t// remove loader\n\t\t\t\ttoggleLoader();\n\t\t\t\tconsole.log(store);\n\t\t\t\tconsole.log(data);\n\t\t\t\t// display ebay results\n\t\t\t\tif (store === \"ebay\") {\n\t\t\t\t\tconsole.log(\"shouldnt run\");\n\t\t\t\t\tdisplayEbayResults(data);\n\t\t\t\t\t// display walmart results\n\t\t\t\t} else if (store === \"walmart\") {\n\t\t\t\t\tconsole.log(\"shouldnt run\");\n\t\t\t\t\tdisplayWalmartResults(data);\n\t\t\t\t\t// if option set to all\n\t\t\t\t\t// display results for all\n\t\t\t\t} else {\n\t\t\t\t\tlet walmartData = JSON.parse(data[0]);\n\t\t\t\t\tlet ebayData = JSON.parse(data[1]);\n\t\t\t\t\tdisplayWalmartResults(walmartData);\n\t\t\t\t\tdisplayEbayResults(ebayData);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => console.log(err));\n\t}", "function dataSend() {\n let db;\n const request = indexedDB.open('my-db');\n request.onerror = (event) => {\n console.log('Error with IndexDB', event);\n };\n request.onsuccess = (event) => {\n db = event.target.result;\n getData(db);\n };\n }", "function refreshQueryData() {\n var user = keepUser.getUser();\n $http.get('/getQueryByUser/' + user).then(function (responce) {\n $scope.Data = responce.data;\n });\n }", "executeQuery(res, query){ \n sql.connect(dbConfig, function (err) {\n if (err) { \n console.log(\"Error while connecting database :- \" + err);\n res.send(err);\n }\n else {\n // create Request object\n var request = new sql.Request();\n // query to the database\n request.query(query, function (err, res) {\n if (err) {\n console.log(\"Error while querying database :- \" + err);\n res.send(err);\n }\n else {\n res.send(res);\n }\n });\n }\n }); \n }", "async function selectAllData() {\n let sql = 'SELECT sn,label FROM enterprise_info';\n console.log(sql);\n let dataList = await query(sql);\n return dataList;\n}", "function fetchData({ query }) {\n return axios({\n method: \"get\",\n url: `https://api.spotify.com/v1/search?q=${query}&type=track,artist&limit=10`\n });\n}", "getAll(request, response, next) {\n this.model.find({}, (err, data) => {\n if (err) {\n return next(err);\n }\n response.json(data);\n });\n }", "function fetch() {\n $scope.isLoading = true;\n $http.post(url+'/api/user/getUserList', {\n // skip: $scope.searchParams.begin,\n skip: $scope.searchParams.limit,\n page: $scope.searchParams.pageNum - 1\n })\n .success(function (data) {\n $scope.isLoading = false;\n console.log('fetch userList from server success:', data);\n $scope.data_store = data.instances.list;\n $scope.userList = $scope.data_store;\n $scope.searchParams.total = data.instances.pageNum;\n\n })\n .error(function (data) {\n $scope.isLoading = false;\n alert('Internal server error');\n console.log('got error:', data);\n });\n }", "function TQueries() {}", "function TQueries() {}", "function TQueries() {}", "function querySearch(query) {\n\t\t\t\t\t\t\treturn $http(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tmethod : 'POST',\n\t\t\t\t\t\t\t\t\t\turl : 'http://localhost/imsui/api/inv/getByName',\n\t\t\t\t\t\t\t\t\t\tdata : $.param( {\n\t\t\t\t\t\t\t\t\t\t\tq : query,\n\t\t\t\t\t\t\t\t\t\t\thead : $scope.cart.head\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\theaders : {\n\t\t\t\t\t\t\t\t\t\t\t'Content-Type' : 'application/x-www-form-urlencoded'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}).then(function(response) {\n\t\t\t\t\t\t\t\treturn response.data;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}", "getAll(req, res, next) {\n try {\n const huisId = req.params.huisId\n const query = 'SELECT ID, Naam, Beschrijving, Ingredienten, Allergie, Prijs FROM maaltijd WHERE StudentenhuisID = ?'\n const values = [huisId]\n pool.getConnection((err, connection) => {\n if (err) {\n logger.error('Error getting connection from pool: ' + err.toString())\n const error = new ApiError(err, 500)\n next(error);\n return\n }\n connection.query(query, (err, rows, fields) => {\n connection.release()\n if (err) {\n const error = new ApiError(err, 412)\n next(error);\n } else {\n res.status(200).json({result: rows}).end()\n }\n })\n })\n } catch (ex) {\n logger.error(ex)\n const error = new ApiError(ex, 500)\n next(error);\n }\n }", "async function list(req, res) {\n let data\n if (req.query.mobile_phone) {\n data = await reServ.search(req.query.mobile_phone);\n } else if(req.query.date) {\n data = await reServ.list(req.query.date);\n }\n res.json({ data });\n}", "function Query(applicationId, path, ql, options, success, failure) {\n if (path.lastIndexOf(\"/\", 0) !== 0) {\n path = \"/\" + path;\n }\n path = \"/\" + self.currentOrganization + \"/\" + applicationId + path;\n var client = self;\n var self = this;\n var query = {};\n var start_cursor = null;\n var next_cursor = null;\n var prev_cursor = null;\n\n function getServiceParams() {\n var params = {};\n if (ql) {\n params['ql'] = ql;\n }\n if (start_cursor) {\n params['cursor'] = start_cursor;\n }\n if (prev_cursor) {\n params['prev'] = prev_cursor;\n }\n if (options) {\n for (var name in options) {\n params[name] = options[name];\n }\n }\n return params;\n }\n this.getServiceParams = getServiceParams;\n\n function hasPrevious() {\n return prev_cursor != null;\n }\n this.hasPrevious = hasPrevious;\n\n function getPrevious() {\n start_cursor = null;\n next_cursor = null;\n if (prev_cursor) {\n start_cursor = prev_cursor.pop();\n send(\"GET\", null);\n }\n }\n this.getPrevious = getPrevious;\n\n function hasNext() {\n return next_cursor && start_cursor;\n }\n this.hasNext = hasNext;\n\n function getNext() {\n if (next_cursor && start_cursor) {\n prev_cursor = prev_cursor || [];\n prev_cursor.push(start_cursor);\n start_cursor = next_cursor;\n next_cursor = null;\n send(\"GET\", null);\n }\n }\n this.getNext = getNext;\n\n function send(method, data) {\n var params = getServiceParams();\n prev_cursor = null;\n next_cursor = null;\n start_cursor = null;\n apiRequest(method, path, params, data, function (data) {\n if (data.entities && data.entities.length > 1) {\n start_cursor = data.entities[0].uuid;\n if (data.params) {\n if (data.params.prev) {\n prev_cursor = data.params.prev;\n }\n if (data.params.cursor) {\n start_cursor = data.params.cursor[0];\n }\n }\n next_cursor = data.cursor;\n }\n if (success) {\n success(data, self);\n }\n }, function (data) {\n if (failure) {\n failure(data, self);\n }\n });\n }\n this.send = send;\n\n function post(obj) {\n if (obj) {\n send(\"POST\", JSON.stringify(obj));\n }\n }\n this.post = post;\n\n function put(obj) {\n if (obj) {\n send(\"PUT\", JSON.stringify(obj));\n }\n }\n this.put = put;\n\n function delete_() {\n send(\"DELETE\", null);\n }\n this.delete_ = delete_;\n }", "query(oracleId, queryFee, queryTtl, responseTtl, fee, query) {\n // if (this.oracle) {\n let data = {\n 'target': 'oracle',\n 'action': 'query',\n 'payload': {\n 'type': 'OracleQueryTxObject',\n 'vsn': 1,\n 'oracle_pubkey': oracleId,\n 'query_fee': queryFee,\n 'query_ttl': {'type': 'delta', 'value': queryTtl},\n 'response_ttl': {'type': 'delta', 'value': responseTtl},\n 'fee': fee,\n 'query': typeof query.toString !== 'undefined' ? query.toString(): query\n }\n }\n this.webSocket.send (JSON.stringify (data))\n return data\n }", "function estGet(req, res, next) {\n try {\n console.log('apiREST params', req.params);\n console.log('apiREST query', req.query);\n let sql = 'SELECT * FROM personas';\n con.query(sql,[], function(err,result) {\n if(err) {\n // Enviar error SQL\n console.error('ERR',err.message);\n res.status(500).send({\n finalizado: true,\n mensaje: 'get Error SQL',\n });\n } else {\n // Manipular resultados\n res.status(200).send({\n finalizado: true,\n mensaje: 'get OK',\n datos: result,\n });\n }\n\t\t});\n\n } catch(e) {\n console.log('ERROR', e);\n res.status(401).send({\n finalizado: true,\n mensaje: 'get Error',\n });\n }\n}", "async list(Request, Response){\n pool.connect(async function (err, client, done){\n\n const userId = Request.headers.authorization;\n const { mes } = Request.body\n console.log(mes, userId);\n \n const despesas = await client.query(\"select id_despesas, nome, _data, valor from despesas inner join categoria using (id_categoria) where Extract('Month' From _data) = $1 and categoria.id_usuario = $2\", [mes, userId]);\n \n done();\n \n return Response.json(despesas.rows);\n });\n \n }", "function getData(req, res) {\n const query = {};\n\n RecordModel.find(query, (findError, recordsArray) => {\n if (findError) {\n res.status(500);\n res.send('City Records says: Error finding records');\n } else {\n res.json(recordsArray);\n }\n });\n}", "function selectDataHandler(req,res){\nlet sql= `SELECT * FROM digi_test ;`;\nclient.query(sql).then(result=>{ // here we needed the (result ) because this function have results not like the func before because inserting process have no result \n\nres.render('pages/favorite' , {data: result.rows}) // path of favorite page to render on it \n\n})\n \n}", "fetchData() {\n this.props.fetchData(this.props.query);\n }", "async function getData(query = 'meal'){\r\n\tconst BASE_URL = 'https://api.edamam.com/search';\r\n\tconst APP_ID = '27405351';\r\n\tconst APP_KEY = '8a9c5a0b765495ba5ccf340cb3d98624';\r\n\r\n\tshowLoader();\r\n\tconst response = await axios({\r\n\t\turl: `${BASE_URL}?q=${ query }&app_id=${APP_ID}&app_key=${APP_KEY}`,\r\n\t\tmethod: 'get',\r\n\t\theaders: {\r\n\t\t\t'Access-Control-Allow-Origin': '*'\r\n\t\t}\r\n\t});\r\n\r\n\treturn Promise.resolve(response.data);\r\n}", "static database_query(json, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.database_query({0})\".format(json));\n Database.query(json, fcn);\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}", "async function getMoviesFromBackend(query) {\n if (!loadFavourites) {\n try {\n let url = 'http://localhost:3000/movies' + (query ? ('?q=' + query) : '');\n let res = await fetch(url);\n moviesList = await res.json();\n } catch (error) {\n console.log(error);\n $('#errorMessage').text(\"Couldn't load JSON!\");\n }\n }\n displayMoviesToHtml(moviesList);\n}", "getAll() {\n return this.getDataFromServer(this.path);\n }", "function queryAllItems() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // for (var i = 0; i < res.length; i++) {\n // console.log(\n // res[i].item_id +\n // \" | \" +\n // res[i].product_name +\n // \" | \" +\n // res[i].department +\n // \" | \" +\n // res[i].price +\n // \" | \" +\n // res[i].stock_quantity\n // );\n // }\n // console.log(\"successfully quried products\");\n console.table(res);\n start(res);\n });\n}", "async function handler(req, res) {\n console.log(JSON.stringify(req, null, 2))\n let stopID = req.params.stopID\n let result = await data.stop.query({\n KeyConditionExpression: 'stop_id = :stopID',\n ExpressionAttributeValues: {\n ':stopID': stopID\n }\n })\n res({\n json: result.Items\n })\n}", "function onGetAllSuccess_GetResponseFromDatabaseWhereClause(records){\n isSuccess = true;\n ReturnRecords = (records);\n}", "function LQuery() {}", "function LQuery() {}", "function LQuery() {}", "function fetchQuery(\n\t\toperation,\n\t\tvariables,\n\t\tcacheConfig,\n\t\tuploadables,\n\t) {\n\t\treturn fetch('http://localhost:5000/graphql', {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t// Add authentication and other headers here\n\t\t\t\t'content-type': 'application/json'\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tquery: operation.text, // GraphQL text from input\n\t\t\t\tvariables,\n\t\t\t}),\n\t\t}).then(response => {\n\t\t\treturn response.json();\n\t\t});\n\t}", "async gatherDataFromServer(client) {\n const userPhids = [];\n const userPhidMap = new Map();\n\n const projPhids = [];\n const projPhidMap = new Map();\n\n // There is no specific \"apps.search\" call that can be made so we fall back\n // to using \"phid.query\" for PHID-APPS. This actually works across all\n // types, but the lookup results are less useful in addition to being less\n // detailed. Ex, \"fullName\" for a USER is `${username} (${realName})`.\n const genericPhids = [];\n const genericPhidMap = new Map();\n\n for (const [phid, info] of this._phidToInfo.entries()) {\n if (phid.startsWith('PHID-USER')) {\n userPhids.push(phid);\n userPhidMap.set(phid, info);\n } else if (phid.startsWith('PHID-PROJ')) {\n projPhids.push(phid);\n projPhidMap.set(phid, info);\n } else {\n genericPhids.push(phid);\n genericPhidMap.set(phid, info);\n }\n }\n\n let userSearchPromise;\n let projSearchPromise;\n let genericSearchPromise;\n\n if (userPhids.length > 0) {\n userSearchPromise = client.apiCall(\n 'user.search',\n {\n constraints: {\n phids: userPhids,\n }\n }\n );\n } else {\n userSearchPromise = Promise.resolve({ data: [] });\n }\n\n if (projPhids.length > 0) {\n projSearchPromise = client.apiCall(\n 'project.search',\n {\n constraints: {\n phids: projPhids,\n },\n }\n );\n } else {\n projSearchPromise = Promise.resolve({ data: [] });\n }\n\n if (genericPhids.length > 0) {\n genericSearchPromise = client.apiCall(\n 'phid.query',\n {\n phids: genericPhids,\n }\n );\n } else {\n genericSearchPromise = Promise.resolve({});\n }\n\n const userResults = await userSearchPromise;\n for (const userInfo of userResults.data) {\n const info = userPhidMap.get(userInfo.phid);\n // Remove the users as we match them up for invariant checking.\n userPhidMap.delete(userInfo.phid);\n\n info.name = userInfo.fields.realName;\n info.nick = `@${userInfo.fields.username}`;\n }\n\n const projResults = await projSearchPromise;\n for (const projInfo of projResults.data) {\n const info = projPhidMap.get(projInfo.phid);\n projPhidMap.delete(projInfo.phid);\n\n info.name = projInfo.description;\n info.nick = `#${projInfo.name}`;\n }\n\n const genericResults = await genericSearchPromise;\n // The results are an object dictionary where the `phid` of each value is\n // its key in the dictionary, so we don't need the key.\n for (const phidInfo of Object.values(genericResults)) {\n const info = genericPhidMap.get(phidInfo.phid);\n genericPhidMap.delete(phidInfo.phid);\n\n info.name = phidInfo.fullName;\n info.nick = `!${phidInfo.name}`;\n }\n\n if (userPhidMap.size !== 0) {\n console.warn('Some user lookups did not resolve:', userPhidMap);\n }\n if (projPhidMap.size !== 0) {\n console.warn('Some project lookups did not resolve:', projPhidMap);\n }\n if (genericPhidMap.size !== 0) {\n console.warn('Some generic/app lookups did not resolve:', genericPhidMap);\n }\n }", "function queryRequested (queryString, queryParams, callBack) {\n pool.getConnection(function (err, connection) {\n if (err) {\n console.log(err)\n }\n if (queryParams !== null) {\n connection.query(queryString, queryParams, callBack)\n connection.release()\n } else {\n connection.query(queryString, callBack)\n connection.release()\n }\n })\n}", "getData(){}", "function query(text, values, cb) {\n\t\tpool.connect(function(err, client, done) {\n\t\t\tif (err) { returnError(\"Error fetching client from pool: \" + err); }\n\t\t\tclient.query(text, values, function(err, result) {\n\t\t\t\tdone();\n\t\t\t\t// result.rows is is an array of Anonymous objects\n\t\t\t\t// Convert it to json using stringify and parse before returning it\n\t\t\t\tvar returnedRows = err ? [] : JSON.parse(JSON.stringify(result.rows));\n\t\t\t\tcb(err, returnedRows);\n\t\t\t});\n\t\t});\n\t}", "queryLists() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_bucketlist_belonging_to_user/\" + this.state.userData.id)\n .then(response => response.json())\n .then(obj => this.loadLists(obj));\n }", "query(options) {\n\n\n this.resource.onQuery(options).then(response => {\n\n // Callback function that should be called with the result object. The result object:\n //\n // result.results (object) - Array of result objects. The default renderers\n // expect objects with id and text keys. The id property is required,\n // even if custom renderers are used. The object may also contain a children\n // key if hierarchical data is displayed. The object may also contain a disabled\n // boolean property indicating whether this result can be selected.\n //\n // result.more (boolean) - true if more results are available for the current\n // search term.\n //\n // results.context (object) - A user-defined object that should be made available\n // as the context parameter to the query function on subsequent queries to load\n // more result pages for the same search term. See the description of\n // options.context parameter.\n options.callback({more: response.more, results: response.results});\n });\n }", "fetchWithGet(e) {\n let or_query = this.state.query\n // If value is not empty (did not select all), apply query\n if (e.target.value !== \"\") {\n or_query[e.target.name] = e.target.value\n } else {\n // Else remove filter from query array\n delete or_query[e.target.name]\n }\n this.setState({\n query: or_query\n })\n this.fetchData()\n }" ]
[ "0.67702353", "0.67365044", "0.654332", "0.65028936", "0.6469413", "0.63651663", "0.63122827", "0.6246417", "0.6240221", "0.6238856", "0.622833", "0.6227184", "0.62103575", "0.61777556", "0.61689365", "0.6163017", "0.6145435", "0.6144922", "0.6121435", "0.6102793", "0.6092311", "0.60842746", "0.6064822", "0.60615534", "0.6054682", "0.6051762", "0.60392034", "0.6031809", "0.6031546", "0.6028566", "0.60172105", "0.6011944", "0.6011209", "0.5999751", "0.59903485", "0.598688", "0.5975431", "0.5965875", "0.5952549", "0.5945891", "0.5945891", "0.5943501", "0.593402", "0.5915547", "0.59114087", "0.5900499", "0.58959293", "0.586608", "0.58583903", "0.58556104", "0.58501226", "0.58378667", "0.58312774", "0.5827307", "0.582675", "0.5824609", "0.5811494", "0.58027995", "0.5801201", "0.5797435", "0.5796009", "0.57917136", "0.57827973", "0.5779252", "0.57784206", "0.57754695", "0.57726896", "0.57680345", "0.5767743", "0.5767283", "0.5767283", "0.5767283", "0.5749884", "0.5748085", "0.5746299", "0.57456166", "0.5741331", "0.57402694", "0.57338876", "0.57301325", "0.5720378", "0.5704533", "0.57015246", "0.56995624", "0.5698738", "0.5689149", "0.56867164", "0.56849617", "0.56843394", "0.5680314", "0.56786937", "0.56786937", "0.56786937", "0.5675435", "0.566286", "0.5659965", "0.56589705", "0.5657203", "0.5654665", "0.56536466", "0.5652347" ]
0.0
-1
Explicitly handles the etner button on search bar
handleEnterButton(e){ var unsortedProdList = []; var sortedProdList = []; if(e.keyCode === 13){ this.state.productList.map((item,key)=>{ unsortedProdList.push(item); }); unsortedProdList.forEach((item) => { if(String(item['name']).includes(e.target.value)){ sortedProdList.push(item); } }) this.setState({productList: sortedProdList}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSearchButton(event) {\n if (\n event.target.label ==\n gSearchBundle.GetStringFromName(\"labelForSearchButton\")\n ) {\n onSearch();\n } else {\n onSearchStop();\n }\n}", "function clickSearchButton(e){\n _self.getDefaultPlace(_self.scope.inputSearch.value); \n }", "clickSearchBox(event) {\n if (!this.isSearching()) {\n this.startSearching();\n }\n }", "onActionClickSearchBar() {\n this.search(this.state.search)\n }", "function searchthis(e){\n $.search.value = \"keyword to search\";\n $.search.blur();\n focused = false;\n needclear = true;\n}", "handleOpenSearch(event) {\n this.searchButton = !this.searchButton;\n }", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function setSearch() {\r\n\tconst btn=document.querySelector('#searchbtn');\r\n\tbtn.addEventListener('click', searchCraft);\r\n\tconst bar = document.querySelector('#searchbar');\r\n\tbar.addEventListener(\"keyup\", function(event) {\r\n if (event.key === \"Enter\"|event.keyCode === 13) {\r\n searchCraft(event);\r\n\t }\r\n\t});\r\n}", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "function setQuery(event) { \r\n if(event.keyCode == 13) { //13 è l'unicode che corrisponde al tasto INVIO\r\n getResults(srchBar.value); //in input la città e in output le informazioni\r\n srchBar.value = \"\";\r\n circleBtnSearch.setAttribute(\"class\", \"not-active\");\r\n srchbar.hidden = !srchbar.hidden;\r\n }\r\n}", "function onclickForSearchButton(event)\n{\n //console.log(event);\n \n var q = document.getElementById('search-query').value; //escape here?\n \n //some kanji searches are going to be legitimately only one char.\n //we need a trim() function instead...\n if(q.length < 1)\n {\n return;\n }\n \n buttonSpinnerVisible(true);\n \n var matches = doEdictQueryOn(q);\n}", "handleSearchClick(e){\n this.toggleSearch();\n \n e.stopPropagation(); //parents not told of the click\n }", "function onSearchFocus() {\n if (activeSearch) {\n searchButton.className = \"pivot_searchbtn\"\n // pop up the suggestions as if we had pressed a key\n onSearchKeyPress({})\n } else {\n searchForm.className = \"\"\n searchBox.value = \"\"\n }\n /* note that this must be on mousedown, not onclick!\n mousedown on this element happens before blur on the text box,\n but before click on this element. we change the text box's contents\n on blur, so using mousedown is the easiest solution. */\n searchButton.onmousedown = onSearch\n }", "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "function clicked() {\n search()\n; }", "function searchEventListener() {\n\t$(\"#searchbtn\").click(function() {\n\t\tif ($(\"#searchbox\").val() != '') {\n\t\t\tsearchNewspapers($(\"#searchbox\").val());\n\t\t}\n\t});\n}", "function searchHandler(e) {\n \"use strict\";\n // Prevent default form action\n e.preventDefault();\n showFilteredBreeds();\n}", "onConfirmSearchBar() {\n //this.search(this.state.search)\n }", "handleSearchClick(){\n\n this.doSearch();\n\n }", "searchinputClickCallback(event) {\n event.target.select();\n this.searchinputCallback(event);\n }", "function addeventListener() {\n var button = document.getElementById('search-button');\n button.addEventListener('click', linearSearch);\n }", "handleSearchClick(event) {\n\t\tthis.props.onSearchClick(event, this.state);\n\t}", "function buttonSearch(){\n\tsearchTerm = this.attributes[2].value; \n\tsearchTerm = searchTerm.replace(/\\s+/g, '+').toLowerCase();\n\t\t\n \tdisplayGifs ();\n}", "function whatToSearch(){\n $(`.js-search`).on('click',function(){\n //will eventually ask to allow for location\n // make an if statement to set a global variable to winerie or taste room depending on which button was pressed.\n $(`.js-where`).removeClass('hidden')\n\n })\n}", "function onSearch() {\n var wasActive = !!activeSearch\n activeSearch = searchBox.value\n if (!wasActive) {\n viewer.addFilter(searchFilter)\n }\n clearOption.style.visibility = \"visible\"\n onSearchBlur()\n viewer.filter()\n refreshFilterPane()\n }", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function enableSearch() {\n if (id(\"search-term\").value.trim() !== \"\") {\n id(\"search-btn\").disabled = false;\n id(\"search-btn\").addEventListener(\"click\", searchPosts);\n }\n }", "function searchButtonHandler (e) {\n e.stopImmediatePropagation();\n e.preventDefault();\n/*\nlet button = e.button;\nlet target = e.target;\nlet classList = target.classList;\nconsole.log(\"searchButtonHandler event: \"+e.type+\" button: \"+button+\" phase: \"+e.eventPhase+\" target: \"+target+\" class: \"+target.classList);\n*/\n clearMenu(); // Clear any open menu\n\n//console.log(\"Magnifier glass context menu\");\n myMenu_open = myMGlassMenu_open = true;\n drawMenu(MyMGlassMenu, e.clientY, e.clientX);\n}", "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "function clickedSearch(e) {\n var newSearch = e.target.textContent;\n getSearchResults(newSearch);\n}", "get searchBtn () { return $('#searchButton') }", "function onSearchInput(e){\n //event? Yes? Set querey to whats in the search box. No? Set querey to nothing\n e \n ? setSearchString(e.target.value)\n : setSearchString('');\n console.log(`search input detected`)\n\n }", "function searchButtonSwitchMode (e) {\n//console.log(\"searchButtonHandler event: \"+e.type+\" button: \"+e.button+\" phase: \"+e.eventPhase);\n if (e.button == 1) {\n\tswitch (options.searchFilter) {\n\t case \"all\":\n\t\tsetSFilterFldrOnlyHandler();\n\t break;\n\t case \"fldr\":\n\t\toptions.searchField = \"both\"; // Reset which parts a search is made on to title + url\n\t\tsetSFilterBkmkOnlyHandler();\n\t\tbreak;\n\t case \"bkmk\":\n\t\tsetSFilterAllHandler();\n\t\tbreak;\n\t}\n }\n}", "_handleChange(e){let root=this;root._getSearchText(root.$.input.value);root.resultCount=0;root.resultPointer=0;root.dispatchEvent(new CustomEvent(\"simple-search\",{detail:{search:root,content:e}}))}", "searchinputCallback(event) {\n const inputVal = this.locationInput;\n if (inputVal) {\n this.getListQuery(inputVal);\n }\n else {\n this.queryItems = [];\n if (this.userSelectedOption) {\n this.userQuerySubmit('false');\n }\n this.userSelectedOption = '';\n if (this.settings.showRecentSearch) {\n this.showRecentSearch();\n }\n else {\n this.dropdownOpen = false;\n }\n }\n }", "search(){\n // Condition checks if nothing has been input when first entering website and clicking the button or when something is typed and then deleted\n // returns out of method if this is the case as there will be no results\n if(this.state === null || this.state.term === ''){\n return;\n }\n\n // Calls the passed down event handler search function from App.js\n this.props.onSearch(this.state.term);\n }", "function manageSearchTextHandler () {\n let value = SearchTextInput.value;\n\n // Clear input timeout if there was one active\n if (inputTimeout != null) {\n\tclearTimeout(inputTimeout);\n }\n\n /*\n * Set the cancel text image, and enable or disable it based on:\n * - 0 character = no image, disabled\n * - 1 or more character(s) = set the cancel image, enable the button\n */\n if (value.length > 0) {\n\tif (!options.searchOnEnter) { // Auto trigger search when no more key typed in\n\t // Set timeout before triggering / updating search mode\n\t inputTimeout = setTimeout(updateSearch, InputKeyDelay);\n\t}\n\tenableExecuteSearch();\n }\n else { // Clear search mode\n\tinputTimeout = null; // We just cleared any last timeout, so set to null\n\n\t// Remember search pane height if needed, before closing it\n\tlet sh = SearchResult.style.height; \n\tif (sh != \"\") { // The search result pane size is different\n\t \t\t\t\t// from its default value set in the CSS\n\t \t\t\t\t// which is 20% (as seen in Computed Style)\n\t if (options.rememberSizes) {\n\t\tif (options.searchHeight != sh) { // Save only if different from already saved\n\t\t options.searchHeight = sh;\n\t\t browser.storage.local.set({\n\t\t\tsearchheight_option: sh\n\t\t })\n\t\t .then(\n\t\t\tfunction () {\n\t\t\t // Signal change to all\n\t\t\t sendAddonMessage(\"savedOptions\");\n\t\t\t}\n\t\t );\n\t\t}\n\t }\n\t}\n\tdisableCancelSearch();\n\n\t// Discard the results table if any\n\tif (resultsTable != null) {\n\t SearchResult.removeChild(resultsTable);\n\t resultsTable = null;\n//\t resultsFragment = null;\n\t curResultRowList = {};\n\t}\n\n\t// If a row was highlighted, do not highlight it anymore\n//\tclearCellHighlight(rcursor, rlastSelOp, rselection.selectIds);\n\tcancelCursorSelection(rcursor, rselection);\n\n\t// Restore bookmarks tree to its initial visibility state\n\tresetTreeVisiblity();\n }\n}", "searchClicked(_) { console.log(this.state.term) }", "HandleSearch(e) {\n this.props.searchname(this.state.search);\n this.setState({ clicked: true, search: '' });\n this.props.handleClickParent(e);\n }", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function handleSearchV2() {\n $(\".blog-topbar .search-btn\").on(\"click\", function() {\n if (jQuery(\".topbar-search-block\").hasClass(\"topbar-search-visible\")) {\n jQuery(\".topbar-search-block\").slideUp();\n jQuery(\".topbar-search-block\").removeClass(\"topbar-search-visible\");\n } else {\n jQuery(\".topbar-search-block\").slideDown();\n jQuery(\".topbar-search-block\").addClass(\"topbar-search-visible\");\n }\n });\n $(\".blog-topbar .search-close\").on(\"click\", function() {\n jQuery(\".topbar-search-block\").slideUp();\n jQuery(\".topbar-search-block\").removeClass(\"topbar-search-visible\");\n });\n jQuery(window).scroll(function() {\n jQuery(\".topbar-search-block\").slideUp();\n jQuery(\".topbar-search-block\").removeClass(\"topbar-search-visible\");\n });\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "onSearch() {\n const {\n onBarsSearch,\n location\n } = this.props;\n onBarsSearch(location);\n }", "function handleSearch(e) {\n e.preventDefault();\n let input = document.getElementById('networkSearch');\n\t\tlet search = input.value;\n\t\tprops.handleSearch(search);\n\t\tinput.value = '';\n }", "searchClicked(_) {\n flikrSearch(this.state.term).fork(this.showError,this.updateResults)\n }", "function navbarSearchBoxOnClick(e) {\n console.log(e.keyCode);\n if (e.keyCode == 13) {\n //searchPostBy('fromSearchButtonType','fromSearchButtonUsername');\n searchPostBy('fromSearchButtonTypeMobile', 'fromSearchButtonUsername');\n }\n}", "function addSearchListener() {\n var target = $(\"#searchbar\");\n target.keyup(sendKeyup)\n}", "function searchPokemon (){\n searchButton.addEventListener\n}", "function onSearchSuggestionItemClick(e) { \r\n e.preventDefault();\r\n e.stopPropagation();\r\n var searchInput = $(\"#search-input\").focus().val('');\r\n searchInput.parent().addClass(\"active\");\r\n var searchInputText = $(this).attr(\"data-search-text\");\r\n var searchInputUrl = $(this).attr(\"data-search-url\");\r\n var searchInputUseGoogleSearch = $(this).attr(\"data-use-google-search\");\r\n searchInput.attr(\"data-search-url\", searchInputUrl);\r\n searchInput.attr(\"data-use-google-search\", searchInputUseGoogleSearch);\r\n searchInput.val(searchInputText).off(\"keyup\", makeGoogleSearch);\r\n $(\"#search-form\").submit();\r\n $(\"#search-suggestion\").hide();\r\n $(\"#search-input-box\").removeClass('with-suggestions');\r\n }", "function bindSearchIconEvent(searchElements) {\n\n WM.forEach(searchElements, function (ele) {\n var searchEle = WM.element('<a class=\"app-header-action wi wi-search\"></a>');\n WM.element(ele).before(searchEle);\n //Tap icon to show/hide search box\n bindTapEvtHandler(searchEle, function () {\n toggleSearchContainer(ele);\n });\n });\n\n }", "function setSearchClick(searchUrl) {\n $(\"#search-btn\").on(\"click\", function() {\n var searchInput = $(\"#search-input\").val();\n if (!searchInput == \"\") {\n $(\"#result-panels-wrapper\").html(\"\");\n getSearchData(searchUrl, searchInput);\n }\n });\n}", "function onSearchKeyPress(e) {\n switch (e.keyCode) {\n case 38:\n // up arrow\n updateSuggestion(currentSuggestion - 1)\n break\n case 40:\n // down arrow\n updateSuggestion(currentSuggestion + 1)\n break\n case 13:\n // enter. it'll submit the form, but let's unfocus the text box first.\n inputElmt.focus()\n break\n default:\n nextSearch = searchBox.value\n var searchResults = viewer.runSearch(nextSearch, true)\n searchSuggestions.innerHTML = \"\"\n currentSuggestion = -1\n suggestionsCount = 0\n addWordWheelResults(searchResults.front)\n addWordWheelResults(searchResults.rest)\n }\n }", "function submit_search(event) {\n if (event.keyCode == 13) {\n $('#we-yxname-search').click();\n }\n}", "search(e){\n \n\t e.preventDefault();\n\t let input = document.querySelector('#photo-search');\n\t let term = input.value;\n\t \n\t if(term.length > 2){\t\t \n\t\t input.classList.add('searching');\n\t\t this.container.classList.add('loading');\n\t\t this.search_term = term;\n\t\t this.is_search = true;\n\t\t this.doSearch(this.search_term);\t\t \n\t } else {\t\t \n\t\t input.focus();\t\t \n\t }\n\t \n }", "function bindSearchHandler() {\n document.getElementById(\"search\").addEventListener(\"input\", searchHander);\n}", "searchClicked(e) { flickrSearch(this.state.term).fork(this.props.showError, this.updateResults ) }", "function enableExecuteSearch () {\n CancelSearchInput.src = \"/icons/enter.png\";\n CancelSearchInput.disabled = false;\n sboxState = SBoxChanging;\t// Content of search box is changing\n}", "onTextInput(event) {\r\n this.searchValue = event.target.value;\r\n if (this.searchValue.trim().length >= 1) {\r\n this.showSearchBoxList = true;\r\n const apiEndpoint = `${process.env.GOOGLE_PLACE_API_URL}${this.apiKey}&types=(${this.searchType})&language=${dxp.i18n.languages[0]}&input=${this.searchValue}`;\r\n this.getData(apiEndpoint).then(async (data) => {\r\n if (data) {\r\n this.filterItemsJson = data;\r\n if (this.filterItemsJson['predictions']) {\r\n this.filterItemsJson = this.filterItemsJson['predictions'];\r\n }\r\n if (this.filterItemsJson.length) {\r\n this.responseFlag = true;\r\n }\r\n }\r\n });\r\n }\r\n if (this.showSearchBoxList === false) {\r\n this.showSearchBoxList = !this.showSearchBoxList;\r\n }\r\n }", "function searchBarHander(e) {\n let inputText = e.target.value.toLowerCase();\n // Filtering the list based on user's input in Search bar\n toDoList.filter(function (task) {\n let taskText = task.text;\n let taskId = task.idNum;\n let element = document.querySelector(\n \"[data-task-id=\" + CSS.escape(taskId) + \"]\"\n );\n // if the user's input was found in the list, show that, and hide others\n if (taskText.toLowerCase().indexOf(inputText) != -1) {\n element.style.display = \"grid\";\n } else {\n element.style.display = \"none\";\n }\n });\n}", "function search(){\n $('.search-small').click(function(){\n $('.nav-search').fadeIn();\n })\n $(\".nav-search\").click(function(){\n $(this).fadeOut();\n })\n $(\".closesearch\").click(function(){\n $(\".nav-search\").fadeOut();\n })\n $(\".nav-search .form-control\").click(function(e){\n e.stopPropagation();\n })\n}", "function focusSearchBoxListener(){ $('#query').val('').focus() }", "function onClearSearch() {\n $('#search').val('');\n $('#types .btn-primary').removeClass('btn-primary').addClass('btn-light');\n $('#clear-filter').fadeOut();\n $('#items').children().fadeIn();\n $('#items').unmark();\n }", "function search_keypress(evt) {\n}", "addHandlerSearch(handler) {\n this._parentElement.addEventListener('submit', function (e) {\n e.preventDefault();\n handler();\n });\n }", "function manualSearch(e) {\n let term = document.querySelector(\"#searchTerm\").value;\n term = term.trim();\n if (term.length < 1) return;\n manualSearchData(term.toLowerCase());\n}", "onKeyUp(e) {\n if (e.keyCode === 13) {\n this.search();\n }\n }", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "cmdGlodaSearchDownSell(aEvent) {\n aEvent.stopPropagation();\n this._showFilterBar(true);\n let textWidget = document.getElementById(QuickFilterManager.textBoxDomId);\n textWidget.select();\n }", "function searchFor(what){\n\tdocument.forms['searchForm'].elements['search'].value=what; // In case called from elsewhere we fill in the search field for referencing back to it.\n\tgo.click(); // this functionality is in bclp_ext_tabs.js as it is all done as part of the tabs object. It's the handler part of Ext.widget with id 'go'\n}", "function searchOnKeyUp(e) {\n // Filter out up, down, esc keys\n const keyCode = e.keyCode;\n const cannotBe = [40, 38, 27];\n const isSearchBar = e.target.id === \"search-bar\";\n const keyIsNotWrong = !cannotBe.includes(keyCode);\n if (isSearchBar && keyIsNotWrong) {\n // Try to run a search\n runSearch(e);\n }\n}", "function selectingButtonListener() {\n var button = $('.contacts-search-bar button');\n button.click(searchToArrow);\n}", "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function onkeyForSearchInput(event)\n{\n //.charCode or .keyCode ??\n if(event.keyCode == 13) //ENTER key\n {\n //trigger already registered \"click\" handler\n document.getElementById('search-button').click();\n }\n}", "searchToClick() {\n\n\n\n this.axiosSearch(\"movie\");\n this.axiosSearch(\"tv\");\n\n }", "submitSearch() {\n console.log('Searching for repositories...');\n function prevDefault(e) {\n e.preventDefault();\n };\n}", "handleSearch() {\n if (this.state.searchTerm) {\n this.props.onSearch(this.state.searchTerm);\n }\n else {\n return;\n }\n }", "function search() {\n\t\n}", "function handleSearchV1() {\n jQuery('.header-v5 .search-button').click(function () {\n jQuery('.header-v5 .search-open').slideDown();\n });\n\n jQuery('.header-v5 .search-close').click(function () {\n jQuery('.header-v5 .search-open').slideUp();\n });\n\n jQuery(window).scroll(function(){\n if(jQuery(this).scrollTop() > 1) jQuery('.header-v5 .search-open').fadeOut('fast');\n });\n }", "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n }", "function clickPrereqSearch(){\n\t\t$(\"#prereq_search_icon\").click(function(){\n\t\t\tsearchPrereq(); \n\t\t});\n\n\t\t$('#prereq_search_input').keypress(function(event){\n\t\t var keycode = (event.keyCode ? event.keyCode : event.which);\n\t\t if(keycode == '13'){\n\t\t searchPrereq(); \n\t\t }\n\t\t});\n\t}", "function configureSearchInput()\n{\n document.getElementById('search-query').\n addEventListener('keypress', onkeyForSearchInput, false);\n}", "_handleEnter() {\n const properties = virtualKeyboard.getActiveTags()\n const character = properties.text\n if (character === KEYBOARD.setup.deleteSymbol) {\n this._handleBack()\n return\n }\n searchBox.addCharacter(character)\n this.tag('SearchText').text.text = searchBox.getText()\n }", "handleSearchBar()\n {\n this._page = 1;\n this._searchBar = $(\"#searchBar\").val();\n this.getBooks();\n }", "butonSubmitRechercher() {\n return cy.get('.Search--button');\n }", "function onSearchBlur() {\n if (activeSearch) {\n searchBox.value = activeSearch\n searchButton.className = \"pivot_searchbtn pivot_clrsearch\"\n searchButton.onmousedown = clearSearch\n } else {\n searchForm.className = \"pivot_watermark\"\n searchBox.value = \"Search...\"\n searchButton.onmousedown = null\n }\n searchSuggestions.innerHTML = \"\"\n currentSuggestion = -1\n suggestionsCount = 0\n }", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "function submitSearch(event) {\n var textElement = event.target;//use instead of SrcElement, which is depreciated\n var btnName = textElement.id.replace(\"Box\", \"Btn\");\n var targetBtn = document.getElementById(btnName);\n if (event.keyCode === 13 || event.which ===13) {\n targetBtn.click();\n event.preventDefault();//prevent default event handling for pressing enter (which is to submit the form)\n event.stopPropagation();\n }\n}", "function handleOneSearch() {\n $(\"#search-screen-header\").hide();\n $(\"#js-search-one\").on(\"click\", event => {\n event.preventDefault();\n $(\"#main-screen-header\").hide();\n $(\"#similars-search-screen-header\").hide();\n $(\"#js-multi-search-option\").hide();\n $(\"#js-search-one\").hide();\n $(\"#one-movie-search\").show();\n $(\"#search-screen-header\").show();\n });\n }", "function handleSearch(e){\n setSearch(()=>e.target.value)\n e.preventDefault()\n search && fetch(search_api+search)\n .then((res)=>res.json())\n .then((data)=>{setMovies((pv)=>pv=data.results)}) \n if(e.target.value==='' ||e.target.value===undefined ){\n setTrending(!trending)\n }\n if(movies===undefined){\n setTxt('')\n }\n}", "afterSearch(searchText, result) {\n }", "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function onSearchComplete() {\n $('events').hide(); $('search-results').show(); $('back-to-events-button').show();\n}", "function keyEventSearchPerson(e){\n var event1 = e || window.event;\n if(event1.keyCode == 13){\n $('#btn-searchPerson').click();\n }\n}", "function handleSearchKeystroke(event) {\r\n searchText = document.getElementById('search').value.toLowerCase().trim();\r\n let matchingBooks = allBooks.filter(book => book.title.toLowerCase().includes(searchText) || book.author.toLowerCase().includes(searchText));\r\n removeBooksFromDOM();\r\n matchingBooks.forEach(function (book) {\r\n insertNewBook(book.id, book.title, book.author, book.subject, book.photoURL, book.vendorURL, book.favorite);\r\n });\r\n applyEventListeners();\r\n}", "function userNormalSearch(e){\n\te.preventDefault();\n\tsearchTerm = $('#search').val().trim(); \n\tuserSearch();\n}", "function HB_Element_SearchBox() {\n\n\t \t$( '.hb-search .open.show-full-screen' ).on( 'click', function() {\n\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.parents( '.hb-search' );\n\n\t\t\t/*******************************************************************\n\t\t\t * Render HTML for effect *\n\t\t\t ******************************************************************/\n\t\t\t var sidebar_content = parent.find( '.hb-search-fs' )[ 0 ].outerHTML;\n\t\t\t $( 'body' ).append( sidebar_content );\n\n\t\t\t var background_style = $( this ).attr( 'data-background-style' );\n\t\t\t var layout = $( this ).attr( 'data-layout' );\n\t\t\t var search_form = $( 'body > .hb-search-fs' );\n\n\t\t\t if ( layout == 'topbar' && $( this ).hasClass( 'active-topbar' ) ) {\n\t\t\t \tsearch_close();\n\t\t\t } else {\n\n\t\t\t \tswitch ( layout ) {\n\t\t\t \t\tcase 'full-screen':\n\t\t\t \t\tsearch_form.fadeIn( 300 );\n\t\t\t \t\t$( 'html' ).addClass( 'no-scroll' );\n\t\t\t \t\tbreak;\n\t\t\t \t\tcase 'topbar':\n\n\t\t\t \t\tvar admin_bar = $( '#wpadminbar' );\n\t\t\t \t\tvar margin_top = admin_bar.length ? admin_bar.height() : '0';\n\n\t\t\t \t\t$( this ).addClass( 'active-topbar' );\n\n\t\t\t \t\tsearch_form.css( {\n\t\t\t \t\t\t'display': 'block',\n\t\t\t \t\t\t'top': ( margin_top - 80 ) + 'px'\n\t\t\t \t\t} ).animate( {\n\t\t\t \t\t\t'top': margin_top + 'px'\n\t\t\t \t\t} );\n\t\t\t \t\t$( 'body > .wrapper-outer' ).css( {\n\t\t\t \t\t\t'position': 'relative',\n\t\t\t \t\t\t'top': '0px'\n\t\t\t \t\t} ).animate( {\n\t\t\t \t\t\t'top': '80px'\n\t\t\t \t\t} );\n\n\t\t\t \t\tbreak;\n\t\t\t \t}\n\n\t\t\t \tsearch_form.addClass( background_style + ' ' + layout );\n\t\t\t \tsearch_form.find( '.close' ).attr( 'data-layout', layout );\n\t\t\t \tsearch_form.find( 'form input' ).focus();\n\t\t\t }\n\n\t\t\t} );\n\n\t \tfunction search_close() {\n\t \t\tvar _this = $( 'body > .hb-search-fs .close' );\n\t \t\tvar layout = _this.attr( 'data-layout' );\n\n\t \t\tswitch ( layout ) {\n\t \t\t\tcase 'full-screen':\n\t \t\t\t$( 'body > .hb-search-fs' ).fadeOut( 300, function() {\n\t \t\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t \t\t\t\t$( 'body > .hb-search-fs' ).remove();\n\t \t\t\t\t$( 'body > .wrapper-outer' ).removeAttr( 'style' );\n\t \t\t\t} );\n\t \t\t\tbreak;\n\t \t\t\tcase 'topbar':\n\t \t\t\tvar admin_bar = $( '#wpadminbar' );\n\t \t\t\tvar margin_top = admin_bar.length ? admin_bar.height() : '0';\n\n\t \t\t\t$( 'body > .hb-search-fs' ).animate( {\n\t \t\t\t\t'top': ( margin_top - 80 ) + 'px'\n\t \t\t\t}, function() {\n\t \t\t\t\t$( this ).remove();\n\t \t\t\t} );\n\n\t \t\t\t$( 'body > .wrapper-outer' ).animate( {\n\t \t\t\t\t'top': '0px'\n\t \t\t\t}, function() {\n\t \t\t\t\t$( this ).removeAttr( 'style' );\n\t \t\t\t} );\n\n\t \t\t\tbreak;\n\t \t\t}\n\n\t \t\t$( '.header .hb-search' ).find( '.open.active-topbar' ).removeClass( 'active-topbar' );\n\t \t}\n\n\t \t$( 'body' ).on( 'click', '.hb-search-fs .close', function() {\n\t \t\tsearch_close();\n\t \t} );\n\n\t \t$( '.header .hb-search.dropdown .open' ).click( function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parents = _this.closest( '.hb-search' );\n\t \t\tvar search_form = parents.find( '.search-form:first' );\n\t \t\tvar index_current = $( '.header .hb-search.dropdown' ).index( parents );\n\t \t\tvar parents_info = parents[ 0 ].getBoundingClientRect();\n\t \t\tvar border_top_width = parseInt( parents.css( 'borderTopWidth' ) );\n\t \t\tvar border_bottom_width = parseInt( parents.css( 'borderBottomWidth' ) );\n\n\t\t\t// Remove active element item more\n\t\t\t$( '.header .hb-search.dropdown:not(:eq(' + index_current + '))' ).removeClass( 'active-dropdown' );\n\n\t\t\tif ( parents.hasClass( 'active-dropdown' ) ) {\n\t\t\t\tparents.removeClass( 'active-dropdown' );\n\t\t\t\tsearch_form.removeClass( 'set-width' );\n\t\t\t} else {\n\t\t\t\tWR_Click_Outside( _this, '.hb-search', function( e ) {\n\t\t\t\t\tparents.removeClass( 'active-dropdown' );\n\t\t\t\t\tsearch_form.removeClass( 'set-width' );\n\t\t\t\t} );\n\n\t\t\t\t// Reset style\n\t\t\t\tsearch_form.removeAttr( 'style' );\n\n\t\t\t\tvar width_content_broswer = $( window ).width();\n\n\t\t\t\tif ( search_form.width() > ( width_content_broswer - 10 ) ) {\n\t\t\t\t\tsearch_form.css( 'width', ( width_content_broswer - 10 ) );\n\t\t\t\t\tsearch_form.addClass( 'set-width' );\n\t\t\t\t}\n\n\t\t\t\tvar width_content_broswer = $( window ).width();\n\t\t\t\tvar search_form_info = search_form[ 0 ].getBoundingClientRect();\n\t\t\t\tvar current_info = _this[ 0 ].getBoundingClientRect();\n\n\t\t\t\t// Get offset\n\t\t\t\tvar offset_option = ( width_content_broswer > 1024 ) ? parseInt( WR_Data_Js[ 'offset' ] ) : 0;\n\n\t\t\t\t// Set left search form if hide broswer because small\n\t\t\t\tif ( width_content_broswer < ( search_form_info.right + 5 ) ) {\n\t\t\t\t\tvar left_search_form = ( search_form_info.right + 5 + offset_option ) - width_content_broswer;\n\t\t\t\t\tsearch_form.css( 'left', -left_search_form + 'px' );\n\t\t\t\t} else if ( search_form_info.left < ( 5 + offset_option ) ) {\n\t\t\t\t\tsearch_form.css( 'left', '5px' );\n\t\t\t\t}\n\n\t\t\t\tvar margin_top = ( parents.attr( 'data-margin-top' ) == 'empty' ) ? parents.attr( 'data-margin-top' ) : parseInt( parents.attr( 'data-margin-top' ) );\n\n\t\t\t\t// Remove margin top when stick\n\t\t\t\tif ( _this.closest( '.sticky-row-scroll' ).length || margin_top == 'empty' ) {\n\t\t\t\t\tvar parent_sticky_info = _this.closest( ( _this.closest( '.sticky-row-scroll' ).length ? '.sticky-row' : '.hb-section-outer' ) )[ 0 ].getBoundingClientRect();\n\t\t\t\t\tvar offset_top = parseInt( ( parent_sticky_info.bottom - parents_info.bottom ) + ( parents_info.height - border_top_width ) );\n\n\t\t\t\t\tsearch_form.css( 'top', offset_top );\n\t\t\t\t} else if ( margin_top > 0 ) {\n\t\t\t\t\tsearch_form.css( 'top', ( margin_top + ( parents_info.height - ( border_top_width + border_bottom_width ) ) ) );\n\t\t\t\t}\n\n\t\t\t\tparents.addClass( 'active-dropdown' );\n\n\t\t\t\t// Set width input if overflow\n\t\t\t\tvar ls_form = parents.find( '.wrls-form' );\n\n\t\t\t\tif( ls_form.length ) {\n\t\t\t\t\tvar width_cate = parents.find( '.cate-search-outer' ).width();\n\t\t\t\t}\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tparents.find( '.txt-search' ).focus();\n\t\t\t\t}, 300 );\n\t\t\t}\n\t\t} );\n\n\t \t/* Action for expand width */\n\t \t$( '.header .hb-search.expand-width .open' ).on( 'click', function( event ) {\n\t \t\tvar _this = $( this );\n\t \t\tvar parents = _this.closest( '.hb-search' );\n\t \t\tvar form_search = parents.find( '.search-form form' )\n\t \t\tvar info_form = form_search[ 0 ].getBoundingClientRect();\n\t \t\tvar width_form = info_form.width;\n\t \t\tvar header = _this.closest( '.header' );\n\t \t\tvar is_vertical = header.hasClass( 'vertical-layout' );\n\t \t\tvar is_expand_right = true;\n\n\t \t\tif ( parents.hasClass( 'expan-width-active' ) ) {\n\t \t\t\tform_search.stop( true, true ).css( {\n\t \t\t\t\toverflow: 'hidden'\n\t \t\t\t} ).animate( {\n\t \t\t\t\twidth: '0px'\n\t \t\t\t}, 200, function() {\n\t \t\t\t\tparents.removeClass( 'expan-width-active' );\n\t \t\t\t\tform_search.removeAttr( 'style' );\n\n\t \t\t\t\t/*** Show elements element current ***/\n\t \t\t\t\tvar parents_container = _this.closest( '.container' ).find( '.hide-expand-search' );\n\n\t \t\t\t\tparents_container.css( 'visibility', '' ).animate( {\n\t \t\t\t\t\topacity: 1\n\t \t\t\t\t}, 200, function() {\n\t \t\t\t\t\tparents_container.removeClass( 'hide-expand-search' );\n\t \t\t\t\t\t$( this ).css( 'opacity', '' );\n\t \t\t\t\t} );\n\t \t\t\t} );\n\t \t\t} else {\n\t \t\t\tWR_Click_Outside( _this, '.hb-search', function( e ) {\n\t \t\t\t\tform_search.stop( true, true ).css( {\n\t \t\t\t\t\toverflow: 'hidden'\n\t \t\t\t\t} ).animate( {\n\t \t\t\t\t\twidth: '0px'\n\t \t\t\t\t}, 200, function() {\n\t \t\t\t\t\tparents.removeClass( 'expan-width-active' );\n\t \t\t\t\t\tform_search.removeAttr( 'style' );\n\n\t \t\t\t\t\t/*** Show elements element current ***/\n\t \t\t\t\t\tvar parents_container = _this.closest( '.container' ).find( '.hide-expand-search' );\n\n\t \t\t\t\t\tparents_container.css( 'visibility', '' ).animate( {\n\t \t\t\t\t\t\topacity: 1\n\t \t\t\t\t\t}, 200, function() {\n\t \t\t\t\t\t\tparents_container.removeClass( 'hide-expand-search' );\n\t \t\t\t\t\t\t$( this ).css( 'opacity', '' );\n\t \t\t\t\t\t} );\n\t \t\t\t\t} );\n\t \t\t\t} );\n\n\t \t\t\tvar info_search_current = _this[ 0 ].getBoundingClientRect();\n\t \t\t\tvar width_ofset_left = info_search_current.left + info_search_current.width / 2;\n\t \t\t\tvar width_broswer = document.body.offsetWidth;\n\t \t\t\tvar width_open = parents.outerWidth();\n\n\t \t\t\tif ( is_vertical ) {\n\n\t \t\t\t\tvar info_parents = parents[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar info_header = header[ 0 ].getBoundingClientRect();\n\n\t\t\t\t\t// Left position\n\t\t\t\t\tif ( header.hasClass( 'left-position-vertical' ) ) {\n\t\t\t\t\t\tis_expand_right = ( info_parents.left - info_header.left - 10 ) >= info_form.width ? false : true;\n\n\t\t\t\t\t\t// Right position\n\t\t\t\t\t} else {\n\t\t\t\t\t\tis_expand_right = ( info_header.right - info_parents.right - 10 ) >= info_form.width ? true : false\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tis_expand_right = width_ofset_left * 2 < width_broswer;\n\t\t\t\t}\n\n\t\t\t\t// Expand right\n\t\t\t\tif ( is_expand_right ) {\n\n\t\t\t\t\t/** * Hide elements right element current ** */\n\t\t\t\t\tvar list_next_all = parents.nextUntil();\n\n\t\t\t\t\tif ( list_next_all.length ) { console.log( 'fasdf' );\n\t\t\t\t\tvar width_next = 0;\n\n\t\t\t\t\tvar handle_animate = function() {\n\t\t\t\t\t\tform_search.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: width_open + 5,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tvisibility: 'initial'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\twidth: width_form\n\t\t\t\t\t\t}, 200, function() {\n\t\t\t\t\t\t\t$( this ).css( 'overflow', '' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( !is_vertical ) {\n\t\t\t\t\t\tlist_next_all.each( function( key, val ) {\n\t\t\t\t\t\t\tif ( width_next < width_form ) {\n\t\t\t\t\t\t\t\t$( val ).animate( {\n\t\t\t\t\t\t\t\t\topacity: 0\n\t\t\t\t\t\t\t\t}, 200, function() {\n\t\t\t\t\t\t\t\t\t$( val ).css( 'visibility', 'hidden' )\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t$( val ).addClass( 'hide-expand-search' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twidth_next += $( val ).outerWidth( true );\n\n\t\t\t\t\t\t\tif ( width_next > width_form )\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tsetTimeout( handle_animate, 200 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandle_animate();\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t\t// Expand width form search\n\t\t\t\t\t\tform_search.stop( true, true ).css( {\n\t\t\t\t\t\t\tleft: width_open + 5,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tvisibility: 'initial'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\twidth: width_form\n\t\t\t\t\t\t}, 200, function() {\n\t\t\t\t\t\t\t$( this ).css( 'overflow', '' );\n\t\t\t\t\t\t} );\n\n\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Expand left\n\t\t\t\t} else {\n\n\t\t\t\t\t/*** Hide elements left near element current ***/\n\t\t\t\t\tvar list_prev_all = parents.prevUntil();\n\n\t\t\t\t\tif ( list_prev_all.length ) {\n\t\t\t\t\t\tvar width_prev = 0;\n\n\t\t\t\t\t\tvar handle_animate = function() {\n\t\t\t\t\t\t\tform_search.stop( true, true ).css( {\n\t\t\t\t\t\t\t\tright: width_open + 5,\n\t\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t\tvisibility: 'initial'\n\t\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\t\twidth: width_form\n\t\t\t\t\t\t\t}, 200, function() {\n\t\t\t\t\t\t\t\t$( this ).css( 'overflow', '' );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif ( !is_vertical ) {\n\t\t\t\t\t\t\tlist_prev_all.each( function( key, val ) {\n\t\t\t\t\t\t\t\tif ( width_prev < width_form ) {\n\t\t\t\t\t\t\t\t\t$( val ).animate( {\n\t\t\t\t\t\t\t\t\t\topacity: 0\n\t\t\t\t\t\t\t\t\t}, 200, function() {\n\t\t\t\t\t\t\t\t\t\t$( val ).css( 'visibility', 'hidden' )\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t$( val ).addClass( 'hide-expand-search' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\twidth_prev += $( val ).outerWidth( true );\n\n\t\t\t\t\t\t\t\tif ( width_prev > width_form )\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tsetTimeout( handle_animate, 200 );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thandle_animate();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Expand width form search\n\t\t\t\t\t\tform_search.stop( true, true ).css( {\n\t\t\t\t\t\t\tright: width_open + 5,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tvisibility: 'initial'\n\t\t\t\t\t\t} ).animate( {\n\t\t\t\t\t\t\twidth: width_form\n\t\t\t\t\t\t}, 200, function() {\n\t\t\t\t\t\t\t$( this ).css( 'overflow', '' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tparents.addClass( 'expan-width-active' );\n\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tparents.find( '.txt-search' ).focus();\n\t\t\t\t}, 300 );\n\t\t\t}\n\t\t} );\n\n/* Action for Boxed */\n$( '.header .hb-search.boxed .open' ).on( 'click', function() {\n\tvar _this = $( this );\n\tvar parents = _this.parents( '.hb-search' );\n\tparents.find( 'input[type=\"submit\"]' ).trigger( 'click' );\n} );\n}", "handleClickEvent() {\n this.props.fetchSearch(this.state.search)\n }", "_addSearchBarEvents() {\n const searchBarForm = document.getElementById(\"search-bar-form\");\n const searchBarInput = document.getElementById(\"search-bar-input\");\n\n searchBarForm.onclick = (e) => e.stopPropagation();\n\n searchBarInput.onfocus = () => {\n this._closeAllFiltersExceptClicked();\n };\n\n searchBarInput.oninput = (e) => {\n let recipesListToDisplay;\n\n if (searchBarInput.value.length >= 3) {\n recipesListToDisplay = this.getRecipesListToDisplay();\n\n this._displaySearchResultMessage(recipesListToDisplay);\n } else if (this._badgesList.length > 0) {\n recipesListToDisplay = this._recipesList.search(\n {\n userInput: \"\",\n joinedBadges: this._userRequest.joinedBadges,\n },\n this._hashTableForSearchingRecipes\n );\n\n this._displaySearchResultMessage(recipesListToDisplay);\n } else {\n recipesListToDisplay = this._recipesList;\n\n const messageAside = document.getElementById(\"message\");\n\n messageAside.classList.remove(\"opened\");\n }\n\n this._renderFiltersOptions(\n this.getItemsListsToDisplay(recipesListToDisplay)\n );\n this._renderCards(recipesListToDisplay);\n };\n\n searchBarForm.onsubmit = (e) => {\n e.preventDefault();\n searchBarInput.blur();\n };\n }" ]
[ "0.7752137", "0.76469797", "0.74152416", "0.7324277", "0.7211574", "0.7202888", "0.7197784", "0.7162076", "0.71501607", "0.7042931", "0.69985706", "0.69935787", "0.69819283", "0.69747907", "0.6967185", "0.6954629", "0.6949268", "0.691358", "0.68608326", "0.6825792", "0.6824238", "0.67896444", "0.67884356", "0.677439", "0.6770675", "0.676943", "0.6768761", "0.67508036", "0.6748843", "0.6743123", "0.6727621", "0.6721549", "0.67047757", "0.6682141", "0.6676065", "0.6660395", "0.6638159", "0.66356987", "0.661922", "0.6616573", "0.660266", "0.6601182", "0.659505", "0.659505", "0.65908355", "0.6585676", "0.65794045", "0.6572675", "0.6566413", "0.6536659", "0.65354794", "0.65291625", "0.65201753", "0.6517729", "0.65102077", "0.6510153", "0.6506756", "0.65050554", "0.6504312", "0.649962", "0.6492727", "0.6491265", "0.64824164", "0.6477064", "0.6476786", "0.64757264", "0.6470748", "0.6469563", "0.64682806", "0.6468126", "0.6462155", "0.646088", "0.6457426", "0.64511585", "0.6447437", "0.64449507", "0.6432602", "0.6423435", "0.64224726", "0.6420721", "0.64191985", "0.6413991", "0.6411318", "0.6409126", "0.6406458", "0.64013344", "0.64002204", "0.63985723", "0.63898826", "0.6389492", "0.6389203", "0.6386828", "0.6386193", "0.637843", "0.6368554", "0.63651776", "0.63633865", "0.63596463", "0.6349509", "0.63356006", "0.63337874" ]
0.0
-1
Handles the query entered in the search bar
handleInputSearchBar(e){ this.setState({ query:e.target.value },() => { if(this.state.query && this.state.query.length>1){ if(this.state.query.length % 2 === 0){ this.getProductDataList(); } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function handleQuery () {\n var searchText = $scope.searchText,\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "function handleQuery(){var searchText=$scope.searchText||'';var term=searchText.toLowerCase();// If caching is enabled and the current searchText is stored in the cache\n\tif(!$scope.noCache&&cache[term]){// The results should be handled as same as a normal un-cached request does.\n\thandleResults(cache[term]);}else{fetchResults(searchText);}ctrl.hidden=shouldHide();}", "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function getInput() {\n\t\t\tsearchBtn.addEventListener('click', () => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchTerm = searchValue.value.toLowerCase();\n\t\t\t\tconsole.log(searchTerm);\n\t\t\t\tresults.innerHTML = ''; // clear page for new results\n\t\t\t\tgetData(searchTerm); // run w/ searchTerm\n\t\t\t\tformContainer.reset();\n\t\t\t});\n\t\t}", "function setQuery(event) {\n if (event.keyCode === 13) {\n getResults(searchbox.value);\n }\n}", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function search() {\n var query_value = $('input#searchbar').val();\n $('b#search-string').html(query_value);\n if(query_value !== ''){\n $.ajax({\n type: \"POST\",\n url: \"/g5quality_2.0/search.php\",\n data: { query: query_value },\n cache: false,\n success: function(html){\n $(\"ul#results\").html(html);\n }\n });\n }return false;\n }", "onSearchTextChange(query) {\n this.props.searchTextChanged(query); /**fire action creator for input field */\n this.props.searchText(query); /** pass query to datasource filter */\n }", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "searchinputCallback(event) {\n const inputVal = this.locationInput;\n if (inputVal) {\n this.getListQuery(inputVal);\n }\n else {\n this.queryItems = [];\n if (this.userSelectedOption) {\n this.userQuerySubmit('false');\n }\n this.userSelectedOption = '';\n if (this.settings.showRecentSearch) {\n this.showRecentSearch();\n }\n else {\n this.dropdownOpen = false;\n }\n }\n }", "function handleQuery(pageControl, args) {\n var originalResults;\n app.sessionState.lastSearch = args.queryText;\n //this.initializeLayout(element.querySelector(\".resultslist\").winControl, Windows.UI.ViewManagement.ApplicationView.value);\n searchData(pageControl, args.queryText);\n }", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function handleQueryInput() {\n const value = queryInput.value;\n if (value.length > 2) {\n // debounce text entry\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n doSearch(value);\n }, DEBOUNCE_DELAY);\n }\n}", "function searchVenue(){\n\t\t$(\"#query\").click(function(){\n\t\t\t$(this).val(\"\");\n\t\t});\n\n\t\t$(\"#query\").blur(function(){\n\t\t\tif ($(this).val() == \"\") {\n\t\t\t\t$(this).val(\"Example: Ninja Japanese Restaurant\");\n\t\t\t}\n\t\t\n\t\t\tif ($(this).val() != \"Example: Ninja Japanese Restaurant\") {\n\t\t\t\t$(this).addClass(\"focus\");\n\t\t\t} else {\n\t\t\t\t$(this).removeClass(\"focus\");\n\t\t\t}\n\t\t});\n\n\t\t//Submit search query and call to getVenues\n\t\t$(\"#searchform\").submit(function(event){\n\t\t\tevent.preventDefault();\n\t\t\tif (!lat) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(getLocation);\n\t\t\t} else {\n\t\t\t\tgetVenues();\n\t\t\t}\t\t\n\t\t});\n\n\t}", "function searchQuery(){\n\t// clear the previous search results\n\t$(\"#content\").html(\"\");\n\t// get the query from the search box\n\tvar query = $(\"#searchBox\").val().replace(\" \", \"%20\");\n\tdisplaySearchResults(query);\n\t// clear search box for next query\n\t$(\"#searchBox\").val(\"\");\n}", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function handleSearchSubmit(event) {\n event.preventDefault()\n setQuery(event.target.search.value)\n history.push('/search')\n }", "function setQuery() {\n getSearch(search.value);\n}", "function setQuery(event){ // If enter is press store value in getResults()\n if(event.keyCode == 13){\n getResults(searchBox.value);\n }\n}", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n SongsService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n songService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function manualSearch(e) {\n let term = document.querySelector(\"#searchTerm\").value;\n term = term.trim();\n if (term.length < 1) return;\n manualSearchData(term.toLowerCase());\n}", "function do_search() {\n var query = input_box.val();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= $(input).data(\"settings\").minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= $(input).data(\"settings\").minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= $(input).data(\"settings\").minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n _showLoading()\n try {\n SongService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "onTextInput(event) {\r\n this.searchValue = event.target.value;\r\n if (this.searchValue.trim().length >= 1) {\r\n this.showSearchBoxList = true;\r\n const apiEndpoint = `${process.env.GOOGLE_PLACE_API_URL}${this.apiKey}&types=(${this.searchType})&language=${dxp.i18n.languages[0]}&input=${this.searchValue}`;\r\n this.getData(apiEndpoint).then(async (data) => {\r\n if (data) {\r\n this.filterItemsJson = data;\r\n if (this.filterItemsJson['predictions']) {\r\n this.filterItemsJson = this.filterItemsJson['predictions'];\r\n }\r\n if (this.filterItemsJson.length) {\r\n this.responseFlag = true;\r\n }\r\n }\r\n });\r\n }\r\n if (this.showSearchBoxList === false) {\r\n this.showSearchBoxList = !this.showSearchBoxList;\r\n }\r\n }", "function handleSearchAttempt (e) {\n var _query;\n\n // If there's no index, exit immediately and re-initialise:\n if (typeof _links !== 'object' || !Array.isArray(_links) || !_links) { return init(); }\n\n // Prevent default submit behaviour\n typeof e !== 'undefined' && e.preventDefault();\n\n // Retrieve the search query from the input element\n _query = e.target.querySelector('input').value;\n\n // Suffice it to say that we should quit if there's no query\n if (typeof _query !== 'string' || !_query) { return; }\n\n displaySearchResults(_query, getSearchResults(_query, _links));\n return false;\n }", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "search(){\n // Condition checks if nothing has been input when first entering website and clicking the button or when something is typed and then deleted\n // returns out of method if this is the case as there will be no results\n if(this.state === null || this.state.term === ''){\n return;\n }\n\n // Calls the passed down event handler search function from App.js\n this.props.onSearch(this.state.term);\n }", "function run_search() {\n var q = $(elem).val();\n if (!/\\S/.test(q)) {\n // Empty / all whitespace.\n show_results({ result_groups: [] });\n } else {\n // Run AJAX query.\n closure[\"working\"] = true;\n $.ajax({\n url: \"/search/_autocomplete\",\n data: {\n q: q\n },\n success: function(res) {\n closure[\"working\"] = false;\n show_results(res);\n }, error: function() {\n closure[\"working\"] = false;\n }\n })\n }\n }", "function query(term) {\n $(\"#SearchBox\").val(term);\n search(term);\n $.pageslide.close();\n }", "function executeSearch() {\n\tlet user_input = $('#class-lookup').val().toUpperCase();\n\t\t\n\t// clears search results\n\t$('#search-return').empty();\n\n\t// display search hint when input box is empty\n\tif (user_input == \"\"){\n\t\t$('#search-return').append(emptySearchFieldInfo());\n\t}\n\t\n\tfor (course in catalog) {\n\t\t\n\t\t// user input describes a course code\n\t\tif (user_input == course) {\n\t\t\t$('#search-return').append(createCourseContainer(course));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// user input describes a department code\n\t\tif (user_input == catalog[course]['department']) {\n\t\t\t$('#search-return').append(createCourseContainer(course));\n\t\t}\n\t\t\n\t}\n\t\n\t// display a message if no results is returned\n\tif ($('#search-return').children().length == 0) {\n\t\t$('#search-return').append(`<li style='border: 3px solid black;'>\n\t\t\t\t\t\t\t\t\t\t<h3>Sorry, we couldn't find what you were looking for.</h3>\n\t\t\t\t\t\t\t\t\t</li>`)\n\t}\n}", "_handleInputSearch (event) {\n this.filterStringEdit(event);\n this.setState({\n query: event.target.value,\n })\n }", "function getQuery() {\n queryString = document.getElementById(\"query-input\").value;\n if (queryString != \"\")\n {\n saveQuery();\n displayQuery();\n }\n else\n {\n frontend.noInput();\n }\n}", "function search() {\n\tif (searchReq.readyState == 4 || searchReq.readyState == 0) {\n\t\tvar str = escape(document.getElementById('query').value);\n\t\tsearchReq.open(\"GET\", 'php/sugestoes.php?search=' + str, true);\n\t\tsearchReq.send(null);\n\t\tsearchReq.onreadystatechange = handleSearchResult;\n\t}\t\t\n}", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "onSearch(value) {\n this.model.query = value;\n }", "onSearch(value) {\n this.model.query = value;\n }", "function searchResultsHandler() {\r\n $('.input-form').submit(e => {\r\n e.preventDefault();\r\n const userQuery = $('#user-query').val();\r\n const userResultsNumber = $('#user-number-results').val() || '10';\r\n clearInputs();\r\n getSearchResults(userQuery, userResultsNumber);\r\n });\r\n}", "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n }", "function searchHandler(e) {\n \"use strict\";\n // Prevent default form action\n e.preventDefault();\n showFilteredBreeds();\n}", "getQuery($event) {\n $event.preventDefault();\n let query = $event.target.value.trim();\n if (query !== '') {\n this.tuberService.searchYouTube(query);\n $event.target.value !== '';\n }\n }", "function handleSearch(e){\n setSearch(()=>e.target.value)\n e.preventDefault()\n search && fetch(search_api+search)\n .then((res)=>res.json())\n .then((data)=>{setMovies((pv)=>pv=data.results)}) \n if(e.target.value==='' ||e.target.value===undefined ){\n setTrending(!trending)\n }\n if(movies===undefined){\n setTxt('')\n }\n}", "handleSearch() {\n if (this.state.searchTerm) {\n this.props.onSearch(this.state.searchTerm);\n }\n else {\n return;\n }\n }", "function getInput(event){\n event.preventDefault();\n var searchQuery;\n searchQuery = ($(searchBox).val());\n console.log(searchQuery);\n var ytUrl =`https://youtube.googleapis.com/youtube/v3/search?type=video&part=snippet&maxResults=25&q=${searchQuery}\\\\+'+travel'+'&key=AIzaSyDD9MbkIVSzT2a3sOv97OecaqhyGdF174c`;\n searchVideos(ytUrl);\n\n var key = `AIzaSyDWNMiooGhkXMAhnoTL8pudTR83im36YPo`;\n \n var bookUrl = `https://www.googleapis.com/books/v1/volumes?q=${searchQuery}\\\\+travel+guide&key=${key}`;\n searchBooks(bookUrl);\n}", "function onSearchInput(e){\n //event? Yes? Set querey to whats in the search box. No? Set querey to nothing\n e \n ? setSearchString(e.target.value)\n : setSearchString('');\n console.log(`search input detected`)\n\n }", "function handleSearch(e) {\n const { value } = e.target;\n setSearch(value);\n if (!value) dispatch(searchContent({ val: null, type: \"all\" }));\n if (value.length < 3) return \"\";\n return debouncedSearch({ ...sorter, type: \"search\", search: value });\n }", "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "function handleSubmit(event) {\n // prevent page from reloading when form is submitted\n event.preventDefault();\n // get the value of the input field\n const input = document.querySelector('.searchForm-input').value;\n // remove whitespace from the input\n const searchQuery = input.trim();\n // call `fetchResults` and pass it the `searchQuery`\n fetchResults(searchQuery);\n}", "function handleNormalSearch(query) {\n\tconsole.log(\"doing normal search with query: \" + query);\n\t// TODO: you should do normal search here\n}", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "searchWardrobe(query) {\n this.props.searchWardrobe(query.target.value);\n }", "function handleSearchSubmit(event) {\n event.preventDefault();\n let cityInput = document.querySelector(\"#city-input\");\n cityInput = cityInput.value.trim().toLowerCase();\n searchCity(cityInput);\n} // handles the behaviour of the search bar", "function focusSearchBoxListener(){ $('#query').val('').focus() }", "function userNormalSearch(e){\n\te.preventDefault();\n\tsearchTerm = $('#search').val().trim(); \n\tuserSearch();\n}", "function handleSearch(event) {\n event.preventDefault();\n if (formSearch) {\n searchGoogleBooksAPI(formSearch.search);\n }\n\n }", "handleUserInput(searchText) {\n this.setState({\n searchText: searchText\n });\n\n if (searchText === \"\") {\n // Clear, otherwise we get junk results\n this.clear();\n } else {\n // Get the first page of movies. Page size is 20, which is fine ....\n theMovieDb.search.getMovie({\"query\": encodeURIComponent(searchText), \"include_adult\":false},\n (res) => {\n this.setState({\n searchResults: JSON.parse(res).results\n });\n },\n // Failure to load ....\n (res) => {\n this.clear();\n console.log(\"Error calling TMDb: \" + res);\n // TODO - what else should we do?\n });\n }\n }", "function searchClick() {\n console.log(\"sono qui\");\n var query = $('#titolo_digit').val();\n console.log(query);\n movieResult(query);\n tvResult(query);\n\n}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function onExecuteSearch(searchInput, resultsContainer)\n{\n var query = searchInput.value;\n\n if(query)\n {\n getResults(query, function(results) {\n\n var resultsList = getResultsList(results);\n\n // Clear existing results container (if applicable)\n var currResultsList = document.getElementById('results');\n if(currResultsList)\n {\n resultsContainer.removeChild(currResultsList);\n }\n\n // Display current results\n resultsContainer.appendChild(resultsList);\n\n });\n }\n}", "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not instantiated properly.\")\n } else {\n console.log(\"hugo-fuse-search: search failed: \" + err)\n }\n return;\n }\n let searchitems = '';\n\n if (results.length === 0) { // no results based on what was typed into the input box\n this.resultsAvailable = false;\n searchitems = '';\n } else { // we got results, show 5\n for (let item in results.slice(0,5)) {\n let result = results[item];\n if ('item' in result) {\n let item = result.item;\n searchitems += this.itemHtml(item);\n }\n }\n this.resultsAvailable = true;\n }\n\n this.element_results.innerHTML = searchitems;\n if (results.length > 0) {\n this.top_result = this.element_results.firstChild;\n this.bottom_result = this.element_results.lastChild;\n }\n }", "function onSearch() {\n var wasActive = !!activeSearch\n activeSearch = searchBox.value\n if (!wasActive) {\n viewer.addFilter(searchFilter)\n }\n clearOption.style.visibility = \"visible\"\n onSearchBlur()\n viewer.filter()\n refreshFilterPane()\n }", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "function searchForQuery(query) {\r\n toggleMainContainer(false);\r\n togglePreloader(true);\r\n showLoadMoreButtons();\r\n clearLists();\r\n search(query, false, 1);\r\n search(query, true, 1); \r\n setCurrentQuery(query);\r\n }", "function handleSearchTermChange(event) {\n\t\tconst value = event.target.value;\n\n\t\t// 1. Change value tag input & check !onSubmit props\n\t\tsetSearchTerm(value);\n\t\tif (!onSubmit) return;\n\n\t\t// 2. Clear item at 1st render\n\t\tif (typingTimeoutRef.current) {\n\t\t\tclearTimeout(typingTimeoutRef.current);\t\t\t\n\t\t}\n\n\t\t// 3. After 300ms and stop typing => filter item\n\t\ttypingTimeoutRef.current = setTimeout(() => {\n\t\t\tconst formValues = {\n\t\t\t\tsearchTerm: value,\n\t\t\t};\n\t\t\tonSubmit(formValues);\n\t\t}, 300);\n\t}", "handleSearchBar()\n {\n this._page = 1;\n this._searchBar = $(\"#searchBar\").val();\n this.getBooks();\n }", "function search() {\n $.var.currentSupplier = $.var.search;\n $.var.currentID = 0;\n $.var.search.query = $(\"#searchable\").val();\n if ($.var.search.query.trim().length === 0) { // if either no string, or string of only spaces\n $.var.search.query = \" \"; // set query to standard query used on loadpage\n }\n $.var.search.updateWebgroupRoot();\n}", "function doSearch( event ) {\n\tif ( typeof event == 'object' ) {\n\t\tif ( event.code == 'Escape' )\n\t\t\tsearchBox.value = '';\n\t}\n\telse\n\t\tsearchBox.value = event || '';\n\n\tlet [ field, value ] = searchBox.value.toLowerCase().split(':');\n\tif ( value === undefined )\n\t\t[ value, field ] = [ field, value ];\n\n\t// search only on the selected gallery - collection or wishlist\n\tconst target = collection.classList.contains('hide') ? wishlist : collection;\n\n\t// iterate over gallery items and hide those that don't match the search string\n\t// if search string is empty, \"unhide\" all items on both galleries\n\t( value === '' ? document : target).querySelectorAll('.item').forEach( item => {\n\t\tconst text = ( field ? item.dataset[ field ] : item.innerText ).toLowerCase();\n\t\titem.classList.toggle( 'hide', value.length && ! text.includes( value ) );\n\t});\n\n\t// show count for displayed items\n\tcount.innerText = target.querySelectorAll('.item:not(.hide)').length;\n}", "function runSearch(curInput,query) {\r\n\t\t\t \tvar url = curInput.attr(\"data-queryurl\");\r\n\t\t\t var cache_key = query + url;\r\n\t\t\t var cached_results = cache.get(cache_key);\r\n\t\t\t if(cached_results) {\r\n\t\t\t populateDropdown(curInput,query, cached_results);\r\n\t\t\t } else {\r\n\t\t\t if(!url) return;\r\n \t\t\t // Extract exisiting get params\r\n\t\t\t var ajax_params = {};\r\n\t\t\t ajax_params.data = {};\r\n\t\t\t ajax_params.url = url;\r\n\t\t\t // Prepare the request\r\n\t\t\t ajax_params.data[\"keyword\"] = query;\r\n\t\t\t ajax_params.type = \"Get\";\r\n\t\t\t ajax_params.dataType = \"json\";\r\n\t\t\t\r\n\t\t\t // Attach the success callback\r\n\t\t\t ajax_params.success = function(results) {\r\n\t\t\t \tcache.add(cache_key,results);\r\n\t\t \t// only populate the dropdown if the results are associated with the active search query\r\n\t\t \tif(curInput.val().toLowerCase() === query) {\r\n\t\t \tpopulateDropdown(curInput,query,results);\r\n\t\t \t}\r\n\t\t\t };\r\n\t\t\t // Make the request\r\n\t\t\t $.ajax(ajax_params);\r\n\t\t\t }\r\n\t\t\t }", "function search() {\n\t\n}", "function handleOnSearch({ currentTarget = {} }) {\n const { value } = currentTarget;\n setQuery(value);\n }", "function onKeyUp( e ){\n \n //get value of key up\n\tvar searchFieldValue = $(\"#searchField\").val();\n\t\n\t//if the value of the query has changed\n\tif( currentSearchString != searchFieldValue ){\n\t \n\t //save it, then use that to perform the search\n\t\tcurrentSearchString = searchFieldValue;\n\t\tsearch( currentSearchString );\n\t}\n}", "function handleSubmit() {\n //Take the search term string entered by the user in the input field, add it to the baseUrl, make a fetch request to that new url, and append the results of what we searched for to the DOM in the correct element, wrapped in li tags\n}", "function onSearchKeyPress(e) {\n switch (e.keyCode) {\n case 38:\n // up arrow\n updateSuggestion(currentSuggestion - 1)\n break\n case 40:\n // down arrow\n updateSuggestion(currentSuggestion + 1)\n break\n case 13:\n // enter. it'll submit the form, but let's unfocus the text box first.\n inputElmt.focus()\n break\n default:\n nextSearch = searchBox.value\n var searchResults = viewer.runSearch(nextSearch, true)\n searchSuggestions.innerHTML = \"\"\n currentSuggestion = -1\n suggestionsCount = 0\n addWordWheelResults(searchResults.front)\n addWordWheelResults(searchResults.rest)\n }\n }", "function handleSearch(e) {\n e.preventDefault();\n let input = document.getElementById('networkSearch');\n\t\tlet search = input.value;\n\t\tprops.handleSearch(search);\n\t\tinput.value = '';\n }", "handleSearch(e) {\n var text = e.target.value;\n this.props.onSearch(text);\n this.setState({\n queryText: text\n });\n }", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "handleSubmit (event) {\n \t\tevent.preventDefault()\n \t\tconst inputValue = this.autosuggestBar.input.value\n \t\tif (inputValue !== '') {\n \t\tthis.search(inputValue)\n \t\t}\n\t}", "function handleSearch(inputElt) {\n\t\tvar query = encodeURIComponent($(inputElt).val());\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/\"+query+\".json\",\n\t\t\tdata : {\n\t\t\t\taccess_token: \"pk.eyJ1IjoibWFwcHktZGV2IiwiYSI6InhBOWRUVHcifQ.YK4jDqt9EXb-Q79QX3O_Mw\"\n\t\t\t},\n\t\t\tsuccess : function(result){\n\t\t\t\tvar best = result.features[0];\n\t\t\t\tmap.setView([best.center[1], best.center[0]], 15);\n\t\t\t},\n\t\t\terror : function(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t});\n\t}", "function handleSearchEvent() {\n const newData = filterStudents(searchValue);\n showPage(newData, 1);\n addPagination(newData);\n}", "function handleSearchTerm(event) {\n setSearchTerm(event.target.value)\n}", "function setQuery(evt) {\n //if you press the enter\n if (evt.keyCode == 13) {\n FORECAST.innerHTML = \"\"; //empty the html forecast table\n getLocation(searchbox.value); // check line 7 for that\n // console.log(searchbox.value);\n }\n}", "function handleRecipeSearch(evt){\r\n\tevt.preventDefault();\r\n\tlet query = searchInput.value.trim();\r\n\r\n\tif(query.length < 1) return;\r\n\r\n\tgetData(query)\r\n\t\t.then(res => res.hits)\r\n\t\t.then(hits => {\r\n\t\t\tresponseHits = hits;\r\n\t\t\tresultsCount.textContent = hits.length;\r\n\t\t\trenderRecipeTemplate();\r\n\r\n\t\t\tdocument\r\n\t\t\t\t.querySelectorAll('button.btn-read-recipe')\r\n\t\t\t\t.forEach( btn => btn.addEventListener('click', showRecipeDetails));\r\n\r\n\t\t\tshowLoader(false);\r\n\t\t})\r\n\t\t.catch(err => {\r\n\t\t\tif(err){\r\n\t\t\t\tresults.innerHTML = \"\";\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t\tshowLoader(false);\r\n\t\t\t}\r\n\t\t})\r\n\r\n\tsearchInput.value = \"\";\r\n}", "function handleSearchChange(event){\n event.preventDefault();\n setSearchTerm(event.target.value);\n }", "function searchTerm(){\n \n }", "function handleSearch(event) {\n\t\tevent.preventDefault();\n\t\tlet userAddress = $userSearchTerm.val();\n\t\t//encode it right here, then pass it to getMaps\n\t\tlet encodedAddress = encodeURI(userAddress);\n\t\tgetMaps(encodedAddress);\n\t}", "function search() {\r\n let searchTerm = id(\"search-term\").value.trim();\r\n if (searchTerm !== \"\") {\r\n id(\"home\").disabled = false;\r\n loadBooks(\"&search=\" + searchTerm);\r\n }\r\n }", "triggersearch(){\r\n\t\t\tlet query='';\r\n\t\t\tif(this.props.keyword){\r\n\t\t\t\tquery=this.props.keyword\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tquery=this.props.query\r\n\t\t\t}\r\n\t\t\tthis.props.fetchSearchResults(query);\r\n\t}", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }" ]
[ "0.79764235", "0.79110783", "0.77525926", "0.7659581", "0.76479644", "0.76479644", "0.76145333", "0.75815505", "0.7544742", "0.75034934", "0.74830097", "0.74830097", "0.74452674", "0.7442663", "0.7390078", "0.73871845", "0.73868", "0.738548", "0.7381054", "0.73779774", "0.73749506", "0.73720574", "0.737186", "0.73540896", "0.734641", "0.7342949", "0.7337586", "0.73257476", "0.7318803", "0.73170763", "0.72997", "0.7293614", "0.7293614", "0.7293614", "0.7270141", "0.72684735", "0.72608125", "0.72463083", "0.7196572", "0.7192226", "0.71796197", "0.71530867", "0.71490544", "0.7127943", "0.7123285", "0.7104506", "0.7103613", "0.7103613", "0.7101288", "0.70791197", "0.7075946", "0.7065098", "0.70588017", "0.7053491", "0.7043865", "0.70265895", "0.7020266", "0.70010465", "0.69825476", "0.69810456", "0.6974817", "0.69734186", "0.6968945", "0.6961382", "0.6952978", "0.6945654", "0.69401556", "0.6935098", "0.6929918", "0.69265425", "0.6923484", "0.69217443", "0.69170165", "0.691546", "0.6910425", "0.69071466", "0.6900301", "0.6899991", "0.68955433", "0.6891549", "0.6889048", "0.6886526", "0.68809754", "0.6878506", "0.68698674", "0.6858514", "0.68514293", "0.6845152", "0.68445337", "0.68418145", "0.6839546", "0.6839397", "0.68393505", "0.68354195", "0.6823967", "0.681194", "0.6808993", "0.6807081", "0.6806201", "0.6805048", "0.6805048" ]
0.0
-1
Creates a list of Cards, According the the data received from backend.
getProductListComponenet(productList){ var temp = []; // console.log(productList); if(productList.length>0 && productList){ productList.map((item,key) => { temp.push(<SimpleCard {...item}/>); }) }else{ temp.push( <div> <h1>"Data not being fetched, restart backend server"</h1> </div> ); } return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCards() {\n cardsData.forEach((data, index) => createCard(data, index));\n }", "function createListOfCards() {\n const cards = createListOfCardsUrl();\n let listOfCards = [];\n for (let i = 0; i < 4; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 11))\n }\n\n for (let i = 4; i < 8; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 2))\n }\n\n for (let i = 8; i < 12; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 3))\n }\n\n for (let i = 12; i < 16; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 4))\n }\n\n for (let i = 16; i < 20; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 5))\n }\n\n for (let i = 20; i < 24; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 6))\n }\n\n for (let i = 24; i < 28; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 7))\n }\n\n for (let i = 28; i < 32; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 8))\n }\n\n for (let i = 32; i < 36; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 9))\n }\n\n for (let i = 36; i < 52; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 10))\n }\n\n listOfCards.push(new CreateNewCard(cards[52], 0))\n\n return listOfCards;\n}", "function createCardList (apiCardInfo) {\n let cardLists = [];\n\n for(let i = 0; i < apiCardInfo.data.length; i++) {\n cardLists.push(apiCardInfo.data[i].name.toLowerCase());\n }\n setCardList(cardLists);\n }", "function cards() {\n console.log(\"here from the card object\");\n this.cardList= [];\n\n for (var i = 1; i < 53; i++) {\n\n cardList.push(new Card(i));\n }\n console.log(cardList);\n return this.cardList;\n //console.log(cardList);\n}", "getCards(params) {\n return Resource.get(this).resource('Store:getCardsInInventory', params).then(cards => {\n // Reset cards\n this.displayData.cards.electronic = [];\n this.displayData.cards.physical = [];\n // Split the cards into electronic and physical\n cards.map(card => {\n if (card.type === 'electronic') {\n this.displayData.cards.electronic.push(card);\n } else {\n this.displayData.cards.physical.push(card);\n }\n });\n });\n }", "function getCards() {\n // Array to hold Suites\n var suites = ['Diamonds', 'Spades', 'Hearts', 'Clubs'];\n // Array to hold non-numeric card faces \n var faceCards = ['J', 'Q', 'K', 'A'];\n\n // Array to hold Cards\n var cards = [];\n\n // Loop for each Suite\n var currentCardIndex = 0;\n for (var suite in suites) {\n // Loop for numeric cards\n for (var i = 2; i <= 10; i++) {\n cards.push(createCard(i, suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n // Loop for non-numeric cards\n for (var face in faceCards) {\n cards.push(createCard(faceCards[face], suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n currentCardIndex = 0;\n}\n\n // Return Array of Card Objects\n return cards;\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 createCardDeck(){\n let cardDeck = [];\n for(let i = 0; i < suits.length; i++) {\n for(let j = 0; j < values.length; j++) {\n let card = {\n suit: suits[i],\n value: values[j]\n }\n cardDeck.push(card)\n } \n } \n return cardDeck;\n }", "constructor() { \n const suits = [\"hearts\", \"diamonds\", \"spades\", \"clubs\"]\n const ranks = [\"ace\",2,3,4,5,6,7,8,9,10,\"jack\",\"queen\",\"king\"]\n this.cards = []\n suits.forEach(suit => {\n ranks.forEach(rank => {\n let newCardObject = new Card(rank, suit);\n this.cards.push(newCardObject);\n });\n });\n }", "function createDeck(){\n //suits IDs limits to array length only (suitIdx)\n for (let suitIdx=0; suitIdx < suits.length; suitIdx++){ \n //Card value IDs (valueIdx)\n for (let valueIdx=0; valueIdx < values.length; valueIdx++){ \n //store all cards as objects\n let card = { \n suit: suits[suitIdx],\n value: values[valueIdx]\n };\n deck.push(card) //add suits and values to create deck of 52\n }\n }\n return deck;\n}", "initDeck(){\n let cards = [];\n for( let i = 0; i < this.quantity; i ++){\n // Chaque carte est insérée par deux dans le deck, et oui, ce sont des paires\n cards.push(new Card(i));\n cards.push(new Card(i));\n }\n this.cards = cards;\n return cards;\n }", "function createDeck() {\n let deck = []\n for (let suitIdx = 0; suitIdx < suits.length; suitIdx++) {\n for (let valueIdx = 0; valueIdx < values.length; valueIdx++) {\n let card = {\n suit: suits[suitIdx],\n value: values[valueIdx]\n }\n deck.push(card);\n }\n }\n return deck;\n}", "function createDeck(){\n let deck=[];\nfor(let suitsIdx=0;suitsIdx<suits.length;suitsIdx++)\n{\n for(let valuesIdx=0;valuesIdx<values.length;valuesIdx++)\n {\n let card={\n suit:suits[suitsIdx],\n value:values[valuesIdx]\n };\n \n deck.push(card);\n }\n}\nreturn deck;\n}", "function createCards(data) {\n document.getElementById(\"card-container\").innerHTML = \"\";\n\n // Loop over the data to create HTML div elements\n for (let i = 0; i < data.length; i++) {\n let num = i;\n let card = document.createElement(\"div\");\n let cardLabel = document.createElement(\"h3\");\n let cardBody = document.createElement(\"p\");\n let cardCode = document.createElement(\"strong\");\n\n // Add the content to each HTML element based on the data\n cardLabel.innerHTML = data[i].label;\n cardBody.innerHTML = data[i].name;\n cardCode.innerHTML = data[i].plusCode;\n\n // Some Fizz / Buzz Fun\n if (num % 3 == 0 && num % 5 == 0) {\n cardBody.className = \"light-red\";\n } else if (num % 3 == 0) {\n cardBody.className = \"light-blue\";\n } else if (num % 5 == 0) {\n cardBody.className = \"medium-green\";\n } else {\n cardBody.className = \"charcoal\";\n }\n\n // Assemble the card elements here\n card.appendChild(cardLabel);\n card.appendChild(cardBody);\n card.appendChild(cardCode);\n\n card.className = \"card\";\n\n // Attach each card to the card container grid here\n document.getElementById(\"card-container\").appendChild(card);\n }\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 }", "static getAllCards() {\n if (this._cards === undefined)\n this.initializeCards();\n return this._cards\n }", "function createDeck() {\n let deck = [];\n for (let suitIdx = 0; suitIdx < suits.length; suitIdx++){\n for (let valueIdx = 0; valueIdx < values.length; valueIdx++){\n let card = {\n suit: suits[suitIdx],\n value: values[valueIdx]\n };\n deck.push(card);\n }\n }\n return deck;\n}", "function createCard() {\n \tconst shuffleCards = shuffle(cardList);\n \tshuffleCards.forEach(function(card){\n \t\tconst li = document.createElement('li');\n \t\tconst i = document.createElement('i');\n \t\tli.setAttribute('class','card');\n \t\ti.setAttribute('class',card);\n \t\tli.appendChild(i);\n \t\tul.appendChild(li);\n \t});\n \tdeck.appendChild(ul);\n }", "function createCards(jsonObj){\n var x = 1\n var jsonCards = jsonObj['cards'];\n for(var i = 0; i < jsonCards.length; i++){\n cards[i] = new Card(jsonCards[i].name, jsonCards[i].value, jsonCards[i].id, jsonCards[i].image);\n console.log(cards[i]);\n }\n}", "function createCards() {\n gameSetup = {};\n gameSetup.cards = [];\n var suits = ['spades', 'diamonds', 'clubs', 'hearts'];\n var values = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];\n for (var i = 0; i < suits.length; i++){\n for (var j = 0; j < values.length; j++){\n gameSetup.cards.push(new Card(values[j], suits[i]));\n }\n }\n}", "function buildCards(){\n for (const card of cards){\n const newCards = document.createElement('li');\n newCards.setAttribute('class', 'card fa fa-' + card);\n deck.appendChild(newCards);\n }\n}", "static fetchCardIndex() {\n fetch(`${BACKEND_URL}/cards`)\n .then(response => response.json())\n .then(cards => Card.createCards(cards))\n }", "function createCards(x) {\n let cards = [];\n for(i=1; i<=x; i++) {\n let obj = new Object();\n if(i%2===0) {\n obj.id=i;\n obj.content = i-1;\n } else {\n obj.id=i;\n obj.content = i;\n \n }\n \n cards.push(obj);\n\n }\n return cards\n}", "function setupCard() {\n angular.forEach(list.cards, function(term) {\n var definition = cardService.cards[term];\n if (definition) {\n $scope.cards.push({\n term: term,\n definition: definition\n });\n } else {\n //sync the cards if the term definition doesn't exist\n cardService.remove(term);\n }\n });\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 }", "add(card){\n this.list.push(card);\n }", "function createCards() {\n for (let i = 0; i < imgList.length; i += 1) {\n const cards = document.createElement('div');\n cards.classList.add('card');\n cards.innerHTML = `<div class='back'>${imgList[i]}</div>\n <div class='front'><i class=\"fa fa-line-chart\" style=\"font-size:2em;color:#ffffff;\"></i></div>`;\n cardArray.push(cards);\n }\n // Loops and Shuffles Card Array\n for (let i = cardArray.length - 1; i >= 0; i -= 1) {\n const randomIndex = Math.floor(Math.random() * (i + 1));\n const itemAtIndex = cardArray[randomIndex];\n cardArray[randomIndex] = cardArray[i];\n cardArray[i] = itemAtIndex;\n }\n }", "function createDeck() {\n let suits = ['spades', 'clubs', 'hearts', 'diamonds'];\n let values = ['A','2','3','4','5','6','7','8','9','10','J','Q','K'];\n let realValues = [1,2,3,4,5,6,7,8,9,10,10,10,10]\n\n suits.forEach((suit) => {\n values.forEach((value, index) => {\n let card = new Card(suit, value, realValues[index]);\n deck.push(card);\n });\n });\n\n prefetchDeckImages();\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}", "getAllCards(){\nreturn cardModel.cards;\n\n }", "function newDeck() {\n var deck = [];\n for (var i = 0; i < suits.length; i++) {\n for (var j = 0; j < ranks.length; j++) {\n var card = {\n suit: suits[i],\n rank: ranks[j],\n img: imgs[i]\n };\n deck.push(card);\n }\n }\n return deck;\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 dataToCards() {\n // console.log(myNYTimesData);\n // el={(...item.keywords.value)}\n let itemList = myNYTimesData.map((item, index) => {\n // console.log(item.keywords[0].value);\n let itemPush = []\n item.keywords.forEach(el => itemPush.push(el.value, \"---\"))\n console.log(\"itemPush: \", itemPush)\n itemPush.length = itemPush.length - 1\n console.log(\"itemPush removed: \", itemPush)\n return <div key={index}> <MyCard element={item.abstract}\n el01={itemPush}\n // el02={\"essai01\"}\n /></div>;\n })\n setButtonsOnCanvos([...buttonsOnCanvos, itemList]);\n }", "function ClueCards () {\n\tvar cards = new Object();\n\t\n\t// People\n\tcards[cardName.Scarllet] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Plum] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Peacock] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Green] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Mustard] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.White] = {\n\t\t\"type\" : cardTypes.PERSON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\t\n\t// Weapons\n\tcards[cardName.Candlestick] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Dagger] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Lead_Pipe] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Revolver] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Rope] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Wrench] = {\n\t\t\"type\" : cardTypes.WEAPON,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\t\n\t// Rooms\n\tcards[cardName.Courtyard] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Game_Room] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Study] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Dining_Room] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Garage] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Living_Room] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Kitchen] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Bedroom] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\tcards[cardName.Bathroom] = {\n\t\t\"type\" : cardTypes.ROOM,\n\t\t\"state\" : cardState.UNKNOWN\n\t};\n\t\n\treturn cards;\n}", "function appendCardList (card) {\n openCards.push(card);\n }", "initializeDeckOfCards(){\n let activeDeck = new Array();\n\n let suit = [\"c\", \"d\", \"h\", \"s\"];\n let faceCards = [\"k\", \"q\", \"j\"];\n for (let i = 0; i < suit.length; i++) {\n // create ace\n let ace = new Card(`a${suit[i]}`, 11, `../assets/cards/a${suit[i]}.jpg` );\n activeDeck.push(ace);\n // create face cards\n for (let j = 0; j < faceCards.length; j++) {\n let card = new Card(`${faceCards[j]}${suit[i]}`, 10, `../assets/cards/${faceCards[j]}${suit[i]}.jpg`);\n activeDeck.push(card);\n }\n // create number cards\n for (let j = 2; j <= 10; j++) {\n let card = new Card(`${j}${suit[i]}`, j, `../assets/cards/${j}${suit[i]}.jpg`);\n activeDeck.push(card); \n }\n }\n return activeDeck; \n }", "_getDealerCards(){\n let newCard = _deck.draw()\n _dealersHand.push(newCard)\n return _dealersHand\n }", "function createCard() {\n $(\".deck\").empty();\n let cardList = shuffle(cards);\n for (const card of cardList) {\n $(\".deck\").append('<li class=\"card\"><i class=\"fa fa-' + card + '\"></i></li>');\n };\n }", "function initCardsFromData() {\n for (const cardKey in data.cards) {\n\n const cardElem = memoryGrid.querySelector('[data-card-id=' + cardKey + ']');\n\n cardElem.className = data.cards[cardKey];\n\n if (cardElem.classList.contains(FLIP) ||\n cardElem.classList.contains(MATCH)) {\n // Update aria label to symbol\n cardElem.setAttribute('aria-label', cardElem.dataset.symbol);\n }\n\n memoryGrid.appendChild(cardElem);\n }\n }", "constructor() {\n this.cards = [];\n\n for (let i = 1; i < 53; i++) {\n this.cards.push(i);\n };\n }", "function createCard(data) {\n var html = data.map(item => `\n <div class=\"card\">\n <div class=\"image\">\n <img src=\"${item.image}\" alt=\"product\"/>\n </div>\n <div class=\"info\">\n <span>${item.name}</span>\n <p>${item.description}</p>\n <p>De: R$${item.oldPrice},00</p>\n <p>Por: R$${item.price},00</p>\n <p>ou ${item.installments.count}x de \n R$${item.installments.value.toFixed(2).replace(\".\", \",\")}</p>\n <input class=\"btn\" type=\"button\" value=\"Comprar\"/>\n </div>\n </div>`\n ).join(\"\");\n document.querySelector(\"#cards\").innerHTML += html;\n}", "function CardList() {\n return (\n <div className=\"CardList\">\n <div className=\"CardList__grid\">\n {cardListData.map(cardData => (\n <Card key={cardData.id} {...cardData} />\n ))}\n </div>\n </div>\n );\n}", "function createDeck() {\n const deckList = document.querySelector('.deck');\n\n //Create list of cards from UI\n let loadCards = Array.from(document.querySelectorAll('.deck li'));\n loadCards.forEach(function(card) {\n //Overwrite any existing show open classes.\n card.className = 'card';\n cards.push(card);\n });\n\n //Shuffle card pack\n const shuffledCards = shuffle(cards);\n\n //Add shuffled cards to UI grid\n shuffledCards.forEach(function(card) {\n deckList.appendChild(card);\n });\n }", "function creatCardList(_numPairs) {\n for (let i = 1; i <= _numPairs; i++) {\n var content = cardContent[0];\n emtyArray.push(content);\n emtyArray.push(content);\n cardContent.splice(0, 1);\n }\n }", "async function getCards() {\n await connectDB();\n let cards = [];\n let cardLinks = await mongoClient.db(\"memory\").collection(\"cards\").find().toArray();\n for (const i of cardLinks) {\n cards.push(linkToCard(i.link, null));\n }\n return cards;\n }", "function AddCards(allCards) {\n const fragment = document.querySelector('.deck');\n for(let i =0; i < allCards.length; i++)\n {\n fragment.appendChild(allCards[i]);\n }\n}", "constructor(name) {\n this.name = name;\n this.cards = [];\n }", "function makeCards() {\n this.colors = colors;\n this.patterns = patterns;\n this.shapes = shapes;\n this.numbers = numbers); \n }", "function _scorecards() {\n data.scorecards = [];\n data.partnersToMakers.forEach(maker => {\n data.partnersToTakers.forEach(taker => {\n data.scorecards.push(new Scorecard(\"scorecard\" + data.scorecards.length, maker, taker, data.fieldsToTags));\n });\n });\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 getCards() {\n var cards = [];\n var keys = Object.keys(data);\n // Condition that allows user to filter ingredients by categories or search for them\n if (keys !== 0) {\n keys.forEach((ingredient) => {\n if (\n (filter === \"Filter by Group...\" ||\n filter.includes(data[ingredient][\"categories\"])) &&\n (search === \"\" ||\n ingredient.toLowerCase().includes(search.toLowerCase()))\n ) {\n cards.push(\n <Col key={ingredient} lg={6} style={{ paddingBottom: \"25px\" }}>\n <IngredientCard\n ingredient={data[ingredient]}\n setDetails={setDetails}\n details={details}\n />\n </Col>\n );\n }\n });\n return cards;\n }\n }", "constructor()\n\t{\n\t\tthis.cards = new Array(MAX_CARDS);\n\t\tthis.numCards = 0;\n\t}", "function createDeck() {\n\treturn {\n\t\t\"shareCode\": 20,\n\t\t\"image\": \"\",\n\t\t\"created\": new Date(),\n\t\t\"title\": \"\",\n\t\t\"anki\": false,\n\t\t\"ankiDate\": \"\",\n\n\t\t\"cards\": []\n\t};\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 cardConstructor(data, skeleton) {\n const newArray = splicer(data, skeleton);\n newArray.forEach((element, index) => {\n newArray[index] = creator(element);\n });\n document.querySelector(\".cards-container\").append(stitcher(newArray));\n}", "static getCards() {\n\t\t//Cards\n\t\tvar cards = [];\n\t\t//Get cards from the card box\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"cardbox\").children));\n\t\t//Get cards from the three mason columns\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol1\").children));\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol2\").children));\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"masoncol3\").children));\n\t\t//Get cards from the holding box\n\t\tcards = cards.concat([].slice.call(document.getElementById(\"inactivecards\").children));\n\t\t//Return the cards\n\t\treturn cards;\n\t}", "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 addCardToList(card) {\n openCardsList.push(card);\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}", "function createCards(cardType) {\n let i = createNewElement('i', cardType);\n let li = createNewElement('li', 'card');\n li.appendChild(i);\n li.addEventListener('click', listener, false);\n document.getElementsByClassName('deck')[0].appendChild(li);\n}", "function generateCards(){\n shuffle(cardList.concat(cardList)).forEach(createCard);\n}", "generateCards(){\n var cards = [];\n if(this.props.currentState.topStories.length){\n for(var i=this.props.currentState.index; i<this.props.currentState.index+10; i++){\n const {selectedStories} = this.props.currentState;\n const isSelected = this.props.currentState.selectedStories.indexOf(this.props.currentState.topStories[i]) > -1 ? true : false;\n const trigger = i == this.props.currentState.index ? true : false;\n cards.push(<Card key={this.props.currentState.topStories[i]} isSelected={isSelected} id={this.props.currentState.topStories[i]} url={this.props.configuration.storyURL} onCompletion={this.incrementLoadedCards}/>)\n }\n }\n return cards;\n }", "function generateCardDeck(){\n cardDeck.length = 0;//empty any potentially existing instance of the deck, to prevent it duplicating entries.\n cardDeck = [];\n for(let suitNo = 0; suitNo < 4; suitNo++){ //condensed it all down to two for loops, and a two switch statements in a constructor.\n for(let rankNo = 0; rankNo< 13; rankNo++){ //4 Suits and 13 Ranks of cards.\n cardDeck.push(new card(rankNo, suitNo));\n }\n }\n shuffleDeck(cardDeck);\n}", "_getPlayerCards(){\n let newCard = _deck.draw()\n _playersHand.push(newCard)\n return _playersHand\n }", "putCompCardOnTable(data) {\n let newCard = <Card src={data.cardPic} id={data.cardNum}/>;\n this.setState(prevState => ({\n listWithCards: [...prevState.listWithCards, newCard]\n }));\n\n this.props.socket.emit('human may start');\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 createProductCards(cardData, sectionID){\n for (var i = 0; i < cardData.length; i++) {\n var card = cardData[i]\n var tmpl = document.getElementById('card-template').content.cloneNode(true);\n tmpl.querySelector('.name').innerText = card.name;\n tmpl.querySelector('.price').innerText = \"$\" + card.price.toString();\n tmpl.querySelector('.custom-card-img').src = \"./assets/images/product_images/\" + card.imgName;\n tmpl.querySelector('.product-link').href = \"./product_pages/\" + detail_page + \"#\" + card.id.toString();\n\n var cardList = document.getElementById(sectionID);\n\n cardList.appendChild(tmpl);\n }\n}", "populateDeck()\n {\n this.cards = [];\n //jack 11\n //queen 12\n //king 13\n //ace 14\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Spades\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_spades.svg`);\n this.cards.push(card);\n }\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Clubs\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_clubs.svg`);\n this.cards.push(card);\n }\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Hearts\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_hearts.svg`);\n this.cards.push(card);\n }\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Diamonds\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_diamonds.svg`);\n this.cards.push(card);\n }\n this.shuffleDeck();\n }", "function renderCards() {\n for (let i = 0; i < cardList.length; i++) {\n $('.deck').append(`<li class=\"card\"><i id=\"card-${i}\" class=\"fa ${cardList[i]}\"></i></li>`);\n }\n}", "function newCard(number) {\n //Check for om tallet er et lige eller ulige tal\n if(number%2==0) {\n var cardList = [];\n var cardValue = 0;\n for(var i=1;i<=number;i++) {\n var modola = i%2;\n if(modola == 1) {cardValue++}\n // Variable - Classen der skal indsættes i HTML\n var card = $('<li class=\"card\" data-pair='+cardValue+'><div class=\"cardFace front\">Front</div><div class=\"cardFace back\"><h2>'+cardValue+'</h2></div></li>');\n // Indsæt et kort ind i HTML\n cardList.push(card)\n }\n return cardList;\n }\n else{return false}\n }", "function createDeck() {\n for (i = 0; i < shapes.length; i++) {\n for (j = 0; j < num.length; j++) {\n var cards = { value: num[j], shape: shapes[i] };\n deck.push(cards);\n }\n }\n return deck;\n}", "function createCards(globals) {\n var BACKGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Card_backs_grid_blue.svg';\n var SORTED_BACKGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Card_backs_grid_red.svg';\n var FOREGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Ornamental_deck_';\n //var cardNumbers = ['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2', 'Ace', 'King', 'Queen'];\t\n\t//var values = [13,12,11,10,9,8,7,6,5,4,3,2,1];\n var cardNumbers = ['2', '3','4','5','6','7','8','9','10','Jack','Queen','King', 'Ace'];\t\n\tvar values = [1,2,3,4,5,6,7,8,9,10,11,12,13];\n \n\tvar cardSuits = ['spades', 'clubs', 'diamonds', 'hearts', 'spades', 'clubs', 'diamonds', 'hearts', 'spades', 'clubs', 'diamonds', 'diamonds', 'spades', 'clubs', 'diamonds', 'hearts'];\n\n // Randomized array of cards\n var cardArray = [];\n // Maps card number to actual card struct\n var cards = {};\n\n // Populate cards and cardArray with card objects\n for (var i = 0; i < globals.NUM_CARDS; i++) {\n var newCard = {};\n newCard.num = i;\n newCard.flipped = false;\n newCard.sorted = false;\n newCard.normalBack = BACKGROUND;\n newCard.sortedBack = SORTED_BACKGROUND;\n\t\tnewCard.value = values[i];\n \n\t\tnewCard.frontFace = FOREGROUND + cardNumbers[i] + '_of_' + cardSuits[i] + '.svg';\n newCard.rightPivot = globals.NUM_CARDS;\n\t\tnewCard.leftPivot = -1;\n\t\t\n\t\tcardArray.push(newCard);\n cards[i] = newCard;\n\t\t\n }\n\n // Randomize ordering of cardArray\n var currentIndex, temporaryValue, randomIndex;\n currentIndex = cardArray.length;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = cardArray[currentIndex];\n cardArray[currentIndex] = cardArray[randomIndex];\n cardArray[randomIndex] = temporaryValue;\n }\n\n // Set zIndex and xPos values based on randomized positions\n for (i = 0; i < globals.NUM_CARDS; i++) {\n var num = cardArray[i].num;\n cards[num].zIndex = i;\n cards[num].xPos = globals.PADDING + globals.SPACE * i;\n }\n\n globals.cardArray = cardArray;\n globals.cards = cards;\n}", "function buildDeck() {\n // Step 1: create an empty deck\n let deck = [];\n\n // Step 2: create list of all suits\n let suits = ['hearts', 'clubs', 'diamonds', 'spades'];\n\n // Step 3: create list of all values\n let values = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A'];\n \n // Step 4: iterate over each combo and create an object for each, add to deck\n for (let s = 0; s < suits.length; s++) {\n for (let v = 0; v < values.length; v++) {\n let card = {\n suit: suits[s],\n value: values[v],\n };\n\n deck.push(card);\n // deck.push({\n // suit: suits[s],\n // value: values[v],\n // });\n }\n }\n\n // Step 5: return deck\n return deck;\n}", "function addAllCards() {\r\n for (var i = 3; i < profileData.allnames.length; i++){\r\n let newProfile = new Profile(profileData.allnames[i],\r\n profileData.allage[i],\r\n profileData.alltitles[i],\r\n profileData.allphotos[i][0]);\r\n // listedProfile.push(newProfile);\r\n let newProfileCard = document.createElement('div');\r\n newProfileCard.classList.add('swipe-card');\r\n cardsContainer.appendChild(newProfileCard);\r\n newProfileCard.innerHTML = `<img src=\"${newProfile.photos}\" alt=\"\">\r\n <div class=\"name-wrapper\">\r\n <div class=\"card-name\">${newProfile.name}, ${newProfile.age}</div>\r\n <i class=\"fas fa-check-circle\"></i>\r\n </div>\r\n <div class=\"card-title\">${newProfile.title}</div>`\r\n }\r\n}", "function buildCards(data) {\n // Perform POST call to send params and get back results\n postCall('http://api.fitstew.com/api/gymSearchAdvanced/',data, function(obj) {\n // Loop through each result and create card\n if(!obj.status) {\n\t\t $.each( obj, function( key, value ) {\n\t\t $('#partnerBlock').html('<div class=\"box\"><div class=\"gtitle\" data-gid=\"' + value.id + '\" data-addr=\"' + value.address + ', ' + value.city +', ' + value.state + ' ' + value.zipcode + '\" data-email=\"' + value.email + '\" data-phone=\"' + value.phone + '\" data-facebook=\"' + value.facebook + '\" data-twitter=\"' + value.twitter + '\" data-monday=\"' + value.monday + '\" data-tuesday=\"' + value.tuesday + '\" data-wednesday=\"' + value.wednesday + '\" data-thursday=\"' + value.thursday + '\" data-friday=\"' + value.friday + '\" data-saturday=\"' + value.saturday + '\" data-sunday=\"' + value.sunday + '\">' + value.name + '</div><div class=\"glogo\"><img src=\"' + value.image + '\"></div><div class=\"gdistance\">' + value.distance + '</div><div class=\"gmatches\">' + value.matched + '</div></div>');\n\t\t \n\t\t });\n\t\t // Call attachedCards function\n\t\t attachCards();\n\t } else {\n\t\t $('#partnerBlock').html('<div class=\"searchError\">No Results Found</div>');\n\t }\n\t });\n }", "function $renderCards(cards){\r\n\t// Number of top cards to display\r\n\tlet counter = STORE.displayedCards;\r\n\tlet topCards = [];\r\n\t// Empty the container in case we refresh\r\n\t$('#clash-cards').empty();\r\n\t// Loop through the array of cards to render applicable data\r\n\tcards.forEach(card => {\r\n\t\t// If the counter hits 0, stop displaying cards\r\n\t\tif(counter > 0){\r\n\t\t\ttopCards.push(card.id);\r\n\t\t\t// Basic DOM object we create and appending info to it\r\n\t\t\tlet $card = $(`<div class=\"card\" data-id=\"${card.id}\">`);\r\n\t\t\t$card.append(`<p class=\"name\">${card.name}</p>`);\r\n\t\t\t$card.append(`<img class=\"app-card\" src=\"${card.cardImg}\" alt=\"${card.name}\">`);\r\n\t\t\t$card.append(`<p class=\"percent\">Win-Rate: <span class=\"perc\">${card.winPerc}%</span></p>`);\r\n\t\t\t$card.append(`<p class=\"use-rate\">Use-Rate: <span class=\"usage\">${card.useRate}%</span></p>`);\r\n\t\t\t// Render the card to the DOM\r\n\t\t\t$('#clash-cards').append($card);\r\n\t\t\t// Remove one from the counter (if 0, stop rendering)\r\n\t\t\tcounter--;\r\n\t\t}\r\n\t})\r\n\treturn topCards;\r\n}", "createCardObjects(cardsBatch, batch_uid, barcodeArray) {\r\n let cardsArray = [];\r\n for (let barcode of barcodeArray) {\r\n let card = {\r\n charityID: cardsBatch.charityID,\r\n charityName: cardsBatch.charityName,\r\n creatorID: cardsBatch.creatorID,\r\n creatorName: cardsBatch.creatorName,\r\n ownerName: \"None\",\r\n ownerLocation: \"None\",\r\n quotaPerMonth: cardsBatch.quotaPerMonth,\r\n quotaPerDay: cardsBatch.quotaPerDay,\r\n redeemedToday: 0,\r\n redeemedThisMonth: 0,\r\n batchUID: batch_uid,\r\n enabled: false,\r\n barcode: barcode\r\n };\r\n cardsArray.push(card);\r\n }\r\n return cardsArray;\r\n }", "function Cards(id, group, name, material, location, cardholder) {\n this.id = id;\n this.group = group;\n this.name = name;\n this.material = material;\n this.location = location;\n this.cardholder = cardholder;\n}", "function initCards(){\n\t\t\tvar counter = 0;\n\t\t\tvar value = 1;\n\t\t\t$(\".wrap-fields ul.fields\").empty();\n\t\t\tfor(var i=0; i<settings.cardcnt; i++){\n\t\t\t\tcards[i] = value;\n\t\t\t\t// Create list element for every card\n\t\t\t\t// I already load the cards into the DOM here to have the pictures in the browser cache!\n\t\t\t\t// The cards will be shuffled afterwards, so even if they are in the DOM the user does not know the final positions!\n\t\t\t\t// This could be avoided by using a colour array instead of images!!\n\t\t\t\t$(\".wrap-fields ul.fields\").append('<li class=\"field\" data-index=\"' + i + '\"><div class=\"card back\"><img src=\"img/card_bg.gif\" alt=\"Card Back\" /></div><div class=\"card front\"><img src=\"img/colour' + value + '.gif\" alt=\"Colour ' + value + ' Front\" /></div></li>');\n\t\t\t\tcounter++;\n\t\t\t\tif(counter > 1){\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tvalue++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function setCards() {\n let containerCards = document.getElementById('contenedor-pokemon');\n let emptyCard = '';\n data.pokemon.forEach(poke => emptyCard += createCard(poke));\n\n containerCards.innerHTML = emptyCard;\n}", "function createCards() {\n // Creates the backs of each card and sets the id of each\n let back = document.createElement('div');\n back.className = 'back';\n backs = [];\n\t\n for (i = 0; i <= 3; i++) {\n backs.push(back.cloneNode());\n backs[i].setAttribute('id', `large${i+1}`);\n }\n for (i = 0; i <= 19; i++) {\n backs.push(back.cloneNode());\n backs[i + 4].setAttribute('id', `small${i+1}`);\n }\n\n // Creates the front face and each card container template\n let front = document.createElement('div');\n front.className = 'front';\n\n card.className = 'card available';\n card.appendChild(front.cloneNode());\n\n // Iterates each card and then appends the appropriate card back\n for (i = 0; i <= 23; i++) {\n cards.push(card.cloneNode());\n cards[i].appendChild(backs[i]);\n }\n\n // Creates the card containers and appends the correct cards to them\n let largeContainer = document.createElement('div');\n largeContainer.setAttribute('id', 'large-cards');\n\n let smallContainer = document.createElement('div');\n smallContainer.setAttribute('id', 'small-cards');\n\n for (i = 0; i <= 3; i++) {\n largeContainer.appendChild(cards[i]);\n }\n\n for (i = 0; i <= 19; i++) {\n smallContainer.appendChild(cards[i + 4]);\n }\n\n inputContainer.appendChild(largeContainer);\n inputContainer.appendChild(smallContainer);\n\n assignLarge();\n assignSmall();\n addCardListeners();\n}", "function getCards(data){\n\tvar cards = data.items.MTG.cards;\n\tfor(c in cards){\n\t\tvar name = cards[c].split(\"-\")[0];\n\t\tvar span = $(\"<span>\"+name+\"</span><br>\");\n\t\t$(\"#mtg-list\").append(span);\n\t}\n\treturn null;\n}", "renderCards() {\n return this.props.data.map((item) => {\n return this.props.renderCard(item);\n });\n }", "function instantiateCards(cards) {\n for(var i=0; i<cards.length; i++) {\n cards[i].status = 'blocked';\n switch (cards[i].type) {\n case \"chinese\":\n instantiateChineseCard(cards[i]);\n break;\n default:\n console.log('instatiateCards: unhandled card type', cards[i].type);\n break;\n }\n }\n if( cards.length > 0)\n cards[0].status = 'active';\n}", "function setupDeck() {\r\n deckOfCards = [];\r\n hand = [];\r\n for (var i = 0; i < suits.length; i++) {\r\n for (var j = 0; j < values.length; j++) {\r\n deckOfCards.push(new Card(suits[i],values[j]))\r\n }\r\n }\r\n}", "'board.getCards' (boardId) {\n let userId = this.userId\n let board = Boards.findOne({\"_id\": boardId});\n if (board) {\n // Check user's permission:\n let userRole = boardUtils.getUserRole(userId, board)\n if(canPerform(userRole, ACCESS_CARD)){\n let cards = []\n board.boardList.map((list) => {\n // noinspection JSAnnotator\n let theList = Meteor.call('getList',list._id)\n theList.listCard.map((card) => {\n cards.push(card)\n })\n })\n return cards\n } else\n throw new Meteor.Error(403, \"You do not have permission to access the cards\")\n } else {\n throw new Meteor.Error(404, 'Board not found')\n }\n }", "function createBoard() {\n debug(\"createBoard\");\n shuffle(cardList);\n cardList.forEach(function(i) {\n newCard = document.createElement('li');\n newIcon = document.createElement('i');\n deck = document.querySelector('.deck');\n \n newCard.setAttribute(\"class\", \"card\");\n newIcon.setAttribute(\"class\", i);\n deck.appendChild(newCard);\n deck.lastChild.appendChild(newIcon);\n })\n evtListener(); \n }", "function CardList(props) {\n var els = [];\n for (var i = 0; i < props.cards.length; ++i) {\n els.push(e(\n Card,\n Object.assign({key: 'card-' + i}, props.cards[i])));\n }\n return e('div', null, els);\n}", "async _setCardsData() {\n this.cardsData = await CardHelper.fetchCardsData(\n this.numTotalCards,\n 1,\n this.cardsDataUrl\n );\n this.numTotalCards = this.cardsData.length;\n }", "function addCard (crd) {\n openCardList.push(crd);\n}", "function DeckOfCards() {\n var cards = [];\n var _listOfFaces = new Array(\"ace\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"jack\", \"queen\", \"king\");\n var _listOfSuits = new Array(\"clubs\", \"diamonds\", \"hearts\", \"spades\");\n\n function all52Cards() {\n for (var j = 0; j < _listOfFaces.length; j++) {\n for (var k = 0; k < _listOfSuits.length; k++) {\n cards.push(new CardConstructer(_listOfFaces[j], _listOfSuits[k]));\n }\n }\n }\n all52Cards(); // running the function once so the cards[] array is filled with 52 cards without need to return sequenced cards as we shuffle it later anyway\n\n}", "async function getCards() {\n const response = await fetch(`/api/pokemon/${pokemon_name}`);\n const cards = response.json();\n return cards;\n }", "buildDeck(){\n for(let i = 1; i < 14; i++){\n for(let j = 0; j < 4; j++){\n let value = '';\n let suit = '';\n let point = i;\n if(j == 0){\n suit = 'Heart';\n }\n if(j == 1){\n suit = 'Diamond';\n }\n if(j == 2){\n suit = 'Club';\n }\n if(j == 3){\n suit = 'Spade';\n }\n value = i.toString();\n if(i == 1){\n value = 'Ace';\n point = 1;\n }\n if(i == 11){\n value = 'Jack';\n point = 10;\n }\n if(i == 12){\n value = 'Queen';\n point = 10;\n }\n if(i == 13){\n value = 'King';\n point = 10;\n }\n this.base.push(new Card(suit, value, point));\n }\n }\n }", "function freshDeck() {\n return SUITS.flatMap(suit => {\n return VALUES.map(value => {\n return new Card(suit, value)\n })\n })\n }", "function Cards() {\r\n \"use strict\";\r\n \r\n // Construct the object\r\n var cards = Object.create(Array.prototype,\r\n { \r\n // Return card at end of array (without changing array).\r\n topCard: {value:\r\n function () {\r\n return this[this.length-1];\r\n } \r\n },\r\n \r\n // Remove and return card at given location.\r\n getCard: {value:\r\n function (cardLoc) {\r\n var theCard = null; // Default value; indicates failure\r\n if (0 <= cardLoc && cardLoc < this.length) {\r\n \r\n // Note that splice() returns an array, even if there is\r\n // only one element in the array. We want the element, not\r\n // the array, which is why the [0] appears.\r\n theCard = this.splice(cardLoc,1)[0];\r\n }\r\n return theCard;\r\n }\r\n },\r\n \r\n // Return index of card matching given string, or -1 if\r\n // not present.\r\n indexOf: {value: \r\n function (move) {\r\n var loc = -1;\r\n for (var i=0; i<this.length && loc < 0; i++) {\r\n if (move == this[i].toString()) {\r\n loc = i;\r\n }\r\n }\r\n return loc;\r\n } \r\n },\r\n \r\n // Return card matching given string, or null if not present.\r\n findCard: {value:\r\n function (move) {\r\n var loc = this.indexOf(move);\r\n return loc<0 ? null : this[loc];\r\n } \r\n },\r\n \r\n // Randomly shuffle the cards.\r\n shuffle: {value:\r\n function () {\r\n for (var i=1; i<this.length; i++) {\r\n var nMinusi = this.length - i;\r\n var ri = Math.floor(Math.random()*(nMinusi+1));\r\n var tmp = this[ri];\r\n this[ri] = this[nMinusi];\r\n this[nMinusi] = tmp;\r\n }\r\n return;\r\n } \r\n },\r\n \r\n // Sort the cards in ascending order according to the \r\n // value (sort order) of Card.\r\n sortCards: {value:\r\n function () {\r\n var compareCards = \r\n function (first, second) {\r\n return first.valueOf() - second.valueOf();\r\n };\r\n this.sort(compareCards);\r\n return;\r\n } \r\n }\r\n });\r\n \r\n // return constructed object\r\n return cards;\r\n }", "setupDeck(){\r\n for (let cardName in this.deck){\r\n let cardJSON = this.deck[cardName];\r\n let cardTop = new CardHalf(cardJSON.topTitle,cardJSON.topText,\r\n new Function(\"card\", cardJSON.topEffect));\r\n let cardBottom = new CardHalf(cardJSON.bottomTitle,cardJSON.bottomText,\r\n new Function(\"card\", cardJSON.bottomEffect));\r\n let card = new Card(cardTop,cardBottom,cardName);\r\n card.owner = this;\r\n this.deck[cardName] = card;\r\n }\r\n }", "static async getAllCards() {\n const cards = await db.query(`SELECT * FROM cards`);\n return cards.rows;\n }", "function constructCardList(cards) {\n if (cards.length !== 0) {\n let ul = document.createElement(\"ul\");\n cards.forEach(function(card) {\n // add the plus icon\n let image = document.createElement(\"img\");\n image.src = \"images/plus.png\";\n image.alt = \"Add \" + card.name + \" to current deck\";\n let figure = document.createElement(\"figure\");\n figure.appendChild(image);\n\n let info = card.name + \" [\" + card.set + \"]\"\n let para = document.createElement(\"p\");\n para.appendChild(document.createTextNode(info));\n\n let li = document.createElement(\"li\");\n li.id = card.id;\n li.appendChild(para);\n li.appendChild(figure);\n ul.appendChild(li);\n });\n\n // EVENT DELEGATION\n // display detailed information about a card when the user clicks on a list item\n ul.addEventListener(\"click\", (event) => {\n // if the add button is clicked, we perform a different action\n let closestListItem = event.target.closest(\"#pokemon-list li\");\n fetchCardDataById(closestListItem.id)\n .then(cardData => {\n if (event.target.tagName === \"IMG\") {\n addToDeckView(cardData);\n } else {\n loadModal(cardData);\n }\n })\n .catch(error => console.error(\"Failure to fetch card data with error=\" + error));\n });\n document.getElementById(\"pokemon-list\").appendChild(ul);\n } else {\n let ul = document.createElement(\"ul\");\n let li = document.createElement(\"li\");\n li.appendChild(document.createTextNode(\"No results found. Try a different search term?\"));\n ul.appendChild(li);\n document.getElementById(\"pokemon-list\").appendChild(ul);\n }\n }", "function createDeck(){\n let deck = [];\n for (let suitIdx = 0; suitIdx<suits.length; suitIdx++){\n for (let valueIdx = 0; valueIdx<values.length; valueIdx++){\n let card = {\n suit: suits[suitIdx],\n value: values[valueIdx]\n };\n deck.push(card);\n }\n }\n return shuffle(deck);\n}", "function createCard(){\n event.preventDefault();\n\n var newCard = new Card(titleInput.value, urlInput.value);\n addCardToList(newCard);\n increaseCardCounter();\n}", "function storeCards(cs) {\n cards = cs;\n return cs;\n }" ]
[ "0.7443371", "0.70586115", "0.69401056", "0.68297523", "0.6676877", "0.6621398", "0.6576024", "0.6500268", "0.64240956", "0.6417418", "0.6409213", "0.64086944", "0.64015234", "0.6390988", "0.6373608", "0.63731164", "0.6362767", "0.6354633", "0.632621", "0.63109356", "0.6301604", "0.627408", "0.6270736", "0.6266019", "0.62647074", "0.6260054", "0.62399215", "0.6210609", "0.620004", "0.6157053", "0.61535925", "0.6151362", "0.61441916", "0.6126951", "0.6096269", "0.6091788", "0.60870826", "0.6087018", "0.6084782", "0.60790294", "0.6069894", "0.6066232", "0.6065793", "0.6051923", "0.6051121", "0.6042546", "0.60374105", "0.60301006", "0.60229677", "0.6022599", "0.60135347", "0.6010195", "0.6010137", "0.6002347", "0.59951234", "0.59928906", "0.59919125", "0.5986625", "0.5980088", "0.59711784", "0.59610254", "0.59468526", "0.5945085", "0.5941758", "0.5931149", "0.5930785", "0.59298027", "0.5926795", "0.59245956", "0.5921055", "0.5913147", "0.59073067", "0.58995396", "0.588273", "0.587819", "0.587209", "0.5869217", "0.5858434", "0.5853371", "0.5853043", "0.5849672", "0.58420235", "0.5839931", "0.5833951", "0.58302224", "0.5829203", "0.582843", "0.5827829", "0.58276314", "0.5824718", "0.5816166", "0.58110785", "0.5808079", "0.5806088", "0.5805615", "0.57970995", "0.57969105", "0.5787969", "0.57867104", "0.5782286", "0.57753915" ]
0.0
-1
Renders The Nav Bar
function NavBarItem(props){ return( <Navbar bg="dark" variant="dark"> <Navbar.Brand href="#home"> <img alt="" src={require('./logo.svg')} width="30" height="30" className="d-inline-block align-top" />{' '} React Bootstrap </Navbar.Brand> </Navbar> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderNavBar() {\n\t //if navBar, delete\n\t var oldNav = document.querySelector('.cat-nav-bar');\n\n\t if (oldNav) {\n\t oldNav.parentNode.removeChild(oldNav);\n\t }\n\n\t var newNavBar = createNavBar(cats);\n\n\t catHolderMaster.appendChild(newNavBar);\n\n\t}", "function renderNavigationMenu() {\n\n }", "function renderNavBar(data){\n for (let i = 0; i < data.length; i++){\n let name = data[i];\n let result = '<li><a href=\"#\" class=\"navBtn\" id=\"' + i + '\">' + name + '</a></li>';\n $('#navBar').append(result);\n }\n }", "function _render() {\n _$navbar.setMod(_B_BAR, _M_WEBAPP, _isWebapp);\n _renderBtn(_$btnL);\n _renderBtn(_$btnR);\n _renderDropdown();\n _renderSearch();\n _renderHead();\n }", "function DisplayNav() {\n switch (userInfo.accountType) {\n case 'E':\n return (<EmpNav />)\n\n case 'U':\n return (<UserNav />)\n\n default:\n return (<VisitNav />)\n }\n }", "function navigationBar() {\n authToken = localStorage.getItem(\"authToken\");\n $('#container').show();\n\n if (authToken === null) {\n navBar.find('a').hide();\n navBar.find('.active').show();\n showMainView();\n $('#welcome-container').find(\"h2\").show()\n welcomeButtons.show()\n profile.hide()\n } else {\n $('#welcome-container').find(\"h2\").hide()\n welcomeButtons.hide()\n navBar.find('a').show();\n navBar.find('.active').show();\n loadAllListings()\n profile.show();\n profile.find(\"a:first-child\").text(\"Welcome \" + localStorage.getItem(\"username\"))\n }\n }", "function generateNav(callback){\n\t\t\tdocument.getElementById(\"terminal\").innerHTML = framework[\"terminal\"];\n\t\t\tdocument.getElementById(\"terminal-content\").innerHTML = framework[\"nav\"];\n\t\t\tcallback(current_tab);\n\t\t}", "function NavBar () {\n\n return ( \n <nav className=\"navigation-items\">\n <div>\n <h1 id=\"header\">Forager's Recipe Book</h1>\n </div>\n <Link to=\"/home\"><h2>Home🏡</h2></Link>\n <Link to=\"/addform\"><h3>Add to the Collection!</h3></Link>\n <Link to=\"/about\"><h3>About</h3></Link> \n </nav>\n );\n}", "function displayNavBar () {\n navItems.forEach(item => {\n const newEle = document.createElement('li');\n const newLink = document.createElement('a');\n navigateByClick(newEle,item);\n newLink.textContent = item.getAttribute('data-nav');\n newLink.classList.add('menu__link');\n newEle.appendChild(newLink);\n fragment.appendChild(newEle)\n })\n navList.appendChild(fragment)\n}", "render() {\n return (\n <nav className=\"navbar navbarstyle navbar-static-top\">\n <div className=\"navbar-inner\">\n <div className=\"container\">\n <div className=\"navbar-header\">\n <div className=\"navbar-brand\">\n <Link to=\"/\">\n <img alt=\"uGate Icon\" src=\"./images/ugatelogo.png\"/>\n\n uGate &reg;</Link>\n </div>\n </div>\n\n <ul className=\"nav navbar-nav navbar-right\">\n <li>\n\n\n <p className=\"navbar-text\">New to uGate?</p>\n </li>\n <li>\n <Link to=\"/SignUp\">\n <span className=\"glyphicon glyphicon-user\"></span> Sign Up\n </Link>\n </li>\n </ul>\n\n </div>\n </div>\n </nav>\n );\n }", "render() {\n\n return(\n\n <div>\n <div className='navBar'>\n <div className='navBar-left'>\n PRT Customers App\n </div>\n\n <div className='navBar-right'>\n <NavLink \n to='/addCustomer'\n className='nav-link'\n activeClassName='nav-link-active'\n >\n <Icon.UserPlus size={ 18.5 } /> &nbsp; Add Customer\n </NavLink>\n <NavLink \n to='/customerList'\n className='nav-link'\n activeClassName='nav-link-active'\n >\n <Icon.List size={ 18.5 } /> &nbsp; Customers List\n </NavLink>\n </div>\n </div> \n </div>\n );\n }", "function leftNav() {\n\tapp.getView().render('content/folder/customerserviceaboutusleftnav');\n}", "function buildNavBar() {\n let sectioninfo = '';\n\n //add each section to the navigation bar\n sections.forEach(section => {\n let sectionId = section.id;\n let sectionData = section.dataset.nav;\n sectioninfo += `<li><a class=\"menu__link ${sectionId}\" href=\"#${sectionId}\">${sectionData}</a></li>`;\n });\n navbar.innerHTML = sectioninfo;\n}", "render() {\n return( \n <nav className=\"navbar navbar-default\">\n <div className=\"navbar-header\">\n </div>\n <ul className=\"nav navbar-nav navbar-right\">\n <li> <a href=\"/home\"> HOME </a> </li>\n <li> <a href=\"/submit\"> SUBMIT </a> </li>\n </ul>\n </nav>\n )\n }", "function buildNavBar(navItems) {\n // Create starting html for nav list\n let navigationList = '<ul><li><a href=\"https://bhogge2.github.io/acme-project/index.html\" title=\"Go to the home page\">Home</a></li>';\n\n // Input the rest of the items into the nav along with the proper HTML\n for (let i = 0; navItems.length > i; i++) {\n navigationList += '<li><a href=\"https://bhogge2.github.io/acme-project/' + \n navItems[i].toLowerCase() + '.html\" title =\"Go to the ' + navItems[i] + ' page\">' + navItems[i] + '</li>';\n }\n\n // Close ul\n navigationList += '</ul>';\n\n console.log(\"Nav Bar inner HTML = \" + navigationList);\n \n return navigationList;\n\n\n}", "static renderNavigationBar(props) {\n return <NavBarWithProps {...props}/>;\n }", "function buildNavBar(){\n// based on the number of sections nav elements will be created for each section\n sections.forEach(function(section){\n let sectionData = section.dataset.nav\n\n let anchor = document.createElement('a')\n anchor.href = '#' + section.id\n anchor.dataset.section = section.id\n anchor.innerText = sectionData\n\n let item = document.createElement('li')\n item.appendChild(anchor)\n\n navBarList.appendChild(item)\n })\n navBarList.style = 'display: flex; text-align: center; justify-content: space-around; margin-top: 15px; margin-bottom: 15px;'\n}", "render() {\n return(\n <div className=\"nav-div\">\n <div className=\"nav-box\">\n Stats\n </div>\n <div className=\"nav-roster\">\n Saved Rosters\n </div>\n <div className=\"nav-box\">\n Welcome, Username\n <div>Log out</div> \n </div>\n </div>\n )\n }", "render() {\n \t\treturn(\n \t\t\t<nav className=\"navbar navbar-inverse\">\n \t\t\t\t<div className=\"container\">\n \t\t\t\t\t<Link className=\"navbar-brand\" to=\"/\">Quotes</Link>\n \t\t\t\t\t<ul className=\"nav navbar-nav\">\n \t\t\t\t\t<li><Link to=\"/\">Home</Link></li>\n \t\t\t\t\t<li><Link to=\"/favorites\">Favorites</Link></li> \t\t\t\t\t\n \t\t\t\t\t</ul> \t\t\t\t\t \n \t\t\t\t</div>\n \t\t\t</nav>\n \t\t\t)\n }", "function app_render_navigation() {\r\n\r\n $('nav').empty();\r\n appData.tagList.forEach(function (value, index) {\r\n let myHTML = `<button class=\"app_nav_cell\" data-index=\"${index}\" value=\"${appData.tagList[index]}\" oncontextmenu=\"app_nav_remove(this)\" onclick=\"app_get_images(this)\">${appData.tagList[index]}</button>`;\r\n $('nav').append(myHTML);\r\n });\r\n}", "function ssoGenerateNavigationBar($username) {\n $r = '';\n $r += '<a class=\"t0\" href=\"http://arduino.cc/en/\">Main Site</a> ';\n $r += '<a class=\"t0\" href=\"http://arduino.cc/blog/\">Blog</a> ';\n $r += '<a class=\"t1\" href=\"http://arduino.cc/playground/\">Playground</a> ';\n $r += '<a class=\"t0\" href=\"http://arduino.cc/forum/\">Forum</a> ';\n $r += '<a class=\"t0\" href=\"http://labs.arduino.cc/\">Labs</a> ';\n $r += '<a class=\"t0\" href=\"http://store.arduino.cc/ww/\">Store</a> ';\n document.getElementById(\"ssoNavBar\").innerHTML = $r;\n\n if (cookieExists('arduino_sso_authorized')) {\n\t$user_state = $LOGGED_IN;\n\tssoGenerateLogoutBar($username);\n } else {\n\t$user_state = $LOGGED_OUT;\n\tssoGenerateLoginBar();\n }\n\n /* load the first timer, to check whether the user is logged in */\n window.setTimeout(\"stateMachine()\",1000);\n\n /* setup a clock to check periodically whether the user is there */\n window.setInterval(\"stateMachine()\",5000);\n}", "function triggerNav() {\n \n /* \n * navopen var stores the info that the user wants to show the navbar or to hide it.\n * navopen is a boolean variable that switches the boolean variable from true to false or vice versa \n */\n navopen = !navopen;\n\n /* \n * If the navopen is true that means User wants to show the navbar then add width, border and border-color by calling the \n * helper function stated above.\n * These values are observations and hence you can change according to you.\n */\n if(navopen){\n setAttributePanel(\"350px\", \"5px solid\", \"white\");\n }else{\n\n /* Otherwise make the width: 0, border: \"\", border-color: \"\" in order to hide the side panel */\n setAttributePanel(\"0px\", \"\", \"\");\n }\n}", "function generate_navBar() {\n var links = [\"#hero_section\", \"#aboutUs\", \"#service\",\n \"#Portfolio\", \"#team\", \"#contact\"];\n var texts_arr = [\"HOME\", \"CAST\", \"PLOT & HISTORY\",\n \"PHOTOS\", \"TEAM\", \"COMMENT\"];\n var section_arr = [\"sec1\", \"sec2\", \"sec3\",\n \"sec4\", \"sec5\", \"sec6\"];\n var ul = document.createElement(\"ul\");\n var li, a, text;\n for (var i = 0, l = links.length; i < l; ++i) {\n li = document.createElement('li');\n a = document.createElement('a');\n text = document.createTextNode(texts_arr[i]);\n\n a.href = links[i];\n\n a.appendChild(text);\n li.appendChild(a);\n //li.id = section_arr[i];\n a.setAttribute(\"class\", section_arr[i]);\n ul.appendChild(li);\n ul.setAttribute(\"class\", \"nav navbar-nav navStyle\");\n\n }\n var element = document.getElementById(\"mainNav\");\n element.appendChild(ul);\n}", "function buildNavBar() {\n // loops over each section in sections\n for (let i=0; i<sections.length; i++) {\n const sectionName = sections[i].dataset.nav;\n const sectionId = sections[i].id;\n //creates new <li> element in the nav ul\n const tab = document.createElement('li');\n //ammends the innerHTML of li item to include link\n tab.innerHTML = `<a id=\"nav_${sectionId}\" class=\"menu__link\" href=\"#${sectionId}\">${sectionName}</a>`;\n // tab.innerHTML = `<a id=\"${sectionId}\" class=\"menu__link\" href=\"#${sectionId}\">${sectionName}</a>`;\n //appends the finished li to the parent ul\n nav.appendChild(tab);\n }\n}", "render() {\n\t\treturn (\n\t\t\t<Navbar fixedTop >\n\t\t <Navbar.Header>\n\t\t\t\t <Navbar.Brand> \n\t\t\t\t\t\t<a href=\"/\">Romcal</a>\n\t\t\t\t </Navbar.Brand>\n\t\t\t\t</Navbar.Header>\n\t\t\t\t<Nav>\n\t\t\t\t\t<LinkContainer exact to=\"/\">\n\t\t\t\t <NavItem eventKey={1}>Home</NavItem>\n\t\t\t\t </LinkContainer>\n\t\t\t\t\t<LinkContainer exact to=\"/calendar\">\n\t\t\t\t <NavItem eventKey={2}>Calendar</NavItem>\n\t\t\t\t </LinkContainer>\n\t\t\t\t</Nav>\n\t\t\t</Navbar>\n\t\t);\n\t}", "function buildNav(data){\n\tconsole.log('data',data);\n\tvar list=document.createElement('ul');\n\n\t//build headers\n\tfor (var key in data[0]) {\n\t\t if (data[0].hasOwnProperty(key)) {\n\t\t // console.log(key + \" -> \" , data[0][key]);\n\t\t var item=document.createElement('li');\n\t\t var itemText=document.createTextNode(key);\n\t\t item.appendChild(itemText);\n\t\t list.appendChild(item);\n \n\t\t //build data for bar chart\n\t\t }\n\t\t}\n\n\n\tdocument.getElementsByTagName('nav')[0].appendChild(list);\n\n}", "function buildNavigation() {\n getSectionDetails();\n const nav = document.querySelector('#navbar__list');\n let navigation = '';\n for (let i = 0; i < sectionHeadings.length; i ++){\n // During initialisation, for the first nav item, use active state. For others, use standard state.\n navigation += '<li id=\"'+navIds[i]+'\" class=\"'+ (i === 0 ? NAV_CLASS_NAME_ACTIVE : NAV_CLASS_NAME) +'\" onclick=\"onLinkClicked(this)\" data-section=\"'+sectionIds[i]+'\">'+sectionHeadings[i]+'</li>'\n }\n nav.innerHTML = navigation;\n}", "function _navBarList(req, res, next) {\n var session = req.session,\n user = session.user;\n\n if (!navbars[session.language] || !navbars[session.language][user.rank]) {\n _createNavbarLists(session.language, user.rank, user.allowedPages);\n }\n res.locals.navbarList = navbars[session.language][session.user.rank];\n\n next();\n}", "render(){\n return (\n <nav>\n <ul className=\"navbar\">\n <Link to='/' style={{textDecoration: \"none\"}}>\n <li className=\"title\">Tick-it</li>\n </Link>\n {this.linkButton()}\n </ul>\n </nav>\n )\n }", "function buildNav(){\n \n sections.forEach(createLi); // applying the createLi function for each Elements\n navBar.appendChild(docFrag);// now we can add the Fragment With contains all li elements to the navBar\n}", "render() {\r\n return (\r\n <Navbar brand='Tinda' className=\"pink\" right>\r\n <NavItem>\r\n {this.props.children}\r\n </NavItem>\r\n <NavItem>\r\n <Link to=\"/user\">Viewer</Link>\r\n </NavItem>\r\n <NavItem>\r\n <Link to=\"/\">Admin</Link>\r\n </NavItem>\r\n </Navbar>\r\n );\r\n }", "render() {\n return (\n <div>\n <nav className=\"navBar\">\n {TokenServices.hasAuthToken()\n ? this.renderHomeLinks()\n : this.renderLoginLinks()}\n </nav>\n </div>\n )\n }", "function onPageLoad() {\r\n genNavBar();\r\n}", "render() {\n return (\n <div className=\"Menu\">\n <nav>\n <ul>\n <li><a href=\"#home\">Home</a></li>\n <li><a href=\"#services\">Services</a></li>\n <li><a href=\"#innovation\">Innovation</a></li>\n <li><a href=\"#guestbook\">Guestbook</a></li>\n </ul>\n </nav>\n </div>\n );\n }", "function initNavBar() {\n // Get the nav list element\n const navbar = document.querySelector(\"#navbar__list\");\n // Get all sections\n const sections = document.querySelectorAll(\"section\");\n // Iterate through sections to build nav\n for (let i = 0; i < sections.length; i++) {\n // function create nav Item => Create Item in navbar\n const navItem = createNavItem(sections[i]);\n navbar.appendChild(navItem);\n }\n }", "function navigationBar (){\n navigation.classList.add('nav');\n content.appendChild(navigation);\n \n homeBtn();\n menuBtn();\n drinksBtn();\n accomodationBtn();\n contactsBtn();\n}", "function NavBar(props) {\n\treturn (\n\t\t\n\t\t <div class=\"x-navbar-wrap\">\n\t\t <div class=\"x-navbar\">\n\t\t <div class=\"x-navbar-inner\">\n\t\t <div class=\"x-container max width\"> \n\t\t\t\t\t<h1 class=\"visually-hidden\">Coded.</h1>\n\t\t\t\t\t<a href=\"http://www.joincoded.com/\" class=\"x-brand img\" title=\"Code Education\">\n\t\t\t\t\t <img src=\"//www.joincoded.com/wp-content/uploads/2017/10/codedlogo.png\" alt=\"Code Education\"/>\n\t\t\t\t\t </a> \n\t\t\t\t\t<a href=\"#\" id=\"x-btn-navbar\" class=\"x-btn-navbar collapsed\" data-x-toggle=\"collapse-b\" data-x-toggleable=\"x-nav-wrap-mobile\" aria-selected=\"false\" aria-expanded=\"false\" aria-controls=\"x-widgetbar\">\n\t\t\t\t\t <i class=\"x-icon-bars\" data-x-icon=\"&#xf0c9;\"></i>\n\t\t\t\t\t <span class=\"visually-hidden\">Navigation</span>\n\t\t\t\t\t</a>\n\n\t\t\t\t\t<nav class=\"x-nav-wrap desktop\" role=\"navigation\">\n\t\t\t\t\t <ul id=\"menu-menu\" class=\"x-nav\">\n\t\t\t\t\t <li id=\"menu-item-170\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-home menu-item-170\">\n\t\t\t\t\t <a href=\"http://www.joincoded.com/\">\n\t\t\t\t\t <span>Home</span></a></li>\n\t\t\t\t\t<li id=\"menu-item-3874\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-3874\">\n\t\t\t\t\t<a><span>Bootcamps</span></a>\n\t\t\t\t\t<ul class=\"sub-menu\">\n\t\t\t\t\t\t<li id=\"menu-item-3907\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3907\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/full-stack-bootcamp/\">\n\t\t\t\t\t\t<span>Full-Stack Bootcamp</span></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li id=\"menu-item-3503\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3503\">\n\t\t\t\t\t<a href=\"http://www.joincoded.com/student-stories/\">\n\t\t\t\t\t<span>Student Stories</span></a></li>\n\t\t\t\t\t<li id=\"menu-item-3965\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-3965\">\n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<span>Apply</span></a>\n\t\t\t\t\t<ul class=\"sub-menu\">\n\t\t\t\t\t\t<li id=\"menu-item-2191\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-2191\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/apply/\">\n\t\t\t\t\t\t<span>Apply for the Full-Stack Bootcamp</span></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li id=\"menu-item-529\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-529\">\n\t\t\t\t\t<a href=\"http://www.joincoded.com/contact-us/\">\n\t\t\t\t\t<span>Contact Us</span></a></li>\n\t\t\t\t\t<li id=\"menu-item-1193\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1193\">\n\t\t\t\t\t<a href=\"http://www.joincoded.com/blog/\">\n\t\t\t\t\t<span>Blog</span></a>\n\t\t\t\t\t<ul class=\"sub-menu\">\n\t\t\t\t\t\t<li id=\"menu-item-1195\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1195 tax-item tax-item-71\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/category/news/\">\n\t\t\t\t\t\t<span>News</span></a></li>\n\t\t\t\t\t\t<li id=\"menu-item-1194\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1194 tax-item tax-item-69\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/category/the-student-experience/\">\n\t\t\t\t\t\t<span>The Student Experience</span></a></li>\n\t\t\t\t\t\t<li id=\"menu-item-1817\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1817 tax-item tax-item-127\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/category/resources/\">\n\t\t\t\t\t\t<span>Coding Resources</span></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\n );\n}", "function MAIN_NAVIGATION$static_(){ToolbarSkin.MAIN_NAVIGATION=( new ToolbarSkin(\"main-navigation\"));}", "function NavigationBarGenerator() {\n\t\tthis.bar = null;\n\t\tthis.leftItems = [];\n\t\tthis.middleItems = [];\n\t\tthis.rightItems = [];\n\t\n\t\t// remove margin of body\n\t\tconst body = document.querySelector(\"body\");\n\t\tbody.style = \"margin: 0px\";\n\t}", "function Nav() {\n return (\n\n <nav id=\"nav\" role=\"navigation\">\n <a href=\"#nav\" title=\"Show navigation\">Show navigation</a>\n <a href=\"#\" title=\"Hide navigation\">Hide navigation</a>\n\n <ul>\n <li>\n <Link to=\"/\">Home</Link>\n </li>\n <li>\n <a href=\"/\" aria-haspopup=\"true\"><span>Pages</span></a>\n <ul>\n <li><Link to=\"/overfishing\">Over Fishing</Link></li>\n <li><Link to=\"/pollution\">Pollution</Link></li>\n <li><Link to=\"/redtide\">Red Tide</Link></li>\n <li><Link to=\"/messageboard\">Message Board</Link></li>\n <li><Link to =\"/interactivegame\">Interactive Game</Link></li>\n \n </ul>\n </li>\n\n <li>\n <Link to=\"/flashCard\">Quiz</Link>\n </li>\n <li><Link to=\"/login\">Log In</Link></li>\n </ul>\n\n </nav>\n \n );\n\n}", "function Nav() {\n return (\n <div>\n Nav<br/>\n <Link to='/dashboard'><button>Home</button></Link><br/>\n <Link to='/new'><button>New Post</button></Link><br/>\n <Link to='/'><button>Logout</button></Link><br/>\n </div>\n )\n}", "function NavBar () {\n return(\n <div>\n <nav id=\"navbar\" >\n <ul className=\"navbar-links\" >\n <Link to='/home' id=\"title\" style={{ textDecoration: 'none', color: 'black' }}>\n <li>PokeMars-Mart</li>\n </Link>\n <Link to='/items' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Shop</li>\n </Link>\n <Link to='/users' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Sign Up</li>\n </Link>\n <Link to='/users' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Log In</li>\n </Link>\n <Link to='/items' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Cart (0) <span class=\"fas fa-shopping-cart\"></span></li>\n </Link>\n </ul>\n </nav>\n </div>\n ) \n}", "function populateNavBar() {\n const nav = document.getElementById('nav');\n nav.className = 'navbar navbar-expand navbar-light bg-light';\n\n const title = document.createElement('span');\n title.className = 'navbar-brand center';\n title.innerHTML = 'WorldStats';\n nav.appendChild(title);\n\n const outerContainer = document.createElement('div');\n outerContainer.id = 'navbarNavAltMarkup';\n outerContainer.className = 'collapse navbar-collapse';\n nav.appendChild(outerContainer);\n\n const innerContainer = document.createElement('div');\n innerContainer.className = 'navbar-nav';\n outerContainer.appendChild(innerContainer);\n\n const about = document.createElement('a');\n about.className = 'nav-item nav-link';\n about.href = '/about';\n about.innerHTML = 'About';\n innerContainer.appendChild(about);\n\n const cards = document.createElement('a');\n cards.className = 'nav-item nav-link';\n cards.href = '/cards';\n cards.innerHTML = 'Country Cards';\n innerContainer.appendChild(cards);\n\n const graphs = document.createElement('a');\n graphs.className = 'nav-item nav-link';\n graphs.href = '/graphs';\n graphs.innerHTML = 'Country Graphs';\n innerContainer.appendChild(graphs);\n}", "function addNavBar(){\n\t$(\"header\").html(\"<nav class=\\\"navbar navbar-inverse navbar-fixed-top\\\" style=\\\"margin-bottom: 0px; border-radius: 0px;\\\">\\n\" +\n\t\t\" <div class=\\\"container-fluid\\\">\\n\" +\n\t\t\" <div class=\\\"navbar-header\\\">\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<button type=\\\"button\\\" class=\\\"navbar-toggle\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#myNavbar\\\">\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<span class=\\\"icon-bar\\\"></span>\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<span class=\\\"icon-bar\\\"></span>\\n\" +\n\t\t\"\t\t\t\t\t\t\t\t\t\t<span class=\\\"icon-bar\\\"></span>\\n\"+\n\t\t\"\t\t\t\t\t\t\t\t\t\t</button>\\n\" +\n\t\t\" <a class=\\\"navbar-brand\\\" href=\\\"#\\\"><strong>La Bahía del Momo</strong></a>\\n\" +\n\t\t\" </div>\\n\" +\n\t\t\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"myNavbar\\\">\\n\"+\n\t\t\" <ul class=\\\"nav navbar-nav\\\">\\n\" +\n\t\t\" <li class=\\\"dropdown\\\">\\n\" +\n\t\t\" <a class=\\\"dropdown-toggle\\\" data-toggle=\\\"dropdown\\\" href=\\\"#\\\">Categorías\\n\" +\n\t\t\" <span class=\\\"caret\\\"></span></a>\\n\" +\n\t\t\" <ul class=\\\"dropdown-menu\\\">\\n\" +\n\t\t\" <li><a id=\\\"featuredLink\\\" href=\\\"#featured\\\">Momos Destacados</a></li>\\n\" +\n\t\t\" <li><a id=\\\"pepeLink\\\" href=\\\"#pepe\\\">Pepe</a></li>\\n\" +\n\t\t\" <li><a id=\\\"feelLink\\\" href=\\\"#feel\\\">Feel</a></li>\\n\" +\n\t\t\" <li><a id=\\\"dogeLink\\\" href=\\\"#doge\\\">Doge</a></li>\\n\" +\n\t\t\" </ul>\\n\" +\n\t\t\" </li>\\n\" +\n\t\t\" </ul>\\n\" +\n\t\t\" <ul class=\\\"nav navbar-nav navbar-right\\\" id=\\\"right-navBar\\\">\\n\" +\n\t\t\" <!--<li><a href=\\\"#\\\"><span class=\\\"glyphicon glyphicon-user\\\"></span> Sign Up</a></li>-->\\n\" +\n\t\t\" <li><a id=\\\"wishList\\\" href=\\\"#\\\">Mi lista de deseos</a></li>\\n\" +\n\t\t\" <li><a id=\\\"cartIcon\\\" href=\\\"src/views/cart.html\\\"><span class=\\\"glyphicon glyphicon-shopping-cart\\\"></span></a></li>\\n\" +\n\t\t\"\t\t\t\t\t<li><a href=\\\"src/views/register.html\\\" id=\\\"loginBtn\\\"></a></li>\\n\"+\n\t\t\" </ul>\\n\" +\n\t\t\" </div>\\n\" +\n\t\t\" </div>\\n\" +\n\t\t\" </nav>\");\n\n}", "function navBar(){\n\t\t$('.nav-button').click(function(){\n\t\t\t$('.nav-content').toggleClass('nav-hide');\n\t\t});\t\n\t}", "function createNavigationBarToggleButton() {\n var NavFrames = $('.NavFrame').addClass('NavVisible').each(function () {\n var $navHead = $(this).find('.NavHead:first');\n $navHead.filter('legend').append(' - ');\n var $buttonLink = $('<span tabIndex=0 class=collapseLink />').text(msg(\"hide\")).onLink(function (e) {\n toggleNavigationBar($(this).closest('.NavFrame'));\n });\n var $button = $('<span class=\"NavToggle collapseButton\" />')\n if (config.brackets) $button.append(document.createTextNode(config.brackets.substr(0, config.brackets.length / 2)), $buttonLink, config.brackets.substr(config.brackets.length / 2));\n else $button.append($buttonLink);\n $navHead[config.linkBefore ? \"prepend\" : \"append\"]($button);\n });\n // if more Navigation Bars found than Default: hide all\n if (NavFrames.length >= config.autoCollapse) NavFrames.not('.noautocollapse').each(function () {\n toggleNavigationBar(this);\n });\n else NavFrames.filter('.collapsed').each(function () {\n toggleNavigationBar(this);\n });\n }", "function createNavigationBarToggleButton() {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if( hasClass(NavFrame, \"NavFrame\") ) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n for (\n var NavChild = NavFrame.firstChild;\n NavChild != null;\n NavChild = NavChild.nextSibling\n ) {\n if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {\n if (NavChild.style.display == 'none') {\n NavToggleText = document.createTextNode(NavigationBarShow);\n break;\n }\n }\n }\n \n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0;\n j < NavFrame.childNodes.length;\n j++\n ) {\n if( hasClass(NavFrame.childNodes[j], \"NavHead\") ) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n}", "function getNav(arr) {\n return \"<nav>\\n\" + arr.map(x => \" <a href=\\\"\\\">\" + x + \"</a>\").join(\"\\n\") + \"\\n</nav>\";\n}", "function displayHeader(){\r\n\r\n var headerContent = '<nav class=\"navbar navbar-inverse navbar-fixed-top \">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <div class=\"navbar-header\"></div>'\r\n headerContent += ' <div id=\"navbar\" class=\"navbar-collapse collapse\"></div> <!--/.navbar -->'\r\n headerContent += ' <ul class=\"list-unstyled\">'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/index.html\"><strong>HOME</strong></a></li> '\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/functions.html\">FUNCTIONS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/primeNumGen.html\">CONTROL FLOW</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/debug.html\">DEGUB CODE</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/DOM.html\">DOM/DHTML</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/forms.html\">FORMS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/objects.html\"> OBJECTS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP8</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP9</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP10</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP11</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP12</a></li></ul>'\r\n headerContent += ' </div>'\r\n headerContent += '</nav>'\r\n headerContent += '<!-- Main jumbotron -->'\r\n headerContent += ' <div class=\"jumbotron\">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <h2><span class=\"glyphicon glyphicon-king\" aria-hidden=\"true\"></span> Tyler Hunt\\'s <code>CS-2513 JavaScript Website</code> </h2>'\r\n headerContent += ' </div>'\r\n headerContent += ' </div>'\r\n headerContent += ' <!-- Main jumbotron -->'\r\n\r\n var pageHeader = document.getElementsByTagName('header');\r\n pageHeader[0].innerHTML = headerContent;\r\n}", "renderEmpty () {\n return (\n <NavItem>\n <NavLink>Sepet Bos</NavLink>\n </NavItem>\n )\n }", "function navBar(students) {\n\tvar howManyPagesCreated = howManyPages(students);\n\t$('.pagination ul li').remove();\n\tfor( i = 1; i <= howManyPagesCreated; i++){\n\t\thtml = '<li><a href=#>' + i + '</a></li>';\n\t\t$('.pagination ul').append(html);\t\n\t}\n\t$('.pagination ul li:first a').addClass('active');\n}", "function renderNavbar() {\n const logo = $(\n '<li class=\"nav-item logo\"><button class=\"nav-link\"><span class=\"link-text\">School Tools</span><i class=\"fas fa-bars fa-2x\"></i></button></li>'\n );\n const home = $(\n '<li class=\"nav-item\"><a href=\"/\" id=\"homeLink\" class=\"nav-link\" title=\"Home\"><i class=\"fas fa-home fa-2x\"></i><span class=\"link-text\">Home</span></a></li>\"'\n );\n const prioritizer = $(\n '<li class=\"nav-item\"><a href=\"prioritizer\" id=\"prioritizerLink\" class=\"nav-link\" title=\"Prioritizer\"><i class=\"fas fa-calendar-check fa-2x\"></i><span class=\"link-text\">Prioritizer</span></a></li>\"'\n );\n const calculator = $(\n '<li class=\"nav-item\"><a href=\"calculator\" id=\"calcLink\" class=\"nav-link\" title=\"Calculator\"><i class=\"fas fa-calculator fa-2x\"></i><span class=\"link-text\">Calculator</span></a></li>\"'\n );\n const planner = $(\n '<li class=\"nav-item\"><a href=\"planner\" id=\"plannerLink\" class=\"nav-link\" title=\"Planner\"><i class=\"fas fa-calendar-alt fa-2x\"></i><span class=\"link-text\">Planner</span></a></li>\"'\n );\n const essay = $(\n '<li class=\"nav-item\"><a href=\"writing-counter\" id=\"essayLink\" class=\"nav-link\" title=\"Essay Counter\"><i class=\"fas fa-file fa-2x\"></i><span class=\"link-text\">Essay Counter</span></a></li>\"'\n );\n const theme = $(\n '<li class=\"nav-item\"><a class=\"nav-link\" title=\"Switch Theme\"><i class=\"fas fa-adjust fa-2x\"></i><span class=\"link-text\">Theme</span></a></li>\"'\n );\n const ul = $('<ul class=\"navbar-nav\"></ul>').append(\n logo,\n home,\n prioritizer,\n calculator,\n planner,\n essay,\n theme\n );\n\n return ul;\n}", "function Navbar(){\n return(\n <nav>\n <a href='www.google.com'>Google</a> |\n <a href='www.facebook.com'>Facebook</a> |\n <a href='www.amazon.com'>Amazon</a> |\n <a href='www.netflix.com'>Netflix</a>\n </nav>\n );\n}", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n for (\n var NavChild = NavFrame.firstChild;\n NavChild != null;\n NavChild = NavChild.nextSibling\n ) {\n if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {\n if (NavChild.style.display == 'none') {\n NavToggleText = document.createTextNode(NavigationBarShow);\n break;\n }\n }\n }\n \n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n }", "render() {\n return this.state.isLoading ? (\n <div className={styles.loading}>Dogz not out yet</div>\n ) : (\n <nav>\n <ul className={styles.list}>\n {this.state.breeds.map((breed, i) => (\n <li className={styles.listItem} key={i}>\n <Link to={`/${breed.path}`} className={styles.link}>\n {breed.displayName}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n );\n }", "generateHTML() {\n return `<nav>${this.generateMenu(this.data)}</nav>`;\n }", "function openNav(data) {\n document.getElementById(\"mySidenav\").style.width = \"500px\";\n getNavBar_html(data);\n document.getElementById(\"main\").style.marginLeft = \"500px\";\n document.body.style.backgroundColor = \"rgba(0,0,0)\";\n document.getElementById(\"main\").style.opacity = \"0.2\";\n}", "function renderNavigation() {\n // CREATE NAVBAR IN DOM from MAIN_LINKS in data.js\n $('#header').append(componentNavbar());\n $('.sidebar-wrapper').append(componentSidebar());\n for (let link of MAIN_LINKS) {\n $('#navbar-list').append(componentNavbarList(link));\n }\n $('#navbar-list').append(\n '<li> <button type=\"button\" id=\"side-bar-button\" class=\"btn btn\"><i class=\"bi bi-cart-fill text-light\"></i></button></li>'\n );\n //SHOW SIDEBAR HANDLER\n $('#side-bar-button').click(function (e) {\n generateTotal();\n $('.sidebar-wrapper').css('display', 'block');\n });\n\n //HIDE SIDEBAR HANDLERS\n // BUTTON\n $('#side-bar-close').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar-wrapper').css('display', 'none');\n });\n // MODAL\n $('.sidebar-wrapper').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar').click(function (e) {\n e.stopPropagation();\n });\n $('.sidebar-wrapper').css('display', 'none');\n });\n // CREATE FOOTER IN DOM\n $('.footer-container').append(componentFooter());\n}", "function buildNavigationBar() {\n let pageSections = document.getElementsByTagName('section');\n let mainUl = document.getElementById('navbar__list');\n let fragment = document.createDocumentFragment();\n\n for (const sec of pageSections) {\n const secTitle = sec.getAttribute(\"data-nav\");\n const listItem = document.createElement('LI');\n const htmlText = '<a data-nav=\\\"' + secTitle + '\\\">' + secTitle + '</a>';\n\n listItem.insertAdjacentHTML('beforeend', htmlText);\n listItem.addEventListener('click', goToSection);\n //using DocumentFragment because appendChild is a expensive proccess, for better performance\n fragment.appendChild(listItem);\n }\n //painting and reflow happens only one time after the loop\n mainUl.appendChild(fragment);\n}", "render() {\n return (\n <Navbar>\n <Navbar.Header>\n <Navbar.Brand>\n <a href=\"/\">{t(\"Учет УСН 6%\")}</a>\n </Navbar.Brand>\n </Navbar.Header>\n <Nav>\n <NavItem eventKey={1} href=\"/#incomes\" style={this.props.setStyle('income')}>\n {t(\"Доходы\")}\n </NavItem>\n <NavItem eventKey={2} href=\"/#spendings\" style={this.props.setStyle('spending')}>\n {t(\"Расходы\")}\n </NavItem>\n <NavItem eventKey={3} href=\"/#reports\" style={this.props.setStyle('report')}>\n {t(\"Отчеты\")}\n </NavItem>\n <NavItem eventKey={4} href=\"/#companies\" style={this.props.setStyle('company')}>\n {t(\"Организации\")}\n </NavItem>\n <NavItem eventKey={5} href=\"/#accounts\" style={this.props.setStyle('account')}>\n {t(\"Банковские счета\")}\n </NavItem>\n <NavItem eventKey={6} onClick={() => this.props.logout()}>{t(\"Выход\")}</NavItem>\n </Nav>\n </Navbar>\n )\n }", "function _enableNavBar() {\n if (_options.enableNavBar) {\n var $navBar = $(_renderDirNavbar(_currentDir));\n\n if ($(\"#pfsd-navbar-container\").length === 0) {\n $('<div id=\"pfsd-navbar-container\"></div>').insertBefore(\".modal-body\");\n }\n $(\"#pfsd-navbar-container\").empty();\n $(\"#pfsd-navbar-container\").append($navBar);\n _arrangeNavBar();\n }\n }", "renderHomeLinks() {\n return (\n <div className='navContents'>\n {TokenServices.hasAuthToken() && <Nickname />}\n <div role=\"navigation\" className=\"burgerIcon\" id=\"burger\" onClick={this.burgerClick}> &#9776; </div>\n <ul aria-live=\"polite\" className=\"links null\" id=\"links\" onClick={this.burgerClick}>\n <li><Link to='/contacts'>Contacts</Link></li>\n <li><Link to='/alerts'>My Alerts</Link></li>\n <li><Link to='/delete-account'>Settings</Link></li>\n <li><Link onClick={this.signOut} to='/auth/login' >Log Out</Link></li>\n </ul>\n </div>\n )\n }", "getNavBar() {\n const studentLink = '#/student/' + currentUser.studentId;\n\n return (\n <Navbar>\n <Navbar.Header>\n <Navbar.Brand>\n <a href=\"#/home\">classcoder!</a>\n </Navbar.Brand>\n </Navbar.Header>\n <Nav>\n <NavItem eventKey={1} href={studentLink}>Student</NavItem>\n <NavItem eventKey={2} href=\"#/teacher\">Teacher</NavItem>\n </Nav>\n </Navbar>\n );\n }", "function NavBar () {\n return(\n <header>Header menu here</header>\n )\n}", "render() {\n const { auth } = this.props;\n return (\n <nav>\n <div className=\"nav-wrapper\">\n <Link to={auth ? \"/surveys\" : \"/\"} className=\"left brand-logo\">\n Feedback\n </Link>\n <ul id=\"nav-mobile\" className=\"right \">\n {this.renderContent()}\n </ul>\n </div>\n </nav>\n );\n }", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "function createNavigationBarToggleButton()\n {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "render(){ \n return (\n <section className=\"navigation schoger-border is-transparent\">\n <nav className=\"navbar is-white\">\n\n <div className=\"navbar-brand\" >\n <Link to='/' className=\"navbar-item\">\n <img src={logo} alt=\"intelliSound Logo\" height=\"60\"/>\n </Link>\n\n <div className=\"navbar-burger burger is-white\"\n data-target= \"Options\"\n onClick={(event) => this.handleToggleHamNav(event)} >\n <span></span>\n <span></span>\n <span></span>\n </div>\n </div>\n\n <div className=\"navbar-menu\" id='navbar-menu-id'>\n <div className=\"navbar-start\"></div>\n\n <div className=\"navbar-end\" id=\"Options\">\n <Link to=\"/\" className=\"navbar-item has-text-centered\">Home</Link>\n <Link to=\"/about\" className=\"navbar-item has-text-centered\">About Us</Link>\n\n </div>\n </div>\n\n <div className=\"navbar-item\"></div>\n\n </nav>\n </section>);\n }", "function displayHeader(){\r\n\r\n var headerContent = '<nav class=\"navbar navbar-inverse navbar-fixed-top \">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <div class=\"navbar-header\"></div>'\r\n headerContent += ' <div id=\"navbar\" class=\"navbar-collapse collapse\"></div> <!--/.navbar -->'\r\n headerContent += ' <ul class=\"list-unstyled\">'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/index.html\"><strong>HOME</strong></a></li> '\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/functions.html\">FUNCTIONS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/primeNumGen.html\">CONTROL FLOW</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/debug.html\">DEGUB CODE</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/DOM.html\">DOM/DHTML</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"../pages/forms.html\">FORMS</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 07</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 08</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 09</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 10</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 11</a></li>'\r\n headerContent += ' <li><a class=\"navbar-brand\" href=\"#\"> CSP 12</a></li></ul>'\r\n headerContent += ' </div>'\r\n headerContent += '</nav>'\r\n headerContent += '<!-- Main jumbotron -->'\r\n headerContent += ' <div class=\"jumbotron\">'\r\n headerContent += ' <div class=\"container\">'\r\n headerContent += ' <h2><span class=\"glyphicon glyphicon-king\" aria-hidden=\"true\"></span> Tyler Hunt\\'s <code>CS-2513 JavaScript Website</code> </h2>'\r\n headerContent += ' </div>'\r\n headerContent += ' </div>'\r\n headerContent += ' <!-- Main jumbotron -->'\r\n\r\n var pageHeader = document.getElementsByTagName('header');\r\n pageHeader[0].innerHTML = headerContent;\r\n}", "function buildNavBar() {\n const sections = document.querySelectorAll('section');\n const docFragment = document.createDocumentFragment();\n sections.forEach((section) => {\n const listItem = document.createElement('li');\n const anchor = document.createElement('a');\n anchor.setAttribute('class', 'menu__link');\n anchor.setAttribute('href', `#${section.id}`);\n anchor.textContent = section.dataset.nav;\n listItem.appendChild(anchor);\n docFragment.appendChild(listItem);\n });\n listOfItems.appendChild(docFragment);\n}", "render() {\n\t\treturn (\n\t\t\t<Collapse className=\"text-center\" navbar>\n\t\t\t\t<Nav navbar>\n\t\t\t\t\t<NavItem>\n\t\t\t\t\t\t<Button onClick = {this.handleLogOut} className=\"btn-nav mx-3\">\n\t\t\t\t\t\t\tLog Out\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</NavItem>\n\t\t\t\t</Nav>\n\t\t\t</Collapse>\n\t\t);\n\t}", "renderNavigation() {\n if (this.state.windowWidth <= 524) {\n return (\n <div className=\"mobile-nav\">\n <p className=\"mobile-bars\" onClick={this.handleNavClick}>\n <i className=\"fa fa-bars\" id=\"hamburger\" aria-hidden=\"true\" />\n </p>\n {this.renderMobileNav()}\n </div>\n );\n }\n return (\n <div className=\"navbar\">\n {this.navigationLinks()}\n </div>\n );\n }", "function createNavigationBarToggleButton()\n{\n\tvar indexNavigationBar = 0;\n\t// iterate over all < div >-elements, < span >-elements, and <fieldset>-elements\n\tvar blocks = document.getElementsByTagName(\"div\");\n\tvar spans = document.getElementsByTagName(\"span\");\n\tvar fieldsets = document.getElementsByTagName(\"fieldset\");\n\tfor(\n\t\t\tvar i=0;\n\t\t\ti < spans.length;\n\t\t\ti++\n\t\t) blocks[blocks.length+i] = spans[i];\n\tfor(\n\t\t\tvar i=0;\n\t\t\ti < fieldsets.length;\n\t\t\ti++\n\t\t) blocks[blocks.length+spans.length+i] = fieldsets[i];\n\tfor(\n\t\t\tvar i=0; \n\t\t\tNavFrame = blocks[i]; \n\t\t\ti++\n\t\t) {\n\t\t// if found a navigation bar\n\t\tif (hasClass(NavFrame, \"NavFrame\")) {\n \n\t\t\tindexNavigationBar++;\n\t\t\tvar NavToggle = document.createElement(\"a\");\n\t\t\tNavToggle.className = 'NavToggle';\n\t\t\tNavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n\t\t\tNavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n\t\t\tvar NavToggleText = document.createTextNode(NavigationBarHide);\n\t\t\tNavToggle.appendChild(NavToggleText);\n\t\t\t// Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n\t\t\tfor(\n\t\t\t var j=0; \n\t\t\t j < NavFrame.childNodes.length; \n\t\t\t j++\n\t\t\t) {\n\t\t\t if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n\t\t\t\tif( NavFrame.childNodes[j].tagName.toLowerCase() == 'legend' )\n\t\t\t\t\tNavFrame.childNodes[j].appendChild(document.createTextNode(' - '));\n\t\t\t\tNavFrame.childNodes[j].appendChild(NavToggle);\n\t\t\t }\n\t\t\t}\n\t\t\tNavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n\t\t}\n\t}\n\t// if more Navigation Bars found than Default: hide all\n\tif (indexNavigationBar >= NavigationBarShowDefault) {\n\t\tfor(\n\t\t\t\tvar i=1; \n\t\t\t\ti<=indexNavigationBar; \n\t\t\t\ti++\n\t\t) {\n\t\t\ttoggleNavigationBar(i);\n\t\t}\n\t}\n \n}", "function createNavigationBarToggleButton() {\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for(\n var i=0; \n NavFrame = divs[i]; \n i++\n ) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(\n var j=0; \n j < NavFrame.childNodes.length; \n j++\n ) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n // if more Navigation Bars found than Default: hide all\n if (NavigationBarShowDefault < indexNavigationBar) {\n for(\n var i=1; \n i<=indexNavigationBar; \n i++\n ) {\n toggleNavigationBar(i);\n }\n }\n \n }", "function showNavigation(){\r\n\tvar nav = document.getElementById(\"navBar\");\r\n\tnav.style = \"display:block !important\";\r\n\t\r\n}", "render() {\n return (\n // create the nav bar using pre-defined terms and styling from Bootstrap\n <nav className=\"navbar navbar-expand-lg navbar-light bg-light mb-2\">\n {/* Create a link that takes users to the home page and call the link Google Books */}\n <Link className=\"navbar-brand\" to=\"/\">\n Google Books\n </Link>\n {/* Create a button with the following data points. Upon click it should trigger the toggleNav function */}\n <button\n onClick={this.toggleNav}\n className=\"navbar-toggler\"\n data-toggle=\"collapse\"\n data-target=\"#navbarNav\"\n aria-controls=\"navbarNav\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n >\n <span className=\"navbar-toggler-icon\" />\n </button>\n {/* create a div with a class navbar-collapse when the state of the nav bar is collpased */}\n <div className={`${this.state.open ? \"\" : \"collapse \"}navbar-collapse`} id=\"navbarNav\">\n {/* create an unorder listed that contains links */}\n <ul className=\"navbar-nav\">\n {/* create a list item that is link to the homepage with the name Search*/}\n <li className=\"nav-item\">\n {/* create an onclick that triggers the toggleNav function above */}\n <Link \n onClick={this.toggleNav}\n className={window.location.pathname === \"/\" ? \"nav-link active\" : \"nav-link\"}\n to=\"/\"\n >\n Search\n </Link>\n </li>\n {/* create a list item that send users to the Saved books page */}\n <li className=\"nav-item\">\n {/* create an onclick that triggers the toggleNav function */}\n <Link\n onClick={this.toggleNav}\n className={window.location.pathname === \"/saved\" ? \"nav-link active\" : \"nav-link\"}\n to=\"/saved\"\n >\n Saved\n </Link>\n </li>\n </ul>\n </div>\n </nav>\n );\n }", "function createNavigationBarToggleButton()\n{\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for (var i = 0; NavFrame = divs[i]; i++) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var NavToggleText = document.createTextNode(NavigationBarHide);\n for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {\n if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {\n if (NavChild.style.display == 'none') {\n NavToggleText = document.createTextNode(NavigationBarShow);\n break;\n }\n }\n }\n \n NavToggle.appendChild(NavToggleText);\n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(var j=0; j < NavFrame.childNodes.length; j++) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n}", "render(props) {\r\n const navImageSrc = this.props.isNavOpen ? '/images/x.svg' : '/images/bars.svg';\r\n\r\n if (Session.get('loggedIn') === true) {\r\n return (\r\n <div className=\"header\">\r\n <div className=\"header__content\">\r\n <img className=\"header__nav-toggle\" src={navImageSrc} onClick={this.props.handleNavToggle}/>\r\n <h1 className=\"header__title\">{this.props.title}</h1>\r\n <button className=\"button button--link-text\" onClick={() => this.props.handleLogout()}>Logout</button>\r\n </div>\r\n </div>\r\n );\r\n } else {\r\n return (\r\n <div className=\"header\">\r\n <div className=\"header__content\">\r\n <h1 className=\"header__title\">{this.props.title}</h1>\r\n <Link to=\"/login\" className=\"button button--link\">Login</Link>\r\n <Link to=\"/signup\" className=\"button button--link\">Signup</Link>\r\n </div>\r\n </div>\r\n );\r\n }\r\n }", "function setNavigation() {\r\n\t\t\tvar i, html = '';\r\n\r\n\t\t\t//generate the buttons\r\n\t\t\tif(o.buttons) {\r\n\t\t\t\t$nav = $('<ul />', {\r\n\t\t\t\t\tid: o.navigationId\r\n\t\t\t\t});\r\n\t\t\t\tfor(i = 0; i < itemNum; i++) {\r\n\t\t\t\t\thtml += '<li><span></span></li>';\r\n\t\t\t\t}\r\n\t\t\t\t$nav.html(html).appendTo($root).fadeIn(700);\r\n\r\n\t\t\t\t$navLi = $nav.find('li');\r\n\t\t\t\t$navLi.eq(0).addClass(o.selectedClass);\r\n\t\t\t}\r\n\r\n\t\t\t//generate the arrows\r\n\t\t\tif(o.arrows) {\r\n\t\t\t\t$prevArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.prevArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t\t$nextArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.nextArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t}\r\n\r\n\t\t}", "function left_nav(separator, linktags, latest) {\n if(separator == undefined) {\n separator = \"<br>\";\n }\n \n if(linktags == undefined) {\n linktags = \"\";\n }\n \n if(latest == undefined) {\n\t\tlatest = 1;\n }\n \n\tvar i = 0\n\n\tfor(i = 0; i < leftbar.length; i+= 2) {\n\t\t// append website root to non-external links\n\t\tif(leftbar[i+1].indexOf(\"http\") == -1) {\n\t\t\tdocument.write(\"<a \" + linktags + \" href='\" + website[1] + \"/\" + leftbar[i+1] + \"'>\" + leftbar[i] + \"</a>\" + separator)\n\t\t} else {\n\t\t\tdocument.write(\"<a \" + linktags + \" href='\" + leftbar[i+1] + \"'>\" + leftbar[i] + \"</a>\" + separator)\n\t\t}\n\t\tif(leftbar[i] == \"Announcements\" && latest != 0) {\n\t\t\tdocument.write(\"<b>Latest: \" + latestannouncement + \"</b>\" + separator)\n\t\t}\n\t\tdocument.write(separator)\n\t}\n}", "render() {\n const {navItems} = this.state;\n const {first, last} = this.props;\n\n return(\n <Navbar fluid inverse>\n <Navbar.Header>\n <Navbar.Brand>\n {first} {last}\n </Navbar.Brand>\n <Navbar.Toggle/>\n </Navbar.Header>\n <Navbar.Collapse>\n <Nav>\n {navItems.map(item => {\n return(\n <NavItem \n id={item[0]}\n key={item[1]}\n eventKey={item[1]}\n onClick={e => this.handleClick(e,item)}\n >\n {item[0]}\n </NavItem>\n );\n })} \n </Nav>\n </Navbar.Collapse>\n </Navbar>\n );\n }", "function writeNavWidth () {\n document.write(navWidth) ;\n }", "function makeNavBar() {\n for (let i = 0; i < sections.length; i++) {\n let liElement = document.createElement('li'); //create menu items\n liElement.setAttribute('class', 'Section');\n let links = document.createElement('a'); //create the links for menu items\n links.setAttribute('class', 'navLink');\n content = sections[i].getAttribute('data-nav');\n path = sections[i].getAttribute('id');\n links.setAttribute('href', `#${path}`);\n links.innerText = `${content}`;\n navList.appendChild(liElement);\n liElement.appendChild(links);\n\n }\n}", "function buildNavigation(){\n for (let i=0; i < sectionList.length; i++){\n const newMenuItem = document.createElement('li');\n const sectionName = sectionList[i].getAttribute('data-nav')\n const sectionId = sectionList[i].getAttribute('id')\n newMenuItem.innerHTML = createNavItemHTML(sectionId, sectionName)\n fragment.appendChild(newMenuItem);\n }\n const navBarList = document.getElementById('navbar__list')\n navBarList.appendChild(fragment);\n}", "render() {\n return (\n <div>\n \t<div style={{background: '#292E33', height: '60px', display: 'flex', alignItems: 'center'}}>\n \t\t<ul className=\"nav\">\n \t\t\t<li className=\"nav-item\">\n \t\t\t\t<Link to=\"/\" className=\"nav-link active custom-nav\"> Home </Link>\n \t\t\t</li>\n <li className=\"nav-item\">\n <Link to=\"/hospitals\" className=\"nav-link active custom-nav\"> Hospitals </Link>\n </li>\n \t\t</ul>\n \t</div>\n </div>\n );\n }", "render() {\n const pathName = this.props.location.pathname.split('/');\n pathName.shift();\n const pathLength = pathName.length;\n const { branch, repo } = this.props;\n\n return (\n <header>\n {Object.keys(branch).length || typeof branch === 'string' ? (\n <div>\n <NavItem path=\"/repos\" name=\"Repositories > \" repository={true} />\n <NavItem\n path={`/repos/${repo}`}\n name={`${repo} > `}\n isRepo={true}\n breadcrumb={true}\n />\n <i className=\"fas fa-code-branch\" />\n <span> branches</span>\n <NavItem\n path={`/repos/${repo}/branches/${branch.name}`}\n name={` > ${this.renderBranchName(branch)}`}\n isBranch={true}\n branch={branch}\n breadcrumb={true}\n />\n </div>\n ) : repo ? (\n <div>\n <NavItem\n path=\"/repos\"\n name=\"Repositories > \"\n repository={true}\n breadcrumb={true}\n />\n <NavItem\n path={`/repos/${repo}`}\n name={`${repo}`}\n isRepo={true}\n breadcrumb={true}\n />\n </div>\n ) : (\n <div>\n <NavItem\n path=\"/repos\"\n name=\"Repositories\"\n repository={true}\n breadcrumb={true}\n />\n </div>\n )}\n </header>\n );\n }", "function Header() {\n return (\n <div className=\"wrapper\">\n <img src={GRTH} alt=\"imageGRTH\" />\n <div className=\"nav-bar\">\n <Link className=\"link\" to=\"/homePage\">\n home page\n </Link>\n {'|'}\n <Link className=\"link\" to=\"/folders\">\n folders\n </Link>\n {'|'}\n <Link className=\"link\" to=\"/summary\">\n summary\n </Link>\n </div>\n </div>\n );\n}", "function Nav(conf) {\n\n var self = this;\n\n this.conf = conf;\n this.navbar_obj = document.getElementById(gs_nav_placeholder_id);\n\n /* The nav is a <ul> with items <li> and page links <a>. */\n this.genNavListTags = function() {\n\n for (index = 0; index < self.conf.nav_items.length; index++) {\n\n var li = document.createElement('li');\n var a = document.createElement('a');\n var item = self.conf.nav_items_bname[index]; // get link names\n\n /* Select active page and nav buttons. Make nav items non-active\n * by default. */\n appendAttribute(a, 'class', 'non-active-nav');\n\n /* make the nav tab show up as 'active' by excluding it from\n * the non-active-nav class. */\n if (self.conf.requested_page == item) {\n a.removeAttribute('class');\n appendAttribute(li, 'class', 'active');\n }\n\n appendAttribute(li, 'id', 'navitem');\n appendAttribute(li, 'class', 'nav-item');\n\n /* setup nav links for each button */\n appendAttribute(a, 'class', 'nav-link');\n appendAttribute(a, 'href', '?page='+item+'#');\n appendAttribute(a, 'data-toggle','tab');\n\n /* make sure the ribbon doesn't get in the way */\n appendAttribute(a, 'style', 'z-index: 1000;');\n\n /* set nav button name */\n a.innerHTML = item;\n\n li.appendChild(a);\n self.navbar_obj.appendChild(li);\n }\n };\n this.genNavListTags();\n\n}", "function navagationArray () {\n $(\".nav\").append(\"<li><a href='index.html'>Home</a></li>\" + \n \"<li><a href='FindAPet_Shelter.html'>Shelters</a></li>\" + \n \"<li><a href='Lost&Found.html'>Lost &amp; Found</a></li>\" + \n \"<li><a href='AddAPet.html'>Add A Pet</a></li>\" +\n \"<li><a href='Admin.html'>Admin Panel</a></li>\");\n }", "onRender () {\n let Navigation = new NavigationView();\n App.navigationRegion.show(Navigation);\n Navigation.setItemAsActive(\"home\");\n }", "function toggleNavBar () {\n $('#navigatorbar').toggleClass('show');\n $('.sub-nav').toggleClass('show');\n $('#thumbnail').removeClass('active');\n }", "function createNavigationBarToggleButton()\n{\n var indexNavigationBar = 0;\n // iterate over all < div >-elements \n var divs = document.getElementsByTagName(\"div\");\n for (var i = 0; NavFrame = divs[i]; i++) {\n // if found a navigation bar\n if (hasClass(NavFrame, \"NavFrame\")) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement(\"a\");\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);\n NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');\n \n var isCollapsed = hasClass( NavFrame, \"collapsed\" );\n /*\n * Check if any children are already hidden. This loop is here for backwards compatibility:\n * the old way of making NavFrames start out collapsed was to manually add style=\"display:none\"\n * to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make\n * the content visible without JavaScript support), the new recommended way is to add the class\n * \"collapsed\" to the NavFrame itself, just like with collapsible tables.\n */\n for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {\n if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {\n if ( NavChild.style.display == 'none' ) {\n isCollapsed = true;\n }\n }\n }\n if (isCollapsed) {\n for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {\n if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {\n NavChild.style.display = 'none';\n }\n }\n }\n var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);\n NavToggle.appendChild(NavToggleText);\n \n // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)\n for(var j=0; j < NavFrame.childNodes.length; j++) {\n if (hasClass(NavFrame.childNodes[j], \"NavHead\")) {\n NavFrame.childNodes[j].appendChild(NavToggle);\n }\n }\n NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);\n }\n }\n}", "function Nav () {\n return (\n <nav className=\"navbar navbar-expand-lg navbar-light bg-light\">\n <a className=\"navbar-brand\" href=\"/saved\">\n SAVED BOOKS\n </a>\n <a className=\"navbar-brand\" href=\"/\">\n SEARCH FOR NEW\n <span className=\"sr-only\">(current)</span>\n </a>\n </nav>\n );\n}", "render() {\n return (\n <View style={Styles.header}>\n <View style={Styles.menu}>\n {this.renderMenuItem(t(\"USERS\"),Styles.menuItemLeft,\n this.props.activeScreen === Screens.USERS_LIST,this.props.gotoUsers)\n }\n {this.renderMenuItem(t(\"PROFILE\"),Styles.menuItemRight,\n this.props.activeScreen === Screens.PROFILE,this.props.gotoProfile)\n }\n </View>\n </View>\n )\n }", "renderNavMenu(){\n let navBarMenu = this.state.navBarMenu;\n let navBarSelections = navBarMenu.map((navBarSelection, index) => {\n let activeClass = navBarSelection.active ? \" activated\" : \"\";\n return (\n <a href={`#${navBarSelection.id}`} className={`Banner-Menu-Selection ${activeClass}`} onClick={()=>this.updateNavMenu(index)}>\n <div className=\"Banner-Menu-Selection__Name\">{navBarSelection.name}</div>\n </a>\n )\n })\n return (\n <div id=\"Banner-Menu-Endless\" className=\"Endless-Detail__Banner-Menu\">\n <nav className=\"Endless-Detail__Container Banner-Menu-Wrapper\">\n {navBarSelections}\n </nav>\n </div>\n )\n }", "function buildNav(){\n const navList = document.getElementById(\"navbar__list\");\n for (let i of getAllSections()){\n const item = makeNavItem(i);\n navList.appendChild(item);\n }\n}", "function createNavigationBarToggleButton() {\n var indexNavigationBar = 0;\n var NavFrame;\n var NavChild;\n /* iterate over all < div >-elements */\n var divs = document.getElementsByTagName( 'div' );\n for ( var i = 0; (NavFrame = divs[i]); i++ ) {\n /* if found a navigation bar */\n if ( $( NavFrame ).hasClass( 'NavFrame' ) ) {\n \n indexNavigationBar++;\n var NavToggle = document.createElement( 'a' );\n NavToggle.className = 'NavToggle';\n NavToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar );\n NavToggle.setAttribute( 'href', '#' );\n $( NavToggle ).on( 'click', $.proxy( window.toggleNavigationBar, window, indexNavigationBar ) );\n \n var isCollapsed = $( NavFrame ).hasClass( 'collapsed' );\n /**\n * Check if any children are already hidden. This loop is here for backwards compatibility:\n * the old way of making NavFrames start out collapsed was to manually add style=\"display:none\"\n * to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make\n * the content visible without JavaScript support), the new recommended way is to add the class\n * \"collapsed\" to the NavFrame itself, just like with collapsible tables.\n */\n for ( NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling ) {\n if ( $( NavChild ).hasClass( 'NavPic' ) || $( NavChild ).hasClass( 'NavContent' ) ) {\n if ( NavChild.style.display === 'none' ) {\n isCollapsed = true;\n }\n }\n }\n if ( isCollapsed ) {\n for ( NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {\n if ( $( NavChild ).hasClass( 'NavPic' ) || $( NavChild ).hasClass( 'NavContent' ) ) {\n NavChild.style.display = 'none';\n }\n }\n }\n var NavToggleText = document.createTextNode( isCollapsed ? NavigationBarShow : NavigationBarHide );\n NavToggle.appendChild( NavToggleText );\n \n /* Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked) */\n for( var j = 0; j < NavFrame.childNodes.length; j++ ) {\n if ( $( NavFrame.childNodes[j] ).hasClass( 'NavHead' ) ) {\n NavToggle.style.color = NavFrame.childNodes[j].style.color;\n NavFrame.childNodes[j].appendChild( NavToggle );\n }\n }\n NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );\n }\n }\n}" ]
[ "0.7378136", "0.7335155", "0.6867642", "0.68675387", "0.68566644", "0.6759498", "0.67142713", "0.65211177", "0.65088344", "0.6491339", "0.6435851", "0.6422452", "0.6419913", "0.6415462", "0.6360725", "0.6356849", "0.63450503", "0.6341991", "0.633546", "0.6322069", "0.631369", "0.62455136", "0.6207614", "0.61998117", "0.61968917", "0.618658", "0.6182752", "0.6182706", "0.61773944", "0.6145955", "0.6140423", "0.61385584", "0.6138175", "0.6120753", "0.6119798", "0.611799", "0.6094102", "0.60882396", "0.60748744", "0.6074874", "0.6065195", "0.6054156", "0.6044684", "0.6044585", "0.60325533", "0.60259485", "0.6015558", "0.6008889", "0.6008802", "0.60081154", "0.60022634", "0.6001797", "0.5999596", "0.59881794", "0.5965347", "0.5961686", "0.5952742", "0.59494", "0.5942586", "0.5935302", "0.59299654", "0.59156275", "0.5909629", "0.5903933", "0.5902966", "0.5900012", "0.5900012", "0.5900012", "0.5900012", "0.5900012", "0.5900012", "0.5883609", "0.5880999", "0.5878842", "0.586972", "0.58629805", "0.5862505", "0.5843831", "0.5839381", "0.58345336", "0.583299", "0.58319914", "0.581456", "0.58143926", "0.58078927", "0.5805313", "0.579478", "0.5787234", "0.57866436", "0.5786142", "0.5785739", "0.57849956", "0.5778438", "0.5778058", "0.5776741", "0.5764192", "0.5762538", "0.57597", "0.5756803", "0.5749116", "0.57464355" ]
0.0
-1
Sign in the user upon button click.
function handleSignIn(event) { GoogleAuth.signIn(); loginHandler(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleAuthClick() {\n auth2.signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleSignInButtonClick() {\n if (!loggedIn) {\n setHasError(true);\n setErrorMessage('Please log in to continue');\n setShowLogin(!showLogin);\n } else {\n setLoggedIn(true);\n }\n }", "function handleAuthClick() {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n}", "signIn() {}", "function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n}", "function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n}", "function signIn() {\n\tconsole.log(\"Sign In Button Pressed.\");\n\tvar name = $(\"input:text[name=signInName]\").val().trim();\n\tvar pass = $(\"input:password[name=signInPassword]\").val().trim();\n\n\tvar userInfo = {\n\t\tsignInName: name,\n\t\tsignInPassword: pass\n\t}\n\n\t//=-=-=-=-=-=-=-=\n\t$.post(\"/api/user/login\", userInfo)\n .then(function(data){\n \tconsole.log(\"Sent user info: \" + userInfo);\n \tif (data.error)\n \t\t$(\"input:text[name=signInName]\").val(data.error);\n\n \tif (data.success)\n \t\twindow.location = data.redirectTo;\n });\n\t//=-=-=-=-=-=-=-=\n}", "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n\n}", "function logInClick() {\n\tif (!logInBtn) return;\n\n\tlogInBtn.onclick = function() {\n\t\twindow.location.href='protected/admin.php';\n\t}\n}", "function SignInButton(eventId) {\n setEventId(eventId);\n setModalVisibleSignIn(true);\n }", "function handleClick(event){\n console.log(\"Signing in\")\n}", "handleAuthClick() {\n gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick(event) {\n window.gapi.auth2.getAuthInstance().signIn();\n }", "function handleAuthClick() {\n\tgapi.auth2.getAuthInstance().signIn().catch((ignore) => {});\n}", "function interactiveSignIn() {\r\n }", "function handleAuthClick(event) {\n GoogleAuth.signIn();\n }", "function handleAuthClick(event) {\r\n\t console.log(\"Authorized button clicked\");\r\n\tgapi.auth2.getAuthInstance().signIn();\r\n }", "clickLoginButton() {\n this.loginButton.click();\n }", "async login() {\n const I = this;\n I.amOnPage('/');\n I.fillField('input[type=\"email\"]', 'Oleg@swapify.com');\n I.fillField('input[type=\"password\"]', 'Heslo123');\n I.click(locate('button').withText('Prihlásiť sa'));\n }", "function onLoginButtonClick(event) {\n console.log('Digits login started.');\n Digits.logIn().done(onLogin).fail(onFailure);\n return false;\n }", "function signIn(inputEmail = varEmail, inputPassword = varPassword) {\n\n\t\tinputs.get(0).sendKeys(inputEmail);\n\t\tinputs.get(1).sendKeys(inputPassword);\n\n\t\tsignInButton.click();\n\t}", "async clickSignIn() {\n await this.driver.findElement(By.css(SELECTORS.signIn)).click();\n }", "function signIn(e){\r\n\tCloud.Users.login({\r\n\t\tlogin:$.login.value,\r\n\t\tpassword:$.password.value\r\n\t}, function(e){\r\n\t\tif(e.success){\r\n\t\t\tvar tochange=Alloy.createController(\"index\");\r\n\t\t\ttochange.signInButton.title=\"Sign Out\";\r\n\t\t\t$.signWin.close();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$.signWin.close();\r\n\t\t\talert(\"Sign in Failed\");\r\n\t\t}\r\n\t});\r\n\t\r\n\t\r\n}", "function signIn(){\n var dataEntered = getLoginData();\n loginUser(dataEntered);\n}", "function modalLogIn() {\n $(\"#logIn\").find(\".btn-primary\").click(logIn);\n}", "signIn() {\n\n if (this.$.form.validate()) {\n let phone = this.phone;\n let password = this.password;\n this.details = { mobile: phone, password: password }\n this.$.form.reset();\n this._makeAjax(`http://10.117.189.55:9090/admanagement/users/login`, \"post\", this.details);\n\n } else {\n this.$.blankForm.open();\n\n }\n }", "function login() {\n\t\tclearPage();\n\t\twindow.CLASH.user.id = 0;\n\t\tlet loginForm = document.querySelector('#login');\n\t\tlet loginbtn = loginForm.querySelector('#loginBtn');\n\t\tlet password = loginForm.querySelector('#passwd');\n\t\tpassword.innerHTML = '';\n\t\tloginForm.classList.remove('h-login');\n\t\tloginbtn.classList.add('h-login');\n\t}", "function btnLoginClicked() {\n\tif ($.txtUserName.value.length != 0 && $.txtPassword.value.length != 0) {\n\t\t$.activityIndicator.show();\n\t\tvar hostIP = $.txtHostIP.value,\n\t\t username = $.txtUserName.value,\n\t\t password = $.txtPassword.value;\n\n\t\tif ($.swcKeepMeSignedIn.value == true) {\n\t\t\tLoginGlobal.saveLoginInformationToProperties(username, hostIP);\n\t\t}\n\t\tLoginGlobal.login(hostIP, username, password);\n\t} else {\n\t\talert(\"Please enter a username and password.\");\n\t}\n}", "function startSignIn() {\n document\n .getElementById('quickstart-button')\n .disabled = true;\n if (firebase.auth().currentUser) {\n firebase\n .auth()\n .signOut();\n window.close();\n } else {\n startAuth(true);\n }\n}", "function attachSignin(element) {\n auth2.attachClickHandler(element, {},\n function (googleUser) {\n onSignIn(googleUser); // Call the Onsign in function\n },\n function (error) {\n alert(JSON.stringify(error, undefined, 2));\n });\n}", "function myrunwayLogin(){\r\n $(\"#signin\").on(\"click\", function(){\r\n $('#login').click();\r\n\r\n if (!$(\"#username\").val()) {\r\n sap.messageBox.showMsg(sapLang.getText(\"110001\"));\r\n $(\"#username\").focus();\r\n } else if (!$(\"#password\").val()) {\r\n sap.messageBox.showMsg(sapLang.getText(\"110002\"));\r\n $(\"#password\").focus();\r\n } else {\r\n var signInObj = {};\r\n signInObj.snsProvider = \"DEFAULT\";\r\n signInObj.snsAccount = $(\"#username\").val();\r\n signInObj.password = $(\"#password\").val();\r\n signInObj.isMyRunwayLogin = \"true\";\r\n var reqData = JSON.stringify({SignInVO: signInObj});\r\n signinMyRunway(reqData);\r\n $(\"#share\").hide(); \r\n }\r\n \r\n return false;\r\n });\r\n \r\n $(document).on('keypress', function(e) {\r\n if(e.keyCode == 13 && !$(\"#login\").hasClass(\"hidden\")) {\r\n $(\"#signin\").click();\r\n }\r\n });\r\n }", "function handleAuthClick(event) {\n //gapi.auth2.getAuthInstance().signIn();\n console.log('Handling auth click');\n initClient();\n}", "function handleLoginBtnClick() {\n console.log(\"login clicked\", email, password);\n\n }", "login (username, password) {\n this.inputUsername.setValue(username);\n this.inputPassword.setValue(password);\n this.btnSubmit.click();\n }", "function signIn() {\n auth.signInWithEmailAndPassword(email, password)\n .then(() => {\n navigation.navigate(\"Main\")\n }).catch(error=> {\n alert(error.message)\n })\n }", "logIn() {\n // Call the show method to display the widget.\n this.lock.show();\n }", "login (username, password) {\n this.loginUsername.setValue(username);\n this.loginPassword.setValue(password);\n this.loginBtn.click();\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 clickLogIn() {\n\tvar email = ($('.email-login').find('input[type=email]')).val();\n\tvar password = ($('.email-login').find('input[type=password]')).val();\n\t\n\t$.ajax({\n\t\turl: '\\/login\\/signin',\n\t\tmethod: 'POST',\n\t\tdata: {email, password}\n\t}).done(function(jsondata) {\n\t\twindow.location.href = jsondata.redirect;\n\t}).fail(function() {\n\t\talert(\"Invalid Login Credentials\");\n\t});\n}", "function showSignedIn() {\n\talert(\"sign in success\")\n\tdocument.getElementById(\"signin_btn\").innerHTML = \"Sign Out\"\n}", "function loginButton(){\n\tfunction getUser(userData) {\n \t$.get(\"/api/\", userData, function(data){\n \t\tconsole.log(data);\n \t\t//ensure all the retreived data is saved in the session\n \t\tsessionStorage.setItem('userId', data[0].id);\n \t\tsessionStorage.setItem('userfName', data[0].fName);\n\t\t\tsessionStorage.setItem('userlName', data[0].lName);\n\t\t\tsessionStorage.setItem('userCompany', data[0].company);\n\t\t\tsessionStorage.setItem('userEmail', data[0].email);\n\t\t\tsessionStorage.setItem('userPassword', data[0].password);\n \t})\n \t.then(changeURL);\n \t \n \t}\n \t//verify user information is entered correctly\n \tif($('#userEmail').val() == \"\" || $('#userPassword').val() == \"\"){\n \t\talert('Some information is missing from the form. Please make sure all information is filled out fully.');\n \t}else{\n\t\tgetUser({\n\t\t\taction: 'login',\n\t\t\temail: $('#userEmail').val(),\n\t\t\tpassword: $('#userPassword').val()\n\t\t});\n\t}\n}", "function startSignIn() {\n document.getElementById('quickstart-button').disabled = true;\n if (firebase.auth().currentUser) {\n firebase.auth().signOut();\n } else {\n startAuth(true);\n }\n}", "handleAuthClick(event) {\n event.preventDefault();\n window.gapi.auth2.getAuthInstance().signIn();\n }", "logIn() {\n const props = {\n email: this.email() || this.username(),\n password: this.password()\n };\n\n app.modal.show(new LogInModal(props));\n }", "function goLogIn() {\n \n body.innerHTML = renderLoginDiv(email2, pass2, message2);\n assignListener('login2');\n }", "function signinFunction() {\n var username = document.getElementById('username-input').value;\n var password = document.getElementById('password-input').value;\n signIn(username, password)\n}", "clickLoginButton() {\n this.loginButton.waitForVisible();\n this.loginButton.click();\n }", "handleSignIn() {\n // Sign in the user -- this will trigger the onAuthStateChanged() method\n\n }", "function login() {\n User.login(self.user, handleLogin);\n }", "function sign_in() {\n start();\n}", "function signedIn(){\r\n document.cookie = \"signedin=true\" + ';';\r\n changeSignIn();\r\n}", "function listenSigninBtn() {\n\t$('.signin-button').on('click', event => {\n\t\tlocation.reload();\n\t});\n}", "async function handleAuthClick(event) {\n await gapi.auth2.getAuthInstance().signIn();\n window.location.reload(true);\n}", "async login() {\n await auth0.loginWithPopup();\n this.user = await auth0.getUser();\n if(this.user) _isLoggedIn = true;\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 }", "function openSignIn() {\n $(\"#signin\").modal('open');\n }", "signIn(email, password) {\n /* Sign in the user */\n\n }", "function signin(username) {\n\n\t}", "signIn() {\n\n if (this.$.form.validate()) {\n let phone = this.phone;\n let password = this.password;\n this.details = { mobile: phone, password: password }\n this.$.form.reset();\n this._makeAjax(`${baseUrl1}/akshayapathra/admins`, 'post', this.details);\n } else {\n\n }\n }", "async logIn(){\n let email = this.baseEl.find('#login-email').val();\n let password = this.baseEl.find('#login-password').val();\n \n let login = new Login({ \n email : email,\n password : password\n })\n\n await login.save()\n \n if( !login.loggedIn ) { return this.validatesLogin(login)} \n App.loggedIn = true;\n UserLogin.current.hideModal();\n NavBar.current.toggleRegisterButton();\n BookingPage.current.smoothLogIn();\n Salon.current.click();\n }", "function handleSignUpBtnClick() {\n console.log(\"signup clicked\");\n }", "function reloadWithSignIn() {\n doSignIn({prompt: 'select_account'});\n}", "loginBasic() {\n this.open();\n this.login('robert.hayes+4@auticon.us', 'PotterMalfoy22');\n this.clickLoginButton();\n }", "orderAccess() {\n loginPage.open();\n loginPage.username.setValue('pepeamigo@gmail.com');\n loginPage.password.setValue('pepito');\n loginPage.submit();\n }" ]
[ "0.7470999", "0.7374268", "0.7348004", "0.7327811", "0.7296217", "0.72920984", "0.72627515", "0.72627515", "0.72627515", "0.7262626", "0.7262626", "0.7262626", "0.7252664", "0.7250213", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72392756", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.72360355", "0.7213547", "0.72050446", "0.72050446", "0.72018373", "0.7170776", "0.71514547", "0.7132203", "0.7127606", "0.71211565", "0.7093992", "0.707669", "0.7054422", "0.696906", "0.6911112", "0.68921924", "0.68596035", "0.68535525", "0.6823666", "0.68175375", "0.6808599", "0.6805623", "0.6787251", "0.67682695", "0.6730124", "0.6729945", "0.6718007", "0.67081225", "0.67058986", "0.6676048", "0.66640544", "0.6646523", "0.6641568", "0.6639538", "0.66303426", "0.66272897", "0.6609439", "0.65925485", "0.6581716", "0.65790033", "0.6569127", "0.65603316", "0.6547006", "0.6544791", "0.6537945", "0.6534724", "0.6520887", "0.65052927", "0.650414", "0.6497023", "0.64896595", "0.64765716", "0.6469267", "0.6453439", "0.64375657", "0.6428822", "0.6428768", "0.64277685", "0.64225066", "0.6420428", "0.64188224", "0.6416811" ]
0.0
-1
Sign out the user upon button click.
function handleSignOut(event) { GoogleAuth.signOut(); logoutHandler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function btnSignOutOnClick() {\n firebase.auth().signOut();\n}", "signOut() {\n this.bitski.userManager.removeUser();\n this.contractInstance = null;\n this.showLoginButton();\n }", "function signOut() {\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.');\n $(\".button4\").hide();\n });\n }", "function handleSignoutClick() {\n auth2.signOut();\n}", "function handleSignoutClick() {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function signOut() {\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.');\n $(\"#signOutButton\").hide();\n $(\"#profilePic\").hide();\n $(\"#signInButton\").show();\n\n });\n }", "onButtonPress() {\n firebase.auth().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "handleSignoutClick() {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick() {\n\tgapi.auth2.getAuthInstance().signOut().catch((ignore) => {});\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "function handleSignoutClick(event) {\r\n gapi.auth2.getAuthInstance().signOut();\r\n}", "function signOutUser() {\n // Sign out of Firebase.\n signOut(getAuth());\n\n // Refresh page to disable buttons\n location.reload();\n}", "function handleSignoutClick(event) {\r\n\tgapi.auth2.getAuthInstance().signOut();\r\n }", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\r\n gapi.auth2.getAuthInstance().signOut();\r\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n\tgapi.auth2.getAuthInstance().signOut();\n}", "function handleSignoutClick(event) {\n\tgapi.auth2.getAuthInstance().signOut();\n}", "onLogoutClicked() {\n AuthActions.logoutUser();\n }", "function handleSignoutClick(event) {\n window.gapi.auth2.getAuthInstance().signOut();\n }", "function sign_out() {}", "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n $.get('/public/logout');\n}", "function signOut () {\n oauth.clearTokens();\n setIcon();\n}", "function signOut() {\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n localStorage.removeItem('token');\n user = {};\n notif('top-end', 'success', 'Sign out Success');\n isSignIn();\n });\n}", "function signOut() {\n localStorage.removeItem('curUser');\n}", "function onLogoutClick(){\n firebase.auth().signOut().then(function() {\n // Sign-out successful.\n }).catch(function(error) {\n // An error happened.\n });\n}", "function signOut() {\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.');\n });\n }", "function signOut() {\r\n var auth2 = gapi.auth2.getAuthInstance();\r\n auth2.signOut().then(function () {\r\n console.log('User signed out.');\r\n });\r\n }", "async signOut () {\n const res = await postJSON('/api/logout')\n if (!this.checkResponse(res)) {\n this.page.profileBox.style.display = 'none'\n return\n }\n State.clearAllStore()\n State.removeAuthCK()\n window.location.href = '/login'\n }", "function signOut(){\n\tfirebase.auth().signOut().then(function() {\n\t\t$(\"#mainSection\").hide();\n\t\t$(\"#logInUser\").show();\n\t\t$(\"#signUp\").hide();\n\t}, function(error) {\n\t\tconsole.error('Sign Out Error', error);\n\t});\n\tclearFields();\n}", "function handleSignoutClick(event) {\n //Disconnecting and revoking scopes\n gapi.auth2.getAuthInstance().disconnect();\n //gapi.auth2.getAuthInstance().signOut();\n //var auth2 = gapi.auth2.getAuthInstance();\n // auth2.signOut().then(function () {\n // console.log('User signed out.');\n // });\n}", "function handleSignoutClick(event) {\n clearChildren();\n setInactive();\n gapi.auth2.getAuthInstance().signOut();\n\n}", "function signOut() {\n // Sign out of Firebase.\n firebase.auth().signOut();\n if(!!isUserSignedIn()){\n document.getElementById( \"btnlog\" ).setAttribute( \"onClick\", \"javascript: signIn();\" );\n document.getElementById(\"btnlog\").textContent=\"Sign In\";\n var elem = document.getElementById('addmin');\n elem.parentNode.removeChild(elem);\n\n }\n \n}", "function SignOut() {\n return auth.currentUser && (\n <button onClick={() => auth.signOut()}>Swim Out</button>\n )\n}", "signout() {\n\t\tthis.firebase.auth.signOut();\n\t}", "signout() {\n\t\tthis.firebase.auth.signOut();\n\t}", "function onSignOut() {\n //should sign user out and toggleHidden\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.')\n //setting back to default\n $(\".userName\").text(\"USER_NAME\");\n $(\"img\").attr(\"src\", \"assets/placeholder.png\");\n $(\".email\").text(\"example@example.com\");\n });}", "signOut(){\n /* Sign out the user, and update the state */\n\n }", "function handleSignoutClick(event) {\n document.getElementById(\"operation\").innerHTML = \"\"\n document.getElementById(\"progress\").innerHTML = \"\"\n clearCanvas()\n \n gapi.auth2.getAuthInstance().signOut()\n}", "function logout() {\n auth.signOut();\n}", "function handleSignoutClick(event) {\n console.log(event, 'handleSignoutClick');\n GoogleAuth.signOut();\n }", "handleSignoutClick() {\n if (this.gapi) {\n this.gapi.auth2.getAuthInstance().signOut();\n }\n else {\n console.log(\"Error: this.gapi not loaded\");\n }\n }", "function onSignOut() {\n //should sign user out and toggleHidden\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.')\n //setting back to default\n $(\"h1\").text(\"Welcome\");\n // $(\"img\").attr(\"src\", \"assets/placeholder.png\");\n // $(\".email\").text(\"example@example.com\");\n });\n}", "function doSignout() {\n firebase.auth().signOut();\n}", "function onSignOut() {\n //should sign user out and toggleHidden\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.')\n //setting back to default\n $(\".userName\").text(\"USER_NAME\");\n $(\"img\").attr(\"src\", \"assets/placeholder.png\");\n $(\".email\").text(\"example@example.com\");\n });\n}", "function onSignOut() {\n //should sign user out and toggleHidden\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.')\n //setting back to default\n $(\".userName\").text(\"USER_NAME\");\n $(\"img\").attr(\"src\", \"assets/placeholder.png\");\n $(\".email\").text(\"example@example.com\");\n });\n}", "function signOut()\n {\n firebase.auth().signOut().then(function() {\n // Sign-out successful.\n console.log(\"Logout Success\");\n document.getElementById(\"containerLogin\").style.display=\"block\";\n document.getElementById(\"containerOneOnOne\").style.display=\"none\"; \n }).catch(function(error) {\n // An error happened.\n });\n }", "function logout(e){\n //e.preventDefault();\n localStorage.clear();\n $(\"#homepage\").hide();\n $(\"#add-todo\").hide();\n $(\"#list-todo\").hide();\n $(\"#login-page\").show();\n $(\"#getTodoById\").hide();\n $(\"#login-email\").val(\"\")\n $(\"#login-password\").val(\"\")\n let auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n swal(\"Logout Success!\", \"You has signed out.\", \"success\")\n });\n}", "function logOut(){\n auth.signOut().then(()=>{\n setUser(\"\")\n })\n }", "function signOut() {\n\tfirebase.auth().signOut().then(function() {\n\t\t$('#form').submit();\n\t}, function(error) {\n\t // An error happened.\n\t});\n}", "function signOut() {\n if (authService.isAuth()) {\n authService.signOut();\n sendTo(\"/\");\n }\n}", "function signOut() {\n // Clear Credentials:\n // updateClientId(\"\");\n // updateClientSecret(\"\");\n // updateProjectId(\"\");\n\n // Clear Tokens:\n updateOAuthCode(\"\");\n updateAccessToken(\"\");\n updateRefreshToken(\"\");\n\n // Clear Devices:\n clearDevices();\n\n // Signed Out:\n updateSignedIn(false);\n}", "function signOut() {\n AsyncStorage.clear().then(() => {\n setLoggedUser(null);\n });\n }", "function SignOut() {\n return auth.currentUser && (\n <button onClick={() => auth.signOut()}>Sign Out</button>\n )\n}", "logOut(){\n firebase.auth().signOut();\n }", "function onSignOut() {\n //should sign user out and toggleHidden\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.')\n //setting back to default\n $(\".userName\").text(\"USER_NAME\");\n $(\"img\").attr(\"src\", \"https://unsplash.it/200/300\");\n $(\".email\").text(\"example@example.com\");\n });\n}", "function signOut() {\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n document.getElementsByClassName(\"userContent\")[0].innerHTML = '';\n document.getElementsByClassName(\"userContent\")[0].style.display = \"none\";\n document.getElementById(\"gSignIn\").style.display = \"block\";\n });\n \n auth2.disconnect();\n //upon success disconnect update the user sync state on his firebase data\n firebase.database().ref('users/' + currentUser.luid).update({\n googleSync: false\n })\n}", "function logout() {\n window.sessionStorage.removeItem(\"jwt\");\n window.sessionStorage.removeItem(\"idle-timer\");\n window.sessionStorage.removeItem(\"oldOrg\");\n window.location.replace(`${window.location.origin}`);\n const _signIn = document.getElementById(\"signInButton\");\n if (_signIn){\n _signIn.removeAttribute( \"hidden\" );\n }\n}", "logout() {\n fire.auth().signOut();\n }", "function Auth_SignOut() {\n firebase.auth().signOut().then(function() {\n // Sign-out successful. - maybe change view?\n }).catch(function(error) {\n // An error happened. - maybe show error page?\n });\n}", "function onSignOut() {\n console.log('>onSignOut');\n //showSignedOutUserControls();\n}", "function signOut(){\n\tfirebase.auth().signOut().then(function() {\n\t\t$(\"#recordDiv\").hide();\n\t\t$(\"#textDiv\").hide();\n\t\t$(\"#foodDiv\").hide();\n\t\t$(\"#newUserDiv\").hide();\n\t\t$(\"#signOutDiv\").hide();\n\t\t$(\"#thankyou\").hide();\n\t\t$(\"#loginDiv\").show();\n\t\t\n\t}, function(error) {\n\t\tconsole.error('Sign Out Error', error);\n\t});\n\tclearFields();\n}", "function signOut() {\n\n\tvar auth2 = gapi.auth2.getAuthInstance();\n\tauth2.signOut().then(function() {\n\n\t\t$(\".g-signin2\").css(\"display\", \"block\");\n\t\t$(\".data\").css(\"display\", \"none\");\n\t\talert(\"Hope to see you again.\");\n\t})\n\n}", "onSignOut() {\n firebase.auth().signOut();\n }", "function onSignOut() {\n //should sign user out and toggleHidden\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n console.log('User signed out.')\n //setting back to default\n $(\".newText1\").text(\"\");\n \n $(\".email\").text(\"example@example.com\");\n $(\".scoreA\").text(\"\");\n });\n \n}", "signOutUser() {\n this.__userApiToken__ = null\n }", "signout() {\n \n fire.auth().signOut().then(function() {\n \n // Sign-out successful.\n }).catch(function(error) {\n // An error happened.\n console.log(error)\n });\n }", "function logOut() {\n setCookie(-100);\n $(\"#signUp\").css(\"display\", \"inherit\");\n $(\"#signOff\").css(\"display\", \"none\");\n hideButtons(); //Ocultamos los botones privados\n initPopulate();\n}", "function SignOut() {\n return auth.currentUser && (\n <button className=\"ui inverted red button\" onClick={() => auth.signOut()}>Sign Out</button>\n );\n}", "signOut(event){\n event.preventDefault();\n Meteor.logout();\n Materialize.toast('You have been signed out!', 4000);\n FlowRouter.go('/signin');\n }", "handleSignOut(event) {\n event.preventDefault();\n firebase.auth().signOut();\n }" ]
[ "0.7971634", "0.79283696", "0.7919959", "0.7899161", "0.7871195", "0.7866677", "0.7850537", "0.78293633", "0.7824971", "0.7824971", "0.7824971", "0.7822838", "0.78069776", "0.77900946", "0.77900946", "0.77900946", "0.7783564", "0.7783564", "0.7777048", "0.77677405", "0.77665126", "0.7746744", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.7742112", "0.77364147", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.77315754", "0.769439", "0.769439", "0.7668765", "0.76386213", "0.7632624", "0.76229745", "0.75527513", "0.75510544", "0.7546384", "0.7501207", "0.7492619", "0.74900925", "0.7448742", "0.7419181", "0.7415722", "0.7390044", "0.73830116", "0.73825085", "0.7379287", "0.7379287", "0.73740244", "0.73731124", "0.7364644", "0.7360961", "0.73560333", "0.734816", "0.7345626", "0.7314232", "0.72883844", "0.72883844", "0.7279656", "0.7267286", "0.72667855", "0.72645515", "0.7263332", "0.7255204", "0.72466147", "0.7244603", "0.72323215", "0.7217464", "0.72139716", "0.72125417", "0.7211619", "0.7202218", "0.71899587", "0.7187857", "0.7179879", "0.717834", "0.71772504", "0.71766996", "0.71550715", "0.7145439", "0.7139311", "0.71360004", "0.7131121" ]
0.0
-1
formatting queries for request url
function formatQuery(params) { const queryItems = Object.keys(params).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`) return queryItems.join('&') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_formatQueryString(query) {\n // TODO: Figure out how to fix the url encoding of the colons so I can\n // use this more specific search\n // const q = Object.entries(query)\n // .map(([key, val]) => {\n // if (key === 'title') {\n // key = 'track';\n // }\n // return encodeURIComponent(`${key}:${val}`);\n // })\n // .join('&');\n\n const q = Object.values(query)\n .map(val => encodeURIComponent(val))\n .join('%20');\n\n debug('Query String: %s', q);\n return q;\n }", "function formatQueryString(input) {\n var formattedQuery = input.slice();\n formattedQuery = formattedQuery.trim().toLowerCase().replace(/\\s\\s+/g, '+');\n return formattedQuery;\n}", "function urlFormat(base, query){\n var q = \"?\"\n for(var key in query){\n if(query.hasOwnProperty(key)){\n q += key+\"=\"+query[key]+\"&\";\n }\n }\n return base+q;\n}", "function buildQueryURL() {\n // if(queryParams != '') {\n // queryURL is the url we'll use to query the API\n var queryParams = $(\"#countryInput\").val();\n\n // var queryURL = \"https://coronavirus-tracker-api.herokuapp.com/v2/locations?source=jhu&timelines=true&country=\";\n var queryURL = \"https://covid-19.dataflowkit.com/v1/\";\n\n\n\n // console.log(queryParams)\n return queryURL + queryParams;\n\n // }else{\n // $(\"#error\").html('Field cannot be empty');\n // }\n }", "function make_query(req){\n\tvar s = []\n\n\tfor(key in req.query)\n\t\ts.push(key + \"=\" + req.query[key])\n\n\treturn(s.join('&'))\n}", "formatQuery (query) {\n return query.split(',').join(' + ');\n }", "function formatQueryString(str) {\n var finalString;\n var splitString = str.split(\" \");\n if (splitString.length > 1) {\n finalString = splitString.join(\"+\");\n }\n else {\n finalString = str;\n }\n return finalString;\n }", "toUrlAndQuery() {\r\n return `${super.toUrl()}?${Array.from(this.query).map((v) => v[0] + \"=\" + v[1]).join(\"&\")}`;\r\n }", "function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}", "function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}", "function urlQueryValues() {}", "getEncodedQuery() {}", "function parseQry(qry){\n // encode query for transport to salesforce\n return(qry.replace(/ /g, '+').replace(/=/g,'%3D'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, pctEncodeSpaces ? '%20' : '+');\n\t }", "function ParsedQueryString() {}", "function ParsedQueryString() {}", "function queryString(req) {\n var query_string = {};\n var query = req.url;\n var vars = query.split(\"&\");\n for (var i=0;i<vars.length;i++) {\n var pair = vars[i].split(\"=\");\n // If first entry with this name\n if (typeof query_string[pair[0]] === \"undefined\") {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n // If second entry with this name\n } else if (typeof query_string[pair[0]] === \"string\") {\n var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n query_string[pair[0]] = arr;\n // If third or later entry with this name\n } else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n } \n return query_string;\n}", "_buildQueryString(query){\n // create a copy of the object with reformatted data.\n var data = {};\n data._aggregate = query._aggregate === null ? undefined : query._aggregate;\n data._columns = query._columns === null ? undefined : query._columns.join(',');\n data._wheres = query._wheres === null ? undefined : JSON.stringify(query._wheres);\n data._limit = query._limit === null ? undefined : query._limit;\n data._offset = query._offset === null ? undefined : query._offset;\n data._orders = query._orders === null ? undefined : query._orders.map((order) => order.join(',')).join('|');\n data._groups = query._groups === null ? undefined : query._groups;\n data._with = query._with === null ? undefined : query._with.join(',');\n // return as a string.\n return qs.stringify(data);\n }", "_formatQuery(document) {\n let q = document.query;\n if (document.exclude && document.exclude.length > 0) {\n document.exclude.forEach(item => {\n // eslint-disable-next-line quotes\n q += ' -\"' + item + '\"';\n });\n }\n q += ' AND -filter:retweets';\n return q;\n }", "toUrlAndQuery() {\r\n const aliasedParams = new Map(this.query);\r\n let url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, (match, labelName, value) => {\r\n Logger.write(`Rewriting aliased parameter from match ${match} to label: ${labelName} value: ${value}`, 0 /* Verbose */);\r\n aliasedParams.set(labelName, `'${value}'`);\r\n return labelName;\r\n });\r\n if (aliasedParams.size > 0) {\r\n const char = url.indexOf(\"?\") > -1 ? \"&\" : \"?\";\r\n url += `${char}${Array.from(aliasedParams).map((v) => v[0] + \"=\" + v[1]).join(\"&\")}`;\r\n }\r\n return url;\r\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%3B/gi, ';').replace(/%20/g, pctEncodeSpaces ? '%20' : '+');\n }", "function urlencode(query) {\n // var street = \"\"+query+\"\";\n var result = new String(query).replace(/ /g, \"%20\");\n return result\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "toUrlParams(query) {\n\t\tconsole.debug(query)\n\t\tconst params = {\n\t\t\tfr : query.offset,\n\t\t\tsz : query.size,\n\t\t\tcids : query.collectionId\n\t\t}\n\n\t\tif(query.searchLayers) {\n\t\t\tconst sl = Object.keys(query.searchLayers).filter((l) => {\n\t\t\t\treturn query.searchLayers[l];\n\t\t\t});\n\t\t\tif(sl.length > 0) {\n\t\t\t\tparams['sl'] = sl.join(',');\n\t\t\t}\n\t\t}\n\n\t\tif(query.term) {\n\t\t\tparams['st'] = query.term;\n\t\t}\n\n\t\tif(query.dateRange) {\n\t\t\tlet dr = query.dateRange.field + '__';\n\t\t\tdr += query.dateRange.start + '__';\n\t\t\tdr += query.dateRange.end;\n\t\t\tparams['dr'] = dr;\n\t\t}\n\n\t\tif(query.fieldCategory) {\n params['fc'] ='';\n query.fieldCategory.map(function(item){\n params['fc'] += item.id + '|';\n\t\t\t});\n params['fc'] = params['fc'].slice(0, -1);\n\t\t}\n\n\t\tlet sf = []\n\t\tif(query.selectedFacets) {\n\t\t\tsf = Object.keys(query.selectedFacets).map((key) => {\n\t\t\t\treturn query.selectedFacets[key].map((value) => {\n\t\t\t\t\treturn key + '|' + value;\n\t\t\t\t})\n\t\t\t});\n\t\t\tparams['sf'] = sf.join(',');\n\t\t}\n\n\t\tif(query.sort) {\n\t\t\tlet s = query.sort.field + '__';\n\t\t\ts += query.sort.order;\n\t\t\tparams['s'] = s;\n\t\t}\n\t\treturn params;\n\t}", "function q(req){\n\treturn qs.parse(url.parse(req.url).query);\n}", "function encodeUriQuery(val, pctEncodeSpaces) { // 1416\n return encodeURIComponent(val). // 1417\n replace(/%40/gi, '@'). // 1418\n replace(/%3A/gi, ':'). // 1419\n replace(/%24/g, '$'). // 1420\n replace(/%2C/gi, ','). // 1421\n replace(/%3B/gi, ';'). // 1422\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); // 1423\n} // 1424", "function encodeUriQuery(val, pctEncodeSpaces) {\n if (angular.isUndefined(val) || val === null) {\n return '';\n }\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "function getQueryString (queryParams) { \n return Object.keys(queryParams)\n .map(x => `${enc(x)}=${enc(queryParams[x])}`)\n .join('&')\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%3B/gi, ';').\n\t replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%3B/gi, ';').\n\t replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function constructQueryString(){\n\tvar result = \"\";\n\t\n\tif(count > 0){\n\t\tresult = \"?\" + queries[0].name + \"=\" + queries[0].value;\n\t\tvar i = 1;\n\t\tfor(; i < count; i++){\n\t\t\tresult+= \"&\" + queries[i].name + \"=\" + queries[i].value;\n\t\t}\n\t}\n\treturn result;\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t\treturn encodeURIComponent(val).\n\t\treplace(/%40/gi, '@').\n\t\treplace(/%3A/gi, ':').\n\t\treplace(/%24/g, '$').\n\t\treplace(/%2C/gi, ',').\n\t\treplace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }", "formatQueryParams() {\n let urls = this.url.split('?');\n if (urls.length <= 1) {\n return {};\n }\n let escape = querystring.unescape(urls[1]);\n let params = querystring.parse(escape);\n _.each(params, (v, k) => {\n if (_.isString(params[k])) {\n params[k] = JSON.parse(v);\n }\n });\n return params;\n }", "function buildQueryString(args){\n var search = $.extend({}, LS.urlParams, args);\n\n var search_data = [];\n for (var search_key in search) {\n search_data.push(search_key + '=' + search[search_key]);\n }\n search_data = search_data.join('&');\n\n return '?' + search_data;\n }", "function encodeUriQuery(val, pctEncodeSpaces) {\n\t\treturn encodeURIComponent(val).\n\t\t\treplace(/%40/gi, '@').\n\t\t\treplace(/%3A/gi, ':').\n\t\t\treplace(/%24/g, '$').\n\t\t\treplace(/%2C/gi, ',').\n\t\t\treplace(/%3B/gi, ';').\n\t\t\treplace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}", "function encodeUriQuery(val, pctEncodeSpaces) {\n if (pctEncodeSpaces === void 0) { pctEncodeSpaces = false; }\n return encodeURIComponent(val)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function httpQuery(args) {\n const arglist = [];\n for (const key in args) {\n arglist.push(key + \"=\" + encodeURIComponent(args[key]));\n }\n return arglist.join(\"&\");\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace((pctEncodeSpaces ? null : /%20/g), '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace((pctEncodeSpaces ? null : /%20/g), '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace((pctEncodeSpaces ? null : /%20/g), '+');\n}", "function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}", "function encodeUriQuery(s){return encodeUriString(s).replace(/%3B/gi,';');}", "buildQueryStrings() {\n this.formatReferenceFileQuery();\n }", "_toQueryString(params) {\n return '?' + Object.entries(params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n }", "_toQueryString(params) {\n return '?' + Object.entries(params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n }", "function QueryParameters() {}", "function createURL(query){\n return Object.keys(query).map(function(k) {\n return encodeURIComponent(k) + '=' + encodeURIComponent(query[k])\n }).join('&')\n}", "exQueryParams(request, response) {\n\n const params = request.query;\n console.log(params);\n \n return response.json({\n titulo: \"Exemplo Query Params\",\n parametros: params\n });\n }", "function buildQueryURL() {\n\n var baseURL = \"https://api.openweathermap.org/data/2.5/weather?q=\";\n var key = \"&units=imperial&appid=6c743e42a0f9ac97fab6ec81e5e3acc9\";\n var querySearch = $(\"#searchBar\")\n .val()\n .trim();\n var all = baseURL + querySearch + key;\n return baseURL + querySearch + key;\n}" ]
[ "0.7299639", "0.7208712", "0.7008765", "0.67837757", "0.6663055", "0.65995634", "0.65841204", "0.65767133", "0.6538788", "0.6538788", "0.65377015", "0.65186054", "0.648666", "0.6441823", "0.6428883", "0.6428883", "0.6408066", "0.63577884", "0.6353783", "0.63536924", "0.6333032", "0.6331551", "0.6329876", "0.6272052", "0.6272052", "0.6272052", "0.6272052", "0.6272052", "0.6272052", "0.6272052", "0.62686896", "0.6258982", "0.6245117", "0.6230509", "0.6220243", "0.6220243", "0.6220243", "0.6220243", "0.6220243", "0.6220243", "0.62174404", "0.62080336", "0.62080336", "0.62080336", "0.62080336", "0.62080336", "0.62080336", "0.62051755", "0.62051755", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.61964005", "0.6195403", "0.6194973", "0.61819243", "0.61727047", "0.61437404", "0.6140574", "0.61353666", "0.61299133", "0.61197335", "0.61197335", "0.61197335", "0.6118672", "0.6111927", "0.60802907", "0.6075792", "0.6075792", "0.60695785", "0.60677147", "0.60639095", "0.60532993" ]
0.64602613
13
getting location information from WheelMap API
function getWheelMapNodes(bounds) { const params = { api_key: apiKey, bbox: bounds, per_page: 1000, } const options = { mode: 'no-cors' } const queryString = formatQuery(params) const url = `${searchURL}?${queryString}` fetch(url, options) .then(response => { console.log(response); }) .catch(err => { console.log(err) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLocationInfo(){\n return this.map.getLocationInfo();\n }", "function gbDidSuccessGetLocation ( lat, long )\n{\n\tvar api_url = \"http://api.wunderground.com/api/\" + APIKEY + \"/conditions/q/\" + lat + \",\" + long + \".json\";\n\tgbRequest ( api_url, '1', 'YES' );\n}", "function getGeolocation() {\n // console.log(this.responseText);\n var data = JSON.parse(this.responseText);\n var results = data.results;\n results.forEach(function (element) {\n console.log(element.geometry.location);\n var ubication = {\n lat: element.geometry.location.lat,\n lng: element.geometry.location.lng\n };\n });\n }", "async getLatLong() {\n this.spinner.style.display = 'block';\n const response = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.key}`\n );\n\n const responseData = await response.json();\n\n return {\n responseData,\n };\n }", "function getStreet() {\n var apikey = '8iMbHQoKISbmKAynwHsO7ZlMhuPhWgtu';\n $.ajax({\n url: 'https://www.mapquestapi.com/geocoding/v1/reverse',\n dataType: 'json',\n method: 'GET',\n data: {\n location: lat + \",\" + lon,\n key: apikey,\n }\n }).then(function (response) {\n //On succesful of good response: set Ticket Master Quiries off of retured info\n searchAddress = response.results[0].locations[0].street;\n searchCity = response.results[0].locations[0].adminArea5;\n searchState = response.results[0].locations[0].adminArea3;\n startPoint = searchAddress + \", \" + searchCity + \", \" + searchState;\n\n main(); //call to main to get other defualt values not obtained through location servies permissions\n });\n }", "static async getGeoData() {\n try {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIKey}`);\n const data = await response.json();\n return (data.coord);\n } catch(err) {\n alert(err);\n }\n }", "async getLocation() {\r\n const locationResp = await fetch('https://extreme-ip-lookup.com/json/?key=Yw6V3K7FoTxqx9uE9gf3');\r\n const location = await locationResp.json();\r\n\r\n return {\r\n location\r\n };\r\n }", "function getCityLocation(data) {\n if (data) {\n let { results: res } = data;\n let { 0: obj } = res;\n let city = obj.address_components[0].long_name;\n let location = obj.geometry.location;\n let { lat, lng: lon } = location;\n lat = parseFloat(lat).toFixed(3);\n lon = parseFloat(lon).toFixed(3);\n APIrqs(lat, lon, city);\n\n }\n\n}", "function getBrowserGeoLoc(){\n getLocation();\n showPosition();\n }", "function getLocation() {\n\n navigator.geolocation.getCurrentPosition(success, fail);\n\n async function success(position) {\n let key = \"Q6NBLIK5NWGiVhHZwd4vZyiw4A1IgD9Z\";\n let lng = position.coords.longitude;\n let lat = position.coords.latitude;\n console.log(position)\n let address = await fetch(`http://open.mapquestapi.com/geocoding/v1/reverse?key=${key}&location=${lat},${lng}&includeRoadMetadata=true&includeNearestIntersection=true`)\n\n address = await address.json();\n let city = address.results[0].locations[0].adminArea5;\n let state = address.results[0].locations[0].adminArea3;\n let country = address.results[0].locations[0].adminArea1;\n document.querySelector(\"#location\").innerHTML = `welcome all from ${city},${state},${country}`;\n }\n\n function fail(msg) {\n document.querySelector(\"#location\").innerHTML= msg.message;\n }\n }", "function getLoc() {\n\n\tif (!navigator.geolocation) {\n\n\t geolocate.innerHTML = 'Geolocation is not available';\n\n\t} else {\n\t \n\t map.locate();\n\n\t console.log(map.locate());\n\t}\n}", "async function findlocation(lat, long) {\n try {\n const res = await fetch(\n `https://api.opencagedata.com/geocode/v1/json?q=${lat}+${long}&key=c8105eebae7b4212a76c2d1f7510cc67`\n );\n const data = await res.json();\n\n console.log(data);\n weather(data.results[0].components.city);\n } catch (err) {\n console.log(err);\n }\n}", "function fechLocation() {\n navigator.geolocation.getCurrentPosition(success);\n\n async function success(position) {\n lat = position.coords.latitude\n lon = position.coords.longitude;\n // console.log(lat);\n // console.log(lon);\n\n let resp = await fetch(`http://open.mapquestapi.com/geocoding/v1/reverse?key=${Geolocation_API_Key}&location=${lat},${lon}`);\n resp = await resp.json();\n // console.log(resp);\n\n const city = resp.results[0].locations[0].adminArea5\n const state = resp.results[0].locations[0].adminArea3\n const country = resp.results[0].locations[0].adminArea1\n const zip = resp.results[0].locations[0].postalCode\n\n document.querySelector(\"#address\").innerHTML = `Welcome all from ${city}, ${state}, ${zip}, ${country}!`;\n };\n }", "static getLocationById(woeid) {\n\t\tvar query =\n\t\t\t`select item, location \n\t\t\t\tfrom weather.forecast \n\t\t\t\twhere woeid = ${woeid} and u='c'`;\n\t\treturn axios.get(`${url}/?q=${query}&format=json`)\n\t\t\t.then(res => {\n\t\t\t\tvar item = res.data.query.results.channel.item;\n\t\t\t\tvar location = res.data.query.results.channel.location;\n\t\t\t\treturn {\n\t\t\t\t\twoeid: woeid,\n\t\t\t\t\ttitle: `${location.city}, ${location.region}, ${location.country}`,\n\t\t\t\t\tcondition: item.condition,\n\t\t\t\t\tforecast: item.forecast\n\t\t\t\t}\n\t\t\t});\n\t}", "function getGeoLocation() {\n showPage('results');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(returnedPosition) {\n let position = {};\n position.longitude = returnedPosition.coords.longitude;\n position.latitude = returnedPosition.coords.latitude;\n getCityByLocation(position);\n });\n }\n}", "function useLatAndLong(result) {\n let api = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/onecall?lat=${result.lat}&lon=${result.lon}&appid=${appid}&units=metric`;\n fetch(api)\n .then(function (res) {\n return res.json();\n })\n .then(function (resp) {\n console.log(resp);\n showHourWeather(resp.hourly.slice(0, 12));\n showDailyWeather(resp.daily);\n });\n}", "function getLocation(city) {\n document.getElementById(\"spinner\").style.display = \"block\";\n fetch(\n `https://geocode.search.hereapi.com/v1/geocode?q=${city}&apiKey=${hereAPIKey}` //getting the location of the city\n )\n .then((items) => {\n document.getElementById(\"spinner\").style.display = \"none\";\n return items.json();\n })\n .then(calcLonLat);\n // console.log(calcLonLat());\n}", "function getLocationFromBingAPI(location, name, next) {\n $.getJSON('http://dev.virtualearth.net/REST/v1/Locations?q='+name+'&key=AoFgEWwWs5F5jvzub_gTZzRfF0DLFUNj-2hoS2xIsM-RlGZ33SAEXTdN7vxaEmX4&jsonp=?', function(result) {\n try { // longitude\n location.push(result.resourceSets[\"0\"].resources[\"0\"].point.coordinates[\"1\"]);\n location.push(result.resourceSets[\"0\"].resources[\"0\"].point.coordinates[\"0\"]); // latitude\n } catch (err) {\n console.log(\"this place is undefined:\" + err);\n location.push(-98.95733642578125); // longitude for USA\n location.push(39.44325637817383); // latitude for USA\n }\n next();\n });\n}", "function geolocation() {\n\n let Key = \"nOkTZJzGcN8wKdZbHtemhMf4zHkvJBVG\";\n\n navigator.geolocation.getCurrentPosition(success);\n\n async function success(position) {\n\n long = position.coords.longitude;\n lat = position.coords.latitude;\n\n let theLocation = await fetch(`http://www.mapquestapi.com/geocoding/v1/reverse?key=${Key}&location=${lat},${long}&includeRoadMetadata=true&includeNearestIntersection=true`)\n theLocation = await theLocation.json()\n\n const city = theLocation.results[0].locations[0].adminArea5;\n const state = theLocation.results[0].locations[0].adminArea3;\n const address = document.getElementById('address')\n address.innerHTML = `welcome all from ${city}, ${state}`;\n }\n }", "function getLocation() {\n return findLocation(getStatus());\n}", "function getGeoWeather() {\n \tweather.getGeoWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}", "function getLatLng(results){\n\t//Output the results\n\tconsole.log(results);\n\t//Scroll down the array in the JSON. I ignore everything except the two lat long variables\n\tvar location = results[\"results\"][0][\"geometry\"][\"location\"],\n\t\t//Finds the lattitude value\n\t\tlat = location[\"lat\"],\n\t\t//Finds the longitude value\n\t\tlng = location[\"lng\"]\n\t//weatherRequest(lat, lng)\n\t//Output the lat, long into the console for debugging 2\n\tconsole.log(lat)\n\tconsole.log(lng)\n\tconsole.log(\"lat, lng. Above\")\n}", "function getCordinates(query, locationtype, countrycode, admindistrictcode) {\n query = query.replace(/ /g, \"+\")\n var url = \"https://\" + config.credentials.weather.username + \":\" + config.credentials.weather.password + \"@\" + config.credentials.weather.host + \":\" + config.credentials.weather.port + \"/api/weather/v3/location/search?query=\" + query + \"&locationType=\" + locationtype + \"&countryCode=\" + countrycode + \"&adminDistrictCode=\" + admindistrictcode + \"&language=en-US\";\n var options = {\n method: 'GET',\n url: url\n }\n request(options, function(error, response, body) {\n\n if (!error && response.statusCode == 200) {\n var result = JSON.parse(body)\n //console.log(result)\n var longitude = result.location.longitude[0];\n var latitude = result.location.latitude[0];\n //console.log(longitude, latitude);\n getWeather(longitude, latitude)\n } else {\n console.log(\"Error getting cordinates\")\n }\n });\n\n}", "function success(ubicacion){\r\n fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/search/?lattlong=${ubicacion.coords.latitude},${ubicacion.coords.longitude}`)\r\n .then(response => response.json())\r\n .then(response => {\r\n placewoeid = response[0].woeid;\r\n getInfo();\r\n })\r\n}", "async function getLatLng(data) {\n try {\n const response = await axios\n .get(\n `https://api.openweathermap.org/data/2.5/weather?q=${data}&appid=9d7a9a132d47022faca7ad4802838e35`\n )\n .then((res) => {\n lon = res.data.coord.lon;\n lat = res.data.coord.lat;\n });\n } catch (error) {\n console.log(error);\n }\n}", "function get_office_location(){\n\n}", "async function getCoordsAndLocation(location) {\n const locationData = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=${key}&units=${getUnits()}`,\n {mode: 'cors'},\n );\n const locationDataJson = await locationData.json();\n const locationName =\n locationDataJson.name + ', ' + locationDataJson.sys['country'];\n return [locationDataJson.coord.lat, locationDataJson.coord.lon, locationName];\n}", "function getCoords(location) {\n const latitude = location.coords.latitude;\n const longitude = location.coords.longitude;\n const id = \"location1\";\n\n fetchCurrentWeather(latitude, longitude, id);\n}", "async getAddressCoord(){\n \n let url = new URL('https://api.tomtom.com/search/2/geocode/.json')\n url.search = new URLSearchParams({\n query: this.searchAddress,\n key: 'HgVrAuAcCtAcxTpt0Vt2SyvAcoFKqF4Z',\n versionNumber: '2',\n limit: '1'\n })\n \n const response = await fetch(url);\n\n const data = await response.json();\n this.lat = data.results[0].position.lat;\n this.lon = data.results[0].position.lon;\n\n console.log(this.lat);\n }", "function getLocInfo(zipInput) {\n fetch(geoBaseURL + zipInput)\n .then(response =>\n response.json().then(data => ({\n\n data: data,\n status: response.status\n\n\n })).then(function (getTemp) {\n let latLng = getTemp.data.results[0].locations[0].latLng\n let lat = parseFloat(latLng.lat.toFixed(4))\n let lng = parseFloat(latLng.lng.toFixed(4))\n\n console.log(\"getLocInfo\")\n console.log(getTemp.status, lat, lng)\n getWeatherFromLatLng(lat, lng)\n }));\n}", "function getLatLong() {\n // Check if API key is provided.\n if (!key) {\n app.textContent =\n \"You need to provide an API key from weatherBit.com to use the app\";\n return;\n }\n // Check if geolocation supported and get positions\n if (!navigator.geolocation) {\n app.textContent = \"Geolocation is not supported by your browser\";\n } else {\n navigator.geolocation.getCurrentPosition(\n successLatLong,\n () => error(errorLocation),\n { enableHighAccuracy: true }\n );\n }\n }", "function getWoeidInfo(city, errorCallback, successCallback){\n request.get(\"https://www.metaweather.com/api/location/search/?query=\" + city, function(error, response){\n if(!error && response.statusCode == 200){\n var data = JSON.parse(response.body);\n if(data.length < 1){\n errorCallback(city);\n }else{\n successCallback({\n city: data[0].title,\n woeid: data[0].woeid,\n });\n }\n }else{\n errorCallback(city);\n }\n });\n}", "function getLocation() {\n $.get(\"http://jarvis.cse.buffalo.edu/mine/zipcode\", function(zip){\n zipcode = zip;\n if(zipcode == 0){zipcode = 14086;}\n $.get(\"http://maps.googleapis.com/maps/api/geocode/json?address=\"+zipcode, function(loca){\n lat = loca['results'][0]['geometry']['location']['lat'];\n lng = loca['results'][0]['geometry']['location']['lng'];\n $.get(\"http://maps.googleapis.com/maps/api/geocode/json?latlng=\"+ lat + \",\" + lng + \"&sensor=true\", function(body) {\n // KEY for 'address_components'\n // [1] Street name, [2] City Name, [3] Town, [4] County, [5] State, [6] Country, [7] Zip Code\n var town = body['results'][0]['address_components'][3]['long_name'];\n var state = body['results'][0]['address_components'][5]['short_name']; // long_name is full name\n var location = town+\", \"+state;\n document.getElementById('location').innerHTML = location;\n });\n });\n });\n }", "async getLocation() {\n const location = await Location.getCurrentPositionAsync({ enableHighAccuracy: true });\n return {\n \"latitude\": location.coords.latitude, \n \"longitude\": location.coords.longitude, \n \"latitudeDelta\": 0.04,\n \"longitudeDelta\": 0.05 \n };\n }", "function lookupLatLong_Complete(result) {\n var lat = result.results[0].geometry.location.lat;\n var long = result.results[0].geometry.location.lng;\n\n locationName = result.results[0].formatted_address;\n\n //calls darksky\n var darkSkyUrl = \"https://api.darksky.net/forecast/f76dbd347401ed83f364678ffc75ffae/\" + lat + \",\" + long;\n localWeather(darkSkyUrl);\n\n}", "function yourLocationWeather( latitude, longitude ) {\n console.log(\"latitude\" + latitude)\n console.log(\"longitude \" + longitude)\n var queryURL = `https://api.opencagedata.com/geocode/v1/json?q=${latitude}+${longitude}&key=3620c85faf154e74a7e16400eae1d31e`;\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n fetchCityWeather(response.results[0].components.town)\n })\n}", "function onLocationGet(location){\n\tnet.urlFunction(location,onDataReceive);\t\t//pass lat/long to api and pull weather data\n}", "function showPosition() {\n fetch(\"https://ipwhois.app/json/?objects=city,latitude,longitude\")\n .then((response) => response.json())\n .then((data) => {\n let currentLat = parseFloat(data.latitude).toFixed(2);\n let currentLong = parseFloat(data.longitude).toFixed(2);\n let currentCity = data.city;\n // Adding position marker - the main map\n let markerHome = L.marker([currentLat, currentLong]).addTo(map);\n markerHome\n .bindPopup(`<em>You are here: </em><br><b>${currentLat}°, ${currentLong}°<br>in: <u>${currentCity}</u></b>`)\n .openPopup();\n // Adding position to the 3D Map\n showPosition3D(currentLat, currentLong, currentCity);\n // Showing Local Solar Time\n localSolarTime(currentLat, currentLong);\n })\n .catch(console.error);\n}", "function getLatLng() {\n $.ajax({ \n url: \"https://api.tfl.gov.uk/BikePoint/?app_key=70f368b0777b1f4a568b24aadb61ce78&app_id=eb934f02\",\n success: function(data){\n for (var i = 0; i < data.length; i++) {\n var location = { lat: data[i].lat, lng: data[i].lon };\n var bikesAvailable = data[i].additionalProperties[6].value;\n addMarker(location, bikesAvailable);\n };\n }\n });\n}", "function getLocationData() {\n const url = 'https://ipinfo.io/json?token=08f12254167956';\n return fetch(url).then((result) => result.json());\n}", "async function getLocation() {\n Location.setAccuracyToHundredMeters();\n let location;\n try {\n location = await Location.current();\n } catch (error) {\n // default to the lyric\n location = { latitude: 47.620537, longitude: -122.320814 };\n }\n\n let locationName = \"\";\n let minDistance = Number.MAX_SAFE_INTEGER;\n for (const place of Object.keys(geoLocationMap)) {\n const distance = calcCrow(\n location.latitude,\n location.longitude,\n geoLocationMap[place].latitude,\n geoLocationMap[place].longitude\n );\n if (distance < minDistance) {\n locationName = place;\n minDistance = distance;\n }\n }\n\n return locationName;\n}", "function getCoords(data) {\n latitude = data.results[0].geometry.location.lat;\n longitude = data.results[0].geometry.location.lng;\n console.log(\"Lat: \" + latitude + \"Long: \" + longitude);\n url = \"?zipInput=\" + zipInput + \"&addressInput=\" + addressInput + \"&cityInput=\" + cityInput + \"&stateInput=\" + stateInput + \"&longitude=\" + longitude + \"&latitude=\" + latitude;\n url = url.replace(/ /g, '') // Remove White Space\n console.log(url);\n getURL(url);\n}", "function getUserLocation() {\n fetch(`https://ipapi.co/json`)\n .then(function(response) {\n return response.json();\n })\n .then(function(recievedData) {\n displayUserLocation(recievedData);\n });\n}", "async function get_lat_and_lon(location) {\n\n\ttry {\n const url = `https://api.opencagedata.com/geocode/v1/json?q=${location}&key=c8cb98d4f05e49e99c912cf8caa51054`\n\n return await fetch(\n \turl,\n \t{ method: 'GET' }\n \t)\n \t.then( response => response.json() )\n \t.then( json => {\n \t\tresults = json[\"results\"]\n \t\tif (results.length > 0){\n \t\t\tresult = results[0];\n \t\t\tlat = parseFloat(result[\"geometry\"][\"lat\"]);\n \t\t\tlon = parseFloat(result[\"geometry\"][\"lng\"]);\n \t\t\treturn [lat, lon];\n \t\t} else {\n \t\t\tthrow new Error('No Results');\n \t\t}\n \t})\n \t.catch( error => console.error('Error fetching lat & lon:', error) );\n\n\t} catch (err) {\n \tconsole.log(`opencagedata API error: ${err}`);\n\n \treturn {};\n \t}\n}", "function getLocation(position) {\n\t//console.log(position.coords);\n\tvar lat = position.coords.latitude;\n var lng = position.coords.longitude;\n \n\tif (!lat || !lng) {\n \talert('Could not retrieve location');\n return;\n }\n // fetch the API results based on this location\n getRestrooms(lat,lng);\n}", "updateLocation() {\n this.api.exec('getLocation');\n }", "async function locations(zone, type, coord){\r\n \r\n let query, headers, queryURL\r\n \r\n let locationTypes = ['PARKING_ZONE','TRAFFIC_LANE','WALKWAY']\r\n \r\n // (typeof(coord) === undefined) ? tenant.bbox : coord\r\n if (coord === undefined) {coord = '-90:-180,90:180'}\r\n \r\n if (type === 'bbox') {\r\n console.debug('querying locations by bbox')\r\n query = '/locations/search?bbox='+coord\r\n } else if (locationTypes.indexOf(type) >= 0) {\r\n console.debug('querying locations by locationType')\r\n query = '/locations/search?bbox='+coord+'&q=locationType:'+type \r\n } else {\r\n console.debug('querying locations by locationUid')\r\n query = '/locations/'+type\r\n }\r\n\r\n headers = {authorization: 'Bearer '+client_token, 'predix-zone-id': zone} \r\n queryURL = tenant.metadataservice+query\r\n console.log('Query URL: '+queryURL)\r\n \r\n let response = (await request(queryURL,headers))\r\n return (response.content === undefined) ? response : response.content \r\n }", "function getloc()\n{\n\n\tvar latlng = new google.maps.LatLng(shuttle.position.latitude, shuttle.position.longitude);\n geocoder.geocode({ latLng: latlng }, function(results, status){\n\t\tfor(ac in results[0].address_components)\n\t\t{\n\t\t\t//console.log(results[0].address_components[ac].types);\n\t\t\tif(results[0].address_components[ac].types == \"route\")\n\t\t\t{\n\t\t\t\t$(\"#currentstreet\").html(\"Street name: \" + results[0].address_components[ac].long_name);\n\t\t\t}\n\t\t}\n });\n\n\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(createMap);\n } \n }", "function findLocation(query, callback) {\n $.ajax('http://nominatim.openstreetmap.org/search', {\n data: { format: 'json', q: query }, \n dataType: 'json'\n }).success(function(data) {\n callback(data.map(function(item) { \n return { \n latlng: [item.lat, item.lon], \n name: item.display_name \n }; \n }));\n });\n }", "function getCity(coordinates) { \n\tvar xhr = new XMLHttpRequest(); \n\tvar lat = coordinates[0]; \n\tvar lng = coordinates[1]; \n\n\t// Paste your LocationIQ token below.\n\txhr.open('GET', \"https://us1.locationiq.com/v1/reverse.php?key=pk.db6b5613a34db29a0d33169822c6d0b7&lat=\" + \n\tlat + \"&lon=\" + lng + \"&format=json\", true); \n\txhr.send(); \n\txhr.onreadystatechange = processRequest; \n\txhr.addEventListener(\"readystatechange\", processRequest, false); \n\n\tfunction processRequest(e) { \n\t\tif (xhr.readyState == 4 && xhr.status == 200) { \n\t\t\tvar response = JSON.parse(xhr.responseText); \n\t\t\tvar city = response.address.city; \n console.log(city); \n getWeatherDetail(city);\n\t\t\treturn ; \n\t\t} \n\t} \n}", "function getLoc(cityName) {\n\tlet positie = \"\";\n\tgetData(`https://geocode.search.hereapi.com/v1/geocode?apiKey=${apiHereKey}&q=${cityName},%20NL`)\n\t.then(result => {\n\t\treturn result.json();\n\t})\n\n\t.then(coorData => {\n\t\tpositie = coorData.items[0].position;\n\t});\n\treturn positie;\n}", "function initialLocation() {\n var IPapiKey = \"602f8d85bc584bb4b0b520771a9d3287\";\n var IPapi = \"https://ipgeolocation.abstractapi.com/v1/?api_key=\" + IPapiKey;\n fetch(IPapi)\n .then((r) => r.json())\n .then((d) => {\n // assign user's lat/long to variables place them on the map\n searchLat = d.latitude;\n searchLng = d.longitude;\n initMap()\n });\n}", "async function location(params) {\n let location = params.cp + ' ' + params.street + ' ' + params.suburb + ',' + params.city + ' ' + params.state + ' Mexico';\n var lat, lon;\n await axios.get('https://maps.googleapis.com/maps/api/geocode/json', {\n params: {\n address: location,\n key: 'AIzaSyDgRN1AR5CnGjgdcc3f93CzMho80a2yWog'\n }\n }).then(function (resp) {\n lat = resp.data.results[0].geometry.location.lat;\n lon = resp.data.results[0].geometry.location.lng;\n });\n\n return {\n lat,\n lon\n }\n}", "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale; \n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('Json object from getLocation function:'); \n console.log(data);\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city); \n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state); \n \n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations;\n let forecastHourly= data.properties.forecastHourly; \n // Call the function to get the list of weather stations\n getStationId(stationsURL); \n getHourly(forecastHourly);\n }) \n .catch(error => console.log('There was a getLocation error: ', error)) \n} // end getLocation function", "function getLocation(object) {\n return fetch(`https://api.flickr.com/services/rest/?method=flickr.photos.geo.getLocation&api_key=${flickKey}&photo_id=${object.id}&format=json&nojsoncallback=1`)\n .then(r => r.json())\n .then(k => k.photo.location);\n}", "async getInfo(keyword) {\n //http://openapi.seoul.go.kr:8088/(인증키)/xml/MgisArtPlace/1/5/\n //const response = await fetch(`http://openapi.seoul.go.kr:8088/${this.apiKey}/json/GetParkInfo/1/5`)\n const response = await fetch(`http://openapi.seoul.go.kr:8088/${this.apiKey}/json/MgisArtPlace/1/354/`)\n\n const responseData = await response.json();\n\n return responseData;\n\n }", "function getLocation(lat, lon) {\n var url =\n \"https://fcc-weather-api.glitch.me/api/current?lat=\" +\n lat +\n \"&\" +\n \"lon=\" +\n lon;\n $.getJSON(url, function(data) {\n var city = data.name;\n var country = data.sys.country;\n $(\".mdl-card__title\").html(city + \", \" + country);\n });\n }", "getLocationApi(location) {\n var mapurl = `https://maps.googleapis.com/maps/api/geocode/json?address=${location}&key=${googlekey}`;\n console.log(mapurl)\n axios.get(mapurl).then(response => {\n this.setState({\n lat: response.data.results[0].geometry.location.lat,\n lon: response.data.results[0].geometry.location.lng,\n })\n console.log(response.data.results[0].formatted_address)\n this.getWeatherApi(this.state.lat,this.state.lon);\n }).catch(function (error) {\n console.log(error);\n });\n }", "function acceslocationfun() {\n fetch(`http://www.mapquestapi.com/geocoding/v1/reverse?key=etyxXJEu28EtN6ySr5iCsUO9QrMuUc0m&location=${latitude1},${longitude1}&includeRoadMetadata=true&includeNearestIntersection=true`\n , { method: \"GET\" }\n )\n\n .then(res => res.json())\n .then(sec => {\n console.log(geolocationData)\n\n geolocationData = sec;\n //accessed geolocation variable na\n let geo1 = geolocationData.results[0].locations[0].adminArea1\n let geo2 = geolocationData.results[0].locations[0].adminArea3\n let geo3 = geolocationData.results[0].locations[0].adminArea5\n\n document.getElementById(\"geolocation_id\").innerHTML =\"Welcome To \"+ \" \"+ geo3 + \" \" + geo2 + \" \" + geo1\n }\n )\n .then(err => { console.log(err) })\n }", "function GetLatlong() {\n var geocoder = new google.maps.Geocoder();\n var address = document.getElementById('pac-input').value;\n\n geocoder.geocode({\n 'address': address\n }, function(results, status) {\n\n if (status == google.maps.GeocoderStatus.OK) {\n var latitude = results[0].geometry.location.lat();\n var longitude = results[0].geometry.location.lng();\n getWeather(latitude,longitude);\n }\n });\n}", "async getGeoWeather() {\n\t\tconst geoResponse = await fetch(\n\t\t\t`https://api.opencagedata.com/geocode/v1/json?q=${this.lat}+${this.long}&key=${this.geoApiKey}`\n\t\t);\n\t\n\t\t// Convert longtitude latitude to city state\n\t\tconst geoResponseData = await geoResponse.json();\n\n\t\tlet city = geoResponseData.results[0].components.city;\n\t\tlet state = geoResponseData.results[0].components.state_code;\n\n\t\t// Pass city state to API to get current weather data\n\t\tconst response = await fetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?q=${city},${state},US&units=imperial&mode=json&appid=${this.apiKey}`\n\t\t);\n\n\t\tconst responseData = await response.json();\n\n \treturn responseData;\n\t}", "loadLocationData() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/location/\", {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(obj => this.processLocationData(obj));\n }", "function findLocation() {\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent('You.');\n infoWindow.open(map);\n map.setCenter(pos);\n userLat = position.coords.latitude;\n userLng = position.coords.longitude;\n\n //Runs the Zomato ajax call\n getFoodSpots();\n\n }, function () {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "function getaddressLocation(nameBrewery, city, first) {\n var queryURL = \"\";\n var zoomLevel = 0;\n if(nameBrewery === \"\"){\n zoomLevel = 11;\n } else{\n zoomLevel = 15;\n }\n \n if(first){\n var lat = 0;\n var long = 0;\n console.log(navigator);\n\n function success(pos) {\n lat = pos.coords.latitude;\n long = pos.coords.longitude;\n onLanding(lat, long, zoomLevel);\n console.log(\"success\")\n }\n\n function error(err) {\n lat = 41.8781;\n long = -87.6298;\n onLanding(lat, long, zoomLevel);\n console.log(err);\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }\n navigator.geolocation.getCurrentPosition(success, error)\n\n } else{\n var address = nameBrewery.replace(/[\\/\\\\#,+()$~%'\":*?<>{}]/g, '');\n queryURL = 'https://api.mapbox.com/geocoding/v5/mapbox.places/' + address + \" \" + city + '.json?&access_token=' + key;\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n if (response.features.length === 0) {\n $(\"#myModal\").modal();\n return;\n }\n $('.currentCity').html(city);\n var map = new mapboxgl.Map({\n container: 'map', // container id\n style: 'mapbox://styles/mapbox/streets-v11',\n center: [response.features[0].geometry.coordinates[0], response.features[0].geometry.coordinates[1]], // starting position\n zoom: zoomLevel // starting zoom\n })\n // Add zoom and rotation controls to the map.\n map.addControl(new mapboxgl.NavigationControl());\n\n var marker = new mapboxgl.Marker()\n .setLngLat([response.features[0].geometry.coordinates[0], response.features[0].geometry.coordinates[1]])\n .addTo(map);\n \n var checked = $('input:checked');\n if(checked.length === 0){\n getBreweries(city);\n }\n \n });\n }\n }", "function geoCoords(searchInputVal){\n var coordUrl = 'https://api.openweathermap.org/geo/1.0/direct?q=' + searchInputVal + apiKey;\n\n fetch(coordUrl)\n .then(function (response){\n return response.json();\n })\n .then(function (data){\n // console.log(data);\n // console.log(data[0].lat);\n // console.log(data[0].lon);\n var lattitude = data[0].lat;\n var longitude = \"&lon=\" + data[0].lon;\n searchWeather(lattitude, longitude);\n })\n}", "function getCurrentLocationLatLon()\n{\n\tMicrosoft.Maps.loadModule('Microsoft.Maps.Themes.BingTheme',\n\t\t\t\t\t\t\t { callback: function() {\n\t\t\t\t\t\t\t var geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map); \n\t\t\t\t\t\t\t geoLocationProvider.getCurrentPosition({successCallback:displayCenter});\n\t\t\t\t\t\t\t setTimeout(getCenter,8000);\n\t\t\t\t\t\t\t setTimeout(staticPin,8000);\n}});\n}", "function getGeoData() {\n\n //determine if the handset has client side geo location capabilities\n if(geo_position_js.init()){\n\tgeo_position_js.getCurrentPosition(\n\t\t\t\t\t function(data){\n\t\t\t\t\t \n\t\t\t\t\t LATITUDE = data.coords.latitude;\n\t\t\t\t\t LONGITUDE = data.coords.longitude;\n\n\t\t\t\t\t },\n\n\t\t\t\t\t function(data){\n\t\t\t\t\t alert('could not retrieve geo data');\n\t\t\t\t\t }\n\t\t\t\t\t );\n }\n else{\n\talert(\"Functionality not available\");\n }\n\n\n\n}", "function findLocation() {\n var key = \"\";\n var post = \"https://www.googleapis.com/geolocation/v1/geolocate?key=\" + key;\n $.post(post, function (data) {\n if (data.accuracy < 3000) {\n var geocoder = new google.maps.Geocoder;\n geocodeLatLng(geocoder, data.location.lat, data.location.lng);\n }\n });\n }", "async function getWeatherDataByLocation() {\n /* Appel de la fonction getPosition pour récupérer la position */\n const location = await getPosition();\n /* Vérification de l'objet location */\n if (!location.coords) {\n Alert.alert(\n \"Impossible to find your location\",\n \"Please activate on your phone.\"\n );\n return;\n }\n const coords = location.coords;\n \n const response = await fetch(\n `http://api.openweathermap.org/data/2.5/weather?lat=${coords.latitude}&lon=${coords.longitude}&appid=0b626d564aefeb00bdbd2c294ee1df75&units=metric`\n );\n /* reads object JSON */\n const data = await response.json();\n /* store data in weather const */\n setWeather(data);/* \n console.log(data); */\n }", "function getCurrentLocation()\n{\n\tMicrosoft.Maps.loadModule('Microsoft.Maps.Themes.BingTheme',\n\t\t\t\t\t\t\t { callback: function() {\n\t\t\t\t\t\t\t var geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map); \n\t\t\t\t\t\t\t geoLocationProvider.getCurrentPosition({showAccuracyCircle: false,successCallback:displayCenter});\n\t\t\t\t\t\t\t //setTimeout(getCenter,5000);\n\t\t\t\t\t\t\t setTimeout(staticPin,5000);\n}});\n}", "function getCoordinates(city) {\n $.get('https://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=' + apiKey)\n .then(function (response) {\n console.log(response)\n })\n}", "function getAllLocations(){\n\t$.ajax({\n\t\turl: \"http://pokeapi.co/api/v2/location?limit=10\",\n\t\tsuccess: getAllLocationsCallback\n\t})\n}", "function mapper_get_location() {\n var x = document.getElementById(\"note[longitude]\");\n var y = document.getElementById(\"note[latitude]\");\n if(x && y ) {\n x = parseFloat(x.value);\n y = parseFloat(y.value);\n }\n if(x && y && ( x >= -180 && x <= 180 ) && (y >= -90 && y <= 90) ) {\n return new google.maps.LatLng(y,x);\n }\n return new google.maps.LatLng(lat,lon);\n}", "async function getEventLocationLngLat(location) {\n const locationInfo = axios.get(MAP_BASE_URL + location + MAP_API_KEY).then(\n resp => {\n const address = resp.data.results[0].formatted_address;\n const {lat, lng} = resp.data.results[0].geometry.location;\n return {address, lat, lng};\n }\n );\n return locationInfo;\n}", "fetchGeographicLocation() {\n\t\t//First check if the browser supports geo locations\n\t\tif (navigator.geolocation){\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t/*anonymous method passed as the first argument used by the getCurrentPosition\n\t\t\t\t method when it was successful, else it calls the error function */\n\t\t\t\t(position) => {\n\t\t\t\t\t//creating a variable to store the coordinates\n\t\t\t\t\tlet crds = position.coords;\n\t\t\t\t\tthis.fetchWeatherData(crds.latitude, crds.longitude);\n\t\t\t\t},\n\t\t\t\t//the method that gets called when an error occurs\n\t\t\t\t() => {\n\t\t\t\t\twindow.alert(\"Error has occurred\");\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "function getUvInd(lat, lon) {\n $.ajax({\n url: \"https://api.openweathermap.org/data/2.5/uvi?appid=483b31400bcaf50500277fbb33164efa&lat=\" + lat + \"&lon=\" + lon,\n method: \"GET\",\n success: function (response) {\n //response.value\n // console.log(response)\n }\n })\n}", "function getLocation() {\r\n if (navigator.geolocation)\r\n navigator.geolocation.getCurrentPosition(success);\r\n else\r\n alert('Geolocation not supported');\r\n\r\n function success(position) {\r\n latitude = position.coords.latitude;\r\n longitude = position.coords.longitude;\r\n\r\n // send latitude and longitude to gmap to get full address\r\n gmap = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + latitude + ',' + longitude;\r\n\r\n //call fetchWeather to get the data\r\n fetchWeather();\r\n\r\n // cal getAddress to get full address\r\n getAddress();\r\n }\r\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}", "function GeoLocQuery(){}", "function getGeoLocation() {\n \"use strict\";\n var cords = [];\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n cords.push(position.coords.latitude);\n cords.push(position.coords.longitude);\n //When you take them, use them to find the weather\n getWeatherFromCords(cords);\n });\n }\n}", "async function getByLocation(lat, lon) {\n try {\n let resp1 = await fetch(\n `${wurl}lat=${lat}&lon=${lon}&units=metric&${apiKey}`\n );\n let weatherData = await resp1.json();\n\n let resp2 = await fetch(`${curl}alpha/${weatherData.sys.country}`);\n let countryData = await resp2.json();\n\n renderToCard({ ...weatherData, ...countryData });\n } catch (err) {\n console.log(err);\n }\n}", "function getGeoLocation(callback) \n{\n if(OsmMaps.position) \n {\n window.setTimeout(function() \n {\n console.log(OsmMaps.position);\n callback(OsmMaps.position);\n }, 10);\n } \n else if (navigator.geolocation) \n { //current position's lat/long coordinates\n navigator.geolocation.getCurrentPosition(function(position) \n {\n OsmMaps.position = \n {\n \"coords\": {\n \"latitude\": position.coords.latitude,\n \"longitude\": position.coords.longitude\n }\n };\n\n callback(OsmMaps.position);\n });\n } \n else \n { // else get lat/long position of TansAmerica Building in SFO\n throw new Error('incompatible browser');\n }\n}", "function locationInfoCall(lat,long,callback){\n var queryURL1 =`https://developers.zomato.com/api/v2.1/locations?lat=${lat}&lon=${long}&apikey=${apiKey}`;\n $.ajax({\n url: queryURL1,\n method: \"GET\"\n }).then(function(zomatoResponse) {\n \n cityId = zomatoResponse.location_suggestions[0].city_id;\n cityStateName = zomatoResponse.location_suggestions[0].title;\n entityType = zomatoResponse.location_suggestions[0].entity_type;\n entityId = zomatoResponse.location_suggestions[0].entity_id;\n\n var parameters = {\n cityId: cityId,\n cityStateName: cityStateName,\n entityType: entityType,\n entityId: entityId,\n }\n callback();\n });\n \n }//end locationInfoCall function", "function getLocations(place, callback) {\n var request = new XMLHttpRequest();\n var baseUrl = 'https://api.foursquare.com/v2/venues/explore';\n var clientId = 'YAFHOBF2NGR5UJJS4NLNWXCNZBGEMQUBCFA00SFRZLIRM5JO';\n var clientSecret = 'CX2WYTMBELLDEAVQJB3BFFPDWL315NPQK1GYJKL1JZRPBBZX';\n var queryParams = [];\n queryParams[0] = 'near=' + place;\n queryParams[1] = 'client_id=' + clientId;\n queryParams[2] = 'client_secret=' + clientSecret;\n queryParams[3] = 'radius=' + 2000; //finds places in a circle with radius 2000 metetes.\n queryParams[4] = 'v=' + (new Date()).toISOString().slice(0,10).replace(/-/g,\"\");\n var url = baseUrl + '?' + queryParams.join('&');\n request.open('GET', url);\n request.onreadystatechange = function() {\n var requestError = false;\n var data;\n if (request.readyState === 4) {\n //if there is no error, parse the returned data.\n //if error, set the error status to true.\n request.status === 200? data = JSON.parse(request.responseText) : requestError = true;\n callback(requestError, data);\n } \n };\n request.send(null);\n}", "async function getLocationData(query) {\n try {\n const location_URL = `https://maps.googleapis.com/maps/api/geocode/json?address=${query}&key=${process.env.GEOCODE_API_KEY}`;\n const result = await superagent.get(location_URL);\n\n const latLong = result.body.results[0].geometry.location;\n const cityName = result.body.results[0].address_components.filter(e => e.types.includes('locality'))[0].long_name;\n // console.log(result.body.results[0].address_components);\n return { latLong, cityName };\n\n } catch (e) {\n console.log('getLatLong(query) ERROR: ', e);\n }\n}", "function getLocation() {\n var currentLon = \"\";\n var currentLat = \"lat=\";\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(loc) {\n //set currentLon & currentLat\n currentLon += loc.coords.longitude;\n currentLat += loc.coords.latitude;\n //fucntions called built on longitude and latitude location\n buildApi(currentLon, currentLat);\n //drawCoords(currentLon, currentLat);\n });\n } else {\n alert(\"You're lost and we can't find you.\");\n }\n }", "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale;\n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new ERROR('Response not OK.');\n })\n .then(function (data) {\n // Let's see what we got back\n console.log('Json object from getLocation function:');\n console.log(data);\n\n let hourlyURL = data.properties.forecastHourly;\n let hourlyData = getHourly(hourlyURL);\n\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city);\n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state);\n\n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations;\n // Call the function to get the list of weather stations\n getStationId(stationsURL);\n\n getForecast(data.properties.forecast);\n })\n\n .catch(error => console.log('There was a getLocation error: ', error))\n} // end getLocation function", "async getWeather() {\n const response = await fetch(`http://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${this.key}/${this.latitude},${this.longitude}`)\n const result = await response.json();\n\n const ocd = await fetch(`https://api.opencagedata.com/geocode/v1/json?key=${this.ocdkey}&q=${this.latitude}%2C${this.longitude}&language=en`)\n const ocdResult = await ocd.json();\n\n return {\n result,\n ocdResult,\n }\n }", "function getWeather() {\n navigator.geolocation.getCurrentPosition(\n locationSuccess,\n locationError,\n {timeout: 15000, maximumAge: 60000}\n );\n}", "function getPlaceInfo(placeObject) {\n // let placeObject = {\n // name: \"\",\n // address: \"\",\n // city: \"\",\n // state: \"\",\n // zipCode: \"\",\n // lat: \"\",\n // lng: \"\"\n // };\n locationInfoCall(placeObject.lat, placeObject.lng,foodInfoCall);\n }", "function getLatLong (callback) {\n request\n .get('http://api.open-notify.org/iss-now.json')\n .end(function(err, res){\n var lat = res.body.iss_position.latitude\n var lon = res.body.iss_position.longitude\n // $('#issLocation').append(lat, lon);\n // console.log(lat, lon)\n callback([lat, lon])\n })\n}", "function cityLocation(cityName, cityDistance) {\n var locationAPIKey = \"&appid=0888bb26c1d027c60cb2417244156801\";\n var locationURL = \"https://api.openweathermap.org/data/2.5/weather?units=imperial&q=\" + cityName + locationAPIKey;\n $.ajax({\n url: locationURL,\n method: \"GET\"\n }).then(function (response) {\n var long = response.coord.lon;\n var lat = response.coord.lat;\n var temp = Math.round(response.main.temp)\n\n getTrails(lat, long, cityDistance, temp); //passing longitude and latitude parameters to get trail results\n })\n }", "function geoLocationWeather() {\n navigator.geolocation.getCurrentPosition(function(position) {\n fetch(API + \"lat=\" + position.coords.latitude + \"&lon=\" + position.coords.longitude + \"&APPID=\" + KEY + \"&units=metric\")\n .then((resp) => resp.json())\n .then((data) => {\n getWeatherData(data);\n })\n .catch(function(error) {\n console.log(\"Wystąpił błąd: \" + error);\n })\n });\n }", "function getUserLocationName(url){\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n var response = JSON.parse(this.responseText);\n for(var a = 0; a<response.results.length; a++){\n if(response.results[a].types[0]==='locality' && response.results[a].types[1]==='political'){\n //show the user location \n document.getElementById(\"location\").innerHTML = response.results[a][\"formatted_address\"];\n }\n }\n }\n }\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "function geocode(loc) {\n fs.readFile('keys/mapsApi', 'utf8', function(error, apikey) {\n var locComp = loc.split().join('+');\n request.post('https://maps.googleapis.com/maps/api/geocode/json?address=' + locComp + '&key=' + apikey, \n function(error, response, body) {\n if(!error && response.statusCode == 200) {\n var bodyObj = JSON.parse(body);\n console.log(bodyObj);\n if(bodyObj.results && bodyObj.results[0]) {\n return bodyObj.results[0].geometry.location;\n }\n return { lat: 0, lng: 0};\n }\n });\n });\n}", "getAllLocations() {\n\n infoWindow = new window.google.maps.InfoWindow();\n if (navigator && navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(function (position) {\n pos = [position.coords.latitude, position.coords.longitude]\n let centerpos = { \"lat\": position.coords.latitude, \"lng\": position.coords.longitude }\n map.setCenter(centerpos);\n\n }, function (error) {\n console.log(\"error\", error)\n this.handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n this.handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "async getData(location){\n const locationResponse = await fetch(`https://api.foursquare.com/v2/venues/explore?near=${location}&client_id=${this.id}&client_secret=${this.api_key}&v=${this.today}`);\n const locationJson = await locationResponse.json();\n return locationJson;\n }", "function getLocation(location) {\n lat = location.coords.latitude;\n lng = location.coords.longitude;\n }", "function findWeatherDetails() {\n let searchLink =\n \"https://api.openweathermap.org/data/2.5/weather?q=copenhagen&appid=\" +\n appKey;\n httpRequestAsync(searchLink, theResponse);\n}", "function getLatLong(position){\n var crd = position.coords;\n\n // console.log('Your current position is:');\n // console.log(`Latitude : ${crd.latitude}`);\n // console.log(`Longitude: ${crd.longitude}`);\n // call handleWeather to form the querystring\n handleWeather(crd.latitude, crd.longitude)\n}" ]
[ "0.6993513", "0.6836875", "0.6794714", "0.6767347", "0.6706135", "0.6685092", "0.66030556", "0.6582692", "0.65578604", "0.65209436", "0.6507103", "0.64702135", "0.6464208", "0.6455112", "0.64394647", "0.64307845", "0.64202476", "0.64121234", "0.63966024", "0.63925236", "0.6391821", "0.63869554", "0.6339413", "0.6337672", "0.6335529", "0.6335458", "0.6332462", "0.6331359", "0.6306133", "0.63036555", "0.63003886", "0.62947875", "0.62906307", "0.628668", "0.62772447", "0.62624353", "0.6261139", "0.6257976", "0.6254705", "0.624391", "0.62408936", "0.62391263", "0.6226799", "0.6223498", "0.62232125", "0.62137663", "0.6212899", "0.6195442", "0.61904323", "0.61857027", "0.618214", "0.6181812", "0.617835", "0.61751384", "0.6173797", "0.6155841", "0.61549306", "0.6147362", "0.61462206", "0.6138629", "0.61355025", "0.6127656", "0.61170423", "0.61128426", "0.6112035", "0.6106002", "0.610361", "0.61007226", "0.60994464", "0.6096981", "0.60938513", "0.6092581", "0.60808915", "0.60756683", "0.6073451", "0.60707974", "0.60703236", "0.60639256", "0.6063557", "0.6062153", "0.6060295", "0.6060087", "0.60525453", "0.6050892", "0.6047417", "0.604689", "0.6042878", "0.604208", "0.6025826", "0.6025675", "0.60244405", "0.60234445", "0.6007384", "0.59997267", "0.59943646", "0.5992436", "0.5988592", "0.5985756", "0.59843665", "0.5981825", "0.597895" ]
0.0
-1
getting boundbox values for WheelMaps API and converting to proper format (bbox=west,south,east,north) as comma separated float numbers wich are longitude, latitude values in degrees. runs whenever the map is moved and calls getWheelMapNodes function with new bounds
function findBoundaries() { google.maps.event.addListener(map, 'bounds_changed', function() { const bounds = map.getBounds(); const NE = bounds.getNorthEast(); const SW = bounds.getSouthWest(); const coordinates = [`${SW}`, `${NE}`]; const fixed = coordinates.map(e => e.replace(/[{()}]/g, '')).map(e => e.split(', ')).flat(); const parsed = fixed.map(e => parseFloat(e)); [parsed[0], parsed[1]] = [parsed[1], parsed[0]]; [parsed[2], parsed[3]] = [parsed[3], parsed[2]]; const formattedBounds = parsed.join(); getWheelMapNodes(formattedBounds); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWheelMapNodes(bounds) {\n\tconst params = {\n\t\tapi_key: apiKey,\n\t\tbbox: bounds,\n\t\tper_page: 1000,\n\t}\n\tconst options = {\n\t\tmode: 'no-cors'\n\t}\n\tconst queryString = formatQuery(params)\n\tconst url = `${searchURL}?${queryString}`\n\tfetch(url, options)\n\t\t.then(response => {\n\t\t\tconsole.log(response);\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.log(err)\n\t\t});\n}", "function getBoundingBox () {\n let boundingBox = map.getBounds()\n xmin = parseFloat(boundingBox._sw.lng)\n ymin = parseFloat(boundingBox._sw.lat)\n xmax = parseFloat(boundingBox._ne.lng)\n ymax = parseFloat(boundingBox._ne.lat)\n\n //console.log(`${xmin}, ${ymin}, ${xmax}, ${ymax}`)\n}", "function getBoundParams(){\n var bounds = map.getBounds(),\n padding = .00;\n console.log(bounds);\n return { neLat: (bounds._northEast.lat + padding).toFixed(6),\n neLon: (bounds._northEast.lng + padding).toFixed(6),\n swLat: (bounds._southWest.lat - padding).toFixed(6),\n swLon: (bounds._southWest.lng - padding).toFixed(6)\n }\n }", "function updateBounds() {\n\n var crsNamesToLabels = new Object(); // It is not an array!\n crsNamesToLabels[\"EPSG:4326\"] = \"WGS84\";\n crsNamesToLabels[\"CRS:84\"] = \"WGS84\";\n crsNamesToLabels[\"EPSG:3035\"] = \"ETRS-LAEA\";\n crsNamesToLabels[\"EPSG:3034\"] = \"ETRS-LCC\";\n crsNamesToLabels[\"EPSG:4258\"] = \"ETRS89\";\n\n var proj = Ext.getCmp(\"lblProjection\");\n if (proj != undefined) {\n var curProj = map.getProjection();\n if (crsNamesToLabels[curProj] != undefined) {\n curProj = crsNamesToLabels[curProj];\n }\n proj.setText(curProj);\n }\n try {\n var digits = 3;\n if (useProjection == \"Lambert\")\n digits = 0;\n if (useProjection == \"WGS84\")\n digits = 5;\n cX.setValue(mapPanel.map.center.lon.toFixed(digits));\n cY.setValue(mapPanel.map.center.lat.toFixed(digits));\n }catch(ex)\n {\n }\n}", "function compute_bound(bbox) {\n var offset = 0.01;\n var southWest = new L.LatLng(bbox[0][0] - offset, bbox[0][1] - offset);\n var northEast = new L.LatLng(bbox[2][0] + offset, bbox[2][1] + offset);\n return new L.LatLngBounds(southWest, northEast);\n}", "function getBounds(bounds){\n\t var bbox = [];\n\t\n\t bbox.push(parseFloat(bounds.attrib[\"minlon\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"minlat\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"maxlon\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"maxlat\"]));\n\t\n\t return bbox;\n\t}", "function BoundingBox() {\n var bounds = map.getBounds().getSouthWest().lng + \",\" + map.getBounds().getSouthWest().lat + \",\" + map.getBounds().getNorthEast().lng + \",\" + map.getBounds().getNorthEast().lat;\n return bounds;\n}", "function boundsChanged() {\n // REVERSE GEOCODE\n reverseGeocode();\n // FIX CLUSTER\n fixCluster();\n}", "function boundingBox() {\n for (let node of nodes) {\n // If the positions exceed the box, set them to the boundary position.\n var yearX = xSmallScale.bandwidth() * ((node.year - minYear) / 4 + 0.6) // xSmallScale.bandwidth() * ((node.year - minYear) / 4 + 0.1)\n node.x = Math.max(Math.min(node.x, yearX + xSmallScale.bandwidth() / 2.5 - medalRadius), yearX - xSmallScale.bandwidth() / 2.5 + medalRadius);\n node.y = Math.max(Math.min(innerHeight - medalRadius, node.y), 0 + medalRadius);\n }\n }", "function updateBounds() {\n map.fitBounds(mapBounds);\n\n // update dark border area\n topBound.setBounds([[90, -180], [Math.max(mapBounds[0][0], mapBounds[1][0]), 180]]);\n rightBound.setBounds([[Math.min(mapBounds[0][0], mapBounds[1][0]), Math.max(mapBounds[0][1], mapBounds[1][1])],\n [Math.max(mapBounds[0][0], mapBounds[1][0]), 180]]);\n leftBound.setBounds([[Math.min(mapBounds[0][0], mapBounds[1][0]), -180],\n [Math.max(mapBounds[0][0], mapBounds[1][0]), Math.min(mapBounds[0][1], mapBounds[1][1])]]);\n bottomBound.setBounds([[Math.min(mapBounds[0][0], mapBounds[1][0]), -180], [-90, 180]]);\n}", "CalculateBoundingBoxParameters() {\n\n\n\n /**\n * Initialize the minimum and the maximum x,y,z components of the bounding box.\n */\n var maxX = Number.MIN_SAFE_INTEGER;\n var maxY = Number.MIN_SAFE_INTEGER;\n var maxZ = Number.MIN_SAFE_INTEGER;\n\n var minX = Number.MAX_SAFE_INTEGER;\n var minY = Number.MAX_SAFE_INTEGER;\n var minZ = Number.MAX_SAFE_INTEGER;\n\n\n\n //Get the children meshes of the tank.\n var children = this.root.getChildren();\n\n\n\n //There are actually 12 childeren meshes.\n\n\n for (var i = 0; i < children.length; i++) {\n\n //The positions are returned in the model reference frame. The positions are stored\n //in the (x,y,z),(x,y,z) fashion.\n var positions = new BABYLON.VertexData.ExtractFromGeometry(children[i]).positions;\n if (!positions) continue;\n\n var index = 0;\n\n\n //Starting from j = 0, in j+3, j+6 .... there are all the x components.\n for (var j = index; j < positions.length; j += 3) {\n if (positions[j] < minX)\n minX = positions[j];\n if (positions[j] > maxX)\n maxX = positions[j];\n }\n\n index = 1;\n //Starting from j = 1, in j+3, j+6 .... there are all the y components.\n for (var j = index; j < positions.length; j += 3) {\n if (positions[j] < minY)\n minY = positions[j];\n if (positions[j] > maxY)\n maxY = positions[j];\n }\n\n //Starting from j = 2, in j+3, j+6 .... there are all the z components.\n index = 2;\n for (var j = index; j < positions.length; j += 3) {\n if (positions[j] < minZ)\n minZ = positions[j];\n if (positions[j] > maxZ)\n maxZ = positions[j];\n\n }\n\n\n /** \n * Take the length of the segment with a simple yet effective mathematical \n * formula: the absolute value of the maximum value - the minimum value for \n * each component.\n */\n\n var _lengthX = Math.abs(maxX - minX);\n var _lengthY = Math.abs(maxY - minY);\n var _lengthZ = Math.abs(maxZ - minZ);\n\n\n\n }\n\n\n\n //Return an object with all the three variables (the dimensions of the bounding box).\n return { lengthX: _lengthX, lengthY: _lengthY, lengthZ: _lengthZ }\n\n\n\n }", "function get_bounds(){\n\t\t\t\t\n\t\t\t\treturn {\n\t\t\t\t\t\n\t\t\t\t\tsw_lat : map.getBounds().getSouthWest().lat(),\n\t\t\t\t\t\n\t\t\t\t\tsw_lng : map.getBounds().getSouthWest().lng(),\n\t\t\t\t\t\n\t\t\t\t\tne_lat : map.getBounds().getNorthEast().lat(),\n\t\t\t\t\t\n\t\t\t\t\tne_lng : map.getBounds().getNorthEast().lng()\n\t\t\t\t\n\t\t\t\t};\n\t\t\t\n\t\t\t}", "function getBounds(projection, rangeBox) {\n\t return d3.geo.path().projection(projection).bounds(rangeBox);\n\t}", "function getBounds(projection, rangeBox) {\n\t return d3.geo.path().projection(projection).bounds(rangeBox);\n\t}", "function mapFitBounds() {\n\t// bounds\n\tvar b = {\n\t north: 0,\n\t south: 0,\n\t east: 0,\n\t west: 0\n\t};\n\t\n\t// is bound came?\n\tvar c = {\n\t\t north: false,\n\t\t south: false,\n\t\t east: false,\n\t\t west: false\t\t\t\n\t};\n\t\n\t// get bounds if any\n\tfor (key in participants) {\n\t\tx = participants[key].geox;\n\t\ty = participants[key].geoy;\n\t\t\n\t\tif (x == 0 || y == 0) continue;\n\t\t\n\t\t// north\n\t\tif (c.north == false) {\n\t\t\tc.north = true; b.north = y;\n\t\t} else {\n\t\t\tb.north = Math.max(b.north,y);\n\t\t}\n\t\t\n\t\t// south\n\t\tif (c.south == false) {\n\t\t\tc.south = true; b.south = y;\n\t\t} else {\n\t\t\tb.south = Math.min(b.south,y);\n\t\t}\n\n\t\t// east\n\t\tif (c.east == false) {\n\t\t\tc.east = true; b.east = x;\n\t\t} else {\n\t\t\tb.east = Math.max(b.east,x);\n\t\t}\n\t\t\n\t\t// west\n\t\tif (c.west == false) {\n\t\t\tc.west = true; b.west = x;\n\t\t} else {\n\t\t\tb.west = Math.min(b.west,x);\n\t\t}\t\t\n\t}\n\t\n\tif (b.east == b.west && b.north == b.south) {\n\t\t// only one point\n\t\tmapObject.setZoom(5);\n\t\tmapObject.setCenter(new google.maps.LatLng(b.south, b.east));\n\t\treturn;\n\t} \n\n\tif (c.east && c.west && c.north && c.south) {\n\t\tmapObject.fitBounds(b);\n\t\t//mapObject.panToBounds(b);\n\t}\n}", "function getIntersectionBBOX()\n{\n var mapBounds = map.getExtent();\n var mapBboxEls = mapBounds.toBBOX().split(',');\n // bbox is the bounding box of the currently-visible layer\n var layerBboxEls = bbox.split(',');\n var newBBOX = Math.max(parseFloat(mapBboxEls[0]), parseFloat(layerBboxEls[0])) + ',';\n newBBOX += Math.max(parseFloat(mapBboxEls[1]), parseFloat(layerBboxEls[1])) + ',';\n newBBOX += Math.min(parseFloat(mapBboxEls[2]), parseFloat(layerBboxEls[2])) + ',';\n newBBOX += Math.min(parseFloat(mapBboxEls[3]), parseFloat(layerBboxEls[3]));\n return newBBOX;\n}", "function getMapBounds(){\n\tvar bounds = myMap.getBounds();\n\tvar nWlat = bounds.getNorthWest().lat;\n\tvar nWlon = bounds.getNorthWest().lng;\n\tvar sElat = bounds.getSouthEast().lat;\n\tvar sElon = bounds.getSouthEast().lng;\n\tvar boundArray = [nWlat,nWlon, sElat, sElon];\n\treturn boundArray\n}", "function make_bounding_box(boudingBox){\n i = boundingBox.vertices\n thick = 100\n length = 2 * Math.abs(i[1].x - i[0].x)\n return [{\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[1].x, y: i[1].y-thick/2}, // in px also may be undefined (when initializing)\n rotation: 0, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n },\n {\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[2].x+thick/2, y: i[2].y}, // in px also may be undefined (when initializing)\n rotation: 90, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n },\n {\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[3].x, y: i[3].y+thick/2}, // in px also may be undefined (when initializing)\n rotation: 180, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n },\n {\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[0].x-thick/2, y: i[0].y}, // in px also may be undefined (when initializing)\n rotation: 270, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n }]\n}", "function boundingBox(latitudeInDegrees, longitudeInDegrees, halfSideInKm) {\n\tvar lat = deg2rad(latitudeInDegrees);\n var lon = deg2rad(longitudeInDegrees);\n var halfSide = 1000000*halfSideInKm;\n\n // Radius of Earth at given latitude\n var radius = WGS84EarthRadius(lat);\n // Radius of the parallel at given latitude\n var pradius = radius*Math.cos(lat);\n\n var latMin = lat - halfSide/radius;\n var latMax = lat + halfSide/radius;\n var lonMin = lon - halfSide/pradius;\n var lonMax = lon + halfSide/pradius;\n\n return {\n \t'top_left': {\n \t\t'lat': rad2deg(latMin), \n \t\t'lon': rad2deg(lonMin)\n \t},\n \t'bottom_right': {\n \t\t'lat': rad2deg(latMax), \n \t\t'lon': rad2deg(lonMax)\t\n \t} \n };\n}", "function getConicParams(bbox, decimals) {\n var cx = (bbox[0] + bbox[2]) / 2;\n var h = bbox[3] - bbox[1];\n var sp1 = bbox[1] + 1/6 * h;\n var sp2 = bbox[1] + 5/6 * h;\n return `+lon_0=${ cx.toFixed(decimals) } +lat_1=${ sp1.toFixed(decimals) } +lat_2=${ sp2.toFixed(decimals) }`;\n }", "OnRebuildBounds()\n {\n sph3.fromMat4(this._boundingSphere, this._localTransform);\n box3.fromSph3(this._boundingBox, this._boundingSphere);\n this._boundsDirty = false;\n }", "function getBoundingRectLocs (center, grid) {\n var jQueryDoc = $(window.document),\n jQH = jQueryDoc.height(),\n jQW = jQueryDoc.width(),\n R = jQH/jQW,\n size = (grid ||.002);\n\n center.latitude = Math.round(center.latitude/(2*size))*(2*size);\n center.longitude = Math.round(center.longitude/(2*size/R))*(2*size/R);\n\n return [\n center.latitude + size,\n center.longitude - size/R,\n center.latitude - size,\n center.longitude + size/R\n ];\n\n }", "function bboxToNode (bbox) {\n return [\n Math.min(bbox[0],bbox[2]),\n Math.min(bbox[1],bbox[3]),\n Math.max(bbox[0],bbox[2]),\n Math.max(bbox[1],bbox[3])\n ]\n }", "function DoManualBounds() {\n if ($('#cbManualBounds').is(':checked')) {\n $('#cbManualBounds').parent().prop('class', 'cb-wrapper-down');\n // Set map drawing mode to rectangle.\n if (newRect != undefined) {\n newRect.setMap(null);\n }\n drawingManager.setDrawingMode(google.maps.drawing.OverlayType.RECTANGLE);\n // Clear co-ordinate textboxes.\n $('#sw-lat, #sw-lon, #ne-lat, #ne-lon').val('');\n\n }\n else {\n if (drawingManager != undefined) {\n $('#cbManualBounds').parent().prop('class', 'cb-wrapper');\n // Set drawing mode back to null.\n drawingManager.setDrawingMode(null);\n // Add the event listener to restore behavior of automatically grabbing map bound coords.\n boundsChangedListener = google.maps.event.addListener(map, 'bounds_changed', function () {\n DoAutoBounds(map);\n });\n // Remove rectangle overlay from the map.\n //RemoveRect();\n\n\n // Reset the coord textboxes to the coords of the map bounds.\n DoAutoBounds(map);\n }\n }\n}", "function mapBoundaries(data){\n boundaries = L.geoJSON(data, {\n style: {\n color: 'blue', // base layers can change that\n weight: 2\n }\n });\n\n styleBound()\n\n return boundaries\n\n}", "_getWrappedLongitudes() {\n let xmin = this.xllCorner;\n let xmax = this.xurCorner;\n\n if (this.longitudeNeedsToBeWrapped) {\n if (this.isContinuous) {\n xmin = -180;\n xmax = 180;\n } else {\n // not sure about this (just one particular case, but others...?)\n xmax = this.xurCorner - 360;\n xmin = this.xllCorner - 360;\n /* eslint-disable no-console */\n // console.warn(`are these xmin: ${xmin} & xmax: ${xmax} OK?`);\n // TODO: Better throw an exception on no-controlled situations.\n /* eslint-enable no-console */\n }\n }\n return [xmin, xmax];\n }", "_getWrappedLongitudes() {\n let xmin = this.xllCorner;\n let xmax = this.xurCorner;\n\n if (this.longitudeNeedsToBeWrapped) {\n if (this.isContinuous) {\n xmin = -180;\n xmax = 180;\n } else {\n // not sure about this (just one particular case, but others...?)\n xmax = this.xurCorner - 360;\n xmin = this.xllCorner - 360;\n /* eslint-disable no-console */\n // console.warn(`are these xmin: ${xmin} & xmax: ${xmax} OK?`);\n // TODO: Better throw an exception on no-controlled situations.\n /* eslint-enable no-console */\n }\n }\n return [xmin, xmax];\n }", "function onGeocode(r) {\n if (r.bbox) {\n const [west, south, east, north] = r.bbox\n p.save(roundBbox({north, south, east, west}))\n } else {\n const c1 = turfDestination(r.center, 5, 45)\n const c2 = turfDestination(r.center, 5, -135)\n const [east, north] = c1.geometry.coordinates\n const [west, south] = c2.geometry.coordinates\n const newBounds = roundBbox({north, south, east, west})\n p.save(newBounds)\n p.leaflet.map.fitBounds(toLatLngBounds(newBounds))\n }\n }", "function onMapBoundsChanged() {\n console.log(\"Change search box bounds\");\n var bounds = map.getBounds();\n searchBox.setBounds(bounds);\n }", "function makeRangeBox(lon0, lat0, lon1, lat1) {\n\t var dlon4 = (lon1 - lon0) / 4;\n\t\n\t // TODO is this enough to handle ALL cases?\n\t // -- this makes scaling less precise than using d3.geo.graticule\n\t // as great circles can overshoot the boundary\n\t // (that's not a big deal I think)\n\t return {\n\t type: 'Polygon',\n\t coordinates: [\n\t [ [lon0, lat0],\n\t [lon0, lat1],\n\t [lon0 + dlon4, lat1],\n\t [lon0 + 2 * dlon4, lat1],\n\t [lon0 + 3 * dlon4, lat1],\n\t [lon1, lat1],\n\t [lon1, lat0],\n\t [lon1 - dlon4, lat0],\n\t [lon1 - 2 * dlon4, lat0],\n\t [lon1 - 3 * dlon4, lat0],\n\t [lon0, lat0] ]\n\t ]\n\t };\n\t}", "defineMapBounds() {\n \n const coordinates = this.state.options.map(i => i.coordinates);\n\n let maxX = 0,\n minX = 0,\n maxY = 0,\n minY = 0;\n\n coordinates.forEach(coord => {\n if (coord[0] > maxY) {\n maxY = coord[0];\n }\n \n if (coord[0] < minY) {\n minY = coord[0];\n }\n\n if (coord[1] > maxX) {\n maxX = coord[1];\n }\n \n if (coord[1] < minX) {\n minX = coord[1];\n }\n })\n\n // Bounds are defined by two coordinates:\n // position1: the most W and N\n // position2: the most E and S\n this.setState({\n bounds: [[maxY, minX], [minY, maxX]],\n center: [(maxY - minY) / 2, (maxX - minX) / 2]\n })\n }", "function makeRangeBox(lon0, lat0, lon1, lat1) {\n\t var dlon4 = (lon1 - lon0) / 4;\n\t\n\t // TODO is this enough to handle ALL cases?\n\t // -- this makes scaling less precise than using d3.geo.graticule\n\t // as great circles can overshoot the boundary\n\t // (that's not a big deal I think)\n\t return {\n\t type: 'Polygon',\n\t coordinates: [\n\t [ [lon0, lat0],\n\t [lon0, lat1],\n\t [lon0 + dlon4, lat1],\n\t [lon0 + 2 * dlon4, lat1],\n\t [lon0 + 3 * dlon4, lat1],\n\t [lon1, lat1],\n\t [lon1, lat0],\n\t [lon1 - dlon4, lat0],\n\t [lon1 - 2 * dlon4, lat0],\n\t [lon1 - 3 * dlon4, lat0],\n\t [lon0, lat0] ]\n\t ]\n\t };\n\t}", "bbox() {\n let width = this.box.attr(\"width\");\n let height = this.box.attr(\"height\");\n let x = this.box.attr(\"x\");\n let y = this.box.attr(\"y\");\n let cy = y + height / 2;\n let cx = x + width / 2;\n\n return {\n width: width,\n height: height,\n x: x,\n y: y,\n cx: cx,\n cy: cy\n };\n }", "function ready(error, s,e,n,v) {\n\td3.select(\".bkgd\").on(\"click\",function() {repos(n,e,s);});\n\td3.select(\"#geo\").on(\"change\",function() {\n\t\tgeoCheck=!geoCheck;\n\t\treinit(geoCheck,n,e,s)\n\t})\n\t\n\tv=v.values.map(function(d) {return d.value;})\n\tv=d3.nest().key(function(d) {return d.edge}).rollup(function(d) {var record=d[0];record.edges=[];return record}).map(v);\n\n\ts.forEach(function(d) {\n\t\t//pos2.push(projection([+s.lon,+s.lat]));\n\t\tvar geo=projection([+d.lon,+d.lat]);\n\t\td.projx=d3.scale.linear().domain([0,7500]).range([0,800])(d.ratpx);\n\t\td.projy=d3.scale.linear().domain([0,7500]).range([0,800])(d.ratpy);\n\t\td.ratpx=d.projx;d.ratpy=d.projy;\n\t\td.geox=geo[0],d.geoy=geo[1];\n\t\t\n\t\td.ox=d.projx,d.oy=d.projy;\n\t})\n\t\n\tvar totalT=d3.sum(s,function(d) {return d.trafic;})\n\n\tedgesStart=d3.nest().key(function(d) {return d.start;}).map(e);\n\t\n\te.forEach(function(e,i) {\n\t\te.id=i;\n\t\te.start=+e.start;\n\t\te.end=+e.end;\n\t\tif (e.edgeVote) {\n\t\t\te.length=+(v[e.edgeVote].value)*3; // value is between 0 and 100 and corresponds to times between 0 and 5 minutes. \n\t\t\tif (e.type!==\"exit\") {e.length=e.length+120;} // when entering a station or switching lines you have to wait for a train, so 2 minutes are added on average.\n\t\t\tv[e.edgeVote].edges.push(e.id);\n\t\t} else {\n\t\t\te.length=+e.length;\n\t\t}\n\t\te.s1=n[e.start].station;\n\t\te.s2=n[e.end].station;\n\t\tvar t1=+s[e.s1].trafic/edgesStart[s[e.s1].main].length;\n\t\tvar t2=+s[e.s2].trafic/edgesStart[s[e.s2].main].length;\n\t\t//console.log(s[e.s1].main,edgesStart[s[e.s1].main].length)\n\t\te.share=(t1+t2)/totalT;\n\t})\n\n\treticulate(e,s);\n\n\tstations=s;\t\n\tnodes=n;\t\n\tedges=e;\n\tvotes=v;\n\n\tedgesStart=d3.nest().key(function(d) {return d.start;}).map(e);\n\tedgesEnd=d3.nest().key(function(d) {return d.end;}).map(e);\n\n\tedgesC=e.filter(function(d) {if([\"entrance\",\"exit\",\"correspondance\"].indexOf(d.type)===-1) {\n\t\td.color=ratpColors[lineColors[d.type]];return true}})\n\t\n\tdist=calcDist(n,edgesStart,s);\n\n\tvar g3 = staCircleLayer.selectAll(\"circle\").data(stations).enter()\n\t\n\tg3\n\t\t.append(\"circle\").attr(\"class\",\"staCircles\")\n\t\t.style({fill:function(d,i) {return timeScale(dist[i].avg);},stroke:\"black\"})\n\t\t.attr(\"cx\", function(d, i) { return d.projx; })\n\t\t.attr(\"cy\", function(d, i) { return d.projy; })\n\t\t.attr(\"r\",function(d,i) {return d.corr*2+3;/*traScale(stations[i].trafic)*/} )\n\t\t.append(\"title\").text(function(d) {return d.name;});\n\tg3.append(\"text\").attr(\"class\",\"staLabels\")\n\t\t.style({visibility:\"hidden\"})\n\t\t.attr({x:function(d) {return d.projx+5;},y:function(d) {return d.projy-5;},id:function(d,i) {return \"l\"+i;}})\n\t\t.text(function(d) {return d.name;})\n\n\td3.selectAll(\".staCircles\")\n\t\t.on(\"click\",function(d) {repos(n,e,s,v,d,dist);})\n\t\t\n\tcellSta.selectAll(\"path\").data(edgesC).enter().append(\"path\").classed(\"lignes\",1)\n\t\t.attr(\"d\",function(d) {return d.path;})\n\t\t.style({\"stroke-width\":function(d) {return edgeScale(d.share);}, \"stroke\":function(d) {return d.color;}})\n\n\tvar legend0=legend.append(\"g\").attr({id:\"legend0\",transform:\"translate(670,0)\"});\n\tvar onecolor=colors[d3.keys(colors)[Math.floor(Math.random()*d3.keys(colors).length)]]\n\tlegend0.selectAll(\"circle\").data([[130,\"white\"],[150,\"yellow\"],[170,\"red\"]]).enter()\n\t\t.append(\"circle\")\n\t\t.attr({cx:function(d) {return d[0]},cy:20,r:5})\n\t\t.style({\"fill\":function(d) {return d[1];},\"stroke\":\"black\"})\n\tlegend0.selectAll(\"path\").data([[125,5],[145,3],[165,1]]).enter()\n\t\t.append(\"path\")\n\t\t.attr({d:function(d) {return \"M\"+d[0]+\",40h10\"}})\n\t\t.style({\"stroke-width\":function(d) {return d[1]},\"stroke\":colors[d3.keys(colors)[Math.floor(Math.random()*d3.keys(colors).length)]]})\n\t\t\n\tlegend0.append(\"text\").attr({y:25}).text(\"station\").style(\"font-weight\",\"bold\");\n\tlegend0.append(\"text\").attr({y:25,x:60}).text(\"centrale\")\n\tlegend0.append(\"text\").attr({y:25,x:190}).text(\"éloignée\")\n\tlegend0.append(\"text\").attr({y:45}).text(\"ligne\").style(\"font-weight\",\"bold\");\n\tlegend0.append(\"text\").attr({y:45,x:60}).text(\"chargée\")\n\tlegend0.append(\"text\").attr({y:45,x:190}).text(\"peu fréquentée\")\n\t\n\n\tvar legend1=legend.append(\"g\").attr({id:\"legend1\",transform:\"translate(740,0)\"}).style(\"opacity\",0);\n\tlegend1.append(\"text\").attr({y:25}).text(\"Un anneau = 5 minutes de trajet\")\n\n\n\n\tif(location.hash) {\n\t\trepos(n,e,s,v,s[location.hash.slice(1)],dist)\n\t}\n}", "function bound() {\n ['top', 'bottom', 'tlc', 'left', 'blc', 'trc', 'right', 'brc'].forEach((piece) => {\n equilibriate(piece, 0, params.u0, 1);\n });\n}", "function precal_loc() {\n buffer_loc.forEach((obj)=>{obj.x = (obj.longitude + 180) * 10; obj.y = (90 - obj.latitude) * 10;});\n}", "function gmBoundsChanged() {\r\n\t\t\tvar bounds = _gMap.getBounds();\r\n\t\t\tif (bounds) {\r\n\t\t\t\t_gmSearchBox.setBounds(bounds);\r\n\t\t\t}\r\n\r\n\t\t\t// Boundary has been set, so don't set the zoom/center\r\n\t\t\t_areBoundsSet = true;\r\n\t\t} // gmBoundsChanged", "function set_bounds() {\n\n\t// Get the new zoom level\n\tvar zoom \t= esomap.getZoom();\n\tvar center \t= esomap.getCenter();\n\t\n\t// Define the allowed boundaries [SW,NE]\n\tvar zoomBounds = [\n\t\t[-35,-20,35,20],\n\t\t[-70,-100,70,100],\n\t\t[-75,-120,75,120],\n\t\t[-80,-130,80,130],\n\t\t[-85,-135,85,135],\n\t\t[-87,-140,87,140],\n\t];\n\tvar swlat = zoomBounds[zoom-2][0];\n\tvar swlng = zoomBounds[zoom-2][1];\n\tvar nelat = zoomBounds[zoom-2][2];\n\tvar nelng = zoomBounds[zoom-2][3];\n\t\n\t// Set the new bounds\n\tallowedBounds = new google.maps.LatLngBounds(\n\t\tnew google.maps.LatLng( swlat , swlng ), //SouthWest Corner\n\t\tnew google.maps.LatLng( nelat , nelng ) //NorthEast Corner\n\t);\n\t\n\t// Helper function for checking the sign of a variable\n\tfunction sign( x ) { return x > 0 ? 1 : x < 0 ? -1 : 0; }\n\t\t\n\t// If changing the zoom has put us out of bounds, move\n\tif ( !allowedBounds.contains( center ) ) {\n\t\t\n\t\t// Figure out which dimension is out of bounds\n\t\tif ( Math.abs( center.lat() ) > Math.abs( swlat ) ) {\n\t\t\tgoodLat = sign( center.lat() ) * ( Math.abs( swlat ) - 0.01 );\n\t\t} else {\n\t\t\tgoodLat = center.lat();\n\t\t}\n\t\tif ( Math.abs( center.lng() ) > Math.abs( swlng ) ) {\n\t\t\tgoodLng = sign( center.lng() ) * ( Math.abs( swlng ) - 0.01 );\n\t\t} else {\n\t\t\tgoodLng = center.lng();\n\t\t}\n\t\t\n\t\t// Set some new good bounds\n\t\tvar goodBounds = new google.maps.LatLng( goodLat , goodLng );\n\t\tesomap.panTo( goodBounds );\n\t}\n\t\n\treturn allowedBounds;\n}", "_tileBoundsFromWGS84(boundsWGS84) {\n var sw = this._layer._world.latLonToPoint(LatLon(boundsWGS84[1], boundsWGS84[0]));\n var ne = this._layer._world.latLonToPoint(LatLon(boundsWGS84[3], boundsWGS84[2]));\n\n return [sw.x, sw.y, ne.x, ne.y];\n }", "geWorldBoundingBox (fragIds, fragList) {\n\n var fragbBox = new THREE.Box3()\n var nodebBox = new THREE.Box3()\n\n fragIds.forEach((fragId) => {\n\n fragList.getWorldBounds(fragId, fragbBox)\n nodebBox.union(fragbBox)\n })\n\n return nodebBox\n }", "function setBoundries() {\n var deferred = $q.defer();\n _.each(stateConfig.tools.map.supportingLayers, function (b) {\n if (b.admin_level || b.admin_level === 0) {\n switch (b.admin_level) {\n case 0:\n service.boundaries.admin0[b.function] = b;\n break;\n case 1:\n service.boundaries.admin1[b.function] = b;\n break;\n case 2:\n service.boundaries.admin2[b.function] = b;\n break;\n case 3:\n service.boundaries.admin3[b.function] = b;\n break;\n }\n service.boundaries.aliases[b.function].push(b.alias);\n }\n });\n deferred.resolve();\n return deferred.promise;\n }", "function boundingBox( jqNode, jqGraph, box ) {\n var v = jqNode.offset();\n var graphOffset = jqGraph.offset();\n var top = v.top - graphOffset.top;\n var left = v.left - graphOffset.left;\n box = box || {};\n box.top = top;\n box.left = left;\n box.right = left + jqNode.width();\n box.bottom = top + jqNode.height();\n return box;\n }", "function rebuildMapBounds() {\n bounds = new google.maps.LatLngBounds();\n for (var person in people) {\n bounds.extend(people[person].marker.getPosition());\n }\n }", "function boundsChanged(){\r\n config.currentZoomLevel = config.mapObj.getZoom();\r\n\r\n //hide any visible marker overlays\r\n $('#marker-overlay').remove();\r\n \r\n var styleType = config.zoomLevelStyles[config.currentZoomLevel];\r\n \r\n $.logEvent('[$.boundsChanged]: style required for zoom level (' + config.currentZoomLevel + ') = ' + NI.map.themeDefinitions[config.currentZoomLevel]);\r\n\r\n //update the style\r\n config.styledMapType = new google.maps.StyledMapType(NI.map.themeDefinitions[styleType],{map:config.mapObj,name:styleType});\r\n config.mapObj.mapTypes.set(styleType,config.styledMapType);\r\n config.mapObj.setMapTypeId(styleType);\r\n\r\n updateInformation({\r\n styleType:styleType,\r\n zoomLevel:config.currentZoomLevel\r\n });\r\n \r\n var boundsObj = config.mapObj.getBounds();\r\n config.boundsCoOrdinatesObj = {\r\n neLatitude:boundsObj.getNorthEast().lat(),\r\n neLongitude:boundsObj.getNorthEast().lng(),\r\n nwLatitude:boundsObj.getSouthWest().lat(),\r\n nwLongitude:boundsObj.getNorthEast().lng(),\r\n swLongitude:boundsObj.getSouthWest().lng(),\r\n swLatitude:boundsObj.getSouthWest().lat()\r\n }\r\n nwPixelCoordinate = latLngToPixel({\r\n map:config.mapObj,\r\n latLng:new google.maps.LatLng(config.boundsCoOrdinatesObj.nwLatitude,config.boundsCoOrdinatesObj.nwLongitude),\r\n zoomLevel:config.currentZoomLevel\r\n });\r\n var nePixelCoordinate = latLngToPixel({\r\n map:config.mapObj,\r\n latLng:new google.maps.LatLng(config.boundsCoOrdinatesObj.neLatitude,config.boundsCoOrdinatesObj.neLongitude),\r\n zoomLevel:config.currentZoomLevel\r\n });\r\n var neTileCoordinate = new google.maps.Point(\r\n Math.floor(nePixelCoordinate.x/config.tileSize),\r\n Math.floor(nePixelCoordinate.y/config.tileSize)\r\n );\r\n var swPixelCoordinate = latLngToPixel({\r\n map:config.mapObj,\r\n latLng:new google.maps.LatLng(config.boundsCoOrdinatesObj.swLatitude,config.boundsCoOrdinatesObj.swLongitude),\r\n zoomLevel:config.currentZoomLevel\r\n });\r\n var swTileCoordinate = new google.maps.Point(\r\n Math.floor(swPixelCoordinate.x/config.tileSize),\r\n Math.floor(swPixelCoordinate.y/config.tileSize)\r\n ); \r\n var tilesBetween = getTilesBetween({\r\n bottomLeftTile:swTileCoordinate,\r\n topRightTile:neTileCoordinate\r\n });\r\n \r\n $.logEvent('[$.boundsChanged]: neTileCoordinate=' + neTileCoordinate + ', swTileCoordinate=' + swTileCoordinate);\r\n $.logEvent('[$.boundsChanged]: total tiles between (' + tilesBetween.length + '), tiles between=' + tilesBetween); \r\n $.logEvent('[$.boundsChanged]: current zoom level: ' + config.currentZoomLevel + ', topRight: (' + neTileCoordinate.x + ',' + neTileCoordinate.y + '), bottomLeft: (' + swTileCoordinate.x + ',' + swTileCoordinate.y + ')');\r\n\r\n //loop through the visible tiles to get the location data\r\n tileCoordinateToTileId(tilesBetween);\r\n }", "function serializeBounds (bounds) {\n var\n sw = bounds.getSouthWest(),\n ne = bounds.getNorthEast();\n return [sw.lat(), sw.lng(), ne.lat(), ne.lng()].join(',');\n }", "getModifiedWorldBoundingBox(fragIds, fragList) {\n\n const fragbBox = new THREE.Box3()\n const nodebBox = new THREE.Box3()\n\n fragIds.forEach(function(fragId) {\n\n fragList.getWorldBounds(fragId, fragbBox)\n\n nodebBox.union(fragbBox)\n })\n\n return nodebBox\n }", "static setZoomBounds(allBounds) {\n let bounds = allBounds;\n const boundParams = {\n top: bounds.getTop(),\n left: bounds.getLeft(),\n bottom: bounds.getBottom(),\n right: bounds.getRight()\n };\n if ((Math.abs(Math.abs(boundParams.top) - Math.abs(boundParams.bottom) <= 0.0001))) {\n smallFactor = 0.01;\n }\n boundParams.top += ((Math.abs(Math.abs(boundParams.top) - Math.abs(boundParams.bottom))\n + smallFactor) * offsetFactor);\n boundParams.left -= ((Math.abs(Math.abs(boundParams.left) - Math.abs(boundParams.right))\n + smallFactor) * offsetFactor);\n // not needed since bottom pin fits\n // boundParams.bottom -= (Math.abs(Math.abs(boundParams.top) - Math.abs(boundParams.bottom))\n // * offsetFactor);\n boundParams.right += ((Math.abs(Math.abs(boundParams.left) - Math.abs(boundParams.right))\n + smallFactor) * offsetFactor);\n this.boundingBoxDistance = Math.sqrt((((boundParams.top - boundParams.bottom) ** 2))\n + (((boundParams.left - boundParams.right) ** 2)));\n bounds = new H.geo.Rect(boundParams.top, boundParams.left, boundParams.bottom,\n boundParams.right);\n\n return bounds;\n }", "function callback(response) \n {\n \n // get boundaries\n console.log( response.results[0] );\n console.log( \"got \" + response.results[0].attributes.CTYUA13NM);\n //console.log( response.results[0].attributes.CTYUA13NM );\n /// console.log( response.results[0].attributes.CTYUA13NM+\": \" + parseInt( response.results[0].attributes[\"Shape.STArea()\"],10)/1000000 );\n //capture area\n areaMeasures[response.results[0].attributes.CTYUA13NM] = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n areaObj[response.results[0].attributes.CTYUA13NM].area = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n\n if (response.results.length > 0) \n {\n // document.getElementById(\"foundward\").value = response.results[0].attributes.WD11NM;\n\n var ens = new Array();\n //alert(response.results[0].geometry.rings.length);\n for (var k = 0; k < response.results[0].geometry.rings.length; k++) {\n ens[k] = response.results[0].geometry.rings[k];\n }\n\n // approximate datum correction, good enough for this demo\n \n var latmeters = 50;\n var lonmeters = -100;\n\n var minlat = 360.0;\n var maxlat = -360.0;\n var minlon = 360.0;\n var maxlon = -360.0;\n\n // create array of points converted to lat/lon (from easting/northing) and capture mins and maxes\n for (var j = 0; j < ens.length; j++) {\n //alert('j = ' + j);\n latlons[j] = new Array();\n for (var i = 0; i < ens[j].length; i++) {\n var testpoint = ens[j][i];\n var grid = new OsGridRef(testpoint[0] + lonmeters, testpoint[1] + latmeters);\n var latlon = OsGridRef.osGridToLatLong(grid);\n if (latlon.lon < minlon) {\n minlon = latlon.lon;\n }\n if (latlon.lon > maxlon) {\n maxlon = latlon.lon;\n }\n if (latlon.lat < minlat) {\n minlat = latlon.lat;\n }\n if (latlon.lat > maxlat) {\n maxlat = latlon.lat;\n }\n latlons[j][i] = latlon;\n }\n }\n\n // calculate zoom level\n var zoomLevel = getZoom(minlon, maxlon, minlat, maxlat, 512, 512);\n\n // calculate centroid\n var centroid = getCentroid(minlon, maxlon, minlat, maxlat);\n //initialize(centroid.lat, centroid.lon, zoomLevel, latlons);\n drawArea(latlons, response.results[0].value);\n } else {\n alert(\"No matching ward found\");\n }\n }", "function boundingBoxCoordinates(center, radius) {\r\n var latDegrees = radius / METERS_PER_DEGREE_LATITUDE;\r\n var latitudeNorth = Math.min(90, center.latitude + latDegrees);\r\n var latitudeSouth = Math.max(-90, center.latitude - latDegrees);\r\n var longDegsNorth = metersToLongitudeDegrees(radius, latitudeNorth);\r\n var longDegsSouth = metersToLongitudeDegrees(radius, latitudeSouth);\r\n var longDegs = Math.max(longDegsNorth, longDegsSouth);\r\n return [\r\n toGeoPoint(center.latitude, center.longitude),\r\n toGeoPoint(center.latitude, wrapLongitude(center.longitude - longDegs)),\r\n toGeoPoint(center.latitude, wrapLongitude(center.longitude + longDegs)),\r\n toGeoPoint(latitudeNorth, center.longitude),\r\n toGeoPoint(latitudeNorth, wrapLongitude(center.longitude - longDegs)),\r\n toGeoPoint(latitudeNorth, wrapLongitude(center.longitude + longDegs)),\r\n toGeoPoint(latitudeSouth, center.longitude),\r\n toGeoPoint(latitudeSouth, wrapLongitude(center.longitude - longDegs)),\r\n toGeoPoint(latitudeSouth, wrapLongitude(center.longitude + longDegs))\r\n ];\r\n}", "get boundsValue() {}", "function sendBoundsMessage() {\n var bounds = twitter_geomap.map.map.getBounds();\n var sw = {}\n var ne = {}\n sw.lat = bounds.getSouthWest().lat();\n sw.lon = bounds.getSouthWest().lng();\n ne.lat = bounds.getNorthEast().lat();\n ne.lon = bounds.getNorthEast().lng();\n var msg = {}\n msg.bounds = {\"southWest\": sw, \"northEast\": ne}\n // put in a placeholder value just to pass parsing and keep the message format the same\n msg.tile = {\"level\":10,\"xIndex\":321,\"yIndex\":541}\n console.log(\"bounds to send: \",msg)\n OWF.Eventing.publish(\"map.view.center.bounds\",JSON.stringify(msg))\n}", "get bounds() {}", "function LLBboxtoUSNG(LLtoUSNG) {\n return function (north, south, east, west) {\n var northNum = parseFloat(north),\n southNum = parseFloat(south),\n eastNum = parseFloat(east),\n westNum = parseFloat(west),\n // calculate midpoints for use in USNG string calculation\n lat = (northNum + southNum) / 2,\n lon = (eastNum + westNum) / 2,\n\n // round down edge cases\n lat = (lat >= 90) ? 89.9 : (lat <= -90) ? -89.9 : lat,\n lon = (lon >= 180) ? 179.9 : (lon <= -180) ? -179.9 : lon,\n\n // calculate distance between two points (North, West) and (South, East)\n R = 6371000, // metres\n phi1 = northNum * DEG_2_RAD,\n phi2 = southNum * DEG_2_RAD,\n deltaPhi = (southNum - northNum) * DEG_2_RAD,\n deltaLlamda = (westNum - eastNum) * DEG_2_RAD,\n // trigonometry calculate distance\n height = sin(deltaPhi / 2) * sin(deltaPhi / 2),\n height = R * 2 * atan2(sqrt(height), sqrt(1 - height)),\n length = cos(phi1) * cos(phi2) * sin(deltaLlamda / 2) * sin(deltaLlamda / 2),\n length = R * 2 * atan2(sqrt(length), sqrt(1 - length)),\n dist = max(height, length),\n\n // divide distance by square root of two\n lon = (zero(lon) && (eastNum > 90 || eastNum < -90) && (westNum > 90 || westNum < -90)) ? 180 : lon\n\n // calculate a USNG string with a precision based on distance\n // precision is defined in LLtoUSNG declaration\n // result is a USNG string of the form DDL LL DDDDD DDDDD\n // length of string will be based on the precision variable\n if (dist > 100000) {\n return LLtoUSNG(lat, lon, 0)\n } else if (dist > 10000) {\n return LLtoUSNG(lat, lon, 1)\n } else if (dist > 1000) {\n return LLtoUSNG(lat, lon, 2)\n } else if (dist > 100) {\n return LLtoUSNG(lat, lon, 3)\n } else if (dist > 10) {\n return LLtoUSNG(lat, lon, 4)\n } else if (dist > 1) {\n return LLtoUSNG(lat, lon, 5)\n } else if (dist >= 0) {\n return LLtoUSNG(lat, lon, 6)\n }\n }\n}", "function startMapBoxes(){\n initMap();\n updatesBoxesAndMapDueToFilter();\n}", "_setBounds() {\t\t\n\t\tGoogleMaps.load((google) => {\n\t\t\tlet bounds = new google.maps.LatLngBounds(); \n\t\t\n\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\tresolve(this.getActiveMarkers());\n\t\t\t}).then((markers) => {\n\t\t\t\tfor(let m in markers) {\n\t\t\t\t\tbounds.extend(markers[m].pin.getPosition());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.map.fitBounds(bounds);\t\n\t\t\t\tthis._setZoom();\t\t\t\t\t\t\t\n\t\t\t});\t\t\t\t\t\n\t\t});\n\t}", "function updateHandles() {\n\tneHandle.setLatLng(minibox.getBounds().getNorthEast());\n\tnwHandle.setLatLng(minibox.getBounds().getNorthWest());\n\tseHandle.setLatLng(minibox.getBounds().getSouthEast());\n\tswHandle.setLatLng(minibox.getBounds().getSouthWest());\n}", "async function getIso(coords) {\n\n var lon = coords[0];\n var lat = coords[1];\n\n\n const query = await fetch(\n `${urlBase}${profile}/${lon},${lat}?contours_minutes=${minutes}&polygons=true&access_token=${mapboxgl.accessToken}`,\n { method: 'GET' }\n );\n const data = await query.json();\n console.log(data);\n\n\n\n if(map.getLayer('iso')) {\n map.removeLayer('iso');\n map.removeLayer('iso')\n }\n\n\n map.addSource('iso', {\n type: 'geojson',\n data: {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n \n map.addLayer(\n {\n 'id': 'iso',\n 'type': 'fill',\n 'source': 'iso',\n 'layout': {},\n 'paint': {\n 'fill-color': '#5a3fc0',\n 'fill-opacity': 0.7\n }\n },\n 'poi-label'\n );\n\n map.getSource('iso').setData(data);\n\n console.log(turf.bbox(data))\n\n\n map.fitBounds(turf.bbox(data), {\n linear: true,\n padding: 100\n })\n\n\n\n}", "function computeBounds(latlng,rad) {\n\tvar radlatlng = { lat : latlng.lat * Math.PI / 180, lng : latlng.lng * Math.PI / 180 };\n\t\n\tvar rsw = getCoordAtRad(radlatlng,rad,Math.PI * 1.5);\n\t//console.log(sw);\n\trsw = getCoordAtRad(rsw,rad,Math.PI);\n\tvar rne = getCoordAtRad(radlatlng,rad,Math.PI * 0.5);\n\t//console.log(ne);\n\trne = getCoordAtRad(rne,rad,0);\n\t\n\t//all inputs must be radians (except radius which is converted in-function)\n\tfunction getCoordAtRad(coord,radius,angle) {\n\t\tvar nlat, nlng;\n\t\tvar radDist = radius * angle;//arc length\n\t\tnlat = Math.asin(Math.sin(coord.lat) * Math.cos(radDist) \n\t\t\t\t + Math.cos(coord.lat) * Math.sin(radDist) * Math.cos(angle));\n\t\tnlng = (Math.cos(nlat) == 0) ? coord.lng : \n\t\tmod(coord.lng + Math.PI - Math.asin(Math.sin(angle) \n\t\t* Math.sin(radDist) / Math.cos(nlat)), 2 * Math.PI) - Math.PI;\n\t\treturn { lat : nlat, lng : nlng };\n\t}\n\t\n\tfunction mod(x,y) {\n\t\treturn x - y * Math.floor(x / y);\n\t}\n\t\n\tvar sw = { lat : rsw.lat * 180 / Math.PI, lng : rsw.lng * 180 / Math.PI };\n\tvar ne = { lat : rne.lat * 180 / Math.PI, lng : rne.lng * 180 / Math.PI };\n\t\n\treturn { sw : sw, ne : ne };\n}", "GetBoundingBoxes()\n\t{\n\t\treturn Object.values(this.collection).map(function(component)\n\t\t{\n\t\t\treturn {\n\t\t\t\tcomponent: component,\n\t\t\t\tBB: component._getBoundingBox()\n\t\t\t};\n\t\t});\n\t}", "function boxesToJSON( boxes ) {\n var box_list = [];\n for ( var i=0; i<boxes.length; i++ ) {\n\tvar ne = boxes[i].getNorthEast();\n\tvar sw = boxes[i].getSouthWest();\n\n\tbox_list[i*4] = ne.lat();\n\tbox_list[i*4 + 1] = ne.lng();\n\tbox_list[i*4 + 2] = sw.lat();\n\tbox_list[i*4 + 3] = sw.lng();\n }\n\n return JSON.stringify( { \"rectangles\" : box_list } );\n}", "function DoGeo(sender) {\n\n var startlat = $('.advMap').attr('data-lat');\n // Read start long from page parameter.\n\n var startlong = $('.advMap').attr('data-lon');\n // Read start zoom from page parameter.\n\n var startzoom = $('.advMap').attr('data-zoom');\n if ((startlat) && (startlong) && (startzoom)) {\n initCenterLat = startlat;\n initCenterLon = startlong;\n initZoom = parseInt(startzoom);\n\n var newCentre = new google.maps.LatLng(initCenterLat, initCenterLon);\n map.setCenter(newCentre);\n map.setZoom(initZoom);\n }\n\n var boxlat1 = $('#sw-lat').val();\n var boxlong1 = $('#sw-lon').val();\n var boxlat2 = $('#ne-lat').val();\n var boxlong2 = $('#ne-lon').val();\n\n // Populate box coord textboxes with values if present for POI.\n if (newRect) {\n\n // Create rectangle's coordinate bounds.\n var autoRectBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(boxlat1, boxlong1),\n new google.maps.LatLng(boxlat2, boxlong2));\n // Create new rectangle.\n var autoRect = new google.maps.Rectangle({\n strokeWeight: 1,\n strokeColor: '#ae4040',\n fillColor: '#bf5050',\n strokeOpacity: 0.5,\n fillOpacity: 0.3,\n editable: true,\n draggable: true,\n bounds: autoRectBounds,\n map: map\n });\n // Store new auto rectanhle in newRect variable so it can be referenced/removed.\n newRect = autoRect;\n // Set up events for rectangle.\n ManageDrawnShape(newRect, \"rectangle\");\n // Set bounding box coord textbox values.\n DoAutoBounds(autoRect);\n // Check the checkbox.\n\n if (!$('#cbManualBounds').is(\":checked\")) {\n\n // reset screen\n //clearScreen();\n\n } else if (newRect != undefined) {\n $('#cbManualBounds').prop('checked', true);\n }\n }\n else {\n $('#cbManualBounds').prop('checked', false);\n DoManualBounds();\n };\n\n\n // Fade in the page dimmer and then the map modal.\n $('#panelOverlay').fadeIn(150, function () {\n $('#gMapModal').fadeIn(150, function () {\n // Display the map search text box and automatically insert the name of the selected POI.\n $('#pac-input').fadeIn(150, function () {\n //$('#pac-input').val(poi);\n // Set focus to the textbox so that the search box appears with any matching results.\n //$('#pac-input').focus();\n $('.pac-container').css({ 'position': 'fixed' });\n\n setTimeout(function () {\n $('#btnRefreshMap').click();\n }, 500);\n });\n });\n });\n}", "set bounds(value) {}", "function boundsToExtent (bounds) {\r\n bounds = Object(leaflet__WEBPACK_IMPORTED_MODULE_0__[\"latLngBounds\"])(bounds);\r\n return {\r\n 'xmin': bounds.getSouthWest().lng,\r\n 'ymin': bounds.getSouthWest().lat,\r\n 'xmax': bounds.getNorthEast().lng,\r\n 'ymax': bounds.getNorthEast().lat,\r\n 'spatialReference': {\r\n 'wkid': 4326\r\n }\r\n };\r\n}", "function DoAutoBounds(object) {\n // Get the lat/long bounds of the map's viewport\n var bounds = object.getBounds();\n // Get the northeast and southwest lat/long objects.\n var ne = bounds.getNorthEast();\n var sw = bounds.getSouthWest();\n tbSwLat.value = sw.lat();\n tbSwLon.value = sw.lng();\n tbNeLat.value = ne.lat();\n tbNeLon.value = ne.lng();\n\n var horizontalDistance = calculateDistances(sw.lat(), sw.lat(), sw.lng(), ne.lng()) / 1000 * 0.621371192;\n var verticalDistance = calculateDistances(sw.lat(), ne.lat(), sw.lng(), sw.lng()) / 1000 * 0.621371192;\n\n var $horizontalDistanceText = $('<span></span>');\n var $verticalDistanceText = $('<span></span>');\n\n // check all the distances are correct otherwise show appropriate label prompt\n if (horizontalDistance >= 25 && verticalDistance >= 25) {\n\n $horizontalDistanceText.text('Horizontal distance cannot be over 25 miles.');\n\n $('#horizAlertLabel').html($horizontalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#horizontalDis').css({ 'color': '#9d3030' });\n\n $verticalDistanceText.text('Vertical distance cannot be over 25 miles.');\n\n $('#vertAlertLabel').html($verticalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#verticalDis').css({ 'color': '#9d3030' });\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n } else if (horizontalDistance >= 25) {\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n $horizontalDistanceText.text('Horizontal distance cannot be over 25 miles.');\n\n $('#horizAlertLabel').html($horizontalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#horizontalDis').css({ 'color': '#9d3030' });\n if (verticalDistance <= 25) {\n $('#vertAlertLabel').empty();\n $('#verticalDis').css({ 'color': 'black' });\n } else {\n $verticalDistanceText.text('Vertical distance cannot be over 25 miles.');\n $('#vertAlertLabel').html($verticalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#verticalDis').css({ 'color': '#9d3030' });\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n }\n\n } else if (verticalDistance >= 25) {\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n $verticalDistanceText.text('Vertical distance cannot be over 25 miles.');\n $('#vertAlertLabel').html($verticalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#verticalDis').css({ 'color': '#9d3030' });\n if (horizontalDistance <= 25) {\n $('#horizAlertLabel').empty();\n $('#horizontalDis').css({ 'color': 'black' });\n } else {\n $horizontalDistanceText.text('Horizontal distance cannot be over 25 miles.');\n $('#horizAlertLabel').html($horizontalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#horizontalDis').css({ 'color': '#9d3030' });\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n }\n\n } else if (horizontalDistance <= 25) {\n\n $('#horizAlertLabel').empty();\n $('#horizontalDis').css({ 'color': 'black' });\n\n if (verticalDistance >= 25) {\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n $verticalDistanceText.text('Vertical distance cannot be over 25 miles.');\n $('#vertAlertLabel').html($verticalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#verticalDis').css({ 'color': '#9d3030' });\n } else {\n $('#vertAlertLabel').empty();\n $('#verticalDis').css({ 'color': 'black' });\n if (verticalDistance + horizontalDistance > 0) {\n //$('#btnGeoSave').show();\n $('#btnGeoSave').prop(\"disabled\", false);\n //SaveGeo();\n }\n }\n\n } else if (verticalDistance <= 25) {\n\n $('#vertAlertLabel').empty();\n $('#verticalDis').css({ 'color': 'black' });\n\n if (horizontalDistance >= 25) {\n $horizontalDistanceText.text('Horizontal distance cannot be over 25 miles.');\n $('#horizAlertLabel').html($horizontalDistanceText).css({ 'color': '#9d3030', 'font-size': '16px' });\n $('#horizontalDis').css({ 'color': '#9d3030' });\n //$('#btnGeoSave').hide();\n $('#btnGeoSave').prop(\"disabled\", true);\n } else {\n $('#horizAlertLabel').empty();\n $('#horizontalDis').css({ 'color': 'black' });\n if ($('#dateRangeLabel').html() == '') {\n }\n //SaveGeo();\n }\n\n\n } else if (horizontalDistance <= 25 && verticalDistance <= 25) {\n\n $('#horizAlertLabel').empty();\n $('#horizontalDis').css({ 'color': 'black' });\n\n $('#vertAlertLabel').empty();\n $('#verticalDis').css({ 'color': 'black' });\n\n if ($('#dateRangeLabel').html() == '') {\n }\n //$('#btnGeoSave').show();\n $('#btnGeoSave').prop(\"disabled\", false);\n }\n\n $('#horizontalDis').text(horizontalDistance.toFixed(2));\n $('#verticalDis').text(verticalDistance.toFixed(2));\n\n if (object.fillColor)\n $('#sw-lat, #sw-lon, #ne-lat, #ne-lon').css({ 'color': '#9d3030' });\n else\n $('#sw-lat, #sw-lon, #ne-lat, #ne-lon').css({ 'color': '#555' });\n}", "getSeriesValueBoundingBox(world) {\r\n let iv = this.i.lv(toPoint(world));\r\n return fromRect(iv);\r\n }", "function lonLatBounds(bottomLeft, topRight) {\n \n return {bottomLeft: bottomLeft, \n topRight: topRight, \n espg900913: new OpenLayers.Bounds(bottomLeft.lon, bottomLeft.lat, topRight.lon, topRight.lat)\n .transform(ESPG_4326_PROJECTION, ESPG_900913_PROJECTION),\n\n lonLatString: \"bottomLeft: (\" + bottomLeft.lon + \", \" + bottomLeft.lat + \") \" \n + \"topRight: (\" + topRight.lon + \", \" + topRight.lat + \")\"\n + \" [\" + ESPG_4326_PROJECTION + \"]\"\n };\n}", "get boundingBox() { return GeoJsonUtils.getBoundingBox(this.item); }", "function setupGraphics($scope){\r\n var bbox = $scope.bbox;\r\n $scope.south = bbox[$scope.sub][0][0];\r\n $scope.west = bbox[$scope.sub][0][1];\r\n $scope.north = bbox[$scope.sub][1][0];\r\n $scope.east = bbox[$scope.sub][1][1];\r\n}", "updateBoundingBox() {\n this.sceneObject.updateMatrixWorld();\n let box = this.sceneObject.geometry.boundingBox.clone();\n box.applyMatrix4(this.sceneObject.matrixWorld);\n this.boundingBox = box;\n }", "function updateBoundaries(xCoor, yCoor){\n denseBoundaries.tR.x = x.invert(xCoor + 25)\n denseBoundaries.tR.y = y.invert(yCoor - 25)\n\n denseBoundaries.bR.x = x.invert(xCoor + 25)\n denseBoundaries.bR.y = y.invert(yCoor + 25)\n\n denseBoundaries.bL.x = x.invert(xCoor - 25)\n denseBoundaries.bL.y = y.invert(yCoor + 25)\n\n denseBoundaries.tL.x = x.invert(xCoor - 25)\n denseBoundaries.tL.y = y.invert(yCoor - 25)\n }", "updatePointsOnGlobe() {\n const globeseries = [['peers', []]];\n let geoiplookup = '';\n\n if (process.env.NODE_ENV === 'development') {\n geoiplookup = maxmind.openSync(\n path.join(__dirname, 'GeoLite2-City', 'GeoLite2-City.mmdb')\n );\n } else {\n geoiplookup = maxmind.openSync(\n path.join(\n configuration.GetAppResourceDir(),\n 'GeoLite2-City',\n 'GeoLite2-City.mmdb'\n )\n );\n }\n\n RPC.PROMISE('getpeerinfo', []).then(payload => {\n var tmp = {};\n var ip = {};\n let maxnodestoadd = payload.length;\n if (maxnodestoadd > 20) {\n maxnodestoadd = 20;\n }\n for (var i = 0; i < maxnodestoadd; i++) {\n ip = payload[i].addr;\n ip = ip.split(':')[0];\n var tmp = geoiplookup.get(ip);\n globeseries[0][1].push(tmp.location.latitude);\n globeseries[0][1].push(tmp.location.longitude);\n globeseries[0][1].push(0.1); //temporary magnitude.\n }\n\n globeseries[0][1].push(myIP[0]);\n globeseries[0][1].push(myIP[1]);\n globeseries[0][1].push(0.1); //temporary magnitude.\n // console.log(myIP);\n if (myIP[1]) {\n glb.removePoints();\n glb.addData(globeseries[0][1], {\n format: 'magnitude',\n name: globeseries[0][0],\n });\n glb.createPoints();\n }\n });\n }", "function getMapBounds(region) {\n b = {};\n b.no = {}; b.ne = {};\n b.so = {}; b.se = {};\n \n b.no.lat = parseFloat(region.latitude) + \n parseFloat(region.latitudeDelta) / 2.0;\n b.no.lng = parseFloat(region.longitude) - \n parseFloat(region.longitudeDelta) / 2.0;\n \n b.so.lat = parseFloat(region.latitude) - \n parseFloat(region.latitudeDelta) / 2.0;\n b.so.lng = parseFloat(region.longitude) - \n parseFloat(region.longitudeDelta) / 2.0;\n \n b.ne.lat = parseFloat(region.latitude) + \n parseFloat(region.latitudeDelta) / 2.0;\n b.ne.lng = parseFloat(region.longitude) + \n parseFloat(region.longitudeDelta) / 2.0;\n \n b.se.lat = parseFloat(region.latitude) - \n parseFloat(region.latitudeDelta) / 2.0;\n b.se.lng = parseFloat(region.longitude) + \n parseFloat(region.longitudeDelta) / 2.0;\n \n return b;\n}", "function convertButtonHandler() {\n const latlon = convertOsToLatLong1(osGridRef.value);\n latLong.innerText=`${latlon._lat.toFixed(6)}, ${latlon._lon.toFixed(6)}`;\n}", "function getModifiedWorldBoundingBox(fragIds, fragList) {\n\n\tvar fragbBox = new THREE.Box3();\n\tvar nodebBox = new THREE.Box3();\n\n\tfragIds.forEach(function(fragId) {\n\n\t\tfragList.getWorldBounds(fragId, fragbBox);\n\t\tnodebBox.union(fragbBox);\n\t});\n\n\treturn nodebBox;\n}", "get boundingBox() {\n }", "function boundsToExtent (bounds) {\n bounds = leaflet.latLngBounds(bounds);\n return {\n 'xmin': bounds.getSouthWest().lng,\n 'ymin': bounds.getSouthWest().lat,\n 'xmax': bounds.getNorthEast().lng,\n 'ymax': bounds.getNorthEast().lat,\n 'spatialReference': {\n 'wkid': 4326\n }\n };\n}", "getSeriesValueBoundingBox(world) {\n let iv = this.i.lv(toPoint(world));\n return fromRect(iv);\n }", "function getViewFromBoundingBox(bbox, reflectLatitude) {\n\tif (_.isArray(bbox)) {\n\t\tbbox = {\n\t\t\tminLat: bbox[1],\n\t\t\tminLon: bbox[0],\n\t\t\tmaxLat: bbox[3],\n\t\t\tmaxLon: bbox[2]\n\t\t}\n\t}\n\n\tconst center = {\n\t\tlat: (bbox.maxLat + bbox.minLat)/2,\n\t\tlon: (bbox.maxLon + bbox.minLon)/2\n\t};\n\n\tconst boxRange = getBoxRangeFromBoundingBox(bbox, reflectLatitude ? center.lat : null);\n\n\treturn {\n\t\tcenter,\n\t\tboxRange\n\t}\n}", "function getExtendedBounds(bnds){\n // get the coordinates for the sake of readability\n var swlat = bnds._southWest.lat;\n var swlng = bnds._southWest.lng;\n var nelat = bnds._northEast.lat;\n var nelng = bnds._northEast.lng;\n\n // Increase size of bounding box in each direction by 50%\n swlat = swlat - Math.abs(0.5*(swlat - nelat)) > -90 ? swlat - Math.abs(0.5*(swlat - nelat)) : -90;\n swlng = swlng - Math.abs(0.5*(swlng - nelng)) > -180 ? swlng - Math.abs(0.5*(swlng - nelng)) : -180;\n nelat = nelat + Math.abs(0.5*(swlat - nelat)) < 90 ? nelat + Math.abs(0.5*(swlat - nelat)) : 90;\n nelng = nelng + Math.abs(0.5*(swlng - nelng)) < 180 ? nelng + Math.abs(0.5*(swlng - nelng)) : 180;\n\n return L.latLngBounds(L.latLng(swlat, swlng), L.latLng(nelat, nelng));\n }", "set boundsValue(value) {}", "getBounds() {}", "function drawBoxes(boxes) {\n progressMessage.setProgressMessage(\"draw bounding boxes\");\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "function drawBoxes(boxes) {\n boxpolys = new google.maps.Rectangle({\n bounds: boxes,\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }", "function BoundingBoxRect() { }", "async function process_bbox(bbox_array) {\n for (let new_latlng of bbox_array) {\n await find_bbox(new_latlng, lang).then(nuovi => {\n total_points = total_points.concat(nuovi)\n })\n }\n return total_points;\n }", "function eventWindowLoaded() {\n // Create a World Window for the canvas.\n wwd = new WorldWind.WorldWindow(\"canvasOne\");\n\n // Add some image layers to the World Window's globe.\n var layers = [\n {layer: new WorldWind.BMNGLayer(), enabled: false},\n {layer: new WorldWind.BMNGLandsatLayer(), enabled: false},\n {layer: new WorldWind.BingAerialLayer(null), enabled: false},\n {layer: new WorldWind.BingAerialWithLabelsLayer(null), enabled: true},\n {layer: new WorldWind.BingRoadsLayer(null), enabled: false},\n {layer: new WorldWind.OpenStreetMapImageLayer(), enabled: false},\n {layer: new WorldWind.CompassLayer(), enabled: true},\n {layer: new WorldWind.CoordinatesDisplayLayer(wwd), enabled: true},\n {layer: new WorldWind.ViewControlsLayer(wwd), enabled: true}\n ];\n\n // Create those layers.\n for (var l = 0; l < layers.length; l++) {\n layers[l].layer.enabled = layers[l].enabled;\n wwd.addLayer(layers[l].layer);\n }\n\n // Create the Layer Manager to enable user to select certain layers.\n var layerManager= new LayerManager(wwd);\n\n\n var earthQuakes = new EarthQuakeRetrieval();\n var placeMark = new createPlaceMarks(wwd, earthQuakes);\n var barGraph = new barGraphRepresentation(wwd, earthQuakes);\n\n\n\n\n var params = {\n status: placeMark.getInformationToDisplay(earthQuakes[0])\n };\n cb.__call(\n \"statuses_update\",\n params,\n function (reply) {\n //Currently we don't need to do anything with the reply received from twitter in JSON format.\n }\n );\n\n //Function to perform on slider stop\n magnitudeSlider.on('slideStop', function(value){\n //value is the new value for this slider\n slideFunction();\n });\n ageSlider.on('slideStop', function(value){\n //value is the new value for this slider\n slideFunction();\n });\n }", "update() {\n var self = this;\n\n var updateOne = function (obj) {\n var left = undefined;\n var bottom = undefined;\n var right = undefined;\n var top = undefined;\n\n\n if (obj.length !== undefined) {\n if (typeof(obj) == \"string\") {\n obj = obj.split(\",\");\n }\n self.left = parseFloat(obj[0]);\n self.bottom = parseFloat(obj[1]);\n self.right = parseFloat(obj[2]);\n self.top = parseFloat(obj[3]);\n } else {\n if (obj.getBounds !== undefined) {\n obj = obj.getBounds();\n }\n\n if (obj.left !== undefined) {\n left = obj.left;\n }\n if (obj.bottom !== undefined) {\n bottom = obj.bottom;\n }\n if (obj.right !== undefined) {\n right = obj.right;\n }\n if (obj.top !== undefined) {\n top = obj.top;\n }\n }\n\n if (left) {\n left = parseFloat(left);\n }\n if (bottom) {\n bottom = parseFloat(bottom);\n }\n if (right) {\n right = parseFloat(right);\n }\n if (top) {\n top = parseFloat(top);\n }\n\n if (left !== undefined) {\n self.left = left;\n }\n if (bottom !== undefined) {\n self.bottom = bottom;\n }\n if (right !== undefined) {\n self.right = right;\n }\n if (top !== undefined) {\n self.top = top;\n }\n };\n\n for (var i = 0; i < arguments.length; i++) {\n updateOne(arguments[i]);\n }\n }", "async function run () {\n const places = new Map([\n [\"193.60.250.24\",\"51.50920,-0.09550\"],\n // [\"160.75.25.31\",\"41.02140,28.96840\"],\n // [\"130.60.184.132\",\"47.36670,8.55000\"],\n [\"130.235.52.5\",\"55.70000,13.18330\"],\n // [\"150.244.214.237\",\"40.41670,-3.68380\"],\n // [\"158.109.120.133\",\"41.50260,2.08750\"],\n // [\"193.137.55.13\",\"41.14960,-8.61100\"],\n // [\"193.0.115.152\",\"52.25000,21.00000\"],\n [\"129.240.118.130\",\"59.90500,10.74870\"],\n // [\"145.18.12.36\",\"52.35000,4.91670\"],\n [\"130.186.7.246\",\"44.49380,11.33870\"],\n // [\"150.217.6.71\",\"43.76670,11.25000\"],\n // [\"54.194.208.204\",\"53.33890,-6.25950\"],\n // [\"160.114.8.5\",\"46.25000,20.16670\"],\n // [\"147.102.224.101\",\"37.98330,23.73330\"],\n // [\"147.52.80.32\",\"35.32500,25.13060\"],\n // [\"129.187.255.151\",\"48.15000,11.58330\"],\n // [\"134.100.36.5\",\"53.55530,9.99500\"],\n // [\"129.69.8.19\",\"48.76670,9.18330\"],\n // [\"134.99.128.238\",\"51.21670,6.76670\"],\n // [\"129.199.166.212\",\"48.86280,2.32920\"],\n // [\"139.124.244.38\",\"43.31030,6.01300\"],\n // [\"159.84.183.116\",\"45.74850,4.84670\"],\n // [\"130.226.237.173\",\"55.97070,12.02250\"],\n // [\"147.32.3.202\",\"50.50960,13.63910\"],\n // [\"164.15.59.215\",\"50.83330,4.33330\"],\n [\"131.130.70.8\",\"48.20000,16.36670\"],\n // [\"178.250.249.10\",\"24.19170,55.76060\"],\n // [\"54.84.26.108\",\"39.04810,-77.47280\"],\n // [\"23.185.0.1\",\"37.75100,-97.82200\"],\n // [\"23.77.209.53\",\"52.35000,4.91670\"],\n // [\"99.86.243.129\",\"37.75100,-97.82200\"],\n // [\"132.239.180.101\",\"32.88070,-117.23590\"],\n // [\"128.227.9.98\",\"29.65160,-82.32480\"],\n // [\"104.22.2.59\",\"37.76970,-122.39330\"],\n [\"129.79.123.148\",\"39.16530,-86.52640\"],\n // [\"99.86.243.4\",\"37.75100,-97.82200\"],\n // [\"142.104.197.120\",\"48.42670,-123.36550\"],\n // [\"192.77.51.34\",\"46.81400,-71.21940\"],\n // [\"110.234.9.144\",\"20.00000,77.00000\"],\n // [\"164.125.8.119\",\"35.10280,129.04030\"],\n // [\"155.69.7.173\",\"1.36670,103.80000\"],\n // [\"156.62.238.90\",\"-36.86670,174.76670\"],\n // [\"139.80.135.136\",\"-45.87140,170.51190\"],\n // [\"103.18.3.61\",\"3.16670,101.70000\"],\n // [\"161.139.21.66\",\"2.50000,112.50000\"],\n [\"210.152.243.234\",\"35.69000,139.69000\"],\n // [\"133.3.250.141\",\"35.69000,139.69000\"],\n // [\"175.184.38.117\",\"35.82640,139.70440\"],\n [\"167.205.59.96\",\"-6.90390,107.61860\"],\n // [\"143.89.14.1\",\"22.29100,114.15000\"],\n [\"162.105.131.160\",\"39.92890,116.38830\"],\n [\"210.42.121.85\",\"30.58010,114.27340\"],\n [\"202.120.127.230\",\"31.04560,121.39970\"],\n // [\"185.64.253.1\",\"51.49640,-0.12240\"],\n [\"129.78.5.8\",\"-33.86120,151.19820\"],\n // [\"130.220.1.27\",\"-34.92870,138.59860\"],\n [\"81.31.186.20\",\"30.66930,50.20550\"],\n // [\"103.21.127.114\",\"18.97500,72.82580\"],\n // [\"103.27.9.24\",\"28.66670,77.21670\"],\n ['mgimo.ru', '55.74850,37.61840'],\n // ['www.uade.edu.ar', '-34.60330,-58.38170']\n ])\n // while (places.size < 5) {\n // const i = Math.random() * ipCoords.length | 0\n // places.set(ipCoords[i][1], ipCoords[i][0])\n // }\n map.markers = places\n map.draw()\n\n await map.getTimes().then(result => map.triangulate(result))\n // await map.getTimes().then(result => map.triangulate(result))\n // await map.getTimes().then(result => map.triangulate(result))\n // await map.getTimes().then(result => map.triangulate(result))\n}", "get boxProjection() {}", "fitMapBounds() {\n const { map } = this.refs;\n if (!map) {\n return;\n }\n const leaflet = this.refs.map.leafletElement;\n\n const values = this.props.type.values.filter(isValidLatLng);\n\n let bounds = L.latLngBounds();\n\n if (values.length === 1) {\n bounds = L.latLng(+values[0][1], +values[0][0]).toBounds(800);\n } else {\n values.forEach(v => {\n bounds.extend(L.latLng(+v[1], +v[0]));\n });\n }\n // If the bounds are equal, we need to extend them otherwise leaflet will error.\n if (bounds._northEast.lat === bounds._southWest.lat &&\n bounds._northEast.lng === bounds._southWest.lng) {\n bounds._northEast.lat = bounds._northEast.lat + 0.1;\n bounds._southWest.lng = bounds._southWest.lng - 0.1;\n }\n leaflet.fitBounds(bounds);\n }", "function updateDraggedGeoCodes()\n{\n\tpoint = marker.getPosition()\n\tThisLat = point.lat();\n\tThisLong = point.lng();\n\tdocument.getElementById(\"latitude\").value = ThisLat;\n\tdocument.getElementById(\"longitude\").value = ThisLong;\t\n}", "function updateDOM() {\n\n var dragRange, // is the user dragging the entire range and not just one knob?\n lowValueOffset, // where did the low knob start\n highValueOffset, // where did the high knob start\n pointer, // which knob/bar is being dragged\n ref; // which value should we be changing\n\n // update the dimensions\n dimensions();\n\n // set the limit bubble positions\n offset(refs.flrBub, 0);\n offset(refs.ceilBub, pixelize(barWidth - width(refs.ceilBub)));\n\n /**\n * Get the offset percentage from the given absolute offset\n * @param {number} offset\n * @returns {number}\n */\n function percentFromOffset(offset) {\n return ((offset - minOffset) / offsetRange) * 100;\n }\n\n /**\n * Get the decoded value from the given offset\n * @param {number} offset\n * @returns {number}\n */\n function decodedValueFromOffset(offset) {\n return percentFromOffset(offset)/100 * valueRangeDecoded + minValueDecoded;\n }\n\n /**\n * Get the value from the given offset\n * @param {number} offset\n * @returns {number}\n */\n function valueFromOffset(offset) {\n return scope.encode(decodedValueFromOffset(offset));\n }\n\n /**\n * Get the absolute offset from the given decoded value\n * @param {number} value\n * @returns {number}\n */\n function offsetFromDecodedValue(value) {\n\t\t\t\t\t\t\t\t\treturn ((value - minValueDecoded) * offsetRange) + minOffset;\n }\n\n /**\n * Get the absolute offset from the given value\n * @param {number} value\n * @returns {number}\n */\n function offsetFromValue(value) {\n return offsetFromDecodedValue(scope.decode(value));\n }\n\n /**\n * Get the offset percentage from the given decoded value\n * @param {number} value\n * @returns {number}\n */\n function percentFromDecodedValue(value) {\n\t\t\t\t\t\t\t\t\tvar percent = value - minValueDecoded;\n\t\t\t\t\t\t\t\t\tif(valueRange == valueRangeDecoded) {\n\t\t\t\t\t\t\t\t\t\tpercent = roundTo(percent, scope.decodedValues[stepWidth]) / stepRange;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tpercent /= valueRangeDecoded;\n\t\t\t\t\t\t\t\t\t}\n return percent * 100;\n }\n\n /**\n * Get the offset percentage from the given value\n * @param {number} value\n * @returns {number}\n */\n function percentFromValue(value) {\n return percentFromDecodedValue(scope.decode(value));\n }\n\n /**\n * Get the absolute offset (in px) from the given offset percentage\n * @param {number} percent\n * @returns {string}\n */\n function offsetFromPercent(percent) {\n return pixelize(percent * offsetRange / 100);\n }\n\n /**\n * Bring the offset back in range of the slider\n * @param {number} offset\n * @returns {number}\n */\n function bringOffsetInRange(offset) {\n return Math.min(Math.max(offset, minOffset), maxOffset);\n }\n\n /**\n * Bring the element back within the confines of the slider\n * @param {object} element\n * @returns {Object}\n */\n function fitToBar(element) {\n return offset(element, offsetFromPercent(percentFromOffset(bringOffsetInRange(offsetLeft(element)))));\n }\n\n /**\n * Compute the amount of stretch\n * @param {number} percent the mouse offset from the start position\n * @param {number} [maxPercent = 100] the maximum stretch\n * @param {boolean} [end = false] are we beyond the max stretch?\n * @returns {number}\n */\n function percentStretch(percent, maxPercent, end) {\n\n // which direction?\n var sign = percent > 0 ? 1 : -1;\n\n // if the maxPercent is 0 or not given apply no limit (i.e. set it to 100)\n maxPercent = !maxPercent ? 100 : maxPercent;\n\n if(end) {\n // compute the max stretch amount\n return (\n Math.sin((\n Math.min(Math.abs(percent / maxPercent), 1) * Math.PI\n ) - (Math.PI / 2)) + 1\n ) * sign * maxPercent / 6;\n }\n\n // compute the current stretch amount\n return (\n sign * Math.pow(Math.min(Math.abs(percent / maxPercent * 2), 1), scope.stickiness) * maxPercent / 2\n );\n }\n\n /**\n * Update the pointers in the DOM\n */\n function setPointers() {\n\n /**\n * The base percent for the low knob\n * @type {number}\n */\n var rawLowPercent = percentFromDecodedValue(scope.decodedValues[refLow]);\n\n /**\n * The width in percent of a step above the low value\n * @type {number}\n */\n var stepWidthPercentAboveLow = percentFromValue(scope[refLow] + scope[stepWidth]) - rawLowPercent;\n\n /**\n * The width in percent of a step below the low value\n * @type {number}\n */\n var stepWidthPercentBelowLow = rawLowPercent - percentFromValue(scope[refLow] - scope[stepWidth]);\n\n /**\n * The width in percent of the buffer above the low value\n * @type {number}\n */\n var bufferWidthPercentLow = percentFromValue(scope[refLow] + scope.buffer) - rawLowPercent;\n\n /**\n * The width in percent of the pointer\n * @type {number}\n */\n var ptrHalfWidthPercent = percentFromOffset(pointerHalfWidth + minOffset);\n\n /**\n * The percent for the low knob after the stretch has been applied\n * @type {number}\n */\n var stretchedLowPercent = rawLowPercent + percentStretch(stickyOffsetLow, stickyOffsetLow > 0?stepWidthPercentAboveLow:stepWidthPercentBelowLow);\n\n // set the low knob's and bubble's new positions\n offset(refs.minPtr, offsetFromPercent(stretchedLowPercent));\n offset(refs.lowBub,\n offsetFromPercent(percentFromOffset(offsetLeft(refs.minPtr) - halfWidth(refs.lowBub) + pointerHalfWidth)));\n\n if(isDualKnob) {\n // dual knob slider\n\n /**\n * The base percent for the high knob\n * @type {number}\n */\n var rawHighPercent = percentFromDecodedValue(scope.decodedValues[refHigh]);\n\n /**\n * The width in percent of a step above the high value\n * @type {number}\n */\n var stepWidthPercentAboveHigh = percentFromValue(scope[refHigh] + scope[stepWidth]) - rawHighPercent;\n\n /**\n * The width in percent of a step below the high value\n * @type {number}\n */\n var stepWidthPercentBelowHigh = rawHighPercent - percentFromValue(scope[refHigh] - scope[stepWidth]);\n\n /**\n * The width in percent of the buffer below the high value\n * @type {number}\n */\n var bufferWidthPercentHigh = rawHighPercent - percentFromValue(scope[refHigh] - scope.buffer);\n\n /**\n * The percent for the high knob after the stretch has been applied\n * @type {number}\n */\n var stretchedHighPercent = rawHighPercent + percentStretch(stickyOffsetHigh, stickyOffsetHigh > 0?stepWidthPercentAboveHigh:stepWidthPercentBelowHigh);\n\n if(stretchedLowPercent > rawHighPercent - bufferWidthPercentHigh) {\n // if the low knob has reached its maximum\n\n // get the new stretch amount for the low knob\n stretchedLowPercent = rawLowPercent + percentStretch(stickyOffsetLow, bufferWidthPercentLow, true);\n\n // and re-set the low knob's and bubble's new positions\n offset(refs.minPtr, offsetFromPercent(stretchedLowPercent));\n offset(refs.lowBub, offsetFromPercent(percentFromOffset(offsetLeft(refs.minPtr) - halfWidth(refs.lowBub) +\n pointerHalfWidth)));\n }\n\n if(stretchedHighPercent < rawLowPercent + bufferWidthPercentLow) {\n // if the high knob has reached its minimum\n\n // get the new stretch amount for the high knob\n stretchedHighPercent = rawHighPercent + percentStretch(stickyOffsetHigh, bufferWidthPercentHigh, true);\n }\n\n // set the high knob's and bubble's new positions\n offset(refs.maxPtr, offsetFromPercent(stretchedHighPercent));\n offset(refs.highBub, offsetFromPercent(percentFromOffset(offsetLeft(refs.maxPtr) - halfWidth(refs.highBub) +\n pointerHalfWidth)));\n\n // set the selection bar's new position and width\n offset(refs.selBar, offsetFromPercent(stretchedLowPercent + ptrHalfWidthPercent));\n refs.selBar.css({\n width: offsetFromPercent(stretchedHighPercent - stretchedLowPercent)\n });\n\n // set the selection bubbles' new positions\n offset(refs.selBub, offsetFromPercent(((stretchedLowPercent + stretchedHighPercent) / 2) - percentFromOffset(halfWidth(refs.selBub) + minOffset) + ptrHalfWidthPercent));\n offset(refs.cmbBub, offsetFromPercent(((stretchedLowPercent + stretchedHighPercent) / 2) - percentFromOffset(halfWidth(refs.cmbBub) + minOffset) + ptrHalfWidthPercent));\n\n // set the low unselected bar's new position and width\n refs.unSelBarLow.css({\n left : 0,\n width: offsetFromPercent(stretchedLowPercent + ptrHalfWidthPercent)\n });\n\n // set the high unselected bar's new position and width\n offset(refs.unSelBarHigh, offsetFromPercent(stretchedHighPercent + ptrHalfWidthPercent));\n refs.unSelBarHigh.css({\n right: 0\n });\n\n if(AngularSlider.inputtypes.range) {\n // we're using range inputs\n \n var ptrWidth = ptrHalfWidthPercent * 2;\n \n // get the high input's new position\n var highInputLeft = stretchedLowPercent + (bufferWidthPercentLow / 2);\n\t\t\t\t\t\t\t\t\t\t\tvar highInputWidth = 100 - highInputLeft;\n\t\t\t\t\t\t\t\t\t\t\thighInputLeft += ptrWidth;\n \n // get the low input's new width\n var lowInputWidth = stretchedHighPercent - (bufferWidthPercentHigh / 2);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// get the selection inputs new position and width;\n\t\t\t\t\t\t\t\t\t\t\tvar selInputLeft = stretchedLowPercent + ptrWidth;\n\t\t\t\t\t\t\t\t\t\t\tvar selInputWidth = stretchedHighPercent - stretchedLowPercent - ptrWidth;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(stretchedHighPercent <= stretchedLowPercent + ptrWidth) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tselInputLeft = stretchedLowPercent;\n\t\t\t\t\t\t\t\t\t\t\t\tselInputWidth = stretchedHighPercent + ptrWidth - stretchedLowPercent;\n\t\t\t\t\t\t\t\t\t\t\t}\n \n // set the low input's new width\n refs.minInput.css({\n width: offsetFromPercent(lowInputWidth)\n });\n\n // set the high input's new position and width\n refs.maxInput.css({\n left : offsetFromPercent(highInputLeft),\n width: offsetFromPercent(highInputWidth)\n });\n\n // set the selection input's new position and width\n refs.selInput.css({\n left : offsetFromPercent(selInputLeft),\n width: offsetFromPercent(selInputWidth)\n });\n }\n }\n }\n\n /**\n * Update the bubbles in the DOM\n */\n function adjustBubbles() {\n\n /**\n * The bubble to use for dual knobs\n * @type {object}\n */\n var bubToAdjust = refs.lowBub;\n\n // make sure the low value bubble is actually within the slider\n fitToBar(refs.lowBub);\n\n if(isDualKnob) {\n // this is a dual knob slider\n\n // make sure the high value and selection value bubbles are actually within the slider\n fitToBar(refs.highBub);\n fitToBar(refs.selBub);\n\n if(gap(refs.lowBub, refs.highBub) < 10) {\n // the low and high bubbles are overlapping\n\n // so hide them both\n hide(refs.lowBub);\n hide(refs.highBub);\n\n // and show the center bubble\n show(refs.cmbBub);\n\n // and make sure the center bubble is actually within the slider\n fitToBar(refs.cmbBub);\n\n // the center bubble is the bubble we care about now\n bubToAdjust = refs.cmbBub;\n } else {\n // the low and high bubbles aren't overlapping\n\n // so show the low and high bubbles\n show(refs.lowBub);\n show(refs.highBub);\n\n // and hide the center bubble\n hide(refs.cmbBub);\n bubToAdjust = refs.highBub;\n }\n }\n\n if(gap(refs.flrBub, refs.lowBub) < 5) {\n // the low bubble overlaps the floor bubble\n\n // so hide the floor bubble\n hide(refs.flrBub);\n } else {\n // the low bubble doesn't overlap the floor bubble\n\n if(isDualKnob) {\n // this is a dual knob slider\n\n if(gap(refs.flrBub, bubToAdjust) < 5) {\n // the bubble overlaps the floor bubble\n\n // so hide the floor bubble\n hide(refs.flrBub);\n } else {\n // no overlap\n\n // so show the floor bubble\n show(refs.flrBub);\n }\n } else {\n // single knob slider\n\n // so show the floor slider\n show(refs.flrBub);\n }\n }\n\n if(gap(refs.lowBub, refs.ceilBub) < 5) {\n // the low bubble overlaps the ceiling bubble\n\n // so hide the ceiling bubble\n hide(refs.ceilBub);\n } else {\n // the low bubble doesn't overlap the ceiling bubble\n\n if(isDualKnob) {\n // dual knob slider\n\n if(gap(bubToAdjust, refs.ceilBub) < 5) {\n // the bubble overlaps the ceiling bubble\n\n // so hide the ceiling bubble\n hide(refs.ceilBub);\n } else {\n // no overlap\n\n // so show the ceiling bubble\n show(refs.ceilBub);\n }\n } else {\n // no overlap\n\n // so show the ceiling bubble\n show(refs.ceilBub);\n }\n }\n }\n\n /**\n * What to do when dragging ends\n */\n function onEnd() {\n\n // reset the offsets\n stickyOffsetLow = 0;\n stickyOffsetHigh = 0;\n\n if(pointer) {\n // if we have a pointer reference\n\n // update all the elements in the DOM\n setPointers();\n adjustBubbles();\n\n // the pointer is no longer active\n pointer.removeClass('active');\n }\n\n // reset the references\n pointer = null;\n ref = null;\n dragRange = false;\n }\n\n /**\n * What to do when the knob/bar is moved\n * @param {object} event\n */\n function onMove(event) {\n if(pointer) {\n // we have a reference to a knob/bar\n\n scope.$apply(function() {\n\n /**\n * The current x position of the mouse/finger/etc.\n * @type {number}\n */\n var currentX = event.clientX || event.x;\n\n if(dragRange) {\n // the entire range is being dragged\n\n /**\n * The new offset for the low knob\n * @type {number}\n */\n var newLowValue = valueFromOffset(currentX) - lowValueOffset;\n\n /**\n * The new offset for the high knob\n * @type {number}\n */\n var newHighValue = valueFromOffset(currentX) + highValueOffset;\n\n if(newLowValue < minValue) {\n // the new low is outside of the slider\n\n // so bring the values back within range\n newHighValue += minValue - newLowValue;\n newLowValue = minValue;\n } else if(newHighValue > maxValue) {\n // the new high value is outside of the slider\n\n // so bring the values back within range\n newLowValue -= newHighValue - maxValue;\n newHighValue = maxValue;\n }\n\n // get the offset percentages\n var newLowPercent = percentFromValue(newLowValue);\n var newHighPercent = percentFromValue(newHighValue);\n\n // save the temporary sticky offset\n stickyOffsetLow = newLowPercent;\n stickyOffsetHigh = newHighPercent;\n\n // round the raw values to steps and assign them to the knobs\n scope[refLow] = newLowValue = roundToStep(newLowValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);\n scope[refHigh] = newHighValue = roundToStep(newHighValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);\n\n // keep the difference between both knobs the same\n stickyOffsetLow = stickyOffsetLow - percentFromValue(newLowValue);\n stickyOffsetHigh = stickyOffsetHigh- percentFromValue(newHighValue);\n } else {\n // only one knob is being dragged\n\n /**\n * The new offset for the knob being dragged\n * @type {number}\n */\n var newOffset = bringOffsetInRange(currentX + minOffset - offsetLeft(element) - halfWidth(pointer));\n\n /**\n * The new offset percent for the knob being dragged\n * @type {number}\n */\n var newPercent = percentFromOffset(newOffset);\n\n /**\n * The new value for the knob being dragged\n * @type {number}\n */\n var newValue = scope.encode(minValueDecoded + (valueRangeDecoded * newPercent / 100.0));\n\n // set the sticky offset for the low knob\n stickyOffsetLow = newPercent;\n\n if(isDualKnob) {\n // dual knob slider\n\n if(scope.buffer > 0) {\n // we need to account for the buffer\n\n if(ref === refLow) {\n // the low knob is being dragged\n\n if(newValue > scope[refHigh] - scope.buffer) {\n // the new value cuts into the buffer\n\n // so make the value respect the buffer\n newValue = scope[refHigh] - scope.buffer\n }\n } else {\n // the high knob is being dragged\n\n if(newValue < scope[refLow] + scope.buffer) {\n // the new value cuts into the buffer\n\n // so make the value respect the buffer\n newValue = scope[refLow] + scope.buffer;\n }\n }\n } else {\n // we don't have to worry about a buffer\n\n if(ref === refLow) {\n // the low knob is being dragged\n\n if(newValue > scope[refHigh]) {\n // the new value is greater then the value of the high knob\n\n // so set the low value to what the high used to be\n scope[refLow] = scope[refHigh];\n \n // make sure the decoded values are updated\n scope.decodedValues[refLow] = scope.decodeRef(refLow);\n\n // switch the value reference\n ref = refHigh;\n \n // swap the element references\n var temp = refs.minPtr;\n refs.minPtr = refs.maxPtr;\n refs.maxPtr = temp;\n\n // and the classes\n refs.maxPtr.removeClass('active').removeClass('high').addClass('low');\n refs.minPtr.addClass('active').removeClass('low').addClass('high');\n }\n } else {\n // the high knob is being dragged\n\n if(newValue < scope[refLow]) {\n // the new value is less than the value of the low knob\n\n // so set the high value to what the low used to be\n scope[refHigh] = scope[refLow];\n \n // make sure the decoded values are updated\n scope.decodedValues[refHigh] = scope.decodeRef(refHigh);\n\n // switch the value reference\n ref = refLow;\n \n // swap the element references\n var temp = refs.minPtr;\n refs.minPtr = refs.maxPtr;\n refs.maxPtr = temp;\n\n // and the classes\n refs.minPtr.removeClass('active').removeClass('low').addClass('high');\n refs.maxPtr.addClass('active').removeClass('high').addClass('low');\n }\n }\n }\n }\n\n // round the new value and assign it\n scope[ref] = newValue = roundToStep(newValue, scope.precision, scope[stepWidth], scope.floor, scope.ceiling);\n \n // update the decoded value\n scope.decodedValues[ref] = scope.decodeRef(ref);\n\n if(ref === refLow) {\n // the low knob is being dragged\n\n // so update the sticky offset for the low knob\n stickyOffsetLow = stickyOffsetLow - percentFromValue(newValue);\n \n // and ensure the high knob stays put\n stickyOffsetHigh = 0;\n } else {\n // the high knob is being dragged\n\n // so update the sticky offset for the high knob\n stickyOffsetHigh = stickyOffsetLow - percentFromValue(newValue);\n\n // and ensure the low knob stays put\n stickyOffsetLow = 0;\n }\n }\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(scope.ngChange) {\n\t\t\t\t\t\t\t\t\t\t\t\tscope.ngChange();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tctrl.$setViewValue(scope[refLow]);\n\n // update the DOM\n setPointers();\n adjustBubbles();\n\n });\n }\n }\n\n /**\n * What to do when a knob/bar is starting to be dragged\n * @param {object} event\n * @param {object} ptr\n * @param {string} rf\n */\n function onStart(event, ptr, rf) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(scope.ngDisabled && scope.ngDisabled == true) return;\n\n\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t * The current x position of the mouse/finger/etc.\n\t\t\t\t\t\t\t\t\t * @type {number}\n\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\tvar currentX = event.clientX || event.x;\n\n // save the pointer reference\n pointer = ptr;\n\n // save the a reference to the model\n ref = rf;\n\n // set the knob/bar to active\n pointer.addClass('active');\n\n if(ref == refSel) {\n // the selection bar is being dragged\n\n // so tell everyone else this is the case\n dragRange = true;\n \n var startValue = valueFromOffset(currentX);\n\n // and save the start positions\n lowValueOffset = startValue - scope[refLow];\n highValueOffset = scope[refHigh] - startValue;\n }\n\n onMove(event);\n }\n\n /**\n * Bind the various events to the various DOM elements\n */\n function setBindings() {\n if(AngularSlider.inputtypes.range) {\n // we're using range inputs\n\n /**\n * Bind the events necessary for a range input\n * @param {object} elem\n * @param {object} ptr\n * @param {string} rf\n */\n function bindSlider(elem, ptr, rf) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n /**\n * Start event\n * @param {event} ev\n */\n function start(ev) {\n onStart(ev, ptr, rf);\n }\n\n /**\n * End event\n * @param {event} ev\n */\n function end(ev) {\n onMove(ev);\n onEnd();\n }\n\n // bind events to the range input\n\t\t\t\t\t\t\t\t\t\t\t$swipe.bind(elem, {\n\t\t\t\t\t\t\t\t\t\t\t\tstart : start,\n\t\t\t\t\t\t\t\t\t\t\t\tmove : onMove,\n\t\t\t\t\t\t\t\t\t\t\t\tend : end,\n\t\t\t\t\t\t\t\t\t\t\t\tcancel: onEnd\n\t\t\t\t\t\t\t\t\t\t\t});\n }\n\n // bind the events to the low value range input\n bindSlider(refs.minInput, refs.minPtr, refLow);\n\n if(isDualKnob) {\n // bind the events to the high value range input\n bindSlider(refs.maxInput, refs.maxPtr, refHigh);\n // bind the events to the selection bar range input\n bindSlider(refs.selInput, refs.selBar, refSel);\n }\n } else {\n // we're using normal DOM elements\n\n /**\n * Start event\n * @param {object} elem\n * @param {string} rf\n * @param {object} [ptr]\n */\n function bindSwipeStart(elem, rf, ptr) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // if no pointer reference is supplied, reference the element given\n if(angular.isUndefined(ptr)) {\n ptr = elem;\n } else {\n ptr = angularize(ptr);\n }\n\n // bind the swipe start event to the element\n $swipe.bind(elem, {\n start: function(ev) {\n onStart(ev, ptr, rf);\n }\n });\n }\n\n /**\n * Move event\n * @param {object} elem\n */\n function bindSwipe(elem) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // bind the swipe move, end, and cancel events\n $swipe.bind(elem, {\n move : onMove,\n end : function(ev) {\n onMove(ev);\n onEnd();\n },\n cancel: onEnd\n });\n }\n\n // bind the common events to the various common elements\n bindSwipe($document);\n bindSwipeStart(refs.minPtr, refLow);\n bindSwipeStart(refs.lowBub, refLow);\n bindSwipeStart(refs.flrBub, refLow, refs.minPtr);\n if(isDualKnob) {\n // bind the dual knob specific events to the dual knob specific elements\n bindSwipeStart(refs.maxPtr, refHigh);\n bindSwipeStart(refs.highBub, refHigh);\n bindSwipeStart(refs.ceilBub, refHigh, refs.maxPtr);\n bindSwipeStart(refs.selBar, refSel);\n bindSwipeStart(refs.selBub, refSel, refs.selBar);\n bindSwipeStart(refs.unSelBarLow, refLow, refs.minPtr);\n bindSwipeStart(refs.unSelBarHigh, refHigh, refs.maxPtr);\n } else {\n // bind the single knob specific events to the single knob specific elements\n bindSwipeStart(refs.ceilBub, refLow, refs.minPtr);\n bindSwipeStart(refs.fullBar, refLow, refs.minPtr);\n }\n }\n }\n\n // update the DOM\n setPointers();\n adjustBubbles();\n\n if(!eventsBound) {\n // the events haven't been bound yet\n\n // so bind the events, damnit!\n setBindings();\n eventsBound = true;\n }\n }", "function fitBoundaries() {\n if (0 < cfg.boundaries.length) {\n cfg.map.fitBounds(cfg.boundaries);\n }\n }", "rectifyBBox (bbox) {\n // horizontal top\n if (bbox[0].y != bbox[1].y) {\n let ymin = Math.min(bbox[0].y, bbox[1].y)\n bbox[0].y = ymin\n bbox[1].y = ymin\n }\n\n // horizontal bottom\n if (bbox[3].y != bbox[2].y) {\n let ymax = Math.max(bbox[3].y, bbox[2].y)\n bbox[3].y = ymax\n bbox[2].y = ymax\n }\n\n // vertical right\n if (bbox[1].x != bbox[2].x) {\n let xmax = Math.max(bbox[1].x, bbox[2].x)\n bbox[1].x = xmax\n bbox[2].x = xmax\n }\n\n // vertical left\n if (bbox[0].x != bbox[3].x) {\n let xmin = Math.min(bbox[0].x, bbox[3].x)\n bbox[0].x = xmin\n bbox[3].x = xmin\n }\n\n return bbox\n }", "_calculateBounds() {\n // FILL IN//\n }", "moveCameraToFitBounds(){\n console.log('Directions - moveCamera');\n if (!this.props.origin || !this.props.destination || !this.state.mapboxGL) {\n return;\n }\n\n console.log('Directions - moveCamera');\n //this.state.mapboxGL.setVisibleCoordinateBounds();\n this.state.mapboxGL.fitBounds(this.props.origin, this.props.destination, 50);\n \n\n }", "function makeRangeBox(lon, lat) {\n var clipPad = constants.clipPad;\n var lon0 = lon[0] + clipPad;\n var lon1 = lon[1] - clipPad;\n var lat0 = lat[0] + clipPad;\n var lat1 = lat[1] - clipPad;\n\n // to cross antimeridian w/o ambiguity\n if(lon0 > 0 && lon1 < 0) lon1 += 360;\n\n var dlon4 = (lon1 - lon0) / 4;\n\n return {\n type: 'Polygon',\n coordinates: [[\n [lon0, lat0],\n [lon0, lat1],\n [lon0 + dlon4, lat1],\n [lon0 + 2 * dlon4, lat1],\n [lon0 + 3 * dlon4, lat1],\n [lon1, lat1],\n [lon1, lat0],\n [lon1 - dlon4, lat0],\n [lon1 - 2 * dlon4, lat0],\n [lon1 - 3 * dlon4, lat0],\n [lon0, lat0]\n ]]\n };\n}", "function returnBoundingBoxFromCountryName(countryName) {\n\n let countriesInfo = countriesInfoFunctions.returnCountriesInfo();\n\n let features = countriesInfo['countryBorders']['features'];\n\n let countryBoundary;\n\n for (let i = 0; i < features.length; i++) {\n\n if (features[i]['properties']['name'] == countryName) {\n\n countryBoundary = coordinatesToMultipolylineArray(features[i]['geometry']['coordinates']);\n break;\n\n }\n\n }\n\n if (!(countryBoundary)) {\n\n console.error(\"returnBoundingBoxFromCountryName: Country not in countryBoundaries\");\n return;\n\n }\n\n let maxNorth;\n let maxSouth;\n let maxEast;\n let maxWest;\n\n for (let i = 0; i < countryBoundary.length; i++) {\n\n let currentNorth = countryBoundary[i][0][0]; // lat = y\n let currentSouth = countryBoundary[i][0][0]; // lat = y\n let currentEast = countryBoundary[i][0][1]; // lon = x\n let currentWest = countryBoundary[i][0][1]; // lon = x\n\n for (let j = 1; j < countryBoundary[i].length; j++) {\n\n let currentX = countryBoundary[i][j][1];\n let currentY = countryBoundary[i][j][0];\n\n // North and South\n if (currentY > currentNorth) {\n\n currentNorth = currentY;\n\n } else if (currentY < currentSouth) {\n\n currentSouth = currentY;\n\n }\n\n // East and West\n if (currentX > currentEast) {\n\n currentEast = currentX;\n\n } else if (currentX < currentWest) {\n\n currentWest = currentX;\n\n }\n\n }\n\n if (i == 0) {\n\n maxNorth = currentNorth;\n maxSouth = currentSouth;\n maxEast = currentEast;\n maxWest = currentWest;\n\n } else {\n\n if (currentNorth > maxNorth) {\n\n maxNorth = currentNorth;\n\n }\n\n if (currentSouth < maxSouth) {\n\n maxSouth = currentSouth;\n\n }\n\n if (currentEast > maxEast) {\n\n maxEast = currentEast;\n\n }\n\n if (currentWest < maxWest) {\n\n maxWest = currentWest;\n\n }\n\n }\n\n }\n\n return {\n\n north: maxNorth,\n east: maxEast,\n south: maxSouth,\n west: maxWest\n\n }\n\n}", "function getBoundsSearchFunction(boxes) {\n var index, Flatbush;\n if (!boxes.length) {\n // Unlike rbush, flatbush doesn't allow size 0 indexes; workaround\n return function() {return [];};\n }\n Flatbush = require$1('flatbush');\n index = new Flatbush(boxes.length);\n boxes.forEach(function(ring) {\n var b = ring.bounds;\n index.add(b.xmin, b.ymin, b.xmax, b.ymax);\n });\n index.finish();\n\n function idxToObj(i) {\n return boxes[i];\n }\n\n // Receives xmin, ymin, xmax, ymax parameters\n // Returns subset of original @bounds array\n return function(a, b, c, d) {\n return index.search(a, b, c, d).map(idxToObj);\n };\n }", "function update() {\n var bounds = getBounds(features);\n var radius = gridSize / 120000 * Math.pow(2, map.getZoom());\n\n var width = Math.abs((bounds.max[0] - bounds.min[0]) + 2 * radius);\n var height = Math.abs((bounds.max[1] - bounds.min[1]) + 2 * radius);\n var left = bounds.min[0] - radius;\n var top = bounds.min[1] - radius;\n\n svg.attr('width', width).attr('height', height)\n .style('left', left + 'px')\n .style('top', top + 'px');\n\n g.attr('transform', 'translate(' + -bounds.min[0] + ',' + -bounds.min[1] + ')');\n\n g.selectAll('circle')\n .attr('cx', function(d) { return map.latLngToLayerPoint(d.LatLng).x + radius; })\n .attr('cy', function(d) { return map.latLngToLayerPoint(d.LatLng).y + radius;})\n .attr('r', radius);\n }" ]
[ "0.65064317", "0.6287059", "0.6096493", "0.6087814", "0.6083349", "0.60483795", "0.60168546", "0.5967971", "0.5747825", "0.5703452", "0.5682678", "0.5669107", "0.5515693", "0.5515693", "0.5488919", "0.54792976", "0.5460724", "0.5445885", "0.54415995", "0.5440736", "0.5421825", "0.5411396", "0.5404656", "0.5355574", "0.5312925", "0.5309617", "0.5309617", "0.53082377", "0.5277084", "0.5276709", "0.52568626", "0.5256684", "0.5255062", "0.5251986", "0.5239288", "0.52340233", "0.5226095", "0.52241075", "0.52157277", "0.52022773", "0.51977676", "0.51896167", "0.5182532", "0.51741666", "0.5169595", "0.5167932", "0.51516664", "0.51458234", "0.51433575", "0.5100016", "0.50980264", "0.50980216", "0.5094061", "0.50917006", "0.508103", "0.50767994", "0.5073223", "0.50695175", "0.50687724", "0.5064089", "0.5055773", "0.5052253", "0.5044725", "0.5041681", "0.50399786", "0.50343996", "0.50280446", "0.5026087", "0.5006619", "0.49969226", "0.49951905", "0.49950805", "0.49854097", "0.4984699", "0.4978514", "0.4976286", "0.4972095", "0.49644127", "0.49606958", "0.49563244", "0.4954597", "0.49497622", "0.4941745", "0.49364385", "0.49329197", "0.4930293", "0.49263796", "0.49260336", "0.4925975", "0.49134704", "0.49009553", "0.49008504", "0.48936838", "0.4893149", "0.4887071", "0.4884419", "0.48830134", "0.48821402", "0.48820972", "0.48809916" ]
0.757999
0
vuex v3.1.1 (c) 2019 Evan You
function r(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "loadVuex() {\n let keys = Object.keys(settings)\n keys.forEach(this.__loadVuexModule)\n }", "getTokenVuex() {\n return store.getters.jwt;\n }", "users() {\n return this.$store.getters.users\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function t(e){var l=Number(e.version.split(\".\")[0]);if(l>=2)e.mixin({beforeCreate:t});else{var a=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[t].concat(e.init):t,a.call(this,e)}}function t(){var e=this.$options;e.store?this.$store=\"function\"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.71114504", "0.70059747", "0.6747754", "0.6744582", "0.662208", "0.662208", "0.662208", "0.6618358", "0.6592901", "0.6487492", "0.63576543", "0.63523763", "0.63509184", "0.63509184", "0.63509184", "0.63509184", "0.63509184", "0.6339643", "0.6321553", "0.62844443", "0.62812215", "0.62554806", "0.6253598", "0.6253598", "0.6253598", "0.6253598", "0.6253598", "0.62428135", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016" ]
0.0
-1
Stores an associative array that maps URIs to functions
function RDFIndexedFormula() { this.statements = []; // As in RDFFormula this.propertyAction = []; // What to do when getting statement with {s X o} //maps <uri> to f(F,s,p,o) this.classAction = []; // What to do when adding { s type X } this.redirection = []; // redirect to lexically smaller equivalent symbol this.subjectIndex = []; // Array of statements with this X as subject this.predicateIndex = []; // Array of statements with this X as subject this.objectIndex = []; // Array of statements with this X as object this.namespaces = {} // Dictionary of namespace prefixes // Callbackify? function handleRDFType(formula, subj, pred, obj, why) { if (typeof formula.typeCallback != 'undefined') formula.typeCallback(formula, obj, why); var x = formula.classAction[obj.hashString()]; if (x) return x(formula, subj, pred, obj); return false; // statement given is needed } //handleRDFType //If the predicate is #type, use handleRDFType to create a typeCallback on the object this.propertyAction[ '<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'] = handleRDFType; // Assumption: these terms are not redirected @@fixme this.propertyAction['<http://www.w3.org/2002/07/owl#sameAs>'] = function(formula, subj, pred, obj, why) { formula.equate(subj,obj); return false; // statement given is needed e.g. when dereferencing }; //sameAs -> equate & don't add to index this.propertyAction['<http://www.w3.org/2006/link#obsoletes>'] = function(formula, subj, pred, obj, why) { formula.replaceWith(obj, subj); return false; // statement given IS needed }; //sameAs -> equate & don't add to index function newPropertyAction(formula, pred, action) { fyi("newPropertyAction: "+pred); formula.propertyAction[pred] = action; var fixEndA = formula.statementsMatching(undefined, pred, undefined); var i; for (i=0; i<fixEndA.length; i++) { // NOT optimized - sort fixEndA etc // fyi("nePropertyAction: retrospective action for "+st) if (action(formula, fixEndA[i].subject, pred, fixEndA[i].object)) { //@@ kb.remove(st); /// messing up the list we are iterating over?? @@ fyi("newPropertyAction: NOT removing "+fixEndA[i]); } } return false; } this.classAction["<"+owl_ns+"InverseFunctionalProperty>"] = function(formula, subj, pred, obj, addFn) { return newPropertyAction(formula, subj, handle_IFP); // yes subj not pred! }; //IFP -> handle_IFP, do add to index this.classAction["<"+owl_ns+"FunctionalProperty>"] = function(formula, subj, proj, obj, addFn) { return newPropertyAction(formula, subj, handle_FP); }; //FP => handleFP, do add to index function handle_IFP(formula, subj, pred, obj) { var s1 = formula.any(undefined, pred, obj); if (typeof s1 == 'undefined') return false; // First time with this value formula.equate(s1, subj); return true; } //handle_IFP function handle_FP(formula, subj, pred, obj) { var o1 = formula.any(subj, pred, undefined); if (typeof o1 == 'undefined') return false; // First time with this value formula.equate(o1, obj); return true ; } //handle_FP }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createURLHandler() {\n\t\tvar arr = [];\n\t\t\n\t\t\n\t\treturn arr;\t\t\n\t}", "defineFn(name, words) {this.fnDefs[name] = words;}", "constructor() {\n this.functions = {};\n }", "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "constructor () {\n\t\tthis._handlers = new Map();\n\t\tthis._allHandlers = new Array();\n\t}", "get funcReferences() { return exists && has(WA.Function); }", "static _mapToArray (functions) {\n let results = [ ];\n for (let key in functions) {\n results.push ({\n functionCall: functions [key],\n name: key\n });\n }\n return results;\n }", "function EventDict() {}", "get exposedFuncs() {\n return [];\n }", "attach_functions(executables) {\n var run_functions = this.execute_functions\n Object.keys(run_functions).forEach(function(function_name) {\n var to_execute = run_functions[function_name];\n executables[function_name]= to_execute\n });\n this.execute_functions = executables\n this.socket.onmessage = function(event) {\n var data = JSON.parse(event.data);\n var action = data[\"action\"]\n try {\n executables[action](data[\"response_data\"])\n } catch(TypeError) {\n \n } \n };\n }", "_setupQueries(queries = {}) {\n this.queries = new FunctionsDict(queries);\n }", "function getFunctions()\n{\n lines = functionEditor.getValue().split(\"\\n\");\n functions = [];\n for(i = 0; i < lines.length; i++)\n {\n if(lines[i].charAt(0) != ' ' && lines[i].indexOf(\"|\") != 0)\n {\n //If the string does not start with a keyword and does contain a equals sign.\n if(!beginsWithKeyword(lines[i]) && lines[i].indexOf(\"=\") != -1)\n {\n lineSplit = lines[i].split(\"=\");\n lineSplit = lineSplit[0].split(\" \"); //Get content before equals sign, and split on spaces\n\n exsists = false;\n if(!exsists) { //Check if already added\n tmp = {};\n tmp.functionName = lineSplit[0]; //Function name will be the first element in the array split on spaces\n tmp.arguments = lineSplit.slice(1, lineSplit.length - 1).filter(Boolean); //Arguments are the words after it, .filter to filter out empty entries.\n functions[functions.length] = tmp;\n }\n\n }\n }\n }\n\n return functions;\n}", "function dispatch () {\n\t\teach(routes, function (route, uri) {\n\t\t\tvar callback = route[0];\n\t\t\tvar pattern = route[1];\n\t\t\tvar params = route[2];\n\t\t\tvar match = location.match(pattern);\n\n\t\t\t// we have a match\n\t\t\tif (match != null) {\n\t\t\t\t// create params object to pass to callback\n\t\t\t\t// i.e {user: 'simple', id: '1234'}\n\t\t\t\tvar data = match.slice(1, match.length);\n\n\t\t\t\tvar args = data.reduce(function (previousValue, currentValue, index) {\n\t\t\t\t\t\t// if this is the first value, create variables store\n\t\t\t\t\t\tif (previousValue == null) {\n\t\t\t\t\t\t\tpreviousValue = {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// name: value\n\t\t\t\t\t\t// i.e user: 'simple'\n\t\t\t\t\t\t// `vars` contains the keys for the variables\n\t\t\t\t\t\tpreviousValue[params[index]] = currentValue;\n\n\t\t\t\t\t\treturn previousValue;\n\n\t\t\t\t\t\t// null --> first value\n\t\t\t\t\t}, null); \n\n\t\t\t\tcallback(args, uri);\n\t\t\t}\n\t\t});\n\t}", "get this[string]() {}", "function bindHandlers(handlerMap) {\n var m,\n dups = [];\n\n if (noHandlersWarn(handlerMap, 'bindHandlers')) {\n return null;\n }\n m = d3.map(handlerMap);\n\n m.forEach(function (eventId, api) {\n var fn = fs.isF(api) || fs.isF(api[eventId]);\n if (!fn) {\n $log.warn(eventId + ' handler not a function');\n return;\n }\n\n if (handlers[eventId]) {\n dups.push(eventId);\n } else {\n handlers[eventId] = fn;\n }\n });\n if (dups.length) {\n $log.warn('duplicate bindings ignored:', dups);\n }\n }", "get functionStatementLookup() {\n if (!this._functionStatementLookup) {\n this._functionStatementLookup = new Map();\n for (const stmt of this.functionStatements) {\n this._functionStatementLookup.set(stmt.getName(ParseMode.BrighterScript).toLowerCase(), stmt);\n }\n }\n return this._functionStatementLookup;\n }", "function JavaScriptFunctions() // implements FunctionMapper\n {\n // map from function name to function implementation\n this.map = null;\n\n /**\n * @param {string} prefix\n * @param {string} localName\n * @return {function}\n */\n this.resolveFunction = function(prefix, localName)\n {\n if (this.map === null)\n {\n this.map = {};\n }\n\n return this.map[prefix + \":\" + localName];\n };\n\n /**\n * @param {string} prefix\n * @param {string} localName\n * @param {function} func\n */\n this.setFunction = function(prefix, localName, func)\n {\n if (this.map === null)\n {\n this.map = {};\n }\n\n this.map[prefix + \":\" + localName] = func;\n };\n }", "function parseArray(array, functions) {\n _.each(array, function(item, key) { // loop through each item in array\n if(key in functions) { // do we have a matching function for key? \n array[key] = functions[key](item); // do the matching for the element, callback function determines what is returned here\n }\n });\n return array;\n}", "static routes() {\n\n\t\tconst keys = ['all', 'delete', 'get', 'patch', 'post', 'put'];\n\n\t\treturn MapContainer.create(...keys);\n\t}", "constructor() {\n this.fns = { any: [] };\n }", "function $LNh5$var$appendMethods(list, addition) {\n for (var i = 0; i < addition.length; i++) {\n var method = addition[i];\n\n if (list.indexOf(method) === -1) {\n list.push(method);\n }\n }\n} // get pathname of request", "function addMapping(router, mapping) {\n for (var url in mapping) {\n if (url.startsWith('GET ')) {\n var path = url.substring(4);\n router.get(path, mapping[url]);\n console.log(`register URL mapping: GET ${path}`);\n } else if (url.startsWith('POST ')) {\n var path = url.substring(5);\n router.post(path, mapping[url]);\n console.log(`register URL mapping: POST ${path}`);\n } else if (url.startsWith('PUT ')) {\n var path = url.substring(4);\n router.put(path, mapping[url]);\n console.log(`register URL mapping: PUT ${path}`);\n } else if (url.startsWith('DELETE ')) {\n var path = url.substring(7);\n router.del(path, mapping[url]);\n console.log(`register URL mapping: DELETE ${path}`);\n } else {\n console.log(`invalid URL: ${url}`);\n }\n }\n}", "function functions(obj) {\n var key, result = new Iterable_1.XHashMap();\n for (key in obj) {\n if (typeof (obj[key]) === \"function\") {\n result.put(key, obj[key]);\n }\n }\n return result;\n}", "function appendMethods(list,addition){for(var i=0;i<addition.length;i++){var method=addition[i];if(list.indexOf(method)===-1){list.push(method);}}}// get pathname of request", "_construct() {\n for (let url in methods) {\n const urlParts = url.split('/');\n const name = urlParts.pop(); // key for function\n\n let tmp = this;\n for (let p = 1; p < urlParts.length; ++p) { // acts like mkdir -p\n tmp = tmp[urlParts[p]] || (tmp[urlParts[p]] = {});\n }\n\n tmp[name] = (() => {\n const method = methods[url]; // closure forces copy\n return (params) => {\n return this._call(method, params);\n };\n })();\n }\n\n this._debug(`Trakt.tv: module loaded, as ${this._settings.useragent}`);\n }", "function registerFunctionRoutes(app, userFunction, functionSignatureType) {\n if (functionSignatureType === SignatureType.HTTP) {\n app.use('/favicon.ico|/robots.txt', (req, res) => {\n // Neither crawlers nor browsers attempting to pull the icon find the body\n // contents particularly useful, so we send nothing in the response body.\n res.status(404).send(null);\n });\n app.use('/*', (req, res, next) => {\n onFinished(res, (err, res) => {\n res.locals.functionExecutionFinished = true;\n });\n next();\n });\n app.all('/*', (req, res, next) => {\n const handler = makeHttpHandler(userFunction);\n handler(req, res, next);\n });\n }\n else if (functionSignatureType === SignatureType.EVENT) {\n app.post('/*', (req, res, next) => {\n const wrappedUserFunction = wrapEventFunction(userFunction);\n const handler = makeHttpHandler(wrappedUserFunction);\n handler(req, res, next);\n });\n }\n else {\n app.post('/*', (req, res, next) => {\n const wrappedUserFunction = wrapCloudEventFunction(userFunction);\n const handler = makeHttpHandler(wrappedUserFunction);\n handler(req, res, next);\n });\n }\n}", "function functionalUrls(elements) {\n\treturn elements.map(element => urlify(element));\n}", "constructor() {\n this.handlers = new Map();\n }", "_setRegexRoutes() {\n var _out = [],\n _routeParams = [],\n _reg, _routeObj;\n\n var routeHandler = null;\n var routeErrorHandler = function() {};\n var routeSuccessHandler = function() {};\n var routeResolver = null;\n\n this.log.logApi('1. registerRoutes', this.routes);\n for (var _route in this.routes) {\n\n\n // TODO: Route handler can be a function or object\n if (this.utils.type(this.routes[_route]) === 'function') {\n routeSuccessHandler = this.routes[_route];\n }\n\n // TODO: If object, make sure callback prop exists,\n if (this.utils.type(this.routes[_route]) === 'object') {\n\n if (this.routes[_route].error) {\n routeErrorHandler.bind(this.routes[_route].error);\n }\n if (this.routes[_route].success) {\n routeSuccessHandler.bind(this.routes[_route].success);\n }\n\n\n\n console.warn('Found route callback');\n\n if (this.routes[_route].resolve) {\n routeSuccessHandler = this.routes[_route].resolve;\n console.warn('Found route resolver');\n }\n }\n\n // TODO: if object.resolve (Ensure objects key is added to params once resolved.)\n _routeParams = _route.replace('/', '').split('/');\n _reg = this._regexRoute(_route, _routeParams);\n _routeObj = {\n regexp: _reg,\n route: _route,\n success: routeSuccessHandler,\n error: routeErrorHandler\n };\n _out.push(_routeObj);\n //this.log.logApi('setRegexRoutes', _routeObj);\n }\n this.routesRegex = _out;\n return _out;\n }", "function useCallbacks() {\r\n let handlers = [];\r\n function add(handler) {\r\n handlers.push(handler);\r\n return () => {\r\n const i = handlers.indexOf(handler);\r\n if (i > -1)\r\n handlers.splice(i, 1);\r\n };\r\n }\r\n function reset() {\r\n handlers = [];\r\n }\r\n return {\r\n add,\r\n list: () => handlers,\r\n reset,\r\n };\r\n}", "function useCallbacks() {\r\n let handlers = [];\r\n function add(handler) {\r\n handlers.push(handler);\r\n return () => {\r\n const i = handlers.indexOf(handler);\r\n if (i > -1)\r\n handlers.splice(i, 1);\r\n };\r\n }\r\n function reset() {\r\n handlers = [];\r\n }\r\n return {\r\n add,\r\n list: () => handlers,\r\n reset,\r\n };\r\n}", "function registerFunctionRoutes(app, userFunction, functionSignatureType) {\n if (isHttpFunction(userFunction, functionSignatureType)) {\n app.use('/*', (req, res, next) => {\n onFinished(res, (err, res) => {\n res.locals.functionExecutionFinished = true;\n });\n next();\n });\n app.all('/*', (req, res, next) => {\n const handler = makeHttpHandler(userFunction);\n handler(req, res, next);\n });\n }\n else {\n app.post('/*', (req, res, next) => {\n const wrappedUserFunction = wrapEventFunction(userFunction);\n const handler = makeHttpHandler(wrappedUserFunction);\n handler(req, res, next);\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}", "selfAssignHandlerFunctions() {\n this.request = this.api.request.bind(this.api);\n this.addRateLimitService = this.api.addRateLimitService.bind(this.api);\n this.addRequestService = this.api.addRequestService.bind(this.api);\n }", "function addListenersMap(eventId, listenerMap) {\n \n for( var pattern in listenerMap ) {\n addPathOrNodeCallback(eventId, pattern, listenerMap[pattern]);\n }\n }", "function MAP() {\n\n}", "function addMapping(router, mapping) {\n for (let url in mapping.default) {\n if (url.startsWith('GET ')) {\n var path = url.substring(4);\n router.get(path, mapping[url]);\n console.log(`register URL mapping: GET ${path}`);\n\n } else if (url.startsWith('POST ')) {\n var path = url.substring(5);\n router.post(path, mapping[url]);\n console.log(`register URL mapping: POST ${path}`);\n\n } else if (url.startsWith('PUT ')) {\n var path = url.substring(4);\n router.put(path, mapping[url]);\n console.log(`register URL mapping: PUT ${path}`);\n\n } else if (url.startsWith('DELETE ')) {\n var path = url.substring(7);\n router.del(path, mapping[url]);\n console.log(`register URL mapping: DELETE ${path}`);\n\n } else {\n console.log(`invalid URL: ${url}`);\n }\n }\n}", "static createStatic(methodName) {\n this[methodName] = this[routeHandlerFactory](methodName)\n }", "function useCallbacks() {\n let handlers = [];\n function add(handler) {\n handlers.push(handler);\n return () => {\n const i = handlers.indexOf(handler);\n if (i > -1)\n handlers.splice(i, 1);\n };\n }\n function reset() {\n handlers = [];\n }\n return {\n add,\n list: () => handlers,\n reset,\n };\n}", "setIntentHandlers() {\n let intentHandlers = {};\n intentHandlers[Constants.INTENT_ADD] = addIntentHandler;\n intentHandlers[Constants.INTENT_ASK] = askIntentHandler;\n intentHandlers[Constants.INTENT_DELETE] = deleteIntentHandler;\n this._alexa.setIntentHandlers(intentHandlers);\n }", "bindEvents() {\n this.AMapEventListeners = [];\n\n /**\n * Construct event callbacks.\n */\n const eventCallbacks = this.parseEvents();\n\n Object.keys(eventCallbacks).forEach((key) => {\n const eventName = key.substring(2).toLowerCase();\n const handler = eventCallbacks[key];\n\n this.AMapEventListeners.push(\n window.AMap.event.addListener(this.marker, eventName, handler),\n );\n });\n }", "function addMapping(router, mapping) {\n for (let url in mapping) {\n\n if (url.startsWith('GET ')) {\n\n let path = url.substring(4);\n router.get(path, mapping[url]);\n\n } else if (url.startsWith('POST ')) {\n\n let path = url.substring(5);\n router.post(path, mapping[url]);\n\n } else if (url.startsWith('PUT ')) {\n\n let path = url.substring(4);\n router.put(path, mapping[url]);\n\n } else if (url.startsWith('DELETE ')) {\n\n let path = url.substring(7);\n router.delete(path, mapping[url]);\n\n } else {\n console.log(`invalid URL: ${url}`);\n }\n }\n}", "_cacheChildrenWithExternalReferences(element) {\n const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);\n const elements = this._elementsWithExternalReferences =\n this._elementsWithExternalReferences || new Map();\n for (let i = 0; i < elementsWithFuncIri.length; i++) {\n funcIriAttributes.forEach(attr => {\n const elementWithReference = elementsWithFuncIri[i];\n const value = elementWithReference.getAttribute(attr);\n const match = value ? value.match(funcIriPattern) : null;\n if (match) {\n let attributes = elements.get(elementWithReference);\n if (!attributes) {\n attributes = [];\n elements.set(elementWithReference, attributes);\n }\n attributes.push({ name: attr, value: match[1] });\n }\n });\n }\n }", "_cacheChildrenWithExternalReferences(element) {\n const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);\n const elements = this._elementsWithExternalReferences =\n this._elementsWithExternalReferences || new Map();\n for (let i = 0; i < elementsWithFuncIri.length; i++) {\n funcIriAttributes.forEach(attr => {\n const elementWithReference = elementsWithFuncIri[i];\n const value = elementWithReference.getAttribute(attr);\n const match = value ? value.match(funcIriPattern) : null;\n if (match) {\n let attributes = elements.get(elementWithReference);\n if (!attributes) {\n attributes = [];\n elements.set(elementWithReference, attributes);\n }\n attributes.push({ name: attr, value: match[1] });\n }\n });\n }\n }", "static _parseFunctionData (index, data) {\n var func, name;\n\n if (typeof (data) == 'function') {\n func = data;\n name = index;\n } else {\n func = data.functionCall;\n name = data.name;\n }\n\n return { func, name }\n }", "function paths2map(paths) {\n var comboSyntax = config.comboSyntax || ['??', ',']\n var map = []\n\n gutil.forEach(paths, function(path) {\n var root = path[0] + '/'\n var group = files2group(path[1])\n\n gutil.forEach(group, function(files) {\n\n var hash = {}\n var comboPath = root + comboSyntax[0] + files.join(comboSyntax[1])\n\n // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url\n if (comboPath.length > 2000) {\n throw new Error('The combo url is too long: ' + comboPath)\n }\n\n gutil.forEach(files, function(part) {\n hash[root + part] = comboPath\n })\n\n map.push(function(url) {\n return hash[url] || url\n })\n\n })\n\n })\n //console.log('map',map)\n return map\n }", "function FunctionReference() {\r\n\tthis.ovload = null;\r\n\tthis.before = new Array();\r\n\tthis.after = new Array();\r\n\tthis.alt = new Array();\r\n\tthis.chain = new Array();\r\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}", "on(name, callback){\n // if eventsMap[name] undefined, []\n this.eventsMap[name] = this.eventsMap[name] || [];\n // associates event with callback\n this.eventsMap[name].push(callback);\n //result : on('LIST') => doSomething()\n }", "function storeEventHandler(dict, element, animationName, eventCallback) {\n let elementFound = false;\n for (let i = 0; i < dict.length; i++) {\n if (dict[i].key === element) {\n if (dict[i].value) {\n dict[i].value.push({ prop: animationName, handler: eventCallback });\n }\n else {\n dict[i].value = [{ prop: animationName, handler: eventCallback }];\n }\n\n elementFound = true;\n break;\n }\n }\n\n if (!elementFound) {\n dict.push({\n key: element,\n value: [{ prop: animationName, handler: eventCallback }]\n });\n }\n}", "static toMap(keyFunc){\n var groupFunc = keyFunc;\n if( !Util.isFunction(keyFunc) ) {\n groupFunc = function (input) {\n return input[keyFunc];\n };\n }\n\n return groupFunc;\n }", "function loadMethods(input) {\n return loadAnything('function', input, (myFunc) => new InspectorFunction(myFunc));\n}", "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 handlePreds(pred) {\n if (pred.type == 'function declaration') {\n symbolize.push(pred);\n _isGlobal = false;\n }\n else if (pred.type == 'variable declaration') {\n handleVarDecleration(pred);\n }\n else handlePreds2(pred);\n}", "function callbacks_for( endpoints ) {\n var init_callback = function () {\n console.log( \"Getting data\" );\n };\n var callbacks = [];\n callbacks = endpoints.map( function ( e ) {\n return function () {\n _resource.get_sheets_labels( draw_tabs );\n };\n });\n callbacks[0] = function ( data ) {\n draw_endpoint( data['data'] );\n };\n\n return {\n 'init_callback' : init_callback,\n 'callbacks' : callbacks\n };\n }", "parseEvents() {\n return {\n onStart: createEventCallback('onStart', this.pathNavigator).bind(this),\n onPause: createEventCallback('onPause', this.pathNavigator).bind(this),\n onMove: createEventCallback('onMove', this.pathNavigator).bind(this),\n onStop: createEventCallback('onStop', this.pathNavigator).bind(this),\n };\n }", "constructor(numHandlers = 0) {\n this.routes = new Map(); \n //set the pathname of the current route\n this.currentPath = window.location.pathname;\n this.options = {\n context: window,\n startListening: true\n }\n //corresponds to the number of HANDLERS you register, note this is NOT no. of routes since you can have one handler\n //for several routes\n this.numHandlers = numHandlers;\n this.numRegistered = 0;\n this.matchHelper = () => {\n return this.match(window.location.pathname);\n }\n //used to detect when URL changes and execute a handler accordingly\n window.addEventListener('popstate', this.matchHelper); \n }", "function onInit() {\n for (var i in this) {\n if (i.endsWith('_json_'))\n this[i.slice(0,-1)] = this[i].parseJSON();\n else if (i.endsWith('_e4x_'))\n this[i.slice(0,-1)] = new XML(this[i]);\n else if (i.endsWith('_action_')\n || i.endsWith('_action_get_')\n || i.endsWith('_action_post_')\n || i.endsWith('_action_put_')\n || i.endsWith('_action_delete_')\n || i.endsWith('_macro_')\n || i.endsWith('_fetchlet_')\n || i.endsWith('_control_'))\n this[i.slice(0,-1)] = new Function(this[i]);\n }\n}", "function createMetaDataMap(metaArray, keyFunction, valueFunction) {\n\t return metaArray.reduce((acc, cur) => {\n\t acc[keyFunction(cur)] = valueFunction(cur)\n\t return acc\n\t }, {})\n\t}", "function addUserFunction(userFunctionEdn) {\n userFunctions.push(userFunctionEdn);\n}", "map(callback) {\n let result = [];\n for (let key in connections)\n if (connections[key] instanceof Function == false)\n if (!connections[key].data.irnore)\n result.push(callback(connections[key].data));\n return result;\n }", "function getParsingFunctions(axiomNames) {\n if (hasUnknownEntries(axiomNames)) {\n throw new Error('A request for an unknown axiom.')\n }\n\n let functions = null\n\n const convertPred = p => convertToSimplifyPredicate(p, functions)\n const convertExpr = e => convertToSimplifyIntExpr(e, functions)\n const convertVar = v => convertToSimplifyVar(v, functions)\n\n functions = axiomNames\n .map(ax => _axioms[ax].triggers)\n .filter(t => !!t)\n .map(t => ({\n onPredicate: p => t.onPredicate(p, convertPred, convertExpr, convertVar),\n onIntegerExpression: e =>\n t.onIntegerExpression(e, convertPred, convertExpr, convertVar),\n onVariable: v => t.onVariable(v, convertPred, convertExpr, convertVar)\n }))\n\n return functions\n}", "function map() {\n\n}", "function AddToRedditMap(key, URL) {\nreturn function() {\t\n \tif (RedditSearchRequest.readyState == 4 && RedditSearchRequest.status == 200) {\n\t\tvar splitURL = key.split('?');\n \tvar res = JSON.parse(RedditSearchRequest.responseText);\n\t\tif (res.data.children.length > 0) {\n\t\t\tvar assigned = 0;\n\t\t\tfor (var i = 0; i < res.data.children.length; i++) {\n\t\t\t\tif (compURL(URL, res.data.children[0].data.url)) { \n\t\t\t\t\tvar RedditID = res.data.children[0].data.id;\n\t\t\t\t\tRedditMap[key] = RedditID;\n\t\t\t\t\tif (URL != key) {\n\t\t\t\t\t\tRedditMap[URL] = RedditID;\n\t\t\t\t\t}\n\t\t\t\t\tassigned = 1;\n\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (assigned == 0) {\n\t\t\t\tRedditMap[key] = \"\";\n\t\t\t\tRedditMap[URL] = \"\";\n\t\t\t}\n\t\t\tupdateBadge();\n\t\t}\t\n\t\telse if (splitURL.length > 1 && checkQRequired(URL)) {\n\t\t\tbaseURL = splitURL[0];\n\t\t\t//if (RedditMap[baseURL] != undefined) {RedditMap[URL] = RedditMap[baseURL]}\n\t\t\tSearchReddit(baseURL, URL);\n\t\t}\n\t\telse {\n\t\t\tRedditMap[URL] = \"\";\n\t\t\tRedditMap[key] = \"\";\n\t\t\tupdateBadge();\n\t\t}\n \t}\n}\n}", "makeAccessorsFromFunction (callback) {\n return objectMap(ignore(callback),\n (value, key) => () => callback()[key]\n )\n }", "getDistinctFunctionDeclarationMap() {\n const result = {};\n for (const file of this.files) {\n for (const func of file.functionDefinitions) {\n //skip the special function names\n if (this.nonPrefixedFunctionMap[func.name.toLowerCase()]) {\n continue;\n }\n result[func.name.toLowerCase()] = true;\n }\n }\n return result;\n }", "function mapFunction(array, functionToRun) {\n this.mappedArray = array.map(functionToRun);\n}", "function regexpToFunction(re, keys, options = {}) {\n const { decode = (x) => x } = options;\n return function (pathname) {\n const m = re.exec(pathname);\n if (!m)\n return false;\n const { 0: path, index } = m;\n const params = Object.create(null);\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined)\n continue;\n const key = keys[i - 1];\n if (key.modifier === '*' || key.modifier === '+') {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(value => {\n return decode(value, key);\n });\n }\n else {\n params[key.name] = decode(m[i], key);\n }\n }\n return { path, index, params };\n };\n}", "function bindFunctions (namespace, functions=[]) {\n let ns = getNamespace(namespace);\n functions.forEach(fnDef => {\n let { name: method, successCallbackIndex: success, failureCallbackIndex: failure } = fnDef;\n let name = `${namespace}.${method}`;\n exportFunction(JETPACK.RPC.bind(null, { name, success, failure }), ns, { defineAs: method });\n });\n}", "function set_registry(map) {\n registry = map;\n}", "function processLinks() {\n\t\n\t//Indicates internal domains\n\tvar internalDomains = (conf.trackExternalLinks && conf.internalDomains) ? conf.internalDomains.split(PARAM_SEPARATOR) : null;\n\t//Indicates the types of file to be downloaded\n\tvar downloadFileTypes = (conf.trackDownloadLinks && conf.downloadFileTypes) ? conf.downloadFileTypes.split(PARAM_SEPARATOR) : null;\n\t\n\t// Get the current GA instance\n\tvar plattforms = HAF._int.getPlattformInstances();\n\tvar gaRef = null; \n\tfor(var x = 0; x < plattforms.length; x++) {\n\t\tif(plattforms[x].name === HAF._int.Constants.GA ){\n\t\t\tgaRef = plattforms[x];\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfunction createOnclickHandler(link){\n\t\t// this complex syntax creates a closure around the href property of the link\n\t\tvar href = link.href;\t\t\t\n\t\treturn function(){\n\t\t\t//checks if link corresponds to a external link.\n\t\t\tif (internalDomains != null) {\n\t\t\t\tvar findInternalDomain = false;\n\t\t\t\tfor (var j = 0; j < internalDomains.length; j++) {\t\t\t\t\n\t\t\t\t\tvar patter = new RegExp(internalDomains[j], \"i\");\n\t\t\t\t\tif (href.match(patter) != null) {\n\t\t\t\t\t\tfindInternalDomain = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!findInternalDomain) {\n\t\t\t\t\tgaRef.recordOutboundLink(href);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//checks if link corresponds to a file download link.\n\t\t\tif (downloadFileTypes != null) {\n\t\t\t\tvar findFileType = false;\n\t\t\t\tvar fileType = \"\";\n\t\t\t\tfor (var j = 0; j < downloadFileTypes.length; j++) {\t\t\t\t\n\t\t\t\t\tvar patter = new RegExp(\"[\\x2E]\" + downloadFileTypes[j], \"i\");\n\t\t\t\t\tif (href.match(patter) != null) {\n\t\t\t\t\t\tfindFileType = true;\n\t\t\t\t\t\tfileType = downloadFileTypes[j];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (findFileType) {\n\t\t\t\t\tgaRef.recordDownloadFileLink(fileType, href);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tvar links = window.document.getElementsByTagName(\"a\");\n\t//for earch link on the page.\n\tfor ( var i = 0; i < links.length; i++) {\n\t\tvar inlineOnclick = links[i].onclick || '';\n\t\tinlineOnclick = inlineOnclick ? ''+inlineOnclick : ''; \n\t\tif(inlineOnclick && inlineOnclick.indexOf('yellSendTrackLinkEvent') != -1)\n\t\t\tcontinue;\n\t\tif(inlineOnclick && inlineOnclick.indexOf('HAF.lnk_event') != -1)\n\t\t\tcontinue;\n\t\t// Event was changed to mousedown, since it happens around 50ms before onclick thus avoids need to \n\t\t// create some bogus sleep method to block the \n\t\teventClick(links[i], \"mousedown\", createOnclickHandler(links[i]));\t\n\t}\t\n}", "function collectFunctions() {\n var keys = Object.keys(window);\n var functions = [];\n\n keys.forEach(function(key) {\n if (window[key] instanceof Function) { // Step (1)\n functions.push(window[key].name || \"<Anonymous function>\"); // anonymous function support does not currently exist\n }\n });\n\n window.postMessage({ // Step (2)\n type: \"FROM_PAGE\",\n text: functions\n }, \"*\");\n}", "'ev'(env) {\n var args = this.args.map(function (a) {\n return a.ev(env);\n });\n\n for (var i = 0; i < args.length; i++) {\n if (args[i].is === 'undefined') {\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n }\n\n if (this.name in CartoCSS.Tree.functions) {\n if (CartoCSS.Tree.functions[this.name].length <= args.length) {\n var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);\n if (val === null) {\n env.error({\n message: 'incorrect arguments given to ' + this.name + '()',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {is: 'undefined', value: 'undefined'};\n }\n return val;\n } else {\n env.error({\n message: 'incorrect number of arguments for ' + this.name +\n '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n } else {\n var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];\n if (fn === undefined) {\n var functions = toPairs(CartoCSS.Tree.Reference.mapnikFunctions);\n // cheap closest, needs improvement.\n var name = this.name;\n var mean = functions.map(function (f) {\n return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];\n }).sort(function (a, b) {\n return a[1] - b[1];\n });\n env.error({\n message: 'unknown function ' + this.name + '(), did you mean ' +\n mean[0][0] + '(' + mean[0][2] + ')',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n if (fn !== args.length &&\n // support variable-arg functions like `colorize-alpha`\n fn !== -1) {\n env.error({\n message: 'function ' + this.name + '() takes ' +\n fn + ' arguments and was given ' + args.length,\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n } else {\n // Save the evaluated versions of arguments\n this.args = args;\n return this;\n }\n }\n }", "function forInput(type, inputNum, callback){\n\tmap[type][inputNum] = callback;\n}", "function fns(v) {\r\n var a = new Array();\r\n if (v != null) {\r\n for (var i in v.fl) {\r\n a.push(v.fl[i].fn);\r\n }\r\n }\r\n return a;\r\n }", "function updateFunctionAddress (line) {\n const name = line.replace(/^al\\s+[0-9A-F]+ \\./, '');\n\n const address = parseInt(line.match(/[0-9A-F]+/), 16);\n const pageNumber = this + 0;\n\n const name2 = name.replace(/^_/, '');\n\n // the libc page is page 2\n if (pageNumber === 2 && name === 'initlib') {\n defines.initlib2 = address;\n } else if (pageNumber === 2 && name === 'zerobss') {\n defines.zerobss2 = address;\n } else if (pageNumber === 2 && name === 'donelib') {\n defines.donelib2 = address;\n } else if (pageNumber === 3 && name === '__updateSpinner') {\n defines.updateSpinner = address;\n } else if (hasProp(defines, name)) {\n defines[name] = address;\n }\n\n if (\n name !== '_main' && // don't use the wrong main\n pageNumber < 3 &&\n hasProp(hashMap, name)\n ) {\n functionsList[hashMap[name]][2] = address;\n functionsList[hashMap[name]][1] = pageNumber;\n } else if (\n hasProp(hashMap, name2) &&\n functionsList[hashMap[name2]][2] === 1 /* address 1 means it we don't yet\n have the real value */\n ) {\n functionsList[hashMap[name2]][2] = address;\n functionsList[hashMap[name2]][1] = pageNumber;\n }\n}", "function getHandlers() {\n const output = {};\n handlerNamespaces.forEach((key) => {\n const handler = require(`./${key}`);\n Object.keys(handler).forEach((handlerKey) => {\n if (typeof output[handlerKey] !== 'undefined') {\n console.error(`Key already defined: ${handlerKey}, must be unique`);\n process.exit(1);\n } else {\n output[handlerKey] = handler[handlerKey];\n }\n });\n });\n\n return output;\n}", "function accessServices(s) {\n return f => access(r => f(R.map_(s, v => r[v.key])));\n}", "function assignKey(key, scope, method){\n\t var keys, mods;\n\t keys = getKeys(key);\n\t if (method === undefined) {\n\t method = scope;\n\t scope = 'all';\n\t }\n\t\n\t // for each shortcut\n\t for (var i = 0; i < keys.length; i++) {\n\t // set modifier keys if any\n\t mods = [];\n\t key = keys[i].split('+');\n\t if (key.length > 1){\n\t mods = getMods(key);\n\t key = [key[key.length-1]];\n\t }\n\t // convert to keycode and...\n\t key = key[0]\n\t key = code(key);\n\t // ...store handler\n\t if (!(key in _handlers)) _handlers[key] = [];\n\t _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n\t }\n\t }", "function assignKey(key, scope, method){\n\t var keys, mods;\n\t keys = getKeys(key);\n\t if (method === undefined) {\n\t method = scope;\n\t scope = 'all';\n\t }\n\t\n\t // for each shortcut\n\t for (var i = 0; i < keys.length; i++) {\n\t // set modifier keys if any\n\t mods = [];\n\t key = keys[i].split('+');\n\t if (key.length > 1){\n\t mods = getMods(key);\n\t key = [key[key.length-1]];\n\t }\n\t // convert to keycode and...\n\t key = key[0]\n\t key = code(key);\n\t // ...store handler\n\t if (!(key in _handlers)) _handlers[key] = [];\n\t _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n\t }\n\t }", "function evaluateAllFN(FNstr){\n //FNstr must already have links resolved\n let r = /[A-Z]+(?=\\(.+?\\))/\n let match = r.exec(FNstr)\n let resolvedArgs = []\n let result\n if(!match){//no functions in this string\n return FNstr\n }\n if(!gfn[match[0]]){\n let err = 'Invalid Function: '+ match[0]\n throw new Error(err)\n }\n let find = findFN(FNstr, match.index)\n let argsArr = findFNArgs(find)\n if(match[0] === 'IFERROR'){\n try{\n result = evaluateAllFN(args[0])\n }catch(e){\n result = evaluateAllFN(args[1])\n }\n FNstr = FNstr.replace(find,result)\n try {\n FNstr = JSON.parse(FNstr)//need to eval to get string 'true' to boolean `true` if it is just a string or number then it remains\n } catch (error) {}\n \n return FNstr\n }\n for (let i=0; i<argsArr.length; i++){\n let val = argsArr[i]\n let more = r.exec(val)\n if(more){//arg contains a FN\n console.log('more',val)\n resolvedArgs.push(evaluateAllFN(val))\n }else{\n let hasMath = /[0-9=+*/^-]+/gi.test(val);\n let hasletters = /[a-z]/i.test(val)\n let pureMath = hasMath && !hasletters\n let compare = /[<>!=+*/^-]+/gi.test(val)\n let reg = /(\\/[^\\n\\r]+\\/)([gimuy]+)?/.test(val)\n console.log('math:',pureMath, 'compare:',compare, 'reg:',reg)\n if(pureMath && !compare && !reg){\n let solver = new MathSolver()\n resolvedArgs.push(solver.solve(val))\n }else if(compare && !reg){\n let solver = new MathSolver()\n resolvedArgs.push(solver.solveAndCompare(val))\n }else{\n resolvedArgs.push(val)\n }\n }\n }\n result = gfn[match[0]](resolvedArgs)\n FNstr = FNstr.replace(find,result)\n try {\n FNstr = JSON.parse(FNstr)//need to eval to get string 'true' to boolean `true` if it is just a string or number then it remains\n } catch (error) {}\n \n return FNstr\n}", "function makeParseFunction (attributeName, keyNames) {\n return function parseFunction (elem) { \n let attributesString = elem.getAttribute(attributeName); // e.g. \"switchName(no-auto, parent) switchName2(auto, parent)\"\n\n if (!attributesString) {\n return [];\n }\n\n let parsedAttributeValues = parseAttributeString(attributesString); // e.g. [[\"switchName\", \"no-auto\", \"parent\"], [\"switchName2\", \"auto\", \"parent\"]] \n\n return parsedAttributeValues.map(function (arrayOfValues) {\n let returnObj = {};\n keyNames.forEach(function (keyName, index) {\n let val = arrayOfValues[index];\n if (val) {\n returnObj[keyName] = arrayOfValues[index];\n }\n });\n return returnObj;\n });\n }\n}", "function setupCallback(func, callbacks){\n\t\tvar hash = \"\" + Object.keys(callbacks).length;\n\t\tcallbacks[hash] = func;\n\t\tvar dataAttr = document.createAttribute(dataIdName);\n\t\tdataAttr.value = hash;\n\t\treturn dataAttr;\n\t}", "setupCallbacks() {\n var key, fn;\n var callbacks = {\n 'initialize': 'onInitialize',\n 'change': 'onChange',\n 'item_add': 'onItemAdd',\n 'item_remove': 'onItemRemove',\n 'clear': 'onClear',\n 'option_add': 'onOptionAdd',\n 'option_remove': 'onOptionRemove',\n 'option_clear': 'onOptionClear',\n 'optgroup_add': 'onOptionGroupAdd',\n 'optgroup_remove': 'onOptionGroupRemove',\n 'optgroup_clear': 'onOptionGroupClear',\n 'dropdown_open': 'onDropdownOpen',\n 'dropdown_close': 'onDropdownClose',\n 'type': 'onType',\n 'load': 'onLoad',\n 'focus': 'onFocus',\n 'blur': 'onBlur'\n };\n\n for (key in callbacks) {\n fn = this.settings[callbacks[key]];\n if (fn) this.on(key, fn);\n }\n }", "function userinfo_dispatcher_routines() {\n\n\n}", "function acc_handler() {}", "initializeUrlAlias() {\n const aliasMap = new Map();\n aliasMap.set(\"enable\", \"ENABLE\");\n aliasMap.set(\"failover\", \"FAILOVER\");\n aliasMap.set(\"load_balance\", \"LOAD_BALANCE\");\n aliasMap.set(\"recv_buf_size\", \"RECV_BUF_SIZE\");\n aliasMap.set(\"send_buf_size\", \"SEND_BUF_SIZE\");\n aliasMap.set(\"sdu\", \"SDU\");\n aliasMap.set(\"source_route\", \"SOURCE_ROUTE\");\n aliasMap.set(\"retry_count\", \"RETRY_COUNT\");\n aliasMap.set(\"retry_delay\", \"RETRY_DELAY\");\n aliasMap.set(\"https_proxy\", \"HTTPS_PROXY\");\n aliasMap.set(\"https_proxy_port\", \"HTTPS_PROXY_PORT\");\n aliasMap.set(\"connect_timeout\", \"CONNECT_TIMEOUT\");\n aliasMap.set(\"transport_connect_timeout\", \"TRANSPORT_CONNECT_TIMEOUT\");\n aliasMap.set(\"recv_timeout\", \"RECV_TIMEOUT\");\n aliasMap.set(\"ssl_server_cert_dn\", \"SSL_SERVER_CERT_DN\");\n aliasMap.set(\"ssl_server_dn_match\", \"SSL_SERVER_DN_MATCH\");\n aliasMap.set(\"wallet_location\", \"MY_WALLET_DIRECTORY\");\n aliasMap.set(\"pool_connection_class\", \"POOL_CONNECTION_CLASS\");\n aliasMap.set(\"pool_purity\", \"POOL_PURITY\");\n aliasMap.set(\"service_tag\", \"SERVICE_TAG\");\n aliasMap.set(\"connection_id_prefix\", \"CONNECTION_ID_PREFIX\");\n return aliasMap;\n }", "function processUrlParameters() {\n\tvar params = window.location.hash.substring(1).split('&');\n\tfor (i in params) {\n\t\tvar pair = params[i].split('=');\n\t\tvar handler = parameterMap[pair[0]];\n\t\tif (handler) {\n\t\t\thandler(pair[1]);\n\t\t}\n\t}\n}", "all(_route, _f) {\n ['get', 'head', 'post', 'put', 'patch', 'delete'].forEach((_val) => {\n this._bindPathsToMap(_val, _route, _f);\n });\n }", "function prepareShorcuts() {\n let shortcuts = {};\n\n $('.method-wrapper a').each( function() {\n let name = $(this).text().trim();\n\n for (let i=0; i < name.length; i++) {\n let key = name[i].toLowerCase();\n if (key !== '' && shortcuts[key] === undefined) {\n shortcuts[key] = this;\n break;\n }\n }\n });\n\n window.methodsShortcuts = shortcuts;\n\n // Shorcuts handler\n $(document).keydown( function(e) {\n if (e.ctrlKey && e.altKey) {\n let methodLink = shortcuts[e.key];\n if (methodLink !== undefined)\n methodLink.click();\n }\n });\n}", "function storeEventHandler(dict, eventId, eventCallback) {\n let elementFound = false;\n for (let i = 0; i < dict.length; i++) {\n if (dict[i].key === eventId) {\n elementFound = true;\n break;\n }\n }\n\n if (!elementFound) {\n dict.push({\n key: eventId,\n handler: eventCallback\n });\n }\n}", "function mapFunction () {\n\n\t//list of events that are relevant for the behaviour to be found\n\t//var eventArray = [\"mousewheel\"];//\"scroll\",mouseUpEvent,\"keydown\"];\n\n\t//we filter out the events we don't want to consider\n\t//if (eventArray.indexOf(this.event) > -1){\n\t\t/*\n\t\t * \"emit\" function takes two arguments: 1) the key on which to group the data, 2) data itself to group. Both of them can be objects ({this.id, this.userId},{this.time, this.value}) for example\n\t\t */\n\t\t//emit({sid:this.sid, sessionstartms:this.sessionstartms, url:this.url, urlSessionCounter:this.urlSessionCounter},\n\t\temit({sid:this.sid, url:this.url, urlSessionCounter:this.urlSessionCounter},\n\t\t\t\t{ \"episodeEvents\":\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevent:this.event,\n\t\t\t\t\t\t\ttimestamp:this.timestamp,\n\t\t\t\t\t\t\ttimestampms:this.timestampms,\n\t\t\t\t\t\t\tsid:this.sid,\n\t\t\t\t\t\t\tip:this.ip,\n\t\t\t\t\t\t\turl:this.url,\n\t\t\t\t\t\t\tsessionstartms:this.sessionstartms,\n\t\t\t\t\t\t\tsessionstartparsed:this.sessionstartparsed,\n\t\t\t\t\t\t\tvisitCounter:this.visitCounter,\n\t\t\t\t\t\t\tvisitDuration:this.visitDuration,\n\n\t\t\t\t\t\t\tsdSessionCounter:this.sdSessionCounter,\n\t\t\t\t\t\t\tsdTimeSinceLastSession:this.sdTimeSinceLastSession,\n\t\t\t\t\t\t\turlSessionCounter:this.urlSessionCounter,\n\t\t\t\t\t\t\turlSinceLastSession:this.urlSinceLastSession,\n\t\t\t\t\t\t\turlEpisodeLength:this.urlEpisodeLength,\n\n\t\t\t\t\t\t\tepisodeUrlActivity: this.episodeUrlActivity,\n\t\t\t\t\t\t\tepisodeSdActivity: this.episodeSdActivity,\n\n\n\t\t\t\t\t\t\thtmlSize : this.htmlSize,\n\t\t\t\t\t\t\tresolution : this.resolution,\n\t\t\t\t\t\t\tsize : this.size,\n\t\t\t\t\t\t\tusableSize : this.usableSize,\n\n\t\t\t\t\t\t\tidleTime:this.idleTime,\n\t\t\t\t\t\t\tcalculatedActiveTime:this.calculatedActiveTime,\n\t\t\t\t\t\t\tidleTimeSoFar:this.idleTimeSoFar,\n\t\t\t\t\t\t\tsdCalculatedActiveTime:this.sdCalculatedActiveTime,\n\n\t\t\t\t\t\t\tusertimezoneoffset:this.usertimezoneoffset,\n\t\t\t\t\t\t\tmouseCoordinates:this.mouseCoordinates,\n\t\t\t\t\t\t\tnodeInfo:this.nodeInfo,\n\t\t\t\t\t\t\tcount:1\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t);\n\t//}\n}", "map(callback, ...names) {\n const result = [];\n this.each((path, index) => {\n result[index] = callback(path, index);\n }, ...names);\n return result;\n }", "function ObjectWithMap(){\r\n\t\r\n\tthis.map = (func) => {\r\n\t\t\r\n\t\tfor (let i in this){\r\n\t\t\tif(i != 'map') this[i] = func(this[i]);\r\n\t\t}\r\n\t\t\r\n\t}\r\n}", "function appendMethods(list, addition) {\n for (var i = 0; i < addition.length; i++) {\n var method = addition[i];\n\n if (list.indexOf(method) === -1) {\n list.push(method);\n }\n }\n} // get pathname of request", "use (...handlers) { this.handlers = this.handlers.concat(handlers) }", "generateFunctionMap() {\n return {\n 'emigateway.graphql.query.getACSSBusiness': {\n fn: business.getACSSBusiness$,\n obj: business\n },\n 'emigateway.graphql.query.getACSSBusinesses': {\n fn: business.getACSSBusinesses$,\n obj: business\n }, \n 'emigateway.graphql.query.getBusinessById': {\n fn: business.getBusinessById$,\n obj: business\n }, \n 'emigateway.graphql.query.getAllClearingsFromBusiness': {\n fn: clearing.getClearingsFromBusiness$,\n obj: clearing\n }, \n 'emigateway.graphql.query.getClearingById': {\n fn: clearing.getClearingById$,\n obj: clearing\n },\n 'emigateway.graphql.query.getAccumulatedTransactionsByIds': {\n fn: clearing.getAccumulatedTransactionsByIds$,\n obj: clearing\n },\n 'emigateway.graphql.query.getAccumulatedTransactionsByClearingId': {\n fn: clearing.getAccumulatedTransactionsByClearingId$,\n obj: clearing\n },\n 'emigateway.graphql.query.getTransactionsByIds': {\n fn: clearing.getTransactionsByIds$,\n obj: clearing\n },\n 'emigateway.graphql.query.getTransactionsByAccumulatedTransactionId': {\n fn: clearing.getTransactionsByAccumulatedTransactionId$,\n obj: clearing\n },\n 'emigateway.graphql.query.getSettlementsByClearingId': {\n fn: settlement.cqrs.getSettlementsByClearingId$,\n obj: settlement.cqrs\n },\n 'emigateway.graphql.query.getSettlementsCountByClearingId': {\n fn: settlement.cqrs.getSettlementsCountByClearingId$,\n obj: settlement.cqrs\n },\n 'emigateway.graphql.query.getSettlementsByBusinessId': {\n fn: settlement.cqrs.getSettlementsByBusinessId$,\n obj: settlement.cqrs\n },\n 'emigateway.graphql.query.getSettlementsCountByBusinessId': {\n fn: settlement.cqrs.getSettlementsCountByClearingId$,\n obj: settlement.cqrs\n },\n 'emigateway.graphql.query.getAccumulatedTransactionErrors': {\n fn: logError.cqrs.getAccumulatedTransactionErrors$,\n obj: logError.cqrs\n },\n 'emigateway.graphql.query.getAccumulatedTransactionErrorsCount': {\n fn: logError.cqrs.getAccumulatedTransactionErrorsCount$,\n obj: logError.cqrs\n },\n 'emigateway.graphql.query.getClearingErrors': {\n fn: logError.cqrs.getClearingErrors$,\n obj: logError.cqrs\n },\n 'emigateway.graphql.query.getClearingErrorsCount': {\n fn: logError.cqrs.getClearingErrorsCount$,\n obj: logError.cqrs\n },\n 'emigateway.graphql.query.getSettlementErrors': {\n fn: logError.cqrs.getSettlementErrors$,\n obj: logError.cqrs\n },\n 'emigateway.graphql.query.getSettlementErrorsCount': {\n fn: logError.cqrs.getSettlementErrorsCount$,\n obj: logError.cqrs\n },\n 'emigateway.graphql.mutation.changeSettlementState': {\n fn: settlement.cqrs.changeSettlementState$,\n obj: settlement.cqrs\n },\n };\n }", "function registerPage(name, pageFunction) {\n pageFunctions[name] = pageFunction;\n}", "function listen(key, callback) {\n handlers[key] = callback;\n}", "add_press(key, action_func){\n this.press[key] = action_func;\n }", "function setFunctions() {\r\n var commands = [\r\n { command: \"command1\", description: \"description1\" },\r\n { command: \"command2\", description: \"description2\" },\r\n ];\r\n messagePayload.commands = commands;\r\n\r\n console.log(\r\n JSON.stringify(\r\n sendPayload(\"setMyCommands\", messagePayload).getContentText()\r\n )\r\n );\r\n}" ]
[ "0.5627914", "0.5525375", "0.54362535", "0.5414457", "0.5257724", "0.5257337", "0.52383596", "0.5212524", "0.5205943", "0.5189009", "0.51852494", "0.51730436", "0.51723677", "0.5138185", "0.51372784", "0.5110163", "0.50676763", "0.5065058", "0.50540924", "0.5033974", "0.502412", "0.5023353", "0.5021729", "0.50215346", "0.5020863", "0.5012346", "0.49898204", "0.49677792", "0.49629083", "0.49565804", "0.49565804", "0.4937309", "0.49359927", "0.4929553", "0.49192506", "0.4909199", "0.49007246", "0.48939106", "0.4879965", "0.48755273", "0.4866676", "0.48558056", "0.48482054", "0.48482054", "0.4840489", "0.48328945", "0.48290125", "0.4828748", "0.48218894", "0.48093075", "0.4798582", "0.47876084", "0.47787017", "0.47773817", "0.47652185", "0.47644404", "0.47564247", "0.47533134", "0.47497976", "0.47469786", "0.4734691", "0.47194424", "0.47154844", "0.47080162", "0.4707742", "0.47069144", "0.46997377", "0.4697767", "0.46938804", "0.46881875", "0.46799177", "0.46779016", "0.46775666", "0.46749198", "0.46726558", "0.46705842", "0.466744", "0.46603492", "0.4655835", "0.4655835", "0.4650886", "0.4647614", "0.46416512", "0.46260047", "0.46252894", "0.4621983", "0.46214035", "0.46154642", "0.46143433", "0.46069285", "0.45970413", "0.45946082", "0.45881748", "0.45859239", "0.45718223", "0.45717534", "0.45689565", "0.45566073", "0.45528564", "0.4545843", "0.45404944" ]
0.0
-1
sameAs > equate & don't add to index
function newPropertyAction(formula, pred, action) { fyi("newPropertyAction: "+pred); formula.propertyAction[pred] = action; var fixEndA = formula.statementsMatching(undefined, pred, undefined); var i; for (i=0; i<fixEndA.length; i++) { // NOT optimized - sort fixEndA etc // fyi("nePropertyAction: retrospective action for "+st) if (action(formula, fixEndA[i].subject, pred, fixEndA[i].object)) { //@@ kb.remove(st); /// messing up the list we are iterating over?? @@ fyi("newPropertyAction: NOT removing "+fixEndA[i]); } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "withSame(prop, asIdx=-1) {\n\t\tif (this.lastResult === false) return this; //do nothing\n\t\tif (!this.workingList || !this.workingList.length) {\n\t\t\tthis.lastResult = false;\n\t\t\treturn this;\n\t\t}\n\t\tif (asIdx < 0) asIdx = this.matchedItems.length + asIdx;\n\t\tlet list = this.workingList;\n\t\tlet asList = this.matchedItems[asIdx];\n\t\tthis.matchedItems[asIdx] = [];\n\t\tlet keep = new Set();\n\t\tfor (let asItem of asList) {\n\t\t\tlet keepAs = false;\n\t\t\tfor (let item of list) {\n\t\t\t\tif (item === asItem) continue; //skip comparing to itself\n\t\t\t\tif (asItem[prop] === item[prop]) {\n\t\t\t\t\tkeep.add(item);\n\t\t\t\t\tkeepAs = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (keepAs) {\n\t\t\t\tthis.matchedItems[asIdx].push(asItem);\n\t\t\t}\n\t\t}\n\t\tthis.workingList = Array.from(keep);\n\t\tthis.lastResult = (this.workingList.length > 0 && this.matchedItems[asIdx].length > 0);\n\t\treturn this;\n\t}", "eq(other) {\n if (this.ranges.length != other.ranges.length ||\n this.mainIndex != other.mainIndex)\n return false;\n for (let i = 0; i < this.ranges.length; i++)\n if (!this.ranges[i].eq(other.ranges[i]))\n return false;\n return true;\n }", "same(ind, acInd) {\n if (ind === acInd) {\n return true;\n }\n return false;\n }", "_addToIndex (index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {})\n const index2 = index1[key1] || (index1[key1] = {})\n // Setting the key to _any_ value signals the presence of the quad\n const existed = key2 in index2\n\n if (!existed) {\n index2[key2] = null\n }\n\n return !existed\n }", "areInSameSet(firstIndex, secondIndex) {\n return this.getRepresentative(firstIndex) === this.getRepresentative(secondIndex);\n }", "eq(other) { return false; }", "eq(other) { return this.cmp(other) === 0; }", "union(index1, index2) {\n let parent1 = this.findParent(index1);\n let parent2 = this.findParent(index2);\n\n //the bigger set should always win, so that we can avoid flickering when visualising the sets\n if (this.setSizes[parent1] >= this.setSizes[parent2]) {\n this.sets[parent2] = parent1;\n this.setSizes[parent1] += this.setSizes[parent2];\n } else {\n this.sets[parent1] = parent2;\n this.setSizes[parent2] += this.setSizes[parent1];\n }\n }", "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {});\n const index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n const existed = (key2 in index2);\n if (!existed) index2[key2] = null;\n return !existed;\n }", "updateIndex (oplog, added) {\n added.reverse().reduce((handled, item) => {\n if (handled.indexOf(item.payload.key) === -1) {\n handled.push(item.payload.key)\n if (item.payload.op === 'INSERT') {\n this._index[item.payload.id] = item.payload.value\n }\n }\n return handled\n }, [])\n }", "function makeIndex(a, b) {\n let index = Object.create(null);\n\n ((a || []).concat(b ||[])).forEach(function(a) {\n index[a] = true;\n });\n\n return index;\n}", "isIndexReference() {\n return this.isIndex() || this.isRange();\n }", "onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "onlyUnique(value, index, self) {\r\n return self.indexOf(value) === index; \r\n }", "function compareIndexs(_oldIdx, _newIdx){\n\tvar compareObj;\n\tvar toIndex = [];\n\tvar toDelete = [];\n\n\tfor(var i=0,z=_newIdx.length;i<z;i++){\n\t\tcompareObj = _newIdx[i];\n\t\tdelete compareObj.indexTime;\n\t\tif((JSON.stringify(_oldIdx[compareObj.objectID])==JSON.stringify(compareObj))===false){\n\t\t\ttoIndex.push(_newIdx[i]);\n\t\t}\n\t\tif(_oldIdx[compareObj.objectID]){\n\t\t\t_oldIdx[compareObj.objectID].processed = true;\n\t\t}\n\t}\n\n\tfor(var k in _oldIdx){\n\t\tif(!_oldIdx[k].processed){\n\t\t\ttoDelete.push(_oldIdx[k].path);\n\t\t}\n\t}\n\n\treturn {index:toIndex, del:toDelete};\n}", "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n var index1 = index0[key0] || (index0[key0] = {});\n var index2 = index1[key1] || (index1[key1] = {}); // Setting the key to _any_ value signals the presence of the quad\n\n var existed = key2 in index2;\n if (!existed) index2[key2] = null;\n return !existed;\n }", "shouldResetIndex(nextProps) {\n const { suggestions } = this.props;\n if (suggestions.length === 0) {\n return true;\n }\n\n const { index } = this.state;\n if (index >= nextProps.suggestions.length) {\n return true;\n }\n\n const currentId = suggestions[index].pk;\n return nextProps.suggestions[index].pk !== currentId;\n }", "equals(other) {\n return (\n this.batchID === other.batchID &&\n this.vertexID === other.vertexID &&\n this.indexID === other.indexID\n )\n }", "function byDistance(a, b) {\n a = distance(a.index, internal.index);\n b = distance(b.index, internal.index);\n\n if (a === b) {\n return 0;\n } else if (a > b) {\n return 1;\n } else {\n return -1;\n }\n }", "function onlyUnique(value, index, self) { return self.indexOf(value) === index; }", "checkForDuplicates(state, indexDictionary) {\n const data = state.dictionaries[indexDictionary].content;\n\n data.forEach((value) => {\n state.dictionaries[indexDictionary].content = data.map((pair, index) => {\n // Make sure the object is not itself\n if (data.indexOf(pair) !== data.indexOf(value)) {\n if (pair.domain === value.domain && pair.range === value.range) {\n if (\n data[index].validity.status\n && data[index].validity.reason === ''\n ) {\n // Change validity of the pair to false and assign the reason why\n data[index].validity.status = false;\n data[index].validity.reason = reasonNotValid.duplicate;\n }\n }\n }\n return pair;\n });\n });\n }", "equals(other: Face) {\n return this.index === other.index;\n // return this.polyhedron === other.polyhedron && this.index === other.index;\n }", "function compareValues() {\n\n\t\t\t\t// currently does not account for deleted rows...\n\t\t\t\t// but this may not matter - TW might require the cart to be updated after a removal anyways... will require their input\n\n\t\t\t\tif (isCartCheckout || isCartCSR) {\n\n\t\t\t\t\tarrValuesNew[thisIndex] = thisValue;\n\n\t\t\t\t\tvar isSame = arrValuesOriginal.length == arrValuesNew.length && arrValuesOriginal.every(function(element, index) {\n\t\t\t\t\t\treturn element === arrValuesNew[index];\n\t\t\t\t\t});\n\n\t\t\t\t\tif (isSame) {\n\n\t\t\t\t\t\telButtonUpdate.classList.add('disabled');\n\t\t\t\t\t\telButtonFinalize.classList.remove('disabled');\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\telButtonUpdate.classList.remove('disabled');\n\t\t\t\t\t\telButtonFinalize.classList.add('disabled');\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}", "equals(vec){\n return this.x === vec.x && this.y === vec.y;\n }", "function changeExisting(index, name, quant) {\n\n}", "eq(other) {\n if (this.content.length != other.content.length)\n return false;\n for (let i = 0; i < this.content.length; i++)\n if (!this.content[i].eq(other.content[i]))\n return false;\n return true;\n }", "static equalTrans(ta, tb) {\n//----------\nreturn ta[0] === tb[0] && ta[1] === tb[1] && ta[2] === tb[2];\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function Same(arr1, arr2) { \n if (arr1.length !== arr2.length) {\n return false;\n }\n for (var i = 0; i < arr1.length; i++) {\n let corrospondingIndex = arr2.indexOf(arr1[i] ** 2)\n if (corrospondingIndex === -1) {\n return false;\n }\n arr2.splice(corrospondingIndex, 1)\n }\n return true;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "static samePos(a, b) {\r\n return a && b && a.x === b.x && a.y === b.y && a.w === b.w && a.h === b.h;\r\n }", "function neighboring(a, b) {\n console.log(a);\n console.log(b);\n console.log(linkedByIndex);\n return linkedByIndex[a.id + \",\" + b.id] || linkedByIndex[b.id + \",\" + a.id] || a.id == b.id;\n}", "_compareExpandedIndexes(oldIndexes, newIndexes) {\n let indexesToBeCollapsed = [],\n commonIndexes = [],\n indexesToBeExpanded = [],\n oldIndexesCount = oldIndexes.length,\n newIndexesCount = newIndexes.length;\n\n for (let i = 0; i < oldIndexesCount; i++) {\n if (newIndexes.indexOf(oldIndexes[i]) === -1) {\n if (indexesToBeCollapsed.indexOf(oldIndexes[i]) === -1) {\n indexesToBeCollapsed.push(oldIndexes[i]);\n }\n }\n else {\n if (commonIndexes.indexOf(oldIndexes[i]) === -1) {\n commonIndexes.push(oldIndexes[i]);\n }\n }\n }\n\n for (let i = 0; i < newIndexesCount; i++) {\n if (commonIndexes.indexOf(newIndexes[i]) === -1) {\n indexesToBeExpanded.push(newIndexes[i]);\n }\n }\n\n return { collapse: indexesToBeCollapsed, expand: indexesToBeExpanded };\n }", "checkForDuplicates() {\n const alreadyChecked = [];\n for(let list of [this.state.listA, this.state.listB]) {\n for(let row of list) {\n row.isDuplicate = false;\n const duplicate = alreadyChecked.find(otherRow => otherRow.snomed.code === row.snomed.code);\n if (!row.snomed.code || duplicate) {\n row.isDuplicate = true;\n if (duplicate) duplicate.isDuplicate = true;\n } \n alreadyChecked.push(row);\n }\n }\n }", "function onlyUnique(val, idx, array) {// console.log(\"onlyUnique \", array.indexOf(val) === idx);\n return array.indexOf(val) === idx;\n }", "function onlyUnique (value, index, self) {\n return self.indexOf(value) === index\n}", "function same (a, b) {\n\t return a === b || a !== a && b !== b\n\t}", "function onlyUnique(value, index, self) {\r\n\treturn self.indexOf(value) === index;\r\n}", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) return false; // O(1)\n\n for (let i = 0; i < arr1.length; i++) { // O(N)\n let correctIdx = arr2.indexOf(arr1[i] ** 2); // O(N)\n if (correctIdx === -1) return false; // O(1)\n arr2.splice(correctIdx, 1); // O(N)\n }\n return true;\n }", "function onlyUnique(value, index, self) { \r\n return self.indexOf(value) === index;\r\n}", "someOutcomeSelected(outcomeObj){\n return ~Object.values(outcomeObj).indexOf(true)\n }", "addOnIndex(index, value) {\n if (index < 0) {\n console.error(`Index must be greater than 0!`);\n return false;\n }\n\n index = Math.floor(index);\n\n if (this.length <= index) {\n this.add(value);\n } else {\n const temp = this.get(index);\n this.data[index] = value;\n\n for (let i = index + 1; i < this.length; i++) {\n this.data[i + 1] = this.data[i];\n }\n\n this.data[index + 1] = temp;\n this.length++;\n }\n }", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function include(oldvec, ele) {\n let vec = oldvec.slice();\n for (let i = 0; i < vec.length; ++i) {\n if (ele.x == vec[i].x && ele.y == vec[i].y) return true;\n }\n return false;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "set hasMultipleDifferentValues(value) {}", "equals(other) {\n\t\tlet h = super.equals(other);\n\t\tif (typeof h == 'boolean') return h;\n\t\tif (this.m != h.m) return false;\n\t\tfor (let i = 1; i <= this.m; i++) {\n\t\t\tlet x = this.#item[i];\n\t\t\tif (!h.contains(x) || this.key(x) != h.key(x)) return false;\n\t\t\tlet y = h.#item[i];\n\t\t\tif (!this.contains(y) || this.key(y) != h.key(y)) return false;\n\t\t}\n\t\treturn h;\n\t}", "static sameSet(a, b) {\n if (a == b)\n return true;\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].eq(b[i]))\n return false;\n return true;\n }", "avoidDuplicates(p, q) {\r\n var i = this.state.answerIndexes.length;\r\n while (i--) {\r\n if (\r\n (this.state.answerIndexes[i].page === p &&\r\n this.state.answerIndexes[i].qIndex === q) ||\r\n this.state.answerIndexes[i].page === undefined\r\n ) {\r\n this.state.answerIndexes.splice(i, 1);\r\n }\r\n }\r\n }", "function same(arr1, arr2) {\n if(arr1.length !== arr2.length) {\n return false\n }\n\n for (let i = 0; i < arr1.length; i ++) {\n let correctIndex = arr2.indexOf(arr1[i] ** 2)\n if(correctIndex === -1 ){\n return false;\n }\n arr2.splice(correctIndex, 1)\n }\n return true;\n }", "resetIndex() {\n var n = this.data.intervalls.length; \n var index = Array.apply(null, {length: n}).map(Number.call, Number)\n\n this.upsertColumn(\"index\", index);\n\n return true;\n }", "function sameNaive(arr1, arr2){\n if(arr1.length !== arr2.length){\n return false;\n }\n\n for(let i = 0; i < arr1.length; i++){\n let correctIndex = arr2.indexOf(arr1[i] ** 2);\n if(correctIndex == -1){\n return false;\n }\n console.log(arr2);\n arr2.splice(correctIndex, 1);\n }\n return true;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "function naiveSame(arr1, arr2){ // O(n^2)\r\n if(arr1.length !== arr2.length){\r\n return false;\r\n }\r\n for(let i = 0; i < arr1.length; i++){ // O(n)\r\n let correctIdx = arr2.indexOf(arr1[i] ** 2) // nested O(n)\r\n if(correctIdx === -1){\r\n return false;\r\n }\r\n arr2.splice(correctIdx, 1)\r\n }\r\n return true;\r\n}", "_isActive(index,active){return index===active}", "function reindexSquares(target) {\n let targetIndex = squares.indexOf(target),\n empty = squares.find((square) => square.data('index') == 16),\n emptyIndex = squares.indexOf(empty);\n\n squares[targetIndex] = empty;\n squares[emptyIndex] = target;\n }", "uniqueElement (value, index, self) {\n return self.indexOf(value) === index\n }", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0; i < arr1.length; i++) {\n let correctIndex = arr2.indexOf(arr1[i] ** 2)\n if (correctIndex === -1) {\n return false;\n }\n console.log(arr2);\n arr2.splice(correctIndex, 1)\n }\n return true;\n}", "function slowEquals(a, b) {\n let diff = a.length ^ b.length;\n\tfor (let i = 0; i < a.length && i < b.length; i++) {\n\t\tdiff |= a[i] ^ b[i];\n\t}\n\treturn diff === 0;\n}", "function xform(a, b) {\n\tswitch (a.type) {\n\t\tcase Type.NOP: {\n\t\t\tswitch (b.type) {\n\t\t\t\tcase Type.NOP: {\n\t\t\t\t\treturn [nop(), nop()];\n\t\t\t\t}\n\t\t\t\tcase Type.DEL: {\n\t\t\t\t\treturn [del(b.index), nop()];\n\t\t\t\t}\n\t\t\t\tcase Type.INS: {\n\t\t\t\t\treturn [ins(b.index, b.data), nop()];\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase Type.DEL: {\n\t\t\tswitch (b.type) {\n\t\t\t\tcase Type.NOP: {\n\t\t\t\t\treturn [nop(), del(a.index)];\n\t\t\t\t}\n\t\t\t\tcase Type.DEL: {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ta.index < b.index ? [del(a.index), del(b.index - 1)] :\n\t\t\t\t\t\ta.index > b.index ? [del(a.index - 1), del(b.index)] :\n\t\t\t\t\t\t[nop(), nop()]);\n\t\t\t\t}\n\t\t\t\tcase Type.INS: {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ta.index < b.index ? [del(a.index), ins(b.index - 1, b.data)] :\n\t\t\t\t\t\t[del(a.index + 1), ins(b.index, b.data)]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase Type.INS: {\n\t\t\tswitch (b.type) {\n\t\t\t\tcase Type.NOP: {\n\t\t\t\t\treturn [nop(), ins(a.index, a.data)];\n\t\t\t\t}\n\t\t\t\tcase Type.DEL: {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ta.index > b.index ? [ins(a.index - 1, a.data), del(b.index)] :\n\t\t\t\t\t\t[ins(a.index, a.data), del(b.index + 1)]);\n\t\t\t\t}\n\t\t\t\tcase Type.INS: {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ta.index < b.index || a.index === b.index && a.data > b.data ? [ins(a.index, a.data), ins(b.index + 1, b.data)] :\n\t\t\t\t\t\ta.index > b.index || a.index === b.index && a.data < b.data ? [ins(a.index + 1, a.data), ins(b.index, b.data)] :\n\t\t\t\t\t\t[nop(), nop()]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tthrow new Error('pattern matching failed');\n}", "isInsiemeTotalmenteOrdinato(a, b) {\n var a1 = [], b1 = [];\n let index = 0;\n for (let i = 0; i < a.length; i++) {\n if (!a1.includes(a[i])) {\n a1[index] = a[i];\n b1[index] = b[i];\n index++;\n }\n }\n for (let i = 0; i < a1.length; i++) {\n for (let j = 0; j < b1.length; j++) {\n let sx = a1[i];\n let dx = b1[j];\n let match = false;\n if (sx !== dx) {\n for (let k = 0; k < a.length; k++) {\n if ((a[k] === sx && b[k] === dx) || (a[k] === dx && b[k] === sx)) {\n match = true;\n break;\n }\n }\n if (!match)\n return false;\n }\n }\n }\n return true;\n }", "eq(other) { return this == other; }", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n for (let i of arr1) {\n // console.log(i);\n correctIndex = arr2.indexOf(i ** 2); // /** is squared */\n if (correctIndex === -1) {\n return false;\n }\n arr2.splice(correctIndex, 1);\n }\n return true;\n}", "eq(widget) { return false; }", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "function areEqualMappings(a, b) {\n\t return (\n\t // sorted by selectivity\n\t a.generatedColumn == b.generatedColumn &&\n\t a.originalColumn == b.originalColumn &&\n\t a.name == b.name &&\n\t a.generatedLine == b.generatedLine &&\n\t a.originalLine == b.originalLine &&\n\t a.source == b.source\n\t );\n\t}", "function indexEq(a){\r\n for(i in a){\r\n if(a[i]==i)\r\n return true;\r\n }\r\n return false;\r\n}", "syncIndices(action, added = emptyArray$5, removed = emptyArray$5, replaced) {\n const me = this,\n replacedCount = replaced === null || replaced === void 0 ? void 0 : replaced.length; // Only create indices if they have been requested\n\n if (me.dateIndicesRequested) {\n switch (action) {\n case 'clear':\n me._startDateIndex = {};\n me._dateIndex = {};\n break;\n // Add and remove\n\n case 'splice':\n // Handle replacement of records by instances with same ID\n if (replacedCount) {\n added = added.slice();\n removed = removed.slice();\n\n for (let i = 0; i < replacedCount; i++) {\n removed.push(replaced[i][0]);\n added.push(replaced[i][1]);\n }\n }\n\n const addedCount = added.length,\n removedCount = removed.length;\n let dateMS, endDateMS; // Remove entries from indices\n\n if (removedCount) {\n for (let i = 0; i < removedCount; i++) {\n var _DateHelper$clearTime, _outgoingEvent$endDat, _outgoingEvent$endDat2;\n\n const outgoingEvent = removed[i];\n dateMS = (_DateHelper$clearTime = DateHelper.clearTime(outgoingEvent.startDate)) === null || _DateHelper$clearTime === void 0 ? void 0 : _DateHelper$clearTime.getTime();\n endDateMS = (_outgoingEvent$endDat = (_outgoingEvent$endDat2 = outgoingEvent.endDate) === null || _outgoingEvent$endDat2 === void 0 ? void 0 : _outgoingEvent$endDat2.getTime()) !== null && _outgoingEvent$endDat !== void 0 ? _outgoingEvent$endDat : dateMS; // Must handle unscheduled events\n\n if (dateMS) {\n me.removeIndexEntry('startDate', outgoingEvent, DateHelper.makeKey(dateMS));\n\n do {\n me.removeIndexEntry('date', outgoingEvent, DateHelper.makeKey(dateMS));\n dateMS += MS_PER_DAY$1;\n } while (dateMS < endDateMS);\n }\n }\n } // Add entries to indices\n\n if (addedCount) {\n for (let i = 0; i < addedCount; i++) {\n const newEvent = added[i]; // Can only be date-indexed if it's scheduled\n\n if (newEvent.isScheduled) {\n var _DateHelper$clearTime2, _newEvent$endDate$get, _newEvent$endDate;\n\n dateMS = (_DateHelper$clearTime2 = DateHelper.clearTime(newEvent.startDate)) === null || _DateHelper$clearTime2 === void 0 ? void 0 : _DateHelper$clearTime2.getTime();\n endDateMS = (_newEvent$endDate$get = (_newEvent$endDate = newEvent.endDate) === null || _newEvent$endDate === void 0 ? void 0 : _newEvent$endDate.getTime()) !== null && _newEvent$endDate$get !== void 0 ? _newEvent$endDate$get : dateMS; // Must handle unscheduled events\n\n if (dateMS) {\n me.addIndexEntry('startDate', newEvent, DateHelper.makeKey(dateMS));\n\n do {\n me.addIndexEntry('date', newEvent, DateHelper.makeKey(dateMS));\n dateMS += MS_PER_DAY$1;\n } while (dateMS < endDateMS);\n }\n }\n }\n }\n\n break;\n }\n }\n }", "function compare(a, b) {\n if (a.index < b.index)\n return -1;\n else (a.index > b.index)\n return 1;\n }", "function compare(a, b) {\n if (a.index < b.index)\n return -1;\n else (a.index > b.index)\n return 1;\n }", "function same(arr1, arr2){\n if(arr1.length !== arr2.length){\n return false;\n }\n for(let i = 0; i < arr1.length; i++){\n let correctIndex = arr2.indexOf(arr1[i] ** 2)\n if(correctIndex === -1) {\n return false;\n }\n console.log(arr2);\n arr2.splice(correctIndex,1)\n }\n return true;\n}", "function same(arr1, arr2){\n if(arr1.length !== arr2.length){\n return false;\n }\n for(let i = 0; i < arr1.length; i++){\n let correctIndex = arr2.indexOf(arr1[i] ** 2)\n if(correctIndex === -1) {\n return false;\n }\n console.log(arr2);\n arr2.splice(correctIndex,1)\n }\n return true;\n}", "function mySolution(arr1, arr2) {\r\n let newArr1 = [];\r\n arr1.map((item, index) => newArr1.push({\r\n 'price': item,\r\n 'index': index,\r\n 'isArr1': true\r\n }));\r\n let newArr2 = [];\r\n arr2.map((item, index) => newArr2.push({\r\n 'price': item,\r\n 'index': index,\r\n 'isArr1': false\r\n }));\r\n newArr1.push(...newArr2);\r\n let myArr = newArr1.slice(0);\r\n myArr.sort((a, b) => {\r\n return a.price - b.price;\r\n });\r\n console.log('sorted Arr: ', myArr);\r\n let minDiffPrice = 1000000;\r\n let tempItem;\r\n let newArr1Index = 0;\r\n let newArr2Index = 0;\r\n myArr.map(item => {\r\n // init\r\n if (minDiffPrice === 1000000) {\r\n tempItem = item;\r\n tempItem.isArr1 ? newArr1Index = tempItem.index : newArr2Index = tempItem.index;\r\n minDiffPrice--;\r\n } else {\r\n if ((item.price - tempItem.price) < minDiffPrice && item.isArr1 !== tempItem.isArr1) {\r\n // need to update\r\n tempItem.isArr1 ? newArr1Index = tempItem.index : newArr2Index = tempItem.index;\r\n minDiffPrice = item.price - tempItem.price;\r\n tempItem = item;\r\n console.log('diffPrice: ' + minDiffPrice);\r\n tempItem.isArr1 ? newArr1Index = tempItem.index : newArr2Index = tempItem.index;\r\n // console.log([newArr1Index, newArr2Index]);\r\n } else if (item.isArr1 === tempItem.isArr1) {\r\n tempItem = item;\r\n }\r\n }\r\n });\r\n return [newArr1Index, newArr2Index];\r\n}", "function unsafeUpdateAt_(as, i, a) {\n if (as[i] === a) {\n return as;\n } else {\n const xs = [...as];\n xs[i] = a;\n return xs;\n }\n}", "rebuildIndices() {\n const me = this,\n isFiltered = me.isFiltered,\n indices = me._indices || (me._indices = {}),\n keyProps = Object.keys(indices),\n indexCount = keyProps.length,\n values = me._values;\n let filteredIndices;\n\n if (isFiltered) {\n filteredIndices = indices[filteredIndicesProperty] = {};\n } // First, clear indices.\n\n for (let i = 0; i < indexCount; i++) {\n const index = indices[keyProps[i]];\n index.clear();\n\n if (isFiltered) {\n let filteredIndex = filteredIndices[keyProps[i]];\n\n if (filteredIndex) {\n filteredIndex.clear();\n } else {\n filteredIndex = filteredIndices[keyProps[i]] = new Map(); // Piggyback config\n\n filteredIndex.unique = index.unique;\n }\n }\n }\n\n doRebuildIndices(values, indices, keyProps, indexCount); // Create a parallel lookup structure into the _filteredValues\n\n if (isFiltered) {\n doRebuildIndices(me._filteredValues, filteredIndices, keyProps, indexCount);\n }\n\n me._indicesInvalid = false;\n }", "function unique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function unique(value, index, self) {\n return self.indexOf(value) === index;\n}", "_removeFromIndex (index0, key0, key1, key2) {\n // Remove the quad from the index\n const index1 = index0[key0]\n const index2 = index1[key1]\n delete index2[key2]\n\n // Remove intermediary index layers if they are empty\n for (const key in index2) { // eslint-disable-line no-unreachable-loop\n return\n }\n\n delete index1[key1]\n\n for (const key in index1) { // eslint-disable-line no-unreachable-loop\n return\n }\n\n delete index0[key0]\n }", "function onlyUnique(value, index, self) {\n\t\t\treturn self.indexOf(value) === index;\n\t\t}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n }", "static eq(oldSets, newSets, from = 0, to) {\n if (to == null)\n to = 1000000000 /* C.Far */ - 1;\n let a = oldSets.filter(set => !set.isEmpty && newSets.indexOf(set) < 0);\n let b = newSets.filter(set => !set.isEmpty && oldSets.indexOf(set) < 0);\n if (a.length != b.length)\n return false;\n if (!a.length)\n return true;\n let sharedChunks = findSharedChunks(a, b);\n let sideA = new SpanCursor(a, sharedChunks, 0).goto(from), sideB = new SpanCursor(b, sharedChunks, 0).goto(from);\n for (;;) {\n if (sideA.to != sideB.to ||\n !sameValues(sideA.active, sideB.active) ||\n sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))\n return false;\n if (sideA.to > to)\n return true;\n sideA.next();\n sideB.next();\n }\n }", "function uniqesOnly(value, index, self){\n return self.indexOf(value) === index;\n}", "function onSameRow(a, b) {\n return (\n // Occupies the same start slot.\n Math.abs(b.start - a.start) <= 30 ||\n // A's start slot overlaps with b's end slot.\n (a.start > b.start && a.start < b.end)\n )\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}", "function onlyUnique(value, index, self) {\n return self.indexOf(value) === index;\n}" ]
[ "0.6037506", "0.580586", "0.5797484", "0.5676205", "0.56560546", "0.564569", "0.56439006", "0.562467", "0.56232196", "0.56133205", "0.5601093", "0.5587284", "0.5566395", "0.5553829", "0.5515353", "0.5496653", "0.54673785", "0.5428805", "0.5421583", "0.53992003", "0.5377644", "0.5349749", "0.5344563", "0.5328513", "0.53270394", "0.53238785", "0.52918756", "0.52918047", "0.52906126", "0.52824044", "0.52660084", "0.52472097", "0.5239366", "0.52352965", "0.52307665", "0.5208217", "0.51893634", "0.51814634", "0.51770276", "0.5174246", "0.5171826", "0.5170725", "0.51628745", "0.5161695", "0.5161695", "0.5161695", "0.5161695", "0.5161695", "0.5158909", "0.5155399", "0.51530504", "0.51314616", "0.51314616", "0.51314616", "0.51314616", "0.51314616", "0.5131071", "0.5129581", "0.51295125", "0.5127034", "0.5116809", "0.5113389", "0.5112156", "0.5109351", "0.5109351", "0.5102783", "0.51007086", "0.5097434", "0.5097232", "0.5089924", "0.5085499", "0.50832033", "0.5074483", "0.50691193", "0.50674796", "0.5056357", "0.50562227", "0.50562227", "0.50562227", "0.50562227", "0.5054501", "0.50515795", "0.504975", "0.5048347", "0.50461894", "0.50461894", "0.50458354", "0.50458354", "0.5044958", "0.50392914", "0.5034615", "0.5033356", "0.5033356", "0.5033352", "0.5031194", "0.503101", "0.5029792", "0.50272244", "0.5023885", "0.50238067", "0.50238067" ]
0.0
-1
FP => handleFP, do add to index
function handle_IFP(formula, subj, pred, obj) { var s1 = formula.any(undefined, pred, obj); if (typeof s1 == 'undefined') return false; // First time with this value formula.equate(s1, subj); return true; } //handle_IFP
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waAddFIProcess(pv_action,pv_details) {\nvar callType=\"page\"; //used in call to waLinkClick function\n\tif(!wa.containerPageName) {\twaCaptureContainerVariables(\"capture\"); }\n\n\ts.prop7=\"fi:\"+pv_action;\n\tif(pv_details) { \n\t\tpv_details=pv_details.toLowerCase();\n\t\ts.prop7=s.prop7+\"_\"+pv_details;\n\t}\n\t\n\t//do not change page names if sysmsg\n\tif(pv_action==\"sysmsg\") {\n\t\tif(pv_details==\"success\") { wa.events=\"event37\"; }\t//send on SUCCESSFUL fi add\n\t\tcallType=\"link\";\n\t} \n\telse {\n\t\tpv_action=pv_action.toLowerCase();\n\t\twa.pageDetail=pv_action;\n\t\twaSetDefaultVariables();\n\t\t\n\t\tswitch(pv_action) {\n\t\t\tcase \"searchfi\":\t\twa.events=\"event12\";break;\n\t\t\tcase \"selectfi\":\t\tbreak;\n\t\t\tcase \"addfi\":\t\t\t\n\t\t\t\twa.events=\"event11,event10\"; //represents addfi ATTEMPT\n\t\t\t\t//if(!wa.createMboxFIAttempt) {\n\t\t\t\t//\tmboxDefine('offermatica-div','mint_addfiattempt_metrics');\n\t\t\t\t//\twa.createMboxFIAttempt=true;\n\t\t\t\t//}\n\t\t\t\t//mboxUpdate('mint_addfiattempt_metrics');\n\t\t\t\tbreak;\n\t\t\tcase \"verify identity\":\tbreak;\n\t\t\tdefault:\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\twaLinkClick(this,pv_action,callType);\n\twa.events=s.events=s.prop7=\"\";\n}", "async function addToIndex(topic, filepath, filename) {\n try {\n const filedata = await fs.readFileSync(filepath, 'utf8');\n // add file to ipfs\n const r = await Publisher.pin(filedata);\n // put object into index\n const obj = new Obj(r[0].hash, filename, filedata);\n // add to hashes-table \n global.hashes[obj.hash] = obj.file;\n global.indices[topic].addDoc(obj);\n // add to our list\n if (global.ipfsearch.hostedFiles[topic] === undefined) {\n global.ipfsearch.hostedFiles[topic] = [];\n }\n global.ipfsearch.hostedFiles[topic].push({'n': filename, 'h': r[0].hash})\n } catch (error) {\n iLog(`Error : File ${filename} has not been added to the index`);\n iLog(`Reason: ${error}`);\n }\n return global.indices[topic];\n}", "function addVirtual(fo,es) {\n\t\tvar p = -2;\n\t\twhile (fls[fo][p]) p--;\n\t\tes.pos = p;\n\t\tfls[fo][p] = es;\n\t\treturn p;\n\t}", "function add_file_of_point(uid, fobj) {\n var tmp={\"uid\":uid,\"file\":fobj.name};\n ucvm_point_file_list.push(tmp);\n}", "indexAdd({ commit, dispatch }, sessionId) {\n commit(types.INDEX_ADD, sessionId);\n\n //preload logic\n //disabled for now\n if(!didPreload) {\n if(preloadTimeout) {\n clearTimeout(preloadTimeout);\n }\n\n preloadTimeout = setTimeout(() => {\n dispatch('preloadIndex');\n }, 500)\n }\n }", "updateIndex (oplog, added) {\n added.reverse().reduce((handled, item) => {\n if (handled.indexOf(item.payload.key) === -1) {\n handled.push(item.payload.key)\n if (item.payload.op === 'INSERT') {\n this._index[item.payload.id] = item.payload.value\n }\n }\n return handled\n }, [])\n }", "enterFplist(ctx) {\n\t}", "add(filename) {\n if (this.index.length == this.max)\n this.remove(this.index.shift());\n this.index.push(filename);\n if (DEBUG) console.log(`Added ${join(this.path, filename)}`);\n }", "function FSStorage() {\n function getDivs(props) {\n console.log(\"in DB getDivs\", props)\n\n\n // Update the search index every time a blog post is written.\n//exports.onNoteCreated = functions.firestore.document('notes/{noteId}').onCreate((snap, context) => {\n // Get the note document\n // const note = snap.data();\n\n // Add an 'objectID' field which Algolia requires\n // note.objectID = context.params.noteId;\n\n // Write to the algolia index\n // const index = client.initIndex(ALGOLIA_INDEX_NAME);\n //return index.saveObject(note);\n//});\n// [END update_index_function]\n }\n\n function updateDivs(props) {\n console.log(\"in DB\")\n}\n}", "function AddToChart(index) {\n var dataToAdd = fileData[index];\n console.log(\"Adding\", index, dataToAdd.name);\n if (!Exists(fileData.tableIndex)) {\n dataToAdd.tableIndex = index;\n }\n if (inChart.length > 0 && $.grep(inChart, function (a) { return a.tableIndex == index; }).length != 0) {\n console.warn(\"Already in chart\");\n } else if (inChart.length > 0 && !DataParser.MatchingEvents(inChart[0], dataToAdd)) {\n console.warn(\"Incompatable\");\n } else {\n inChart.push(dataToAdd);\n UpdateChart();\n }\n}", "function redsIndex_cb(f_err, list) {\n\t\t\tif (!f_err) {\n\t\t\t\t/* index important values from favorite object */\n\t\t\t\tredsindex(list, req.session.user.id_str); //verify if this is blocking and should be done async\n\t\t\t\t/* format favorite object to pull out only relevant info to send client */\n\t\t\t\trender(list, render_cb);\n\t\t\t}\n\t\t}", "function handleAdd() {\n let newId = docs.length + 1;\n setDocs([\n ...docs,\n {\n id: newId,\n title: `Boleto ${newId}`,\n description: `Descrição do boleto ${newId}`\n }\n ]);\n }", "insert(priority, data) {\n this.fpq.add({priority, data});\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}", "function handleAddWaypoint(newWaypointIndex) {\n\t\t\twaypoint.addWaypoint(newWaypointIndex);\n\n\t\t\t//re-calculate type of last (now next-to-last) waypoint\n\t\t\tvar index = waypoint.getNumWaypoints() - 2;\n\t\t\tvar type = waypoint.determineWaypointType(index);\n\t\t\tui.setWaypointType(index, type);\n\n\t\t\tvar featureId = ui.getFeatureIdOfWaypoint(index);\n\t\t\tvar newId = map.setWaypointType(featureId, type);\n\t\t\tvar position = map.convertFeatureIdToPositionString(newId, map.ROUTE_POINTS);\n\t\t\tui.setWaypointFeatureId(index, newId, position, map.ROUTE_POINTS);\n\t\t}", "addOnIndex(index, value) {\n if (index < 0) {\n console.error(`Index must be greater than 0!`);\n return false;\n }\n\n index = Math.floor(index);\n\n if (this.length <= index) {\n this.add(value);\n } else {\n const temp = this.get(index);\n this.data[index] = value;\n\n for (let i = index + 1; i < this.length; i++) {\n this.data[i + 1] = this.data[i];\n }\n\n this.data[index + 1] = temp;\n this.length++;\n }\n }", "function postAdd(newData, n0, n1) {\n\t indexListeners.forEach(function(l) { l(newValues, newIndex, n0, n1); });\n\t newValues = newIndex = null;\n\t }", "function addFileToQueue (f) {\n\tfor (var i = 0; i < stats.fileQueue.length; i++) { //see if it's already on the queue\n\t\tif (stats.fileQueue [i].f == f) {\n\t\t\treturn;\n\t\t\t}\n\t\t}\n\tstats.fileQueue [stats.fileQueue.length] = {\n\t\tf: f\n\t\t}\n\t}", "onIndexDataEvent(fn) {\n\n this.eventEmitter.on(settings.socket.indexDataEvent, (data) => {\n\n fn(data);\n\n });\n }", "function addDataToIndex(data){\n\t\t\t\t\t\tif ($scope.mmShowType) {\n\t\t\t\t\t\t\tcreateIndexWithType(data);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcreateIndex(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcreateTypedModel();\n\t\t\t\t\t\tif(!$scope.mmModel.fullObjects){\n\t\t\t\t\t\t\t$scope.mmModel.fullObjects = {};\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function postAdd(newData, n0, n1) {\n indexListeners.forEach(function(l) { l(newValues, newIndex, n0, n1); });\n newValues = newIndex = null;\n }", "function SmpFrqIndex(sample_freq, gpf) {\n switch (sample_freq) {\n case 44100:\n gpf.version = 1;\n return 0;\n case 48000:\n gpf.version = 1;\n return 1;\n case 32000:\n gpf.version = 1;\n return 2;\n case 22050:\n gpf.version = 0;\n return 0;\n case 24000:\n gpf.version = 0;\n return 1;\n case 16000:\n gpf.version = 0;\n return 2;\n case 11025:\n gpf.version = 0;\n return 0;\n case 12000:\n gpf.version = 0;\n return 1;\n case 8000:\n gpf.version = 0;\n return 2;\n default:\n gpf.version = 0;\n return -1;\n }\n }", "function SmpFrqIndex(sample_freq, gpf) {\n switch (sample_freq) {\n case 44100:\n gpf.version = 1;\n return 0;\n case 48000:\n gpf.version = 1;\n return 1;\n case 32000:\n gpf.version = 1;\n return 2;\n case 22050:\n gpf.version = 0;\n return 0;\n case 24000:\n gpf.version = 0;\n return 1;\n case 16000:\n gpf.version = 0;\n return 2;\n case 11025:\n gpf.version = 0;\n return 0;\n case 12000:\n gpf.version = 0;\n return 1;\n case 8000:\n gpf.version = 0;\n return 2;\n default:\n gpf.version = 0;\n return -1;\n }\n }", "function handleFiltro(index){\n setFiltroIndex(index);\n \n }", "function register_click(hit_index) {\r\n const hit = hit_results[hit_index];\r\n show_doc(hit);\r\n update_clicks_for_document(hit[\"_id\"]);\r\n update_topic_preferences(hit[\"_source\"][\"category_probs\"]);\r\n console.log(\"hit: \", hit);\r\n update_geo_preferences(hit[\"_source\"][\"geography_probs\"]);\r\n}", "async function addToIndex(body) {\n await client\n .index({\n index,\n body,\n })\n .catch((err) => {\n console.log(\"Error during addToIndex for file: \" + JSON.stringify(body));\n console.log(err);\n });\n}", "function handleSlide() {\n let index = document.getElementsByClassName('swiper-slide-active')[0].getAttribute(\"itemRef\");\n\n setTName(trackNameArr[index]);\n\n if (trackFeature) {\n\n let tFeature = trackFeature.audio_features[index];\n dispatch({\n type: 'UPDATE_FEATURES',\n data: [tFeature.danceability, tFeature.energy, tFeature.speechiness, tFeature.acousticness, tFeature.instrumentalness, tFeature.liveness]\n });\n }\n }", "post(req, res) {\n // Count the hits\n config.TOTAL_HITS++;\n\n // Validate if all required fields have been transmitted and\n // returns 'Bad Request' if not all required data has been passed\n if (!req.body || !req.body.cpf || !req.body.name || !req.body.cpf || !req.body.blackList)\n return res.status(400).send('Bad request: cpf and others data are required!');\n \n // Validate CPF\n if (CPF.validate(req.body.cpf)) {\n // If CPF is masked, remove the mask\n if (CPF.isMasked(req.body.cpf))\n req.body.cpf = CPF.unMask(req.body.cpf);\n \n // Returns 'Bad Request' if data already exists\n CpfsModel.findOne({where: {cpf: req.body.cpf}}).then(registers => {\n if (registers != null || registers.dataValues) {\n // Returns location of the resource and\n // 'Bad Request' if data already exists\n res.location('/cpfs/'+ registers.id);\n return res.status(409).send('Bad request: only one cpf registry is permitted!');\n }\n });\n\n // Try to create the record\n CpfsModel.create(req.body).then(registers => {\n if (!registers)\n // In case of error, return error 500\n return res.status(500).send('Error on created register!');\n\n // Creates the record, returns your location and the data saved\n res.location('/cpfs/' + registers.id);\n // Insert the mask\n registers.cpf = CPF.mask(registers.cpf);\n return res.status(201).json(registers.get());\n });\n }\n else\n // Return to Invalid CPF\n return res.status(400).send('Bad Request: CPF is not valid!');\n }", "addDataToFront(data) {}", "function add_event() {\n search_submit();\n //activeLoadMore();\n activeHistory();\n}", "function handleChange(e, index, custom_index = null) {\n onFieldChange(index, custom_index, e);\n }", "onAddListPlanItem(e, index, key) {\n\t\tvar { header } = this.state;\n\t\tvar new_item = {\n\t\t\ttitle: 'New Option',\n\t\t\tno_title: 'Nytt alternativ'\n\t\t};\n\t\theader.list.items[index].options[key].items.push(new_item);\n\t\tthis.setState({ header });\n\t}", "function add_ex(list){\n var wo_id = list.attr('data-wo_id');\n var form_meta = \"#id_excercises-\" + wo_id +\"-TOTAL_FORMS\";\n alert(form_meta);\n var index = $(form_meta).val();\n alert(index);\n //create the new excercise list item\n var new_ex = $('#to_clone').find('.blank_ex').clone();\n new_ex.html(new_ex.html().replace(/-0-/g, \"-\"+index+\"-\"));\n new_ex.html(new_ex.html().replace(/\\[WO\\]/g, wo_id));\n new_ex.html(new_ex.html().replace(/\\[INDEX\\]/g, list.children().length));\n \n list.append(new_ex);\n //change the form meta data\n $(form_meta).val(parseInt(index)+1);\n}", "function addFee(fcode,fsched,fperiod,fqty,finvoice) // Adds a single fee, optional argument: fCap\r\n{\r\n\t// Updated Script will return feeSeq number or null if error encountered (SR5112) \r\n\tvar feeCap = capId;\r\n\tvar feeCapMessage = \"\";\r\n\tvar feeSeq_L = new Array();\t\t\t\t// invoicing fee for CAP in args\r\n\tvar paymentPeriod_L = new Array();\t\t\t// invoicing pay periods for CAP in args\r\n\tvar feeSeq = null;\r\n\tif (arguments.length > 5) \r\n\t\t{\r\n\t\tfeeCap = arguments[5]; // use cap ID specified in args\r\n\t\tfeeCapMessage = \" to specified CAP\";\r\n\t\t}\r\n\t\r\n\tassessFeeResult = aa.finance.createFeeItem(feeCap,fsched,fcode,fperiod,fqty);\r\n\tif (assessFeeResult.getSuccess())\r\n\t\t{\r\n\t\tfeeSeq = assessFeeResult.getOutput();\r\n\t\tlogMessage(\"Successfully added Fee \" + fcode + \", Qty \" + fqty + feeCapMessage);\r\n\t\tlogDebug(\"The assessed fee Sequence Number \" + feeSeq + feeCapMessage);\r\n\t\r\n\t\tif (finvoice == \"Y\" && arguments.length == 5) // use current CAP\r\n\t\t\t{\r\n\t\t\tfeeSeqList.push(feeSeq);\r\n\t\t\tpaymentPeriodList.push(fperiod);\r\n\t\t\t}\r\n\t\tif (finvoice == \"Y\" && arguments.length > 5) // use CAP in args\r\n\t\t\t{\r\n\t\t\tfeeSeq_L.push(feeSeq);\r\n\t\t\tpaymentPeriod_L.push(fperiod);\r\n\t\t\tvar invoiceResult_L = aa.finance.createInvoice(feeCap, feeSeq_L, paymentPeriod_L);\r\n\t\t\tif (invoiceResult_L.getSuccess())\r\n\t\t\t\tlogMessage(\"Invoicing assessed fee items\" + feeCapMessage + \" is successful.\");\r\n\t\t\telse\r\n\t\t\t\tlogDebug(\"**ERROR: Invoicing the fee items assessed\" + feeCapMessage + \" was not successful. Reason: \" + invoiceResult.getErrorMessage());\r\n\t\t\t}\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tlogDebug( \"**ERROR: assessing fee (\" + fcode + \"): \" + assessFeeResult.getErrorMessage());\r\n\t\tfeeSeq = null;\r\n\t\t}\r\n\t\r\n\treturn feeSeq;\r\n \r\n}", "function _file (index) {\n\n\t\t\t\tthis.index = index;\n\t\t\t\t// initialize file\n\t\t\t\tthis.status = 1;\n\t\t\t\t// triggle callback list\n\t\t\t\tthis.Events = [];\n\n\t\t\t}", "function addWaypoint(index) {\n\t\tif (index) {\n\t\t\twaypointsSet.splice(index, 0, false);\n\t\t\trequestCounterWaypoints.splice(index, 0, 0);\n\t\t} else {\n\t\t\twaypointsSet.push(false);\n\t\t\trequestCounterWaypoints.push(0);\n\t\t}\n\t}", "addRowFilter() {\n const selectedFileSourceDefaults = this.get('selectedFileSourceDefaults');\n this.send('addPolicyFileSource', selectedFileSourceDefaults);\n scheduleOnce('afterRender', this, '_scrollToAddSelectedFileTypeBtn');\n }", "async saveCurentIndex(newStep, filename) {\n\n this.check()\n await this.storage.saveIndex(newStep, filename)\n }", "function saveFSPoint(){\n\t// reset point \n\tcurrent_fs_bd = [];\n\tcurrent_fs_bd.push(point_fs.lon);\n\tcurrent_fs_bd.push(point_fs.lat);\n\t\n\toutputSaveProgress();\n}", "addField (fieldName) {\n if (this._isOptimized) {\n throw new Error('Cannot add a field to an already-optimized index.');\n }\n\n fieldName = this._intern(fieldName);\n this._fields[`${fieldName}`] = {\n terms: {},\n documents: {}\n };\n\n this._index[`${fieldName}`] = {};\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 }", "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 _addf( endpoint ){\n\n\tvar files = commander.rawArgs.slice(4);\n\n\tconsole.log(\"_addf\", \"endpoint:\", endpoint, \"files:\", files );\n\n\tvar app = endpoint.split('/')[1];\n\tconsole.log('@addf app', app);\n\t\n\treturn;\n\n\tvar file = path.normalize(scriptfile);\n\tvar info = path.parse(file);\n\n\tif( !cloudfn.utils.is_readable(file) ) return false;\n\tif( !cloudfn.utils.is_javascript(file)) return false;\n\n\tprepareSecureRequest( (userconfig, hash) => {\n\n\t\tvar url = [remote, '@', 'a', userconfig.username, hash].join('/');\n\t\tconsole.log('@add url', url);\n\n\t\tvar formData = {file:fs.createReadStream( file ), name:info.name};\n\n\t\tconsole.log( chalk.green(\"Adding \") + chalk.blue(file)+ \" to server...\" );\n\n\t\trequest.post({url:url, formData: formData}, (err, httpResponse, body) => {\n\t\t\tparse_net_response(err, httpResponse, body, (body) => {\n\t\t\t\tconsole.log('OK Server response:', body);\n\t\t\t\t// TODO: Parse response to determine success\n\t\t\t\t// TODO: Print test instructions (curl or httpie) \n\t\t\t});\n\t\t});\n\t\t\n\t});\n}", "function _updateFrequency (f) {\n\t\t\n\t}", "async addPointsToHFEvent(eventId, fields, points) {\n const res = await this.post('events/' + eventId + '/series',\n {\n format: 'flatJSON',\n fields: fields,\n points: points\n });\n if (!res.status === 'ok') {\n throw new Error('Failed loading serie: ' + JSON.stringify(res.status));\n }\n return res;\n }", "function handleDone(e,index){ \n // Creating copy of existing data\n const tempItems = [...items];\n\n // modify item as done\n tempItems[index].isDone = true;\n\n setaddItems(tempItems);\n \n //e.preventDefault()\n }", "addRoutePoint (routePoint, index = -1)\n {\n if (index == -1)\n {\n this.route.points.push(routePoint);\n index = this.route.points.length - 1;\n }\n else\n {\n this.route.points.splice(index, 0, routePoint);\n }\n\n routePoint.setOwner(this);\n routePoint.index = index;\n\n for (var i = index + 1; i < this.route.points.length; i++)\n {\n this.route.points[i].index = i;\n }\n\n // Send events after all operation finished, or in callback it will get incorrect value.\n this.sendEvent(SceneObjectEvent.ROUTE_POINT_ADDED, routePoint);\n for (var i = index + 1; i < this.route.points.length; i++)\n {\n this.route.points[i].sendEvent(ObjectEvent.VALUE_CHANGED, new Set([\"index\"]));\n }\n\n routePoint.afterAdded();\n }", "function fdbForEach( index, term, callback ) {\n return new Promise( async ( resolve, reject ) => {\n const pending = [];\n const request = cx.openIndex( index, term );\n request.onsuccess = ( e ) => {\n const cursor = e.target.result;\n if( cursor ) {\n const { value } = cursor;\n pending.push( callback( value ) );\n cursor.continue();\n }\n else Promise.all( pending ).then( resolve );\n };\n request.onerror = () => reject( request.error );\n });\n }", "async function addDataToElastic(){\n await Helper.deleteIdentifierURLs(config.ORIGINAL_SITEMAP);\n const [indexed_urls, indexed_fis] = await Handler.convertDataFromSitemap();\n\n // Create Elasticsearch client and an index\n /*const client = Elastic.createElasticsearchClient(config.ELASTICSEARCH_HOST);\n Elastic.createElasticsearchIndex(client, config.URL_INDEX);\n Elastic.createElasticsearchIndex(client, config.FRAGMENT_IDENTIFIER_INDEX);\n\n\n // Add data in bulk mode to Elasticsearch\n Elastic.addDataInBulkMode(client, indexed_urls, config.URL_INDEX, config.URL_TYPE);\n Elastic.addDataInBulkMode(client, indexed_fis, config.FRAGMENT_IDENTIFIER_INDEX, config.FRAGMENT_IDENTIFIER_TYPE);*/\n}", "function addFrom(sender, eventArgs) {\n\n currentRowIndex = eventArgs.get_itemIndexHierarchical();\n\n var ary = [];\n\n ary[1] = FromTypeTableView.get_dataItems()[currentRowIndex].findElement(\"FORM_NAME\").value;\n ary[2] = FromTypeTableView.get_dataItems()[currentRowIndex].findElement(\"FILE_NAME\").value;\n ary[0] = eventArgs._tableView._element.parentNode.children[0].control._dataItems[currentRowIndex]._dataItem.FORM_ID;\n\n if (ary[0] == \"\" || ary[0] == 'null') ary[0] = 0;\n\n try {\n CRM.WebApp.webservice.FromMasterWebService.InsertUpdateFromMaster(ary);\n alert('Record Save Successfully');\n CRM.WebApp.webservice.FromMasterWebService.GetFromDetail(0, FromTypeTableView.get_pageSize(), FromTypeTableView.get_sortExpressions().toString(), FromTypeTableView.get_filterExpressions().toDynamicLinq(), updatefromdetail);\n\n }\n catch (e) {\n alert('Wrong Data Inserted');\n }\n}", "addAt(index, data) {\n var node = new Node(data);\n\n if (index < 0 || index > this.size) {\n console.log(\"this index \" + index + \"th position is not from current list position 0 to \" + this. size);\n this.size--;\n }else if (index == 0) {\n this.addStart(data);\n this.size--;\n }else if (index == this.size) {\n this.add(data);\n this.size--;\n }else {\n var temp = this.head;\n for (var i = 0; i < index - 1; i++) {\n temp = temp.next;\n }\n\n //updating new nodes pointer to next node\n node.next = temp.next;\n //updating previous node's pointer to new node\n temp.next = node;\n }\n this.size++;\n }", "function create(req, res) {\n Flight.findById((req.params.id), function(err, flight) {\n req.body.index = flight.destinations.length;\n flight.destinations.push(req.body);\n flight.save(function(err) {\n res.redirect(`/flights/${flight._id}`);\n });\n });\n}", "function tuio_object_add(sid, fid, x, y, a) {\n TuioManager.fiducials[id] = new TuioFiducial(id, x, y, angle);\n TuioManager.listeners.fiducialAdded(TuioManager.fiducials[id]);\n}", "freeByCpf(req, res) {\n // Count the hits\n config.TOTAL_HITS++;\n\n // Validate CPF\n if (CPF.validate(req.params.cpf)) {\n\n // If CPF is masked, remove the mask\n if (CPF.isMasked(req.params.cpf))\n req.params.cpf = CPF.unMask(req.params.cpf);\n\n // Update to CPF blocked\n CpfsModel.update(\n { blackList: \"free\" },\n { where: {cpf : req.params.cpf} }\n ).then(registers => {\n res.location('/cpfs/' + req.params.cpf);\n return res.status(204).json('Successfully updated registration!');\n });\n }\n else\n return res.status(404).send('Bad Request: CPF not found!');\n }", "function _trackFID() {\n\t onFID(metric => {\n\t const entry = metric.entries.pop();\n\t if (!entry) {\n\t return;\n\t }\n\n\t const timeOrigin = msToSec(browserPerformanceTimeOrigin );\n\t const startTime = msToSec(entry.startTime);\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FID');\n\t _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n\t _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n\t });\n\t}", "handleAddSubmit() {}", "async function addIndexedData(data) {\r\n // Open up a transaction as usual\r\n var objectStore = db.transaction(['jobs'], \"readwrite\").objectStore('jobs');\r\n\r\n // Create another request that inserts the item back into the database\r\n var updateTitleRequest = objectStore.put(data, 1);\r\n\r\n // Log the transaction that originated this request\r\n console.log(\"The transaction that originated this request is \" + updateTitleRequest.transaction);\r\n\r\n // When this new request succeeds, run the displayData() function again to update the display\r\n updateTitleRequest.onsuccess = function () {\r\n console.log(\"SUCCESS!!!! WOOOHOOOO\");\r\n };\r\n}", "update(context,plist,bufferType,newData) {}", "function handleNewClick() {\n const newDoc = stubNewDocument()\n addUpdate(newDoc)\n appendToExtendedData([newDoc])\n }", "function handleIndexMsg(msg, id, storage, routing_table, awaiting_acks, ip_address, port, socket) {\n ackRoute(msg.target_id, msg.sender_id, id, routing_table, ip_address, port, socket);\n route(msg.target_id, id, routing_table, function(route_id) {\n if (route_id === id) {\n if (!storage[msg.keyword]) storage[msg.keyword] = [];\n for (var link in storage[msg.keyword]) {\n if (storage[msg.keyword][link].url === msg.link) {\n storage[msg.keyword][link].rank++;\n return;\n }\n }\n storage[msg.keyword] = storage[msg.keyword].concat({\n url: msg.link,\n rank: 1\n });\n } else {\n send(new Buffer(msg), route_id, id, routing_table, awaiting_acks, socket);\n }\n });\n}", "function _trackFID() {\n getFID.onFID(metric => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n const timeOrigin = utils$1.msToSec(utils.browserPerformanceTimeOrigin );\n const startTime = utils$1.msToSec(entry.startTime);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n}", "function onChangeField(fieldName, value){\n\tvar controller = View.controllers.get(\"abRepmCostLsIndexProfileController\");\n\tvalue = View.panels.get(\"abRepmCostLsProfileLsIndex\").getFieldValue(fieldName);\n\tif (fieldName == \"ls_index_profile.indexing_frequency\" \n\t\t|| fieldName == \"ls_index_profile.date_index_start\" || fieldName == \"ls_index_profile.date_index_end\"){\n\t\tcontroller.checkDateIndexNext();\n\t\tif (fieldName == \"ls_index_profile.date_index_start\") {\n\t\t\tvar indexId = View.panels.get(\"abRepmCostLsProfileLsIndex\").getFieldValue(\"ls_index_profile.cost_index_id\");\n\t\t\tsetIndexInitialValue(indexId, value);\n\t\t}\n\t}\n\t\n}", "updateIndex(updatedIndex) {\n return new Promise((resolve, reject) => {\n indexFile.update({'term': updatedIndex.term}, {updatedIndex}, (err, result) => {\n if (err) reject(err);\n else resolve(result);\n });\n })\n }", "receiveFft(ps) {\n if (useAfc) {\n this.computeAfc(ps);\n }\n }", "function gen_op_vfp_adds()\n{\n gen_opc_ptr.push({func:op_vfp_adds});\n}", "function _indexCreate(_, indexName, localeCode, model, options, isFunctionIndex) {\n\tvar opt = options || {};\n\tvar diagnoses = opt.diagnoses;\n\t// check if index exists\n\tvar elasticBaseUrl = exports.serverConfig.baseUrl;\n\tif (!elasticHelpers.indexExists(_, elasticBaseUrl, indexName, opt)) {\n\t\t// create index\n\t\tvar reqUrl = elasticBaseUrl + \"/\" + indexName;\n\t\tvar par = {\n\t\t\turl: reqUrl,\n\t\t\tmethod: 'PUT'\n\t\t};\n\t\tvar req = streams.httpRequest(par);\n\t\tvar set = _getIndexSettings(localeCode, isFunctionIndex);\n\t\tset && req.write(_, JSON.stringify(set));\n\t\tvar resp = req.end().response(_);\n\t\telasticHelpers.debugTrace(opt, \"elasticIndex.index put settings status: \" + resp.statusCode);\n\t\t//\n\t\t_processElasticResp(_, resp, null, diagnoses, locale.format(module, \"indexCreated\", indexName));\n\t\t// add search facets: add to index a new type $facet, every entry should have code and description; the id is the code\n\t\t// create a mapping\n\t\tvar mapping = {\n\t\t\t$facet: {\n\t\t\t\tproperties: {\n\t\t\t\t\tcode: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tindex: \"no\",\n\t\t\t\t\t\tinclude_in_all: false\n\t\t\t\t\t},\n\t\t\t\t\tdescription: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tindex: \"no\",\n\t\t\t\t\t\tinclude_in_all: false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tvar _options = {\n\t\t\turl: elasticBaseUrl + \"/\" + indexName + \"/$facet/_mapping\",\n\t\t\tmethod: 'PUT'\n\t\t};\n\t\treq = streams.httpRequest(_options);\n\t\treq.write(_, JSON.stringify(mapping));\n\t\tresp = req.end().response(_);\n\t\t//\n\t\t_processElasticResp(_, resp, null, diagnoses, locale.format(module, \"mappingUpdated\", \"$facet\"));\n\t\t// index facets\n\t\t// indexing facets one by one is easyier to make them non searchable than if we would add a map.\n\t\tvar facets = model.getSearchFacets(_);\n\t\tif (facets && facets.length) {\n\t\t\telasticHelpers.debugTrace(opt, \"ElasticIndex.updateFacets\");\n\t\t\t//\n\t\t\tvar _indexName = indexName;\n\t\t\t//\n\t\t\t_options = {\n\t\t\t\turl: elasticBaseUrl + \"/_bulk\",\n\t\t\t\tmethod: 'PUT'\n\t\t\t};\n\t\t\treq = streams.httpRequest(_options);\n\t\t\t//\n\t\t\tfacets.forEach_(_, function(_, f) {\n\t\t\t\tvar action = {\n\t\t\t\t\tindex: {\n\t\t\t\t\t\t_index: _indexName,\n\t\t\t\t\t\t_type: \"$facet\",\n\t\t\t\t\t\t_id: f.code\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treq.write(_, JSON.stringify(action) + \"\\n\");\n\t\t\t\telasticHelpers.debugTrace(opt, \"ElasticIndex.updateFacets: index data: \" + sys.inspect(f));\n\t\t\t\treq.write(_, JSON.stringify(f) + \"\\n\");\n\t\t\t});\n\t\t\tresp = req.end().response(_);\n\t\t\t//\n\t\t\t_processElasticResp(_, resp, null, diagnoses, \"$facets updated\");\n\t\t}\n\t\t//\n\t\texports.registerModelEvents(_, config.searchEngine);\n\t}\n}", "handleSubmit(event) {\n event.preventDefault()\n\n this.setState({\n loading: true\n })\n const ipfs = new IPFS({\n host: 'ipfs.infura.io',\n port: 5001,\n protocol: 'https'\n })\n\n if (this.state.document !== '' & this.state.password !== '' & this.state.passwordhint !== '') {\n const encrypteddata = this.encryptthisfile(this.state.document,this.state.password) //password from input to be passed here\n ipfs.add(encrypteddata, async (err, _hash) => {\n if (err) {\n this.setState({\n failure: `Error occured: ${err.message}`\n })\n } else {\n this.setState({\n modalOpen: true,\n hash: _hash,\n password: '',\n success: `Success! Your hash: ${_hash}`\n })\n if (firebase.auth().currentUser !== null) {\n const useruidhere = firebase.auth().currentUser.uid\n this.setState({\n useruid : useruidhere\n })\n }\n db.CreateUserIPFSRecord(this.state.useruid,this.state.hash,this.state.passwordhint);\n }\n })\n } else {\n this.setState({\n modalOpen: true,\n failure: `Add Image and Corresponding Password and Hint`\n })\n }\n\n this.setState({\n loading: false\n })\n }", "addToListEventHandler(payload) {\n const post_index = this.content.map(post => post.id).indexOf(payload.content_id);\n\n this.content[post_index].is_added_to_primary_playlist = !this.content[post_index].is_added_to_primary_playlist;\n\n if (payload.is_added && this.destroyOnListRemoval) {\n this.content.splice(post_index, 1);\n }\n\n ContentService.addOrRemoveContentFromList(payload.content_id, payload.is_added)\n .then((response) => {\n if (!response) {\n this.content[post_index].is_added_to_primary_playlist = !this.content[post_index].is_added_to_primary_playlist;\n }\n });\n }", "function pfClickedNext(pageNumba, mode){\n //console.log(\"Clicked Next\");\n\tpageNumba++;\n\tspawnPF(mode, pageNumba);\n}", "function addAdField(app, tab, key, cnt, cb) {\n\tAdminFields.find({'appname':app, 'table':tab, 'name':key}, function(err, docs) {\n\t\tvar s_flag = true;\n\t\tvar thisfield = {};\n\t\tif (err) {\n\t\t\tconsole.log('error checking in on key ' + key + ' in ' + app + '\\'s ' + tab + 'table.');\n\t\t\tthrow err;\n\t\t}\n\t\tif (! docs.length) {\n\t\t\tthisfield = new AdminFields();\n\t\t\tthisfield.name = key;\n\t\t\tthisfield.appname = app;\n\t\t\tthisfield.table = tab;\n\t\t} else if (rejig_db == 'all') {\n\t\t\tthisfield = docs[0];\n\t\t} else s_flag=false;\n\t\tthisfield.listorder = thisfield.editorder = cnt++;\n\t\tif (s_flag) {\n\t\t\tif (key == 'id' || key == '_id' || key == 'modified_date' || key == 'created_date') {\n\t\t\t\tthisfield.listed = false;\n\t\t\t\tthisfield.edited = false;\n\t\t\t} else {\n\t\t\t\tthisfield.listed = true;\n\t\t\t\tthisfield.edited = true;\n\t\t\t}\n\t\t\tthisfield.save(function(err){\n\t\t\t\tif (err) {\n\tconsole.log('ERROR adding ' + key + ' in ' + tab + ' for ' + app);\n\tconsole.log(err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tcb();\n\t\t\t});\n\t\t} else cb();\n\t});\n}", "function addFoodItem(name, expoDate){\n \n if (expoDate != \"\") expoDate = formatDate(expoDate);\n\n db.foodItems.put({name: name, expoDate: expoDate}).then(function(id){\n return db.foodItems.get(id);\n }).then(function (foodItem){\n //after adding item, adding to display\n \n pantry.items.push(foodItem);\n \n if (!pantry.sorted){\n createPantryItem(foodItem);\n }\n else{\n pantry.sortByExpo();\n }\n\n }).catch(function(error) {\n alert (\"Ooops: \" + error);\n }); \n}", "function _trackFID() {\n onFID(metric => {\n const entry = metric.entries.pop();\n if (!entry) {\n return;\n }\n\n const timeOrigin = msToSec(browserPerformanceTimeOrigin );\n const startTime = msToSec(entry.startTime);\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FID');\n _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n });\n }", "function DbAddButton() {\n uploadToDb = true;\n OnSubmit();\n}", "addNewEntryWithTimeStampInfo( timeStamp, index ) {\n\n\n let stepInfo = new StepInfo([], timeStamp);\n this.stepQueue.push(stepInfo) ;\n\n }", "function postFavouriteAPI(req,rsp,next) {\n debug(\"postFavourite\");\n debug(req.body);\n //debug(req);\n var favourite = req.body;\n favourite.id = favourite.groupName;\n favourite.owner = req.user.name;\n leaguesModel.addFavourite(favourite,favouriteCreated);\n\n function favouriteCreated(err,favourite) {\n debug(\"favouriteCreated\");\n if(err!==undefined) {\n debug(err);\n rsp.code = 400;\n rsp.end();\n }\n else {\n debug(favourite);\n //rsp.code = 200;\n favourite.layout = false;\n rsp.render(\"partials/favourite\",favourite);\n }\n\n }\n}", "async function uploadParentToES(parent, index) {\n console.log(\n \"Uploading \" +\n parent +\n \" to ES index \" +\n (parseInt(index) + 1) +\n \" / \" +\n NumberOfParents\n );\n // Get reponse from Munch API for a specific parent\n const body = await rest.getRequest(rest.FlaskUrl + \"/N/\" + parent);\n // Add JSON object to Index\n await connection.addToIndex(body);\n}", "enterFpdef(ctx) {\n\t}", "function addTodoListUser() {\n var listId = document.forms.todoForm.listId.value;\n var login = document.forms.shareListForm.login.value;\n dwr.engine.beginBatch();\n todo_lists.addTodoListUser(listId, login, replyAddTodoListUser);\n todo_lists.getTodoListUsers(listId, replyShareTodoListUsers);\n dwr.engine.endBatch();\n tracker('/ajax/addTodoListUser');\n}", "add(code, state, action, next) {\n this.table[state << 8 /* INDEX_STATE_SHIFT */ | code] = action << 4 /* TRANSITION_ACTION_SHIFT */ | next;\n }", "blockByCpf(req, res) {\n // Count the hits\n config.TOTAL_HITS++;\n\n // Validate CPF\n if (CPF.validate(req.params.cpf)) {\n\n // If CPF is masked, remove the mask\n if (CPF.isMasked(req.params.cpf))\n req.params.cpf = CPF.unMask(req.params.cpf);\n\n // Update to CPF blocked\n CpfsModel.update(\n { blackList: \"block\" },\n { where: {cpf : req.params.cpf} }\n ).then(registers => {\n res.location('/cpfs/' + req.params.cpf);\n return res.status(204).send('Successfully updated registration!');\n });\n }\n else\n return res.status(404).send('Bad Request: CPF not found!');\n }", "function setupIndex(ref){\n \n//Old lunr stuff that didn't make sense\n//\tindex = lunr(function (){\n//\t\tthis.field('tag', 100);\n// this.field('priority', 1);\n//\t\tthis.ref('url');\n// \n// //This is the id\n// this.ref('href');\n//\t});\n\n \n\tref.on(\"child_added\", function(snapshot){\n\t\tvar doc = {\n\t\t\t'tag': snapshot.val().tag,\n\t\t\t'url': snapshot.val().url,\n 'priority': snapshot.val().priority\n\t\t};\n store[doc.url] = {priority: doc.priority, url: doc.url, tag: doc.tag};\n console.log(doc.url + \" added to index\");\n\t});\n}", "function addFunc(pNum){\n done.push(pNum);\n }", "handleAddNew(){\n \t//console.log(this.getName() + \" \" + this.getEmail() );\n \tif(this.isAddable()){\n \t\tlet id = this.state.lastIndex;\n\t \tlet fullname = this.getName();\n\t \tlet email = this.getEmail();\n\t \tlet phonenumber = this.getPhoneNumber();\n\n\t \tid = ++id;\n\t \tthis.state.participant.push({id, \n\t \t\t\tfullname,\n\t \t\t\temail,\n\t \t\t\tphonenumber\n\t \t\t})\n\t \tthis.setState({\n\t \t\tparticipant: this.state.participant,lastIndex:id })\n\t \tthis.fullname.getFullNameFromHeaderNull();\n\t \tthis.phonenumber.getEmailFromHeaderNull();\n\t \tthis.email.getPhoneNumberFromHeaderNull();\n\n \t}\n\n }", "add(index, instance) {\n // Add a single object only one parameter is passed\n // so index = instance\n if( instance === undefined) this.map.set( 0, index );\n else this.map.set( index, instance );\n }", "function addTaxonData(taxonName, field, idx, tP) { //console.log(\"addTaxonData called. taxonName = \", taxonName);\n if (taxonName in tP.taxaObjs) { fillInAnyNewData(taxonName, field, idx, tP);\n } else { buildTaxonObj(taxonName, field, idx, tP); }\n }", "function pushFans(){\n\n\tvar firstName = document.getElementById(\"Fname\").value;\n\tvar surname = document.getElementById(\"Surname\").value;\n\tvar dob = document.getElementById(\"DOB\").value;\n\tvar addressLine1 = document.getElementById(\"address1\").value;\n\tvar addressLine2 = document.getElementById(\"address2\").value;\n\tvar addressLine3 = document.getElementById(\"address3\").value;\n\tvar creditCard = document.getElementById(\"credit-card\").value;\n\tvar expiryDate = document.getElementById(\"expiryDate\").value;\n\tvar cvn = document.getElementById(\"cvn\").value;\n\tvar photoId = document.getElementById(\"photo-id\").value;\n\tvar proofAddress = document.getElementById(\"proof-address\").value;\n\n\n\tvar mydata = database.ref('/Fans/'); // creates ref at Fans\n\tvar postRef = mydata.push({'firstName':firstName,'surname':surname,'dob':dob, 'addressLine1': addressLine1,'addressLine2':addressLine2,'addressLine3':addressLine3, 'creditCard': creditCard,'expiryDate':expiryDate,'cvn':cvn, 'photoId': photoId,'proofAddress':proofAddress, 'valid': \"false\"}); // adds unique key then the following child nodes\n\tvar postID = postRef.key; // saves unique key from above\n\n\tconsole.log(postID) // posts unique key to console so it can be checked\n}", "insertAt(index, data) {}", "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 add_MarketFavs(villageid,koords,dorfname,user,userid,note,villagefav)\r\n{\r\n\tvar marketFavs=get_MarketFavs();\r\n\twrite_MarketFavs(addFavs(marketFavs,villageid,koords,dorfname,user,userid,note,villagefav,\"\"));\r\n}", "function fechaserver() {\n}", "function addFile() {\n document.getElementById(\"chronovisor-converter-container\").appendChild(fileTemplate.cloneNode(true));\n maps.push(null);\n files.push(null);\n data.push(null);\n og_data.push(null);\n }", "function onResponse_addFixum(fixumJSON){\n\n var fixum = $.parseJSON(fixumJSON);\n insertfixumAsTableRow(fixum.fixumID, fixum.startDate, fixum.lastUsedDate, fixum.name, fixum.frequency, fixum.categoryName, fixum.isPositive, fixum.value);\n}", "addTrack() {\n this.props.onAdd(this.props.track);\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 changeExisting(index, name, quant) {\n\n}", "vouchFor(tagsdoc, index) {\n\n var tag = tagsdoc.tags[index];\n var modified_tag = {\n value: tag.value,\n count: tag.count + 1,\n };\n tagsdoc.tags[index] = modified_tag;\n db_pending.put({\n _id: tagsdoc._id,\n _rev: tagsdoc._rev,\n type: \"tag\",\n tags: tagsdoc.tags,\n }, function (err, response) {\n if (err) {\n console.log(err);\n }\n console.log(\"successfully upvoted\");\n });\n\n }", "function pff_addFilterItem(aFilter){\n pfv_filterActiveList.push(aFilter);\n}", "function post(fn) {\n postFunction = fn;\n }", "addField(e) {\n const c = this\n let path = this.props.keys.replace(/\\./g, \"/\")\n\n let value\n if (Array.isArray(c.state.value)) {\n value = this.state.value\n } else if (typeof c.state.value === 'string') {\n value = [this.state.value]\n } else {\n value = [\"\"]\n }\n\n value.push(\"\")\n this.setState({ value })\n //TODO: handle if need to set up an association here\n //use firebase.push() instead\n\n firebaseActions( path, value)\n }", "function saveAlgolia(idx){\n algolia.clearIndex(function(err) {\n algolia.addObjects(idx, function(err, content) {\n if(err===null && idx.length>0){\n console.log(\"modules published!\");\n }else if(idx.length===0){\n console.log(\"nothing to publish!\");\n }else{\n console.log(err);\n }\n });\n });\n}", "function addField(fieldIndex){\n if(!fieldIndex){\n return;\n }\n var fieldTypes = [\n //Single Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXT\", \"placeholder\": \"New Field\"},\n //Date Field\n {\"label\": \"New Date Field\", \"type\": \"DATE\"},\n //DropDownField\n {\"label\": \"New Dropdown\", \"type\": \"OPTIONS\", \"options\": [\n {\"label\": \"Option 1\", \"value\": \"OPTION_1\"},\n {\"label\": \"Option 2\", \"value\": \"OPTION_2\"},\n {\"label\": \"Option 3\", \"value\": \"OPTION_3\"}\n ]},\n //Checkboxes Field\n {\"label\": \"New Checkboxes\", \"type\": \"CHECKBOXES\", \"options\": [\n {\"label\": \"Option A\", \"value\": \"OPTION_A\"},\n {\"label\": \"Option B\", \"value\": \"OPTION_B\"},\n {\"label\": \"Option C\", \"value\": \"OPTION_C\"}\n ]},\n //Radio Buttons Field\n {\"label\": \"New Radio Buttons\", \"type\": \"RADIOS\", \"options\": [\n {\"label\": \"Option X\", \"value\": \"OPTION_X\"},\n {\"label\": \"Option Y\", \"value\": \"OPTION_Y\"},\n {\"label\": \"Option Z\", \"value\": \"OPTION_Z\"}\n ]},\n //Multi Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXTAREA\", \"placeholder\": \"New Field\"},\n //Email Text field\n {\"label\": \"New Email Field\", \"type\": \"EMAIL\", \"placeholder\": \"New Field\"},\n //Password field\n {\"label\": \"New Password Field\", \"type\": \"PASSWORD\", \"placeholder\": \"New Field\"}\n\n ];\n\n FieldService\n .createFieldForForm(vm.formId, fieldTypes[fieldIndex])\n .then(function (response) {\n vm.fields = response.data;\n },\n function (error) {\n console.log(error.statusText);\n });\n\n\n }" ]
[ "0.5589845", "0.5584595", "0.5544091", "0.5357248", "0.53101486", "0.5308594", "0.528337", "0.52490956", "0.52110255", "0.51872367", "0.51660043", "0.5128588", "0.5110708", "0.5103243", "0.50921446", "0.5079954", "0.50797355", "0.5064261", "0.5040345", "0.5028535", "0.5000693", "0.49731183", "0.49731183", "0.49619842", "0.495651", "0.49381736", "0.49213696", "0.49038708", "0.4901048", "0.48951527", "0.48881626", "0.4874736", "0.48703456", "0.48699674", "0.48584324", "0.48517993", "0.48486117", "0.4841728", "0.48328415", "0.4827208", "0.4826247", "0.48243383", "0.48202193", "0.4818922", "0.48055628", "0.47919083", "0.47874057", "0.47861993", "0.47856864", "0.47841227", "0.47781983", "0.476416", "0.47418827", "0.47311944", "0.4729903", "0.47296968", "0.4727509", "0.47141272", "0.47097194", "0.47065133", "0.4701134", "0.46993682", "0.4688421", "0.4687162", "0.4684988", "0.4674628", "0.46725345", "0.46698695", "0.4667199", "0.46671188", "0.46643972", "0.46635187", "0.46618712", "0.46532813", "0.46423417", "0.4642042", "0.46308056", "0.46289214", "0.46268082", "0.46212447", "0.46204537", "0.4616568", "0.46105123", "0.46067154", "0.46039942", "0.46017885", "0.46012783", "0.45956114", "0.45948538", "0.45938623", "0.45933148", "0.459231", "0.45887268", "0.45872492", "0.45863256", "0.45843327", "0.4576706", "0.45754623", "0.45723376", "0.45722875", "0.4569028" ]
0.0
-1
On input parameters, do redirection and convert constants to terms We do not redirect literals
function RDFMakeTerm(formula,val) { if (typeof val != 'object') { if (typeof val == 'string') { return new RDFLiteral(val); } else if (typeof val == 'undefined') { return undefined; } else { // @@ add converting of dates and numbers alert("Can't make term from " + val + " of type " + typeof val); } } if (typeof formula.redirection == 'undefined') alert('formula: '+ formula+', term: '+val); var y = formula.redirection[val.hashString()]; if (typeof y == 'undefined') return val; // fyi(" redirecting "+val+" to "+y) return y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpret(input) {\n console.log(\"calling interpret\");\n var cmd = {},\n tokens = input.trim().toLowerCase().split(\" \");\n cmd.action = tokens.shift();\n cmd.target = tokens.join(\" \");\n return cmd;\n}", "constHandler() {\n\t\tlet constant = this.m_constMenu.value;\n\t\tlet constUnit = this.m_constUnitMenu.value;\n\t\tif(constant != \"\" && constUnit != \"\") {\n\t\t\tlet value = this.CALCULATOR.getConst(constant, constUnit);\n\t\t\tthis.m_constOutput.value = value;\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"constHandler received an empty value\");\n\t\t}\n\t}", "function transformLiteral(lit) {\n if (!lit.datatype) {\n return (lit.language)\n ? new E.LangStringLiteral(lit.value, lit.language)\n : new E.StringLiteral(lit.value);\n }\n switch (lit.datatype.value) {\n case null:\n case undefined:\n case '': {\n return (lit.language)\n ? new E.LangStringLiteral(lit.value, lit.language)\n : new E.StringLiteral(lit.value);\n }\n case Consts_1.TypeURL.XSD_STRING:\n return new E.StringLiteral(lit.value);\n case Consts_1.TypeURL.RDF_LANG_STRING:\n return new E.LangStringLiteral(lit.value, lit.language);\n case Consts_1.TypeURL.XSD_DATE_TIME:\n case Consts_1.TypeURL.XSD_DATE: {\n const val = new Date(lit.value);\n if (isNaN(val.getTime())) {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.DateTimeLiteral(new Date(lit.value), lit.value);\n }\n case Consts_1.TypeURL.XSD_BOOLEAN: {\n if (lit.value !== 'true' && lit.value !== 'false') {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.BooleanLiteral(lit.value === 'true', lit.value);\n }\n case Consts_1.TypeURL.XSD_INTEGER:\n case Consts_1.TypeURL.XSD_DECIMAL:\n case Consts_1.TypeURL.XSD_NEGATIVE_INTEGER:\n case Consts_1.TypeURL.XSD_NON_NEGATIVE_INTEGER:\n case Consts_1.TypeURL.XSD_NON_POSITIVE_INTEGER:\n case Consts_1.TypeURL.XSD_POSITIVE_INTEGER:\n case Consts_1.TypeURL.XSD_LONG:\n case Consts_1.TypeURL.XSD_SHORT:\n case Consts_1.TypeURL.XSD_BYTE:\n case Consts_1.TypeURL.XSD_UNSIGNED_LONG:\n case Consts_1.TypeURL.XSD_UNSIGNED_INT:\n case Consts_1.TypeURL.XSD_UNSIGNED_SHORT:\n case Consts_1.TypeURL.XSD_UNSIGNED_BYTE:\n case Consts_1.TypeURL.XSD_INT: {\n const val = P.parseXSDDecimal(lit.value);\n if (val === undefined) {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.NumericLiteral(val, lit.datatype, lit.value);\n }\n case Consts_1.TypeURL.XSD_FLOAT:\n case Consts_1.TypeURL.XSD_DOUBLE: {\n const val = P.parseXSDFloat(lit.value);\n if (val === undefined) {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.NumericLiteral(val, lit.datatype, lit.value);\n }\n default: return new E.Literal(lit.value, lit.datatype, lit.value);\n }\n}", "function form(context, value, all) {\n var normal = value.trim()\n var alternative\n\n if (!normal) {\n return null\n }\n\n normal = normalize(normal, context.conversion.in)\n\n if (exact(context, normal)) {\n if (!all && flag(context.flags, 'FORBIDDENWORD', context.data[normal])) {\n return null\n }\n\n return normal\n }\n\n // Try sentence case if the value is uppercase.\n if (normal.toUpperCase() === normal) {\n alternative = normal.charAt(0) + normal.slice(1).toLowerCase()\n\n if (ignore(context.flags, context.data[alternative], all)) {\n return null\n }\n\n if (exact(context, alternative)) {\n return alternative\n }\n }\n\n // Try lowercase.\n alternative = normal.toLowerCase()\n\n if (alternative !== normal) {\n if (ignore(context.flags, context.data[alternative], all)) {\n return null\n }\n\n if (exact(context, alternative)) {\n return alternative\n }\n }\n\n return null\n}", "function simplifyArg(arg, category) {\n let res = '';\n switch (category) {\n case 'color':\n case 'identity':\n if (colorMap.has(arg.toLowerCase())) {\n res = colorMap.get(arg.toLowerCase());\n } else {\n res = arg;\n }\n res = res.toUpperCase().split('');\n break;\n case 'mana':\n res = parseManaCost(arg)\n break;\n default:\n res = arg;\n break;\n }\n return res;\n}", "static getStrainParametersVCL(strains) {\n let retvcl = '';\n let defvcl = '# This file handles the URL parameter whitelist\\n\\n';\n strains.forEach(({ name, params }) => {\n if (params.length === 0) {\n return;\n }\n if (name === 'default') {\n defvcl += '# default parameters, can be overridden per strain\\n';\n defvcl += PublishCommand.makeParamWhitelist(params);\n defvcl += '\\n';\n } else {\n retvcl += `\nif (req.http.X-Strain == \"${name}\") {\n${PublishCommand.makeParamWhitelist(params, ' ')}\n}\\n`;\n }\n });\n return defvcl + retvcl;\n }", "function Assign_Lex_Literal() {\r\n}", "function handleIt(type)\t{\n\t\t\t\t\tif(Number(sfo[index]) === 1)\t{\n\t\t\t\t\t\tr.push(index.replace('+','=')); // input name is navcat+.something, so simply changing + to = makes it macroesque-ready.\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function dog(treat) {\n\t// prints parameter with strings\n\tprint('I want ' + treat + ' treats');\n}", "function lsl(hljs) {\n\n var LSL_STRING_ESCAPE_CHARS = {\n className: 'subst',\n begin: /\\\\[tn\"\\\\]/\n };\n\n var LSL_STRINGS = {\n className: 'string',\n begin: '\"',\n end: '\"',\n contains: [\n LSL_STRING_ESCAPE_CHARS\n ]\n };\n\n var LSL_NUMBERS = {\n className: 'number',\n begin: hljs.C_NUMBER_RE\n };\n\n var LSL_CONSTANTS = {\n className: 'literal',\n variants: [\n {\n begin: '\\\\b(?:PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\\\b'\n },\n {\n begin: '\\\\b(?:XP_ERROR_(?:EXPERIENCES_DISABLED|EXPERIENCE_(?:DISABLED|SUSPENDED)|INVALID_(?:EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(?:FOUND|PERMITTED(?:_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(?:PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(?:_OBJECT)?|(?:DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(?:FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(?:_(?:BY_(?:LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(?:PARCEL(?:_OWNER)?|REGION)))?|CAMERA_(?:PITCH|DISTANCE|BEHINDNESS_(?:ANGLE|LAG)|(?:FOCUS|POSITION)(?:_(?:THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(?:ROOT|SET|ALL_(?:OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(?:IVE|_(?:ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(?:FWD|BACK|(?:ROT_)?(?:LEFT|RIGHT)|UP|DOWN|(?:ML_)?LBUTTON)|PERMISSION_(?:RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(?:CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(?:TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(?:INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(?:_START)?|TELEPORT|MEDIA)|OBJECT_(?:CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(?:PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(?:ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(?:COUNT|EQUIVALENCE)|RETURN_(?:PARCEL(?:_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(?:_TAG)?|CREATOR|ATTACHED_(?:POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(?:BODY_SHAPE|PATHFINDING)_TYPE|(?:RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(?:MEMORY|TIME))|TYPE_(?:INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(?:DEBUG|PUBLIC)_CHANNEL|ATTACH_(?:AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](?:SHOULDER|HAND|FOOT|EAR|EYE|[UL](?:ARM|LEG)|HIP)|(?:LEFT|RIGHT)_PEC|HUD_(?:CENTER_[12]|TOP_(?:RIGHT|CENTER|LEFT)|BOTTOM(?:_(?:RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(?:BASE|TIP)|[LR]WING|FACE_(?:JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(?:LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(?:ONLINE|NAME|BORN|SIM_(?:POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(?:ON_FILE|USED)|REMOTE_DATA_(?:CHANNEL|REQUEST|REPLY)|PSYS_(?:PART_(?:BF_(?:ZERO|ONE(?:_MINUS_(?:DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(?:START|END)_(?:COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(?:RIBBON|WIND|INTERP_(?:COLOR|SCALE)|BOUNCE|FOLLOW_(?:SRC|VELOCITY)|TARGET_(?:POS|LINEAR)|EMISSIVE)_MASK)|SRC_(?:MAX_AGE|PATTERN|ANGLE_(?:BEGIN|END)|BURST_(?:RATE|PART_COUNT|RADIUS|SPEED_(?:MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(?:DROP|EXPLODE|ANGLE(?:_CONE(?:_EMPTY)?)?)))|VEHICLE_(?:REFERENCE_FRAME|TYPE_(?:NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(?:LINEAR|ANGULAR)_(?:FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(?:HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(?:LINEAR|ANGULAR)_(?:DEFLECTION_(?:EFFICIENCY|TIMESCALE)|MOTOR_(?:DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(?:EFFICIENCY|TIMESCALE)|BANKING_(?:EFFICIENCY|MIX|TIMESCALE)|FLAG_(?:NO_DEFLECTION_UP|LIMIT_(?:ROLL_ONLY|MOTOR_UP)|HOVER_(?:(?:WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(?:STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(?:ALLOW_UNSIT|ALPHA_MODE(?:_(?:BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(?:_(?:BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(?:DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(?:_(?:STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(?:NONE|LOW|MEDIUM|HIGH)|BUMP_(?:NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(?:DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(?:TYPE_(?:SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(?:MIRROR|INVERT))|PHYSICS(?:_(?:SHAPE_(?:CONVEX|NONE|PRIM|TYPE)))?|(?:POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(?:ALT_IMAGE_ENABLE|CONTROLS|(?:CURRENT|HOME)_URL|AUTO_(?:LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(?:WIDTH|HEIGHT)_PIXELS|WHITELIST(?:_ENABLE)?|PERMS_(?:INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(?:STANDARD|MINI)|PERM_(?:NONE|OWNER|GROUP|ANYONE)|MAX_(?:URL_LENGTH|WHITELIST_(?:SIZE|COUNT)|(?:WIDTH|HEIGHT)_PIXELS)))|MASK_(?:BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(?:TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(?:MEDIA_COMMAND_(?:STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(?:ALLOW_(?:FLY|(?:GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(?:GROUP_)?OBJECTS)|USE_(?:ACCESS_(?:GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(?:GROUP|ALL)_OBJECT_ENTRY)|COUNT_(?:TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(?:NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(?:MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(?:_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(?:HIDE|DEFAULT)|REGION_FLAG_(?:ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(?:COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(?:METHOD|MIMETYPE|BODY_(?:MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(?:INVALID_(?:AGENT|LINK_OBJECT)|NO(?:T_EXPERIENCE|_(?:ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(?:TRIM(?:_(?:HEAD|TAIL))?)|CLICK_ACTION_(?:NONE|TOUCH|SIT|BUY|PAY|OPEN(?:_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(?:NONE|SCRIPT_MEMORY)|RC_(?:DATA_FLAGS|DETECT_PHANTOM|GET_(?:LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(?:TYPES|AGENTS|(?:NON)?PHYSICAL|LAND))|RCERR_(?:CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(?:ALLOWED_(?:AGENT|GROUP)_(?:ADD|REMOVE)|BANNED_AGENT_(?:ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(?:COMMAND|CMD_(?:PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(?:GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(?:CMD_(?:(?:SMOOTH_)?STOP|JUMP)|DESIRED_(?:TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(?:_(?:[ABCD]|NONE))?|MAX_(?:DECEL|TURN_RADIUS|(?:ACCEL|SPEED)))|PURSUIT_(?:OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(?:CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(?:EVADE_(?:HIDDEN|SPOTTED)|FAILURE_(?:DYNAMIC_PATHFINDING_DISABLED|INVALID_(?:GOAL|START)|NO_(?:NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(?:PARCEL_)?UNREACHABLE)|(?:GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(?:_(?:FAST|NONE|SLOW))?|CONTENT_TYPE_(?:ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(?:RADIUS|STATIC)|(?:PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(?:AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\\\b'\n },\n {\n begin: '\\\\b(?:FALSE|TRUE)\\\\b'\n },\n {\n begin: '\\\\b(?:ZERO_ROTATION)\\\\b'\n },\n {\n begin: '\\\\b(?:EOF|JSON_(?:ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(?:BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(?:GRANTED|DENIED))\\\\b'\n },\n {\n begin: '\\\\b(?:ZERO_VECTOR|TOUCH_INVALID_(?:TEXCOORD|VECTOR))\\\\b'\n }\n ]\n };\n\n var LSL_FUNCTIONS = {\n className: 'built_in',\n begin: '\\\\b(?:ll(?:AgentInExperience|(?:Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(?:Details|ErrorMessage)|ReturnObjectsBy(?:ID|Owner)|Json(?:2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(?:Mag|Norm|Dist)|Rot(?:Between|2(?:Euler|Fwd|Left|Up))|(?:Euler|Axes)2Rot|Whisper|(?:Region|Owner)?Say|Shout|Listen(?:Control|Remove)?|Sensor(?:Repeat|Remove)?|Detected(?:Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|(?:[GS]et)(?:AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(?:Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(?:Scale|Offset|Rotate)Texture|(?:Rot)?Target(?:Remove)?|(?:Stop)?MoveToTarget|Apply(?:Rotational)?Impulse|Set(?:KeyframedMotion|ContentType|RegionPos|(?:Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(?:Queueing|Radius)|Vehicle(?:Type|(?:Float|Vector|Rotation)Param)|(?:Touch|Sit)?Text|Camera(?:Eye|At)Offset|PrimitiveParams|ClickAction|Link(?:Alpha|Color|PrimitiveParams(?:Fast)?|Texture(?:Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get(?:(?:Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(?:PrimitiveParams|Number(?:OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(?:Details|PermMask|PrimCount)|Parcel(?:MaxPrims|Details|Prim(?:Count|Owners))|Attached(?:List)?|(?:SPMax|Free|Used)Memory|Region(?:Name|TimeDilation|FPS|Corner|AgentCount)|Root(?:Position|Rotation)|UnixTime|(?:Parcel|Region)Flags|(?:Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(?:Prims|NotecardLines|Sides)|Animation(?:List)?|(?:Camera|Local)(?:Pos|Rot)|Vel|Accel|Omega|Time(?:stamp|OfDay)|(?:Object|CenterOf)?Mass|MassMKS|Energy|Owner|(?:Owner)?Key|SunDirection|Texture(?:Offset|Scale|Rot)|Inventory(?:Number|Name|Key|Type|Creator|PermMask)|Permissions(?:Key)?|StartParameter|List(?:Length|EntryType)|Date|Agent(?:Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(?:Name|State))|(?:Get|Reset|GetAndReset)Time|PlaySound(?:Slave)?|LoopSound(?:Master|Slave)?|(?:Trigger|Stop|Preload)Sound|(?:(?:Get|Delete)Sub|Insert)String|To(?:Upper|Lower)|Give(?:InventoryList|Money)|RezObject|(?:Stop)?LookAt|Sleep|CollisionFilter|(?:Take|Release)Controls|DetachFromAvatar|AttachToAvatar(?:Temp)?|InstantMessage|(?:GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(?:Length|Trim)|(?:Start|Stop)Animation|TargetOmega|Request(?:Experience)?Permissions|(?:Create|Break)Link|BreakAllLinks|(?:Give|Remove)Inventory|Water|PassTouches|Request(?:Agent|Inventory)Data|TeleportAgent(?:Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(?:Axis|Angle)|A(?:cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(?:CSV|Integer|Json|Float|String|Key|Vector|Rot|List(?:Strided)?)|DeleteSubList|List(?:Statistics|Sort|Randomize|(?:Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(?:CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(?:Slope|Normal|Contour)|GroundRepel|(?:Set|Remove)VehicleFlags|SitOnLink|(?:AvatarOn)?(?:Link)?SitTarget|Script(?:Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(?:Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(?:Integer|String)ToBase64|XorBase64|Log(?:10)?|Base64To(?:String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(?:Load|Release|(?:E|Une)scape)URL|ParcelMedia(?:CommandList|Query)|ModPow|MapDestination|(?:RemoveFrom|AddTo|Reset)Land(?:Pass|Ban)List|(?:Set|Clear)CameraParams|HTTP(?:Request|Response)|TextBox|DetectedTouch(?:UV|Face|Pos|(?:N|Bin)ormal|ST)|(?:MD5|SHA1|DumpList2)String|Request(?:Secure)?URL|Clear(?:Prim|Link)Media|(?:Link)?ParticleSystem|(?:Get|Request)(?:Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(?:Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\\\b'\n };\n\n return {\n name: 'LSL (Linden Scripting Language)',\n illegal: ':',\n contains: [\n LSL_STRINGS,\n {\n className: 'comment',\n variants: [\n hljs.COMMENT('//', '$'),\n hljs.COMMENT('/\\\\*', '\\\\*/')\n ],\n relevance: 0\n },\n LSL_NUMBERS,\n {\n className: 'section',\n variants: [\n {\n begin: '\\\\b(?:state|default)\\\\b'\n },\n {\n begin: '\\\\b(?:state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|experience_permissions(?:_denied)?|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\\\\b'\n }\n ]\n },\n LSL_FUNCTIONS,\n LSL_CONSTANTS,\n {\n className: 'type',\n begin: '\\\\b(?:integer|float|string|key|vector|quaternion|rotation|list)\\\\b'\n }\n ]\n };\n}", "function lsl(hljs) {\n\n var LSL_STRING_ESCAPE_CHARS = {\n className: 'subst',\n begin: /\\\\[tn\"\\\\]/\n };\n\n var LSL_STRINGS = {\n className: 'string',\n begin: '\"',\n end: '\"',\n contains: [\n LSL_STRING_ESCAPE_CHARS\n ]\n };\n\n var LSL_NUMBERS = {\n className: 'number',\n begin: hljs.C_NUMBER_RE\n };\n\n var LSL_CONSTANTS = {\n className: 'literal',\n variants: [\n {\n begin: '\\\\b(?:PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\\\b'\n },\n {\n begin: '\\\\b(?:XP_ERROR_(?:EXPERIENCES_DISABLED|EXPERIENCE_(?:DISABLED|SUSPENDED)|INVALID_(?:EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(?:FOUND|PERMITTED(?:_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(?:PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(?:_OBJECT)?|(?:DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(?:FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(?:_(?:BY_(?:LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(?:PARCEL(?:_OWNER)?|REGION)))?|CAMERA_(?:PITCH|DISTANCE|BEHINDNESS_(?:ANGLE|LAG)|(?:FOCUS|POSITION)(?:_(?:THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(?:ROOT|SET|ALL_(?:OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(?:IVE|_(?:ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(?:FWD|BACK|(?:ROT_)?(?:LEFT|RIGHT)|UP|DOWN|(?:ML_)?LBUTTON)|PERMISSION_(?:RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(?:CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(?:TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(?:INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(?:_START)?|TELEPORT|MEDIA)|OBJECT_(?:CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(?:PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(?:ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(?:COUNT|EQUIVALENCE)|RETURN_(?:PARCEL(?:_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(?:_TAG)?|CREATOR|ATTACHED_(?:POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(?:BODY_SHAPE|PATHFINDING)_TYPE|(?:RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(?:MEMORY|TIME))|TYPE_(?:INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(?:DEBUG|PUBLIC)_CHANNEL|ATTACH_(?:AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](?:SHOULDER|HAND|FOOT|EAR|EYE|[UL](?:ARM|LEG)|HIP)|(?:LEFT|RIGHT)_PEC|HUD_(?:CENTER_[12]|TOP_(?:RIGHT|CENTER|LEFT)|BOTTOM(?:_(?:RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(?:BASE|TIP)|[LR]WING|FACE_(?:JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(?:LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(?:ONLINE|NAME|BORN|SIM_(?:POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(?:ON_FILE|USED)|REMOTE_DATA_(?:CHANNEL|REQUEST|REPLY)|PSYS_(?:PART_(?:BF_(?:ZERO|ONE(?:_MINUS_(?:DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(?:START|END)_(?:COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(?:RIBBON|WIND|INTERP_(?:COLOR|SCALE)|BOUNCE|FOLLOW_(?:SRC|VELOCITY)|TARGET_(?:POS|LINEAR)|EMISSIVE)_MASK)|SRC_(?:MAX_AGE|PATTERN|ANGLE_(?:BEGIN|END)|BURST_(?:RATE|PART_COUNT|RADIUS|SPEED_(?:MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(?:DROP|EXPLODE|ANGLE(?:_CONE(?:_EMPTY)?)?)))|VEHICLE_(?:REFERENCE_FRAME|TYPE_(?:NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(?:LINEAR|ANGULAR)_(?:FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(?:HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(?:LINEAR|ANGULAR)_(?:DEFLECTION_(?:EFFICIENCY|TIMESCALE)|MOTOR_(?:DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(?:EFFICIENCY|TIMESCALE)|BANKING_(?:EFFICIENCY|MIX|TIMESCALE)|FLAG_(?:NO_DEFLECTION_UP|LIMIT_(?:ROLL_ONLY|MOTOR_UP)|HOVER_(?:(?:WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(?:STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(?:ALLOW_UNSIT|ALPHA_MODE(?:_(?:BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(?:_(?:BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(?:DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(?:_(?:STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(?:NONE|LOW|MEDIUM|HIGH)|BUMP_(?:NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(?:DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(?:TYPE_(?:SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(?:MIRROR|INVERT))|PHYSICS(?:_(?:SHAPE_(?:CONVEX|NONE|PRIM|TYPE)))?|(?:POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(?:ALT_IMAGE_ENABLE|CONTROLS|(?:CURRENT|HOME)_URL|AUTO_(?:LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(?:WIDTH|HEIGHT)_PIXELS|WHITELIST(?:_ENABLE)?|PERMS_(?:INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(?:STANDARD|MINI)|PERM_(?:NONE|OWNER|GROUP|ANYONE)|MAX_(?:URL_LENGTH|WHITELIST_(?:SIZE|COUNT)|(?:WIDTH|HEIGHT)_PIXELS)))|MASK_(?:BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(?:TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(?:MEDIA_COMMAND_(?:STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(?:ALLOW_(?:FLY|(?:GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(?:GROUP_)?OBJECTS)|USE_(?:ACCESS_(?:GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(?:GROUP|ALL)_OBJECT_ENTRY)|COUNT_(?:TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(?:NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(?:MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(?:_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(?:HIDE|DEFAULT)|REGION_FLAG_(?:ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(?:COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(?:METHOD|MIMETYPE|BODY_(?:MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(?:INVALID_(?:AGENT|LINK_OBJECT)|NO(?:T_EXPERIENCE|_(?:ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(?:TRIM(?:_(?:HEAD|TAIL))?)|CLICK_ACTION_(?:NONE|TOUCH|SIT|BUY|PAY|OPEN(?:_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(?:NONE|SCRIPT_MEMORY)|RC_(?:DATA_FLAGS|DETECT_PHANTOM|GET_(?:LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(?:TYPES|AGENTS|(?:NON)?PHYSICAL|LAND))|RCERR_(?:CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(?:ALLOWED_(?:AGENT|GROUP)_(?:ADD|REMOVE)|BANNED_AGENT_(?:ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(?:COMMAND|CMD_(?:PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(?:GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(?:CMD_(?:(?:SMOOTH_)?STOP|JUMP)|DESIRED_(?:TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(?:_(?:[ABCD]|NONE))?|MAX_(?:DECEL|TURN_RADIUS|(?:ACCEL|SPEED)))|PURSUIT_(?:OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(?:CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(?:EVADE_(?:HIDDEN|SPOTTED)|FAILURE_(?:DYNAMIC_PATHFINDING_DISABLED|INVALID_(?:GOAL|START)|NO_(?:NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(?:PARCEL_)?UNREACHABLE)|(?:GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(?:_(?:FAST|NONE|SLOW))?|CONTENT_TYPE_(?:ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(?:RADIUS|STATIC)|(?:PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(?:AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\\\b'\n },\n {\n begin: '\\\\b(?:FALSE|TRUE)\\\\b'\n },\n {\n begin: '\\\\b(?:ZERO_ROTATION)\\\\b'\n },\n {\n begin: '\\\\b(?:EOF|JSON_(?:ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(?:BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(?:GRANTED|DENIED))\\\\b'\n },\n {\n begin: '\\\\b(?:ZERO_VECTOR|TOUCH_INVALID_(?:TEXCOORD|VECTOR))\\\\b'\n }\n ]\n };\n\n var LSL_FUNCTIONS = {\n className: 'built_in',\n begin: '\\\\b(?:ll(?:AgentInExperience|(?:Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(?:Details|ErrorMessage)|ReturnObjectsBy(?:ID|Owner)|Json(?:2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(?:Mag|Norm|Dist)|Rot(?:Between|2(?:Euler|Fwd|Left|Up))|(?:Euler|Axes)2Rot|Whisper|(?:Region|Owner)?Say|Shout|Listen(?:Control|Remove)?|Sensor(?:Repeat|Remove)?|Detected(?:Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|(?:[GS]et)(?:AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(?:Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(?:Scale|Offset|Rotate)Texture|(?:Rot)?Target(?:Remove)?|(?:Stop)?MoveToTarget|Apply(?:Rotational)?Impulse|Set(?:KeyframedMotion|ContentType|RegionPos|(?:Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(?:Queueing|Radius)|Vehicle(?:Type|(?:Float|Vector|Rotation)Param)|(?:Touch|Sit)?Text|Camera(?:Eye|At)Offset|PrimitiveParams|ClickAction|Link(?:Alpha|Color|PrimitiveParams(?:Fast)?|Texture(?:Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get(?:(?:Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(?:PrimitiveParams|Number(?:OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(?:Details|PermMask|PrimCount)|Parcel(?:MaxPrims|Details|Prim(?:Count|Owners))|Attached(?:List)?|(?:SPMax|Free|Used)Memory|Region(?:Name|TimeDilation|FPS|Corner|AgentCount)|Root(?:Position|Rotation)|UnixTime|(?:Parcel|Region)Flags|(?:Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(?:Prims|NotecardLines|Sides)|Animation(?:List)?|(?:Camera|Local)(?:Pos|Rot)|Vel|Accel|Omega|Time(?:stamp|OfDay)|(?:Object|CenterOf)?Mass|MassMKS|Energy|Owner|(?:Owner)?Key|SunDirection|Texture(?:Offset|Scale|Rot)|Inventory(?:Number|Name|Key|Type|Creator|PermMask)|Permissions(?:Key)?|StartParameter|List(?:Length|EntryType)|Date|Agent(?:Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(?:Name|State))|(?:Get|Reset|GetAndReset)Time|PlaySound(?:Slave)?|LoopSound(?:Master|Slave)?|(?:Trigger|Stop|Preload)Sound|(?:(?:Get|Delete)Sub|Insert)String|To(?:Upper|Lower)|Give(?:InventoryList|Money)|RezObject|(?:Stop)?LookAt|Sleep|CollisionFilter|(?:Take|Release)Controls|DetachFromAvatar|AttachToAvatar(?:Temp)?|InstantMessage|(?:GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(?:Length|Trim)|(?:Start|Stop)Animation|TargetOmega|Request(?:Experience)?Permissions|(?:Create|Break)Link|BreakAllLinks|(?:Give|Remove)Inventory|Water|PassTouches|Request(?:Agent|Inventory)Data|TeleportAgent(?:Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(?:Axis|Angle)|A(?:cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(?:CSV|Integer|Json|Float|String|Key|Vector|Rot|List(?:Strided)?)|DeleteSubList|List(?:Statistics|Sort|Randomize|(?:Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(?:CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(?:Slope|Normal|Contour)|GroundRepel|(?:Set|Remove)VehicleFlags|SitOnLink|(?:AvatarOn)?(?:Link)?SitTarget|Script(?:Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(?:Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(?:Integer|String)ToBase64|XorBase64|Log(?:10)?|Base64To(?:String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(?:Load|Release|(?:E|Une)scape)URL|ParcelMedia(?:CommandList|Query)|ModPow|MapDestination|(?:RemoveFrom|AddTo|Reset)Land(?:Pass|Ban)List|(?:Set|Clear)CameraParams|HTTP(?:Request|Response)|TextBox|DetectedTouch(?:UV|Face|Pos|(?:N|Bin)ormal|ST)|(?:MD5|SHA1|DumpList2)String|Request(?:Secure)?URL|Clear(?:Prim|Link)Media|(?:Link)?ParticleSystem|(?:Get|Request)(?:Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(?:Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\\\b'\n };\n\n return {\n name: 'LSL (Linden Scripting Language)',\n illegal: ':',\n contains: [\n LSL_STRINGS,\n {\n className: 'comment',\n variants: [\n hljs.COMMENT('//', '$'),\n hljs.COMMENT('/\\\\*', '\\\\*/')\n ],\n relevance: 0\n },\n LSL_NUMBERS,\n {\n className: 'section',\n variants: [\n {\n begin: '\\\\b(?:state|default)\\\\b'\n },\n {\n begin: '\\\\b(?:state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|experience_permissions(?:_denied)?|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\\\\b'\n }\n ]\n },\n LSL_FUNCTIONS,\n LSL_CONSTANTS,\n {\n className: 'type',\n begin: '\\\\b(?:integer|float|string|key|vector|quaternion|rotation|list)\\\\b'\n }\n ]\n };\n}", "processInput(input, vars) {\n let words = input || [];\n let alias = this.aliases[words[0].toLowerCase()];\n let aliasLen;\n let currentAliasWord = '';\n let currentAliasWordLen = 0;\n let processedConditionals = false;\n let compiled = [];\n\n // If an alias wasn't found, return the original input\n if (!alias) return input;\n\n // Split the alias up into useable words\n alias = alias.split(' ');\n aliasLen = alias.length;\n\n // Iterate over each word and pop them into the final compiled array.\n // Any $ words are processed with the result ending into the compiled array.\n for (let i = 0; i < aliasLen; i++) {\n currentAliasWord = alias[i];\n currentAliasWordLen = currentAliasWord.length;\n\n // $var? word makes this command only run if the var exists\n if (\n !processedConditionals &&\n currentAliasWord[0] === '$' && currentAliasWord[currentAliasWordLen - 1] === '?'\n ) {\n let checkVar = currentAliasWord.substr(1, currentAliasWordLen - 2);\n if (!vars[checkVar]) {\n compiled = [];\n break;\n } else {\n continue;\n }\n } else {\n processedConditionals = true;\n }\n\n // Non $ word\n if (currentAliasWord[0] !== '$') {\n compiled.push(currentAliasWord);\n continue;\n }\n\n // Refering to an input word ($N)\n if ((currentAliasWord[1] || '').match(/\\d/)) {\n let num = currentAliasWord.match(/\\$(\\d+)(\\+)?(\\d+)?/);\n\n // Did we find anything or does the word it refers to non-existant?\n if (!num || !words[num[1]]) continue;\n\n if (num[2] === '+' && num[3]) {\n // Add X number of words\n compiled = compiled.concat(words.slice(\n parseInt(num[1], 10),\n parseInt(num[1], 10) + parseInt(num[3], 10)\n ));\n } else if (num[2] === '+') {\n // Add the remaining of the words\n compiled = compiled.concat(words.slice(parseInt(num[1], 10)));\n } else {\n // Add a single word\n compiled.push(words[parseInt(num[1], 10)]);\n }\n\n continue;\n }\n\n // Refering to a variable\n if (typeof vars[currentAliasWord.substr(1)] !== 'undefined') {\n // Get the variable\n compiled.push(vars[currentAliasWord.substr(1)]);\n\n continue;\n }\n }\n\n return compiled;\n }", "function lsl(hljs) {\n\n var LSL_STRING_ESCAPE_CHARS = {\n className: 'subst',\n begin: /\\\\[tn\"\\\\]/\n };\n\n var LSL_STRINGS = {\n className: 'string',\n begin: '\"',\n end: '\"',\n contains: [\n LSL_STRING_ESCAPE_CHARS\n ]\n };\n\n var LSL_NUMBERS = {\n className: 'number',\n relevance:0,\n begin: hljs.C_NUMBER_RE\n };\n\n var LSL_CONSTANTS = {\n className: 'literal',\n variants: [\n {\n begin: '\\\\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\\\b'\n },\n {\n begin: '\\\\b(XP_ERROR_(EXPERIENCES_DISABLED|EXPERIENCE_(DISABLED|SUSPENDED)|INVALID_(EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(FOUND|PERMITTED(_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(_OBJECT)?|(DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(_(BY_(LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(PARCEL(_OWNER)?|REGION)))?|CAMERA_(PITCH|DISTANCE|BEHINDNESS_(ANGLE|LAG)|(FOCUS|POSITION)(_(THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(ROOT|SET|ALL_(OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(IVE|_(ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(FWD|BACK|(ROT_)?(LEFT|RIGHT)|UP|DOWN|(ML_)?LBUTTON)|PERMISSION_(RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(_START)?|TELEPORT|MEDIA)|OBJECT_(CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(COUNT|EQUIVALENCE)|RETURN_(PARCEL(_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(_TAG)?|CREATOR|ATTACHED_(POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(BODY_SHAPE|PATHFINDING)_TYPE|(RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(MEMORY|TIME))|TYPE_(INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(DEBUG|PUBLIC)_CHANNEL|ATTACH_(AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](SHOULDER|HAND|FOOT|EAR|EYE|[UL](ARM|LEG)|HIP)|(LEFT|RIGHT)_PEC|HUD_(CENTER_[12]|TOP_(RIGHT|CENTER|LEFT)|BOTTOM(_(RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(BASE|TIP)|[LR]WING|FACE_(JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(ONLINE|NAME|BORN|SIM_(POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(ON_FILE|USED)|REMOTE_DATA_(CHANNEL|REQUEST|REPLY)|PSYS_(PART_(BF_(ZERO|ONE(_MINUS_(DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(START|END)_(COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(RIBBON|WIND|INTERP_(COLOR|SCALE)|BOUNCE|FOLLOW_(SRC|VELOCITY)|TARGET_(POS|LINEAR)|EMISSIVE)_MASK)|SRC_(MAX_AGE|PATTERN|ANGLE_(BEGIN|END)|BURST_(RATE|PART_COUNT|RADIUS|SPEED_(MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(DROP|EXPLODE|ANGLE(_CONE(_EMPTY)?)?)))|VEHICLE_(REFERENCE_FRAME|TYPE_(NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(LINEAR|ANGULAR)_(FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(LINEAR|ANGULAR)_(DEFLECTION_(EFFICIENCY|TIMESCALE)|MOTOR_(DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(EFFICIENCY|TIMESCALE)|BANKING_(EFFICIENCY|MIX|TIMESCALE)|FLAG_(NO_DEFLECTION_UP|LIMIT_(ROLL_ONLY|MOTOR_UP)|HOVER_((WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(ALLOW_UNSIT|ALPHA_MODE(_(BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(_(BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(_(STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(NONE|LOW|MEDIUM|HIGH)|BUMP_(NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(TYPE_(SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(MIRROR|INVERT))|PHYSICS(_(SHAPE_(CONVEX|NONE|PRIM|TYPE)))?|(POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(ALT_IMAGE_ENABLE|CONTROLS|(CURRENT|HOME)_URL|AUTO_(LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(WIDTH|HEIGHT)_PIXELS|WHITELIST(_ENABLE)?|PERMS_(INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(STANDARD|MINI)|PERM_(NONE|OWNER|GROUP|ANYONE)|MAX_(URL_LENGTH|WHITELIST_(SIZE|COUNT)|(WIDTH|HEIGHT)_PIXELS)))|MASK_(BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(MEDIA_COMMAND_(STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(ALLOW_(FLY|(GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(GROUP_)?OBJECTS)|USE_(ACCESS_(GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(GROUP|ALL)_OBJECT_ENTRY)|COUNT_(TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(HIDE|DEFAULT)|REGION_FLAG_(ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(METHOD|MIMETYPE|BODY_(MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(INVALID_(AGENT|LINK_OBJECT)|NO(T_EXPERIENCE|_(ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(TRIM(_(HEAD|TAIL))?)|CLICK_ACTION_(NONE|TOUCH|SIT|BUY|PAY|OPEN(_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(NONE|SCRIPT_MEMORY)|RC_(DATA_FLAGS|DETECT_PHANTOM|GET_(LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(TYPES|AGENTS|(NON)?PHYSICAL|LAND))|RCERR_(CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(ALLOWED_(AGENT|GROUP)_(ADD|REMOVE)|BANNED_AGENT_(ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(COMMAND|CMD_(PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(CMD_((SMOOTH_)?STOP|JUMP)|DESIRED_(TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(_([ABCD]|NONE))?|MAX_(DECEL|TURN_RADIUS|(ACCEL|SPEED)))|PURSUIT_(OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(EVADE_(HIDDEN|SPOTTED)|FAILURE_(DYNAMIC_PATHFINDING_DISABLED|INVALID_(GOAL|START)|NO_(NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(PARCEL_)?UNREACHABLE)|(GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(_(FAST|NONE|SLOW))?|CONTENT_TYPE_(ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(RADIUS|STATIC)|(PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\\\b'\n },\n {\n begin: '\\\\b(FALSE|TRUE)\\\\b'\n },\n {\n begin: '\\\\b(ZERO_ROTATION)\\\\b'\n },\n {\n begin: '\\\\b(EOF|JSON_(ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(GRANTED|DENIED))\\\\b'\n },\n {\n begin: '\\\\b(ZERO_VECTOR|TOUCH_INVALID_(TEXCOORD|VECTOR))\\\\b'\n }\n ]\n };\n\n var LSL_FUNCTIONS = {\n className: 'built_in',\n begin: '\\\\b(ll(AgentInExperience|(Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(Details|ErrorMessage)|ReturnObjectsBy(ID|Owner)|Json(2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(Mag|Norm|Dist)|Rot(Between|2(Euler|Fwd|Left|Up))|(Euler|Axes)2Rot|Whisper|(Region|Owner)?Say|Shout|Listen(Control|Remove)?|Sensor(Repeat|Remove)?|Detected(Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|([GS]et)(AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(Scale|Offset|Rotate)Texture|(Rot)?Target(Remove)?|(Stop)?MoveToTarget|Apply(Rotational)?Impulse|Set(KeyframedMotion|ContentType|RegionPos|(Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(Queueing|Radius)|Vehicle(Type|(Float|Vector|Rotation)Param)|(Touch|Sit)?Text|Camera(Eye|At)Offset|PrimitiveParams|ClickAction|Link(Alpha|Color|PrimitiveParams(Fast)?|Texture(Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get((Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(PrimitiveParams|Number(OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(Details|PermMask|PrimCount)|Parcel(MaxPrims|Details|Prim(Count|Owners))|Attached(List)?|(SPMax|Free|Used)Memory|Region(Name|TimeDilation|FPS|Corner|AgentCount)|Root(Position|Rotation)|UnixTime|(Parcel|Region)Flags|(Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(Prims|NotecardLines|Sides)|Animation(List)?|(Camera|Local)(Pos|Rot)|Vel|Accel|Omega|Time(stamp|OfDay)|(Object|CenterOf)?Mass|MassMKS|Energy|Owner|(Owner)?Key|SunDirection|Texture(Offset|Scale|Rot)|Inventory(Number|Name|Key|Type|Creator|PermMask)|Permissions(Key)?|StartParameter|List(Length|EntryType)|Date|Agent(Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(Name|State))|(Get|Reset|GetAndReset)Time|PlaySound(Slave)?|LoopSound(Master|Slave)?|(Trigger|Stop|Preload)Sound|((Get|Delete)Sub|Insert)String|To(Upper|Lower)|Give(InventoryList|Money)|RezObject|(Stop)?LookAt|Sleep|CollisionFilter|(Take|Release)Controls|DetachFromAvatar|AttachToAvatar(Temp)?|InstantMessage|(GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(Length|Trim)|(Start|Stop)Animation|TargetOmega|Request(Experience)?Permissions|(Create|Break)Link|BreakAllLinks|(Give|Remove)Inventory|Water|PassTouches|Request(Agent|Inventory)Data|TeleportAgent(Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(Axis|Angle)|A(cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(CSV|Integer|Json|Float|String|Key|Vector|Rot|List(Strided)?)|DeleteSubList|List(Statistics|Sort|Randomize|(Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(Slope|Normal|Contour)|GroundRepel|(Set|Remove)VehicleFlags|SitOnLink|(AvatarOn)?(Link)?SitTarget|Script(Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(Integer|String)ToBase64|XorBase64|Log(10)?|Base64To(String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(Load|Release|(E|Une)scape)URL|ParcelMedia(CommandList|Query)|ModPow|MapDestination|(RemoveFrom|AddTo|Reset)Land(Pass|Ban)List|(Set|Clear)CameraParams|HTTP(Request|Response)|TextBox|DetectedTouch(UV|Face|Pos|(N|Bin)ormal|ST)|(MD5|SHA1|DumpList2)String|Request(Secure)?URL|Clear(Prim|Link)Media|(Link)?ParticleSystem|(Get|Request)(Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\\\b'\n };\n\n return {\n name: 'LSL (Linden Scripting Language)',\n illegal: ':',\n contains: [\n LSL_STRINGS,\n {\n className: 'comment',\n variants: [\n hljs.COMMENT('//', '$'),\n hljs.COMMENT('/\\\\*', '\\\\*/')\n ],\n relevance: 0\n },\n LSL_NUMBERS,\n {\n className: 'section',\n variants: [\n {\n begin: '\\\\b(state|default)\\\\b'\n },\n {\n begin: '\\\\b(state_(entry|exit)|touch(_(start|end))?|(land_)?collision(_(start|end))?|timer|listen|(no_)?sensor|control|(not_)?at_(rot_)?target|money|email|experience_permissions(_denied)?|run_time_permissions|changed|attach|dataserver|moving_(start|end)|link_message|(on|object)_rez|remote_data|http_re(sponse|quest)|path_update|transaction_result)\\\\b'\n }\n ]\n },\n LSL_FUNCTIONS,\n LSL_CONSTANTS,\n {\n className: 'type',\n begin: '\\\\b(integer|float|string|key|vector|quaternion|rotation|list)\\\\b'\n }\n ]\n };\n}", "function lsl(hljs) {\n\n var LSL_STRING_ESCAPE_CHARS = {\n className: 'subst',\n begin: /\\\\[tn\"\\\\]/\n };\n\n var LSL_STRINGS = {\n className: 'string',\n begin: '\"',\n end: '\"',\n contains: [\n LSL_STRING_ESCAPE_CHARS\n ]\n };\n\n var LSL_NUMBERS = {\n className: 'number',\n relevance:0,\n begin: hljs.C_NUMBER_RE\n };\n\n var LSL_CONSTANTS = {\n className: 'literal',\n variants: [\n {\n begin: '\\\\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\\\b'\n },\n {\n begin: '\\\\b(XP_ERROR_(EXPERIENCES_DISABLED|EXPERIENCE_(DISABLED|SUSPENDED)|INVALID_(EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(FOUND|PERMITTED(_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(_OBJECT)?|(DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(_(BY_(LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(PARCEL(_OWNER)?|REGION)))?|CAMERA_(PITCH|DISTANCE|BEHINDNESS_(ANGLE|LAG)|(FOCUS|POSITION)(_(THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(ROOT|SET|ALL_(OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(IVE|_(ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(FWD|BACK|(ROT_)?(LEFT|RIGHT)|UP|DOWN|(ML_)?LBUTTON)|PERMISSION_(RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(_START)?|TELEPORT|MEDIA)|OBJECT_(CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(COUNT|EQUIVALENCE)|RETURN_(PARCEL(_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(_TAG)?|CREATOR|ATTACHED_(POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(BODY_SHAPE|PATHFINDING)_TYPE|(RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(MEMORY|TIME))|TYPE_(INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(DEBUG|PUBLIC)_CHANNEL|ATTACH_(AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](SHOULDER|HAND|FOOT|EAR|EYE|[UL](ARM|LEG)|HIP)|(LEFT|RIGHT)_PEC|HUD_(CENTER_[12]|TOP_(RIGHT|CENTER|LEFT)|BOTTOM(_(RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(BASE|TIP)|[LR]WING|FACE_(JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(ONLINE|NAME|BORN|SIM_(POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(ON_FILE|USED)|REMOTE_DATA_(CHANNEL|REQUEST|REPLY)|PSYS_(PART_(BF_(ZERO|ONE(_MINUS_(DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(START|END)_(COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(RIBBON|WIND|INTERP_(COLOR|SCALE)|BOUNCE|FOLLOW_(SRC|VELOCITY)|TARGET_(POS|LINEAR)|EMISSIVE)_MASK)|SRC_(MAX_AGE|PATTERN|ANGLE_(BEGIN|END)|BURST_(RATE|PART_COUNT|RADIUS|SPEED_(MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(DROP|EXPLODE|ANGLE(_CONE(_EMPTY)?)?)))|VEHICLE_(REFERENCE_FRAME|TYPE_(NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(LINEAR|ANGULAR)_(FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(LINEAR|ANGULAR)_(DEFLECTION_(EFFICIENCY|TIMESCALE)|MOTOR_(DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(EFFICIENCY|TIMESCALE)|BANKING_(EFFICIENCY|MIX|TIMESCALE)|FLAG_(NO_DEFLECTION_UP|LIMIT_(ROLL_ONLY|MOTOR_UP)|HOVER_((WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(ALLOW_UNSIT|ALPHA_MODE(_(BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(_(BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(_(STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(NONE|LOW|MEDIUM|HIGH)|BUMP_(NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(TYPE_(SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(MIRROR|INVERT))|PHYSICS(_(SHAPE_(CONVEX|NONE|PRIM|TYPE)))?|(POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(ALT_IMAGE_ENABLE|CONTROLS|(CURRENT|HOME)_URL|AUTO_(LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(WIDTH|HEIGHT)_PIXELS|WHITELIST(_ENABLE)?|PERMS_(INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(STANDARD|MINI)|PERM_(NONE|OWNER|GROUP|ANYONE)|MAX_(URL_LENGTH|WHITELIST_(SIZE|COUNT)|(WIDTH|HEIGHT)_PIXELS)))|MASK_(BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(MEDIA_COMMAND_(STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(ALLOW_(FLY|(GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(GROUP_)?OBJECTS)|USE_(ACCESS_(GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(GROUP|ALL)_OBJECT_ENTRY)|COUNT_(TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(HIDE|DEFAULT)|REGION_FLAG_(ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(METHOD|MIMETYPE|BODY_(MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(INVALID_(AGENT|LINK_OBJECT)|NO(T_EXPERIENCE|_(ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(TRIM(_(HEAD|TAIL))?)|CLICK_ACTION_(NONE|TOUCH|SIT|BUY|PAY|OPEN(_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(NONE|SCRIPT_MEMORY)|RC_(DATA_FLAGS|DETECT_PHANTOM|GET_(LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(TYPES|AGENTS|(NON)?PHYSICAL|LAND))|RCERR_(CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(ALLOWED_(AGENT|GROUP)_(ADD|REMOVE)|BANNED_AGENT_(ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(COMMAND|CMD_(PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(CMD_((SMOOTH_)?STOP|JUMP)|DESIRED_(TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(_([ABCD]|NONE))?|MAX_(DECEL|TURN_RADIUS|(ACCEL|SPEED)))|PURSUIT_(OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(EVADE_(HIDDEN|SPOTTED)|FAILURE_(DYNAMIC_PATHFINDING_DISABLED|INVALID_(GOAL|START)|NO_(NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(PARCEL_)?UNREACHABLE)|(GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(_(FAST|NONE|SLOW))?|CONTENT_TYPE_(ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(RADIUS|STATIC)|(PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\\\b'\n },\n {\n begin: '\\\\b(FALSE|TRUE)\\\\b'\n },\n {\n begin: '\\\\b(ZERO_ROTATION)\\\\b'\n },\n {\n begin: '\\\\b(EOF|JSON_(ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(GRANTED|DENIED))\\\\b'\n },\n {\n begin: '\\\\b(ZERO_VECTOR|TOUCH_INVALID_(TEXCOORD|VECTOR))\\\\b'\n }\n ]\n };\n\n var LSL_FUNCTIONS = {\n className: 'built_in',\n begin: '\\\\b(ll(AgentInExperience|(Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(Details|ErrorMessage)|ReturnObjectsBy(ID|Owner)|Json(2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(Mag|Norm|Dist)|Rot(Between|2(Euler|Fwd|Left|Up))|(Euler|Axes)2Rot|Whisper|(Region|Owner)?Say|Shout|Listen(Control|Remove)?|Sensor(Repeat|Remove)?|Detected(Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|([GS]et)(AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(Scale|Offset|Rotate)Texture|(Rot)?Target(Remove)?|(Stop)?MoveToTarget|Apply(Rotational)?Impulse|Set(KeyframedMotion|ContentType|RegionPos|(Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(Queueing|Radius)|Vehicle(Type|(Float|Vector|Rotation)Param)|(Touch|Sit)?Text|Camera(Eye|At)Offset|PrimitiveParams|ClickAction|Link(Alpha|Color|PrimitiveParams(Fast)?|Texture(Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get((Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(PrimitiveParams|Number(OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(Details|PermMask|PrimCount)|Parcel(MaxPrims|Details|Prim(Count|Owners))|Attached(List)?|(SPMax|Free|Used)Memory|Region(Name|TimeDilation|FPS|Corner|AgentCount)|Root(Position|Rotation)|UnixTime|(Parcel|Region)Flags|(Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(Prims|NotecardLines|Sides)|Animation(List)?|(Camera|Local)(Pos|Rot)|Vel|Accel|Omega|Time(stamp|OfDay)|(Object|CenterOf)?Mass|MassMKS|Energy|Owner|(Owner)?Key|SunDirection|Texture(Offset|Scale|Rot)|Inventory(Number|Name|Key|Type|Creator|PermMask)|Permissions(Key)?|StartParameter|List(Length|EntryType)|Date|Agent(Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(Name|State))|(Get|Reset|GetAndReset)Time|PlaySound(Slave)?|LoopSound(Master|Slave)?|(Trigger|Stop|Preload)Sound|((Get|Delete)Sub|Insert)String|To(Upper|Lower)|Give(InventoryList|Money)|RezObject|(Stop)?LookAt|Sleep|CollisionFilter|(Take|Release)Controls|DetachFromAvatar|AttachToAvatar(Temp)?|InstantMessage|(GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(Length|Trim)|(Start|Stop)Animation|TargetOmega|Request(Experience)?Permissions|(Create|Break)Link|BreakAllLinks|(Give|Remove)Inventory|Water|PassTouches|Request(Agent|Inventory)Data|TeleportAgent(Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(Axis|Angle)|A(cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(CSV|Integer|Json|Float|String|Key|Vector|Rot|List(Strided)?)|DeleteSubList|List(Statistics|Sort|Randomize|(Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(Slope|Normal|Contour)|GroundRepel|(Set|Remove)VehicleFlags|SitOnLink|(AvatarOn)?(Link)?SitTarget|Script(Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(Integer|String)ToBase64|XorBase64|Log(10)?|Base64To(String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(Load|Release|(E|Une)scape)URL|ParcelMedia(CommandList|Query)|ModPow|MapDestination|(RemoveFrom|AddTo|Reset)Land(Pass|Ban)List|(Set|Clear)CameraParams|HTTP(Request|Response)|TextBox|DetectedTouch(UV|Face|Pos|(N|Bin)ormal|ST)|(MD5|SHA1|DumpList2)String|Request(Secure)?URL|Clear(Prim|Link)Media|(Link)?ParticleSystem|(Get|Request)(Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\\\b'\n };\n\n return {\n name: 'LSL (Linden Scripting Language)',\n illegal: ':',\n contains: [\n LSL_STRINGS,\n {\n className: 'comment',\n variants: [\n hljs.COMMENT('//', '$'),\n hljs.COMMENT('/\\\\*', '\\\\*/')\n ],\n relevance: 0\n },\n LSL_NUMBERS,\n {\n className: 'section',\n variants: [\n {\n begin: '\\\\b(state|default)\\\\b'\n },\n {\n begin: '\\\\b(state_(entry|exit)|touch(_(start|end))?|(land_)?collision(_(start|end))?|timer|listen|(no_)?sensor|control|(not_)?at_(rot_)?target|money|email|experience_permissions(_denied)?|run_time_permissions|changed|attach|dataserver|moving_(start|end)|link_message|(on|object)_rez|remote_data|http_re(sponse|quest)|path_update|transaction_result)\\\\b'\n }\n ]\n },\n LSL_FUNCTIONS,\n LSL_CONSTANTS,\n {\n className: 'type',\n begin: '\\\\b(integer|float|string|key|vector|quaternion|rotation|list)\\\\b'\n }\n ]\n };\n}", "function UserInputs (userOption, inputParameter){\r\nswitch(userOption){\r\n\r\n case \"this-song\": \r\n findSong();\r\n break;\r\n case \"this-concert\": \r\n findConcert();\r\n break;\r\n case \"this-do-what-it-says\": \r\n find-do-what-it-says();\r\n break;\r\n default;\r\n console.log(\"a little nonsense now and then, is cherished by the wisest men\"\r\n )\r\n \r\n\r\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 translate(input) {\n\tif (input === \"&&\" || input === \"and\" || input === \"\\u2227\") return \"/\\\\\";\n\tif (input === \"||\" || input === \"or\" || input === \"\\u2228\") return \"\\\\/\";\n\tif (input === \"=>\" || input === \"\\u2192\" || input === \"implies\") return \"->\";\n\tif (input === \"<=>\" || input === \"\\u2194\" || input === \"iff\") return \"<->\";\n\tif (input === \"not\" || input === \"!\" || input === \"\\u00AC\") return \"~\";\n\tif (input === \"\\u22A4\" || input === \"true\") return \"T\";\n\tif (input === \"\\u22A5\" || input === \"false\") return \"F\";\n\treturn input;\n}", "function Assign_Lex_Other() {\r\n}", "function BOT_inputStringProcessing(s) {\r\n\tvar lemstring = (s == \"\") ? \"ping\" : s; // empty output + CR means ping\r\n\tlemstring = BOT_rawStringExtraction(lemstring);\r\n\tBOT_traceString += \"RAW EXTRACT \\\"\" + lemstring + \"\\\"\\n\";\r\n\tlemstring = BOT_englishStringLemmatization(lemstring);\r\n\tBOT_traceString += \"ENGLISH \\\"\" + lemstring + \"\\\"\\n\";\r\n\tBOT_lemString = BOT_mapLemSynonyms(lemstring);\r\n\tBOT_traceString += \"SYNONYMS \\\"\" + lemstring + \"\\\"\\n\";\r\n\tBOT_lemWordList = BOT_extractWords();\r\n}", "function es1(params) {\n \n}", "function injectOperatorBetweenTerms(searchPhrase) {\n // Default to using AND\n\tuseAnd = (module.exports.defaultSplitTerm == 'AND');\n\n // Remove leading and trailing whitespace\n\tsearchPhrase = searchPhrase.trim();\n\n\tif(useAnd){\n\t\t// replace all spaces with ' AND ', then remove any extra ANDs\n searchPhrase = searchPhrase.replace(/ /gi, ' AND ');\n searchPhrase = searchPhrase.replace(/ AND AND AND /gi, ' AND ');\n searchPhrase = searchPhrase.replace(/ AND OR AND /gi, ' OR ');\n searchPhrase = searchPhrase.replace(/\\( AND /gi, '(');\n searchPhrase = searchPhrase.replace(/ AND \\)/gi, ')');\n\t} else {\n\t\t// replace all spaces with ' OR ', then remove any extra ORs\n searchPhrase = searchPhrase.replace(/ /gi, ' OR ');\n searchPhrase = searchPhrase.replace(/ OR AND OR /gi, ' AND ');\n searchPhrase = searchPhrase.replace(/ OR OR OR /gi, ' OR ');\n searchPhrase = searchPhrase.replace(/\\( OR /gi, '(');\n searchPhrase = searchPhrase.replace(/ OR \\)/gi, ')');\n\t}\n\treturn searchPhrase;\n}", "function tokenToAction(token) {\n var word = token.value;\n var definition = context.dictionary.lookup(word);\n\n if (token.isStringLiteral) {\n return namedFunction(\"String: \" + word, function (context) {\n return word;\n });\n }\n // TODO: contributed part on StringPushLiteral s\" (TODO make PR)\n else if (token.isStringPushLiteral) {\n return namedFunction(\"PushString: \" + word, function (context) {\n context.stack.push(word);\n });\n }\n // TODO: contributed part on NeoSyscallLiteral syscall\" (TODO: do not make PR, think on something better...)\n else if (token.isNeoSyscallLiteral) {\n\n if(word == \"Neo.Learn.Call\") { // special syscall \n var execAction = context.stack.pop();\n var definedAction = context.dictionary.lookup(execAction);\n return definedAction; // TODO\n }\n else \n return namedFunction(\"NeoSyscallString: \" + word, function (context) {\n invokeNeoSyscall(word);\n /*\n if(sname == \"Neo.Learn.Execute\") // special syscall \n {\n // invoke tokenizer on read string\n // ????????? TODO\n var str = context.stack.pop();\n next(str);\n }*/\n // TODO: Neo Syscall!!\n\n });\n } \n else if (definition !== null) {\n return definition;\n } else if (isFinite(word)) {\n return namedFunction(\"Number: \" + word, function (context) {\n context.stack.push(+word);\n });\n } else {\n throw new MissingWordError(word);\n }\n\n return function () {\n return \"\";\n };\n }", "function compile_filter_url() {\n\n let filter = {\n /* tipologia : $('input[name=\"condition\"]:checked').val(), */\n query_var: {\n marca: brandInput.val(),\n modello: modelInput.val(),\n alimentazione: fuelInput.val(),\n },\n get_params: {\n maxPrice: maxPriceInput.val(),\n km: kmInput.val(),\n anno: yearInput.val(),\n cambio: transmissioninput.val(),\n novice: noviceInput.is(':checked') == true ? true : '',\n order: $('#order').val() == undefined ? '' : $('#order').val()\n }\n };\n var searchUrl = home_url + '/nuovo/';\n var paramsArr = [];\n let index = 0;\n // COMPILE QUERY_VARS\n for (const [key, value] of Object.entries(filter.query_var)) {\n if (value != '') {\n if (filter.query_var.length < 2) {\n searchUrl += value\n } else if (index == 0) {\n searchUrl += value\n index++\n } else {\n searchUrl += '-' + value;\n }\n }\n }\n let params_index = 0;\n // COMPILE $_GET VARIABLES\n for (const [key, value] of Object.entries(filter.get_params)) {\n if (value != '' && params_index == 0) {\n let newParam = '?' + key + '=' + value;\n paramsArr.push(newParam);\n params_index++;\n } else if (value != '') {\n let newParam = '&' + key + '=' + value;\n paramsArr.push(newParam);\n }\n }\n paramsArr.forEach(el => {\n searchUrl += el;\n })\n // REDIRECT\n window.location.href = searchUrl;\n }", "function Assign_Lex() {\r\n}", "function Literal( arg ) {\r\n}", "function convertValueToInputVars(value, toEval) {\n // if (value === undefined) return '';\n if (isNumber(value) || isInputArray(value) || isInput(value))\n return handleQuickReplace(value, toEval);\n\n // if (isCondition(value))\n return conditionHandler(value, toEval);\n}", "handlePermalink() {\n var subject = this.checkPermalinkTab(\"subjectID\", \"subjectID2\");\n var predicate = this.checkPermalinkTab(\"predicateID\", \"predicateID2\");\n var object = this.checkPermalinkTab(\"objectID\", \"objectID2\");\n var documentName = this.checkPermalinkTab(\"docNameID\", \"docNameID2\");\n var endpoint = DOC.iSel(\"sparql_endpoint\");\n\n if (this.initialSubject) {\n subject.value = this.initialSubject;\n this.initialSubject = \"\";\n }\n if (this.initialPredicate) {\n predicate.value = this.initialPredicate;\n this.initialPredicate = \"\";\n }\n if (this.initialObject) {\n object.value = this.initialObject;\n this.initialObject = \"\";\n }\n if (this.initialDocumentName) {\n documentName.value = this.initialDocumentName;\n //this.initialDocumentName = \"\";\n }\n if (this.initialEndpoint) {\n endpoint.value = this.initialEndpoint;\n this.initialEndpoint = \"\";\n }\n }", "function adjustParameters()\n{\n $(\"#script\").html(generateRedirect($('#URL').val(), \n $('#desktopUrl').val(),\n $('#languageSelect').val(),\n $('#whitelabeled').is(':checked'), \n $('#cookies').is(':checked'), \n $('#frameBreak').is(':checked'), \n $('#https').is(':checked'),\n $('#commaTrue').is(':checked'))\n );\n //generate the permalink and domain urls\n var domain = window.location.protocol + '//' + window.location.hostname + window.location.pathname;\n var permalink = generatePermalink($('#URL').val(), \n $('#desktopUrl').val(),\n $('#languageSelect').val(),\n $('#whitelabeled').is(':checked'), \n $('#cookies').is(':checked'), \n $('#frameBreak').is(':checked'), \n $('#https').is(':checked'),\n $('#commaTrue').is(':checked')\n );\n //generate permalink html\n var permalinkHTML = \"<a href='\" + domain + permalink + \"'>Permalink</a>\";\n $(\"#permalink\").html(permalinkHTML);\n //replace the url with the permalink\n history.replaceState({}, null, permalink);\n}", "function termRedirectHandler(req, res, termCode) {\n // Extract stuff we're interested in from the POST.\n const refererQueryParams = utils.extractQueryParams(req.headers['referer']);\n const assignmentId = refererQueryParams['assignment'];\n\n try {\n const destination = utils.resolveDestinationByTermCode(req.app.locals, termCode, assignmentId);\n return res.redirect(destination);\n } catch (err) {\n return res.send(err);\n }\n}", "function setExampleParameters() {\r\n\t\r\n\t// set query sequence\r\n\tif(! setValue('inputSeq', 'AGCTTTTGGGGACACAGTAGTTGACTGGTATATCTCCTGTAAAAACTAGCTTGTATATACT') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// set junction position\r\n\tif(! setValue('junctionPos', '27') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// set enhancers list\r\n\tsetValue('enhancerList', 'AGCT,GACA,taaaaac,atgtcctcta');\r\n\t\r\n\t// set silencers list\r\n\tsetValue('silencerList', 'CTTTTG,GACA,TATATACT');\r\n\t\t\r\n\t// set enhancers score \r\n\tif(! setValue('enhancerScore', '5') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\t\t\r\n\t// set silencers score \r\n\tif(! setValue('silencerScore', '-7') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\t\r\n\t// set enhancers color to be red\r\n\tif(! setListValue('enhancersColor', 'red')) { // valid options are: green, blue, red\r\n\t\treturn false;\r\n\t}\t\r\n\t\r\n\t// set silencers color to be yellow\r\n\tif(! setListValue('silencersColor', 'yellow')) { // valid options are: violet, yellow, brown\r\n\t\treturn false;\r\n\t}\t\r\n\r\n\t// set \"Sequences to highlight\" option to be \"both\"\r\n\tif(! setRadioValue('mark', 'both')){ // valid options (value field) are: enhancers, silencers, both\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// set check box to be checked\r\n\tvar element = document.getElementById('reverse');\r\n\t\r\n\tif (element == null) {\r\n\t\treturn false;\r\n\t} else{ \r\n\t\telement.checked = true;\r\n\t}\r\n\t\r\n\t// set message\r\n\tif(! setValue('errors', 'Input assignment was performed successfully!') ) {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "function processURLParameters() {\r\n originalURL = decodeURIComponent(window.location.href);\r\n var params = {};\r\n // look for the params\r\n if (originalURL.indexOf(\"#\") != -1) {\r\n var qString = originalURL.split('#')[1];\r\n var args = qString.split(',');\r\n originalURL = originalURL.split('#')[0];\r\n ac.loadCategoryItem(args[0], args[1]);\r\n return;\r\n \t} else if (originalURL.indexOf(\"?\") != -1) {\r\n var qString = originalURL.split('?')[1];\r\n // get rid of any bookmarking stuff\r\n if (qString.indexOf(\"#\") != -1) {\r\n qString = qString.split('#')[0];\r\n originalURL = originalURL.split('#')[0];\r\n window.location.href = originalURL;\r\n }\r\n ps = qString.split('&');\r\n // now go through and create the params map as an object literal\r\n for (var i in ps) {\r\n var t = ps[i].split('=');\r\n params[t[0]] = t[1];\r\n }\r\n // first check for the item in product \r\n if (typeof params.itemId != 'undefined' && typeof params.pid != 'undefined') {\r\n ac.loadCategoryItem(params.pid, params.itemId);\r\n \t// next if there is a catid definition then do it\r\n } else if (typeof params.catid != 'undefined') {\r\n ac.showCategory(params.catid);\r\n }\r\n } else {\r\n // nothing is selected\r\n ac.showFirstCategory();\r\n }\r\n }", "function tagSalam(arg, values) {\n // membuat variable untuk menyimpan strings argumen\n let str0 = arg[0];\n let str1 = arg[1];\n\n // mengembalikan strings dalam bentuk template literals yang telah diformat\n // 'strings pertama' + 'ekspresi' + 'strings kedua'\n return `${str0}${values}${str1}`;\n}", "onInputChangeTerms(terms_search) {\n console.log(\"onInputChangeTerms: \" + terms_search);\n let filters = this.props.filters;\n filters.terms_search = terms_search;\n filters.do_terms_search = true;\n this.props.setFilter( filters );\n }", "function ParamMap(){}", "enterLiteral(ctx) {\n\t}", "function Assign_Lex_Lex() {\r\n}", "function UserInputs(action, input) {\n switch (action) {\n case \"concert-this\":\n runBandsInTown(input);\n fixString(input)\n break;\n case \"spotify-this-song\":\n runSpotify(input);\n fixString(input)\n break;\n case \"movie-this\":\n runOmdb(input);\n fixString(input)\n break;\n case \"do-what-it-says\":\n runRandom(input);\n break;\n default:\n console.log(\"\\n--------------------------------------------------------\");\n console.log(\n \"Please enter a valid argument, such as:\\n\\nnode liri.js movie-this [MOVIE TITLE]\\n\\nnode liri.js spotify-this-song [SONG TITLE]\\n\\nnode liri.js concert-this [ARTIST NAME]\\n\\nnode liri.js do-what-it-says\"\n );\n console.log(\n \"--------------------------------------------------------\\n\\n\"\n );\n }\n}", "function getSubPrep(x, req, res) {\n const url = strOp.subPrep(x);\n res.redirect(url);\n}", "function InputValue(value){\n\t\tif(value.match(/[-+*\\/.]|[0-9]/g)){\n\t\t\tnewValue += value;\n\t\t\t_render();\n\t\t}\n\t\telse if(value == '='){\n\t\t\tevaluate();\n\t\t}\n\t\telse if(value == 'c'){\n\t\t\tnewValue = \"\";\n\t\t\t_render();\n\t\t}\n\t\telse\n\t\t\tconsole.log(\"Invalid!\");\n\t}", "function computeGenre(inputGenre) {\n if (inputGenre) {\n inputGenre = inputGenre.toLowerCase();\n switch (inputGenre) {\n case \"action\": \n parseGenre = \"&with_genres=28\";\n break;\n case \"adventure\":\n parseGenre = \"&with_genres=12\";\n break;\n case \"animation\":\n parseGenre = \"&with_genres=16\";\n break;\n case \"comedy\":\n parseGenre = \"&with_genres=35\";\n break;\n case \"crime\":\n parseGenre = \"&with_genres=80\";\n break;\n case \"documentary\":\n parseGenre = \"&with_genres=99\";\n break;\n case \"drama\":\n parseGenre = \"&with_genres=18\";\n break;\n case \"family\":\n parseGenre = \"&with_genres=10751\";\n break;\n case \"fantasy\":\n parseGenre = \"&with_genres=14\";\n break;\n case \"history\":\n parseGenre = \"&with_genres=36\";\n break;\n case \"horror\":\n parseGenre = \"&with_genres=27\";\n break;\n case \"music\":\n parseGenre = \"&with_genres=10402\";\n break;\n case \"mystery\":\n parseGenre = \"&with_genres=9648\";\n break;\n case \"romance\":\n parseGenre = \"&with_genres=10749\";\n break;\n case \"science fiction\":\n parseGenre = \"&with_genres=878\";\n break;\n case \"tv movie\":\n parseGenre = \"&with_genres=10770\";\n break;\n case \"thriller\":\n parseGenre = \"&with_genres=53\";\n break;\n case \"war\":\n parseGenre = \"&with_genres=10752\";\n break;\n case \"western\":\n parseGenre = \"&with_genres=37\";\n break;\n }\n }\n}", "function computeGenre(inputGenre) {\n if (inputGenre) {\n inputGenre = inputGenre.toLowerCase();\n switch (inputGenre) {\n case \"action\": \n parseGenre = \"&with_genres=28\";\n break;\n case \"adventure\":\n parseGenre = \"&with_genres=12\";\n break;\n case \"animation\":\n parseGenre = \"&with_genres=16\";\n break;\n case \"comedy\":\n parseGenre = \"&with_genres=35\";\n break;\n case \"crime\":\n parseGenre = \"&with_genres=80\";\n break;\n case \"documentary\":\n parseGenre = \"&with_genres=99\";\n break;\n case \"drama\":\n parseGenre = \"&with_genres=18\";\n break;\n case \"family\":\n parseGenre = \"&with_genres=10751\";\n break;\n case \"fantasy\":\n parseGenre = \"&with_genres=14\";\n break;\n case \"history\":\n parseGenre = \"&with_genres=36\";\n break;\n case \"horror\":\n parseGenre = \"&with_genres=27\";\n break;\n case \"music\":\n parseGenre = \"&with_genres=10402\";\n break;\n case \"mystery\":\n parseGenre = \"&with_genres=9648\";\n break;\n case \"romance\":\n parseGenre = \"&with_genres=10749\";\n break;\n case \"science fiction\":\n parseGenre = \"&with_genres=878\";\n break;\n case \"tv movie\":\n parseGenre = \"&with_genres=10770\";\n break;\n case \"thriller\":\n parseGenre = \"&with_genres=53\";\n break;\n case \"war\":\n parseGenre = \"&with_genres=10752\";\n break;\n case \"western\":\n parseGenre = \"&with_genres=37\";\n break;\n }\n }\n}", "toUrlAndQuery() {\r\n const aliasedParams = new Map(this.query);\r\n let url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, (match, labelName, value) => {\r\n Logger.write(`Rewriting aliased parameter from match ${match} to label: ${labelName} value: ${value}`, 0 /* Verbose */);\r\n aliasedParams.set(labelName, `'${value}'`);\r\n return labelName;\r\n });\r\n if (aliasedParams.size > 0) {\r\n const char = url.indexOf(\"?\") > -1 ? \"&\" : \"?\";\r\n url += `${char}${Array.from(aliasedParams).map((v) => v[0] + \"=\" + v[1]).join(\"&\")}`;\r\n }\r\n return url;\r\n }", "function postRespec() {\n\taddTextSemantics();\n\tswapInDefinitions();\n\ttermTitles();\n\tlinkUnderstanding();\n}", "function intosc()\n{\n\tvar theform = document.theform;\n\n\ttheform.rules.value =\n\t\ttheform.cats.value + \"\\n\" + \n\t\ttheform.rewrite.value + \"\\n\" + \n\t\ttheform.rules.value + \"\\n\";\n}", "convertHandler() {\n\t\tlet category = this.m_catMenu.value;\n\t\tlet unitA = this.m_unitAMenu.value;\n\t\tlet unitB = this.m_unitBMenu.value;\n\t\tlet value = this.m_unitAInput.value;\n\t\tif(value != \"\") {\n\t\t\tlet newVal = this.CALCULATOR.convert(category, unitA, unitB, value);\n\t\t\tthis.m_unitBOutput.value = newVal;\n\t\t}\n\t}", "static applyParameterValues(resourceScope, param, paramValueMapping) {\n let value = paramValueMapping[param.value];\n // Set default value if no value has been given\n if (!value && param.defaultScoped) {\n param.defaultScoped.forEach((scoped) => {\n if (!scoped.scope) {\n throw new Error('Missing required oo:defaultScope value for a default scope.\\n' + NodeUtil.inspect(param));\n }\n scoped.scope.forEach((scope) => {\n if (!scoped.scopedValue) {\n throw new Error('Missing required oo:defaultScopedValue value for a default scope.\\n' + NodeUtil.inspect(param));\n }\n if (resourceScope.hasType(scope.value)) {\n value = scoped.scopedValue;\n }\n });\n });\n }\n if (!value && param.defaults) {\n value = param.defaults;\n }\n if (!value && param.required) {\n throw new Error('Parameter ' + param.value + ' is required, but no value for it has been set in ' + paramValueMapping.value + '.\\n' + NodeUtil.inspect(paramValueMapping));\n }\n // Force-add fixed parameter values\n if (param.fixed) {\n // If the paramater value must be unique and a value has already been set, crash\n if (param.unique) {\n if (value) {\n throw new Error('A parameter is unique, has a fixed value, but also has another defined value.\\n' + NodeUtil.inspect(param));\n }\n else {\n value = param.fixed;\n }\n }\n else {\n // Otherwise, add to the value\n if (!value) {\n value = [];\n }\n if (!(value instanceof Array)) {\n throw new Error('Values must be an array\\n' + NodeUtil.inspect(param));\n }\n param.fixed.forEach((f) => value.push(f));\n }\n }\n // If the value is singular, and the value should be unique, transform the array to a single element\n if (param.unique && param.unique.value === 'true' && value instanceof Array) {\n value = value[0];\n }\n // If a param range is defined, apply the type and validate the range.\n if (param.range) {\n if (value instanceof Array) {\n value = value.map((e) => Util.captureType(e, param));\n }\n else {\n value = Util.captureType(value, param);\n }\n }\n // If the parameter is marked as lazy,\n // make the value inherit this lazy tag so that it can be handled later.\n if (value && param.lazy) {\n value.lazy = param.lazy;\n }\n return value;\n }", "inboundState() {\n var op = getUrlParameter('op');\n var value = decodeURIComponent(getUrlParameter('value'));\n \n if (op === 'setSearchTerm') {\n this.quickSearch(value);\n $('#search-value').val(value);\n } else {\n this.setDataOp('setQueryParameter',['dc:language','en']);\n this.retrieveData().extractItems().displayResults();\n }\n \n \n }", "function w(){\r\n\t\tlet ret = []\r\n\t\targuments = normalizeArrayTree(arguments)\r\n\t\tfor(let argument of arguments){\t// Either a constant (a word type), a string (literally) or an empty array\r\n\t\t\tif(typeof argument == 'number')\t// A constant\r\n\t\t\t\tret.push(Words.randomWord(argument))\r\n\t\t\telse if(typeof argument == 'string')\r\n\t\t\t\tret.push(argument)\r\n\t\t}\r\n\t\treturn ret\r\n\t}", "function formatRecipeSearch(parameters,type){\n const paramString = parameters.split(' ').join(',');\n return paramString;\n}", "enterStringValue(ctx) {\n }", "function $8cdd8e5f2a340285$var$lsl(hljs) {\n var LSL_STRING_ESCAPE_CHARS = {\n className: \"subst\",\n begin: /\\\\[tn\"\\\\]/\n };\n var LSL_STRINGS = {\n className: \"string\",\n begin: '\"',\n end: '\"',\n contains: [\n LSL_STRING_ESCAPE_CHARS\n ]\n };\n var LSL_NUMBERS = {\n className: \"number\",\n relevance: 0,\n begin: hljs.C_NUMBER_RE\n };\n var LSL_CONSTANTS = {\n className: \"literal\",\n variants: [\n {\n begin: \"\\\\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\\\b\"\n },\n {\n begin: \"\\\\b(XP_ERROR_(EXPERIENCES_DISABLED|EXPERIENCE_(DISABLED|SUSPENDED)|INVALID_(EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(FOUND|PERMITTED(_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(_OBJECT)?|(DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(_(BY_(LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(PARCEL(_OWNER)?|REGION)))?|CAMERA_(PITCH|DISTANCE|BEHINDNESS_(ANGLE|LAG)|(FOCUS|POSITION)(_(THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(ROOT|SET|ALL_(OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(IVE|_(ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(FWD|BACK|(ROT_)?(LEFT|RIGHT)|UP|DOWN|(ML_)?LBUTTON)|PERMISSION_(RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(_START)?|TELEPORT|MEDIA)|OBJECT_(CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(COUNT|EQUIVALENCE)|RETURN_(PARCEL(_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(_TAG)?|CREATOR|ATTACHED_(POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(BODY_SHAPE|PATHFINDING)_TYPE|(RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(MEMORY|TIME))|TYPE_(INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(DEBUG|PUBLIC)_CHANNEL|ATTACH_(AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](SHOULDER|HAND|FOOT|EAR|EYE|[UL](ARM|LEG)|HIP)|(LEFT|RIGHT)_PEC|HUD_(CENTER_[12]|TOP_(RIGHT|CENTER|LEFT)|BOTTOM(_(RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(BASE|TIP)|[LR]WING|FACE_(JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(ONLINE|NAME|BORN|SIM_(POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(ON_FILE|USED)|REMOTE_DATA_(CHANNEL|REQUEST|REPLY)|PSYS_(PART_(BF_(ZERO|ONE(_MINUS_(DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(START|END)_(COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(RIBBON|WIND|INTERP_(COLOR|SCALE)|BOUNCE|FOLLOW_(SRC|VELOCITY)|TARGET_(POS|LINEAR)|EMISSIVE)_MASK)|SRC_(MAX_AGE|PATTERN|ANGLE_(BEGIN|END)|BURST_(RATE|PART_COUNT|RADIUS|SPEED_(MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(DROP|EXPLODE|ANGLE(_CONE(_EMPTY)?)?)))|VEHICLE_(REFERENCE_FRAME|TYPE_(NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(LINEAR|ANGULAR)_(FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(LINEAR|ANGULAR)_(DEFLECTION_(EFFICIENCY|TIMESCALE)|MOTOR_(DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(EFFICIENCY|TIMESCALE)|BANKING_(EFFICIENCY|MIX|TIMESCALE)|FLAG_(NO_DEFLECTION_UP|LIMIT_(ROLL_ONLY|MOTOR_UP)|HOVER_((WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(ALLOW_UNSIT|ALPHA_MODE(_(BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(_(BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(_(STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(NONE|LOW|MEDIUM|HIGH)|BUMP_(NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(TYPE_(SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(MIRROR|INVERT))|PHYSICS(_(SHAPE_(CONVEX|NONE|PRIM|TYPE)))?|(POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(ALT_IMAGE_ENABLE|CONTROLS|(CURRENT|HOME)_URL|AUTO_(LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(WIDTH|HEIGHT)_PIXELS|WHITELIST(_ENABLE)?|PERMS_(INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(STANDARD|MINI)|PERM_(NONE|OWNER|GROUP|ANYONE)|MAX_(URL_LENGTH|WHITELIST_(SIZE|COUNT)|(WIDTH|HEIGHT)_PIXELS)))|MASK_(BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(MEDIA_COMMAND_(STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(ALLOW_(FLY|(GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(GROUP_)?OBJECTS)|USE_(ACCESS_(GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(GROUP|ALL)_OBJECT_ENTRY)|COUNT_(TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(HIDE|DEFAULT)|REGION_FLAG_(ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(METHOD|MIMETYPE|BODY_(MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(INVALID_(AGENT|LINK_OBJECT)|NO(T_EXPERIENCE|_(ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(TRIM(_(HEAD|TAIL))?)|CLICK_ACTION_(NONE|TOUCH|SIT|BUY|PAY|OPEN(_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(NONE|SCRIPT_MEMORY)|RC_(DATA_FLAGS|DETECT_PHANTOM|GET_(LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(TYPES|AGENTS|(NON)?PHYSICAL|LAND))|RCERR_(CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(ALLOWED_(AGENT|GROUP)_(ADD|REMOVE)|BANNED_AGENT_(ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(COMMAND|CMD_(PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(CMD_((SMOOTH_)?STOP|JUMP)|DESIRED_(TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(_([ABCD]|NONE))?|MAX_(DECEL|TURN_RADIUS|(ACCEL|SPEED)))|PURSUIT_(OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(EVADE_(HIDDEN|SPOTTED)|FAILURE_(DYNAMIC_PATHFINDING_DISABLED|INVALID_(GOAL|START)|NO_(NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(PARCEL_)?UNREACHABLE)|(GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(_(FAST|NONE|SLOW))?|CONTENT_TYPE_(ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(RADIUS|STATIC)|(PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\\\b\"\n },\n {\n begin: \"\\\\b(FALSE|TRUE)\\\\b\"\n },\n {\n begin: \"\\\\b(ZERO_ROTATION)\\\\b\"\n },\n {\n begin: \"\\\\b(EOF|JSON_(ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(GRANTED|DENIED))\\\\b\"\n },\n {\n begin: \"\\\\b(ZERO_VECTOR|TOUCH_INVALID_(TEXCOORD|VECTOR))\\\\b\"\n }\n ]\n };\n var LSL_FUNCTIONS = {\n className: \"built_in\",\n begin: \"\\\\b(ll(AgentInExperience|(Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(Details|ErrorMessage)|ReturnObjectsBy(ID|Owner)|Json(2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(Mag|Norm|Dist)|Rot(Between|2(Euler|Fwd|Left|Up))|(Euler|Axes)2Rot|Whisper|(Region|Owner)?Say|Shout|Listen(Control|Remove)?|Sensor(Repeat|Remove)?|Detected(Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|([GS]et)(AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(Scale|Offset|Rotate)Texture|(Rot)?Target(Remove)?|(Stop)?MoveToTarget|Apply(Rotational)?Impulse|Set(KeyframedMotion|ContentType|RegionPos|(Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(Queueing|Radius)|Vehicle(Type|(Float|Vector|Rotation)Param)|(Touch|Sit)?Text|Camera(Eye|At)Offset|PrimitiveParams|ClickAction|Link(Alpha|Color|PrimitiveParams(Fast)?|Texture(Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get((Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(PrimitiveParams|Number(OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(Details|PermMask|PrimCount)|Parcel(MaxPrims|Details|Prim(Count|Owners))|Attached(List)?|(SPMax|Free|Used)Memory|Region(Name|TimeDilation|FPS|Corner|AgentCount)|Root(Position|Rotation)|UnixTime|(Parcel|Region)Flags|(Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(Prims|NotecardLines|Sides)|Animation(List)?|(Camera|Local)(Pos|Rot)|Vel|Accel|Omega|Time(stamp|OfDay)|(Object|CenterOf)?Mass|MassMKS|Energy|Owner|(Owner)?Key|SunDirection|Texture(Offset|Scale|Rot)|Inventory(Number|Name|Key|Type|Creator|PermMask)|Permissions(Key)?|StartParameter|List(Length|EntryType)|Date|Agent(Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(Name|State))|(Get|Reset|GetAndReset)Time|PlaySound(Slave)?|LoopSound(Master|Slave)?|(Trigger|Stop|Preload)Sound|((Get|Delete)Sub|Insert)String|To(Upper|Lower)|Give(InventoryList|Money)|RezObject|(Stop)?LookAt|Sleep|CollisionFilter|(Take|Release)Controls|DetachFromAvatar|AttachToAvatar(Temp)?|InstantMessage|(GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(Length|Trim)|(Start|Stop)Animation|TargetOmega|Request(Experience)?Permissions|(Create|Break)Link|BreakAllLinks|(Give|Remove)Inventory|Water|PassTouches|Request(Agent|Inventory)Data|TeleportAgent(Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(Axis|Angle)|A(cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(CSV|Integer|Json|Float|String|Key|Vector|Rot|List(Strided)?)|DeleteSubList|List(Statistics|Sort|Randomize|(Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(Slope|Normal|Contour)|GroundRepel|(Set|Remove)VehicleFlags|SitOnLink|(AvatarOn)?(Link)?SitTarget|Script(Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(Integer|String)ToBase64|XorBase64|Log(10)?|Base64To(String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(Load|Release|(E|Une)scape)URL|ParcelMedia(CommandList|Query)|ModPow|MapDestination|(RemoveFrom|AddTo|Reset)Land(Pass|Ban)List|(Set|Clear)CameraParams|HTTP(Request|Response)|TextBox|DetectedTouch(UV|Face|Pos|(N|Bin)ormal|ST)|(MD5|SHA1|DumpList2)String|Request(Secure)?URL|Clear(Prim|Link)Media|(Link)?ParticleSystem|(Get|Request)(Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\\\b\"\n };\n return {\n name: \"LSL (Linden Scripting Language)\",\n illegal: \":\",\n contains: [\n LSL_STRINGS,\n {\n className: \"comment\",\n variants: [\n hljs.COMMENT(\"//\", \"$\"),\n hljs.COMMENT(\"/\\\\*\", \"\\\\*/\")\n ],\n relevance: 0\n },\n LSL_NUMBERS,\n {\n className: \"section\",\n variants: [\n {\n begin: \"\\\\b(state|default)\\\\b\"\n },\n {\n begin: \"\\\\b(state_(entry|exit)|touch(_(start|end))?|(land_)?collision(_(start|end))?|timer|listen|(no_)?sensor|control|(not_)?at_(rot_)?target|money|email|experience_permissions(_denied)?|run_time_permissions|changed|attach|dataserver|moving_(start|end)|link_message|(on|object)_rez|remote_data|http_re(sponse|quest)|path_update|transaction_result)\\\\b\"\n }\n ]\n },\n LSL_FUNCTIONS,\n LSL_CONSTANTS,\n {\n className: \"type\",\n begin: \"\\\\b(integer|float|string|key|vector|quaternion|rotation|list)\\\\b\"\n }\n ]\n };\n}", "function sc_string() {\n for (var i = 0; i < arguments.length; i++)\n\targuments[i] = arguments[i].val;\n return \"\".concat.apply(\"\", arguments);\n}", "function parseTitle(term, origin, control,node) {\n\tvar titleQuery = \"\";\n\tvar valid = false;\n\t\n\tif( term!=\"\"){\n \t\tvalid=true; \n\n\t\t//xslt is case sensitive, users are not!\n\t\t titleQuery=titleQuery+\"remakes/remake[contains(translate(\"+node+\",$smallcase,$uppercase), translate(\\'\"+term+\"\\',$smallcase,$uppercase))] \"+ $('input[name=refine]:radio:checked')[0].value + \" \"; \n\t\t//for now\n\t\tglobalQuery = globalQuery + titleQuery;\n\t} \n\t\t\t\t\t\t \n\treturn titleQuery; \n}", "addValuesToParams(params, geoAttribute) {\n params.forEach((param) => {\n // TODO: Add more types that FME supports\n if (param.type === \"TEXT\" && !(param.name === geoAttribute)) {\n param.value = param.defaultValue;\n } else if (param.type === \"LOOKUP_LISTBOX\") {\n param.value = { $$$INIT$$$: true };\n param.listOptions.forEach((option) => {\n let found = param.defaultValue.find(\n (defVal) => defVal === option.value\n );\n // Prefix option.value with a letter since option.value may be a number\n param.value[this.prefixOptionValue(option.value)] = !(\n found === undefined\n );\n });\n } else if (param.type === \"LOOKUP_CHOICE\") {\n param.value = param.defaultValue;\n }\n });\n }", "function handleOnInputChange(event) {\n\n let newSource;\n\n switch (event.target.name) {\n case \"query\":\n setKeyWords(event.target.value);\n break;\n case \"scopus\":\n //switch between true and false\n queryData.scopus = true;\n queryData.googleScholar = false;\n queryData.arXiv = false;\n break;\n\n case \"googleScholar\":\n //switch between true and false\n queryData.scopus = false;\n queryData.googleScholar = true;\n queryData.arXiv = false;\n break;\n case \"arXiv\":\n //switch between true and false\n queryData.scopus = false;\n queryData.googleScholar = false;\n queryData.arXiv = true;\n break;\n case \"searchBy\":\n queryData.searchBy = event.target.value;\n break;\n case \"year\":\n queryData.year = event.target.value;\n break;\n default:\n break;\n }\n \n if(event.target.name !== \"query\" && queryData.query && keywords){\n queryData.query = keywords;\n history.push(createQueryStringFromObject(queryData));\n }else{\n setSource({\"scopus\": queryData.scopus, \"googleScholar\": queryData.googleScholar, \"arXiv\": queryData.arXiv});\n setSearchBy(queryData.searchBy);\n setYear(queryData.year);\n }\n\n }", "function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) {\n if(!(typeOrLanguageValue in entry)) {\n entry[typeOrLanguageValue] = term;\n }\n }", "function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) {\n if(!(typeOrLanguageValue in entry)) {\n entry[typeOrLanguageValue] = term;\n }\n }", "function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) {\n if(!(typeOrLanguageValue in entry)) {\n entry[typeOrLanguageValue] = term;\n }\n }", "function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) {\n if(!(typeOrLanguageValue in entry)) {\n entry[typeOrLanguageValue] = term;\n }\n }", "function _addPreferredTerm(mapping, term, entry, typeOrLanguageValue) {\n if(!(typeOrLanguageValue in entry)) {\n entry[typeOrLanguageValue] = term;\n }\n }", "function handleRedirect(e) {\n // If there is no event handler in the param it redirects to this param\n if (e.target) {\n const param = e.target.innerText.toLowerCase();\n history.push(`/${param}`);\n } else {\n const param = e.toLowerCase();\n history.push(`/${param}`);\n }\n }", "function passFn() {\n\tthis.set = set;\n\tthis.has = {};\n\tthis.needs = null;\n\tthis.reason = '';\n\t\n\t// pass functions:\n\treturn {\n\t// general rules\n\t\tone: function(token) {\n\t\t\t// first pass, word-level clues\n\t\t\t// it has a capital and isn't a month, etc.\n\t\t\tif (token.noun_capital && !values[token.normalised]) {\n\t\t\t\treturn _.setPos(token, schema.NN, 'capitalised noun');\n\t\t\t}\n\t\t\t// known words list\n\t\t\tvar lexiPos = lexi(token.normalised);\n\t\t\tif (lexiPos) {\n\t\t\t\ttoken.pos = lexiPos;\n\t\t\t\ttoken.pos_reason = 'lexicon';\n\t\t\t\t// if it's an abbreviation, forgive the punctuation (eg. 'dr.')\n\t\t\t\tif(token.pos.tag === 'NNAB'){ token.punctuated = false; }\n\t\t\t\treturn token;\n\t\t\t}\n\t\t\t// handle punctuation like ' -- '\n\t\t\tif (!token.normalised) { return _.setPos(token, schema.UH, 'wordless string'); }\n\t\t\t// suffix pos signals from wordnet\n\t\t\tvar l = token.normalised.length;\n\t\t\tif (l > 4) {\n\t\t\t\tvar suffix = token.normalised.substr(l - 4, l - 1)\n\t\t\t\tif (wordnet.hasOwnProperty(suffix)) {\n\t\t\t\t\treturn _.setPos(token, schema[wordnet[suffix]], 'wordnet suffix');\n\t\t\t\t}\n\t\t\t}\n\t\t\t// suffix regexes for words\n\t\t\tif (token.normalised.length > 4) {\n\t\t\t\tvar r = rules.wordsMatch(token.normalised);\n\t\t\t\tif (r) { return _.setPos(token, r, 'regex suffix'); }\n\t\t\t}\n\t\t\t// see if it's a number\n\t\t\tif (parseFloat(token.normalised)) { return _.setPos(token, schema.CD, 'parseFloat'); }\n\t\t\treturn token;\n\t\t},\n\t\t// wrangles results a bit, i18n\n\t\ttwo: rules.set,\n\t\t// seek verb or noun phrases after their signals\n\t\tthree: function(token, i, tokens) {\n\t\t\tvar next = tokens[i + 1];\n\t\t\tif (token.pos) {\n\t\t\t\t// suggest noun after some determiners (a|the), posessive pronouns (her|my|its) // i18n\n\t\t\t\tif ((rules.strongDeterminers[token.normalised]) || token.pos.tag === 'PP') {\n\t\t\t\t\treturn this.set(token, {needs: 'noun', reason: token.pos.name}); // proceed\n\t\t\t\t}\n\t\t\t\t// suggest verb after personal pronouns (he|she|they), modal verbs (would|could|should) // TODO - MAYBE DECOUPLE (needs language check again)\n\t\t\t\tif (token.pos.tag === 'PRP' && token.pos.tag !== 'PP' || token.pos.tag === 'MD') {\n\t\t\t\t\treturn this.set(token, {needs: 'verb', reason: token.pos.name}); // proceed\n\t\t\t\t}\n\t\t\t}\n\t\t\t// satisfy need on a conflict, and fix a likely error\n\t\t\tif (token.pos) {\n\t\t\t\tif (this.needs == 'verb' && token.pos.parent == 'noun' && (!next || (next.pos && next.pos.parent != 'noun'))) {\n\t\t\t\t\tif (!next || !next.pos || next.pos.parent != this.needs) { // ensure needs not satisfied on the next one\n\t\t\t\t\t\ttoken = this.set(token, {needs: null, pos: 'VB'});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.needs == 'noun' && token.pos.parent == 'verb' && (!next || (next.pos && next.pos.parent != 'verb'))) {\n\t\t\t\t\tif (!next || !next.pos || next.pos.parent != this.needs) { // ensure needs not satisfied on the next one\n\t\t\t\t\t\ttoken = this.set(token, {needs: null, pos: 'NN'});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// satisfy need with an unknown pos\n\t\t\tif (this.needs && !token.pos) {\n\t\t\t\tif (!next || !next.pos || next.pos.parent != this.needs) { // ensure needs not satisfied on the next one\n\t\t\t\t\ttoken = this.set(token, {needs: null, pos: this.needs});\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set them back as satisfied..\n\t\t\tif (token.pos && (this.needs === 'verb' || this.needs === 'noun') && this.needs === token.pos.parent) {\n\t\t\t\tthis.needs = null;\n\t\t\t}\n\t\t\treturn this.set(token, {});\n\t\t},\n\t\t// missing pos and sentences without verbs\n\t\tfour: function(token) {\n\t\t\tif (!token.pos) {\n\t\t\t\t// if there is no verb in the sentence, and there needs to be.\n\t\t\t\tif (this.has['adjective'] && this.has['noun'] && !this.has['verb']) {\n\t\t\t\t\treturn this.set(token, {pos: 'VB', pos_reason: 'needs one verb'});\n\t\t\t\t}\n\t\t\t\t// fallback to a noun\n\t\t\t\ttoken = this.set(token, {pos: 'NN', pos_reason: 'noun fallback'});\n\t\t\t}\n\t\t\treturn token;\n\t\t},\n\t\t// error correction, i18n\n\t\tfive: rules.special\n\t};\n}", "handleTerm(event){\r\n let wantedValue = event.target.value;\r\n this.handleTermChange(wantedValue);\r\n}", "function crawl(path) {\n\t if (path.is(\"_templateLiteralProduced\")) {\n\t crawl(path.get(\"left\"));\n\t crawl(path.get(\"right\"));\n\t } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n\t path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n\t }\n\t}", "function crawl(path) {\n\t if (path.is(\"_templateLiteralProduced\")) {\n\t crawl(path.get(\"left\"));\n\t crawl(path.get(\"right\"));\n\t } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n\t path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n\t }\n\t}", "function ProcessSearchTerms(ss, DefaultOp) {\n //Parse string into array\n var items = ss.split(reBreakChars);\n\n //----------------------------------------\n // Remove empty list entried due to multiple spaces passed to split()\n // Force all items to Uppercase\n //----------------------------------------\n var c = 0;\n for (var i = 0; i < items.length; i++)\n if (items[i] != \"\") { items[c] = items[i].toUpperCase(); c++; }\n items.length = c;\n\n var CheckOp = true;\n var otype = DefaultOp;\n for (var i = 0; i < items.length; i++) {\n\n //----------------------------------------\n // Check for Override Operators.\n // Don't allow Op override if working with NOT terms\n //----------------------------------------\n if ((CheckOp) && (DefaultOp != OPT_NOT)) {\n otype = xxGetOpType(items[i]);\n CheckOp = (otype == 0);\n if (CheckOp) otype = DefaultOp;\n else continue;\n }\n CheckOp = true;\n\n //----------------------------------------\n // Find Text results ==> SearchResults\n //----------------------------------------\n if (otype==OPT_OR) FindText_OR(items[i], SearchIndexes, SearchResults);\n if (otype==OPT_AND) FindText_AND(items[i], SearchIndexes, SearchResults);\n if (otype==OPT_NOT) FindText_DEL(items[i], SearchIndexes, SearchResults);\n\n //build list of find words\n if (DefaultOp!=OPT_NOT)\n gFindList[gFindList.length] = items[i];\n\n //Clear global flag\n gFirstFindCall = false;\n }\n}", "function Traite_Arguments(oArg) {\r\n\tvar Lg = \"fr\";\r\n\tvar stArguments = \"\";\r\n\ttry {\r\n\t\tstArguments += oArg.mois + \"|\";\r\n\t\tstArguments += oArg.annee + \"|\";\r\n\t\tstArguments += oArg.anneeDebut + \"|\";\r\n\t\tstArguments += oArg.anneeFin + \"|\";\t\t\r\n\t\tif (oArg.format) {\r\n\t\t\tstArguments += CodageFormatDate(oArg.format) + \"|\";\r\n\t\t} else {\r\n\t\t\tstArguments += CodageFormatDate(\"dd/MM/yyyy\") + \"|\";\r\n\t\t}\r\n\t\t\r\n\t\tstArguments += oArg.langue;\r\n\t} catch(e) { alert(\"PB Traite_Arguments : \" + e); }\r\n\t//alert(\"stArguments \" + stArguments);\r\n\treturn stArguments;\r\n}", "applyTerm(term) {\n throw new Error('not implemented')\n }", "function ausgabeNamenParams2(firstName,lastName) { // Parameter\r\n\r\n // 1. Job: string composing\r\n let gap = \" \";\r\n let outputStr = \"Hallo \" + firstName + gap + lastName + \"!\";\r\n \r\n // 2. Job: output\r\n console.log(outputStr); // refactoring == Umformung von Code ohne dass sich die Darstellung im Ergebnis ändert\r\n}", "get termType() {\n return 'Literal';\n }", "get termType() {\n return 'Literal';\n }", "function buildParameter(deflt, description, conditions, values) {\n const wrapValue = (value) => {\n if (typeof value === 'boolean') {\n return `${value}`;\n }\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return value;\n };\n const conditionalValues = {};\n conditions.forEach((cdn, idx) => {\n const value = wrapValue(values[idx]);\n conditionalValues[cdn] = { value };\n });\n return {\n \"defaultValue\": {\n \"value\": wrapValue(deflt),\n },\n conditionalValues,\n description,\n };\n}", "function transformArg(arg) {\n // FIXME: *Enum*Filter are currently empty\n let inputType = arg.inputType.some(a => a.kind === 'enum')\n ? arg.inputType[0]\n : arg.inputType.find(a => a.kind === 'object');\n if (!inputType) {\n inputType = arg.inputType[0];\n }\n return {\n name: arg.name,\n inputType: Object.assign(Object.assign({}, inputType), { type: getReturnTypeName(inputType.type) }),\n // FIXME Why?\n isRelationFilter: undefined,\n };\n}", "function handle(data, context) {\n\tdata = data.toString();\n\n\tvar rv = data;\n\n\t//extend globals with context\n\tfor (var k in context){\n\t\tglobal[k] = context[k];\n\t}\n\n\t//eval all keywords\n\tfor (var i = 0, l = rules.length; i<l; i++){\n\t\trv = rv.replace(rules[i].re, function(match, token, content){\n\t\t\treturn rules[i].handle.apply(this, [match, token, content, context])\n\t\t});\n\t}\n\n\treturn rv;\n}", "function wrapAdjective(parameter = \"*\"){\n//P A R E N T\n return function(singleParameter = \"special\"){\n return `You are ${parameter}${singleParameter}${parameter}!`\n }\n // I N N E R F U N C T I O N\n}", "function Params() {\n const { params } = useParams(); // params&age={int}&weather={str}\n var params_array = params.split(\"&\");\n params_array.shift();\n var params2 = params_array.map(item => {\n var param_end_idx = item.indexOf(\"{\")\n var param = item.slice(0, param_end_idx);\n var type = item.slice(param_end_idx + 1, -1);\n return [param, type];\n }\n );\n\n var MappingItems = params2.map(([param, type]) =>\n <div>\n <Form className='params'>\n <Form.Group as={Row}>\n <Form.Label column sm=\"4\">{param}</Form.Label>\n <Col>\n <Form.Control id={param}\n onChange={event => {\n // parse the parameteres according to the input type //\n parameters[param] = parser(param, type, event.target.value);\n }}\n type=\"text\" placeholder=\"\" />\n </Col>\n </Form.Group>\n </Form>\n </div>\n );\n return MappingItems;\n}", "routeToKeyword(nextKeywords) {\n console.log('in router.js routeToKeyword, nextKeywords:', nextKeywords);\n let values = nextKeywords.split(',');\n console.log('in routeToKeyword values:', values);\n this.store.commit('setSelectedKeywords', values);\n\n // if (!this.silent) {\n // nextKeywords = 'kw ' + nextKeywords\n\n // // creating next hash\n // const nextHash = this.makeHash(nextKeywords, this.store.state.selectedServices);\n\n // const lastHistoryState = this.history.state;\n // this.history.replaceState(lastHistoryState, null, nextHash);\n // }\n }", "function handleTemplateLiteral(globals, strings, values) {\n var state = TEXT,\n token = \"\";\n var valuesLength = values.length;\n var parts = [];\n\n for (var i = 0; i < strings.length; i++) {\n if (i < valuesLength) {\n var value = escape(values[i]);\n var parsedTokens = parse(strings[i]);\n var xstate = state;\n if (xstate === ATTR_VALUE_DOUBLEQUOTE) xstate = ATTR_VALUE;\n if (xstate === ATTR_VALUE_SINGLEQUOTE) xstate = ATTR_VALUE;\n if (xstate === ATTR_VALUE_WHITESPACE) xstate = ATTR_VALUE;\n if (xstate === ATTR) xstate = ATTR_KEY;\n\n if (xstate === OPEN) {\n if (token === \"/\") {\n parsedTokens.push([OPEN, \"/\", value]);\n token = \"\";\n } else {\n parsedTokens.push([OPEN, value]);\n }\n } else {\n // TODO resolve component here?\n // if (typeof value === \"function\") value = value(globals);\n parsedTokens.push([VAR, xstate, value]);\n }\n\n parts.push.apply(parts, parsedTokens);\n } else parts.push.apply(parts, parse(strings[i]));\n }\n\n var tree = [null, {}, []];\n var stack = [[tree, -1]];\n\n for (var _i = 0; _i < parts.length; _i++) {\n var cur = stack[stack.length - 1][0];\n var p = parts[_i],\n tokenType = p[0];\n\n if (tokenType === OPEN && /^\\//.test(p[1])) {\n var ix = stack[stack.length - 1][1];\n\n if (stack.length > 1) {\n stack.pop();\n stack[stack.length - 1][0][2][ix] = h(cur[0], cur[1], cur[2].length ? cur[2] : undefined);\n }\n } else if (tokenType === OPEN) {\n var c = [p[1], {}, []];\n cur[2].push(c);\n stack.push([c, cur[2].length - 1]);\n } else if (tokenType === ATTR_KEY || tokenType === VAR && p[1] === ATTR_KEY) {\n var key = \"\";\n var copyKey = void 0;\n\n for (; _i < parts.length; _i++) {\n if (parts[_i][0] === ATTR_KEY) {\n key = concat(key, parts[_i][1]);\n } else if (parts[_i][0] === VAR && parts[_i][1] === ATTR_KEY) {\n if (_typeof(parts[_i][2]) === \"object\" && !key) {\n for (copyKey in parts[_i][2]) {\n if (parts[_i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) {\n cur[1][copyKey] = parts[_i][2][copyKey];\n }\n }\n } else {\n key = concat(key, parts[_i][2]);\n }\n } else break;\n }\n\n if (parts[_i][0] === ATTR_EQ) _i++;\n var j = _i;\n\n for (; _i < parts.length; _i++) {\n if (parts[_i][0] === ATTR_VALUE || parts[_i][0] === ATTR_KEY) {\n if (!cur[1][key]) cur[1][key] = strfn(parts[_i][1]);else parts[_i][1] === \"\" || (cur[1][key] = concat(cur[1][key], parts[_i][1]));\n } else if (parts[_i][0] === VAR && (parts[_i][1] === ATTR_VALUE || parts[_i][1] === ATTR_KEY)) {\n if (!cur[1][key]) cur[1][key] = strfn(parts[_i][2]);else parts[_i][2] === \"\" || (cur[1][key] = concat(cur[1][key], parts[_i][2]));\n } else {\n if (key.length && !cur[1][key] && _i === j && (parts[_i][0] === CLOSE || parts[_i][0] === ATTR_BREAK)) {\n // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes\n // empty string is falsy, not well behaved value in browser\n cur[1][key] = key.toLowerCase();\n }\n\n if (parts[_i][0] === CLOSE) {\n _i--;\n }\n\n break;\n }\n }\n } else if (tokenType === ATTR_KEY) {\n cur[1][p[1]] = true;\n } else if (tokenType === VAR && p[1] === ATTR_KEY) {\n cur[1][p[2]] = true;\n } else if (tokenType === CLOSE) {\n if (selfClosing(cur[0]) && stack.length) {\n var _ix = stack[stack.length - 1][1];\n stack.pop();\n stack[stack.length - 1][0][2][_ix] = h(cur[0], cur[1], cur[2].length ? cur[2] : undefined);\n }\n } else if (tokenType === VAR && p[1] === TEXT) {\n if (p[2] === undefined || p[2] === null) p[2] = \"\";else if (!p[2]) p[2] = concat(\"\", p[2]);\n\n if (Array.isArray(p[2][0])) {\n cur[2].push.apply(cur[2], p[2]);\n } else {\n cur[2].push(p[2]);\n }\n } else if (tokenType === TEXT) {\n cur[2].push(p[1]);\n } else if (tokenType === ATTR_EQ || tokenType === ATTR_BREAK) {// no-op\n } else {\n throw new Error(\"unhandled: \" + tokenType);\n }\n } // TODO handle components\n\n\n if (tree[2].length > 1 && /^\\s*$/.test(tree[2][0])) {\n tree[2].shift();\n }\n\n if (tree[2].length > 2 || tree[2].length === 2 && /\\S/.test(tree[2][1])) {\n return tree[2];\n }\n\n if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === \"string\" && Array.isArray(tree[2][0][2])) {\n tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]);\n }\n\n return tree[2][0];\n\n function parse(str) {\n var res = [];\n if (state === ATTR_VALUE_WHITESPACE) state = ATTR;\n\n for (var _i2 = 0; _i2 < str.length; _i2++) {\n var curChar = str.charAt(_i2);\n\n if (state === TEXT && curChar === \"<\") {\n // _<button>HALLO_</button>\n if (token.length) res.push([TEXT, token]);\n token = \"\";\n state = OPEN; // <button_>HALLO</button_>, ?? not <button x=\"y _> 2\"></button ??, not // <button_></button_>\n } else if (curChar === \">\" && !quot(state) && state !== COMMENT) {\n // <button_>HALLO</button_>\n if (state === OPEN && token.length) {\n res.push([OPEN, token]); // <button disabled_>HALLO</button>\n } else if (state === ATTR_KEY) {\n res.push([ATTR_KEY, token]);\n } // <button x=\"y _> 2\">\n else if (state === ATTR_VALUE && token.length) {\n res.push([ATTR_VALUE, token]);\n }\n\n res.push([CLOSE]);\n token = \"\";\n state = TEXT;\n } else if (state === COMMENT && /-$/.test(token) && curChar === \"-\") {\n token = \"\";\n state = TEXT;\n } else if (state === OPEN && /^!--$/.test(token)) {\n token = curChar;\n state = COMMENT;\n } else if (state === TEXT || state === COMMENT) {\n token += curChar;\n } else if (state === OPEN && curChar === \"/\" && token.length) {// no-op, self closing tag without a space <br/>\n } else if (state === OPEN && /\\s/.test(curChar)) {\n if (token.length) {\n res.push([OPEN, token]);\n }\n\n token = \"\";\n state = ATTR;\n } else if (state === OPEN) {\n token += curChar;\n } else if (state === ATTR && /[^\\s\"'=/]/.test(curChar)) {\n state = ATTR_KEY;\n token = curChar;\n } else if (state === ATTR && /\\s/.test(curChar)) {\n if (token.length) res.push([ATTR_KEY, token]);\n res.push([ATTR_BREAK]);\n } else if (state === ATTR_KEY && /\\s/.test(curChar)) {\n res.push([ATTR_KEY, token]);\n token = \"\";\n state = ATTR_KEY_WHITESPACE;\n } else if (state === ATTR_KEY && curChar === \"=\") {\n res.push([ATTR_KEY, token], [ATTR_EQ]);\n token = \"\";\n state = ATTR_VALUE_WHITESPACE;\n } else if (state === ATTR_KEY) {\n token += curChar;\n } else if ((state === ATTR_KEY_WHITESPACE || state === ATTR) && curChar === \"=\") {\n res.push([ATTR_EQ]);\n state = ATTR_VALUE_WHITESPACE;\n } else if ((state === ATTR_KEY_WHITESPACE || state === ATTR) && !/\\s/.test(curChar)) {\n res.push([ATTR_BREAK]);\n\n if (/[\\w-]/.test(curChar)) {\n token += curChar;\n state = ATTR_KEY;\n } else state = ATTR;\n } else if (state === ATTR_VALUE_WHITESPACE && curChar === '\"') {\n state = ATTR_VALUE_DOUBLEQUOTE;\n } else if (state === ATTR_VALUE_WHITESPACE && curChar === \"'\") {\n state = ATTR_VALUE_SINGLEQUOTE;\n } else if (state === ATTR_VALUE_DOUBLEQUOTE && curChar === '\"') {\n res.push([ATTR_VALUE, token], [ATTR_BREAK]);\n token = \"\";\n state = ATTR;\n } else if (state === ATTR_VALUE_SINGLEQUOTE && curChar === \"'\") {\n res.push([ATTR_VALUE, token], [ATTR_BREAK]);\n token = \"\";\n state = ATTR;\n } else if (state === ATTR_VALUE_WHITESPACE && !/\\s/.test(curChar)) {\n state = ATTR_VALUE;\n _i2--;\n } else if (state === ATTR_VALUE && /\\s/.test(curChar)) {\n res.push([ATTR_VALUE, token], [ATTR_BREAK]);\n token = \"\";\n state = ATTR;\n } else if (state === ATTR_VALUE || state === ATTR_VALUE_SINGLEQUOTE || state === ATTR_VALUE_DOUBLEQUOTE) {\n token += curChar;\n }\n }\n\n if (state === TEXT && token.length) {\n res.push([TEXT, token]);\n token = \"\";\n } else if (state === ATTR_VALUE && token.length) {\n res.push([ATTR_VALUE, token]);\n token = \"\";\n } else if (state === ATTR_VALUE_DOUBLEQUOTE && token.length) {\n res.push([ATTR_VALUE, token]);\n token = \"\";\n } else if (state === ATTR_VALUE_SINGLEQUOTE && token.length) {\n res.push([ATTR_VALUE, token]);\n token = \"\";\n } else if (state === ATTR_KEY) {\n res.push([ATTR_KEY, token]);\n token = \"\";\n }\n\n return res;\n }\n }", "function INDIRECT()\n{\n if(arguments.length==0)\n { \n alert(\"please enter parameter into function \");\n return \"=INDIRECT()\";\n }\n else\n if(arguments.length!=1)\n {\n alert(\"please enter one parameter only into function \");\n return \"=INDIRECT()\";\n\n }\n\n if(ISBLANK(arguments[0])==true)\n {\n\n return \"# REF!\";\n }\n \n \n return arguments[0];\n\n\n}", "function Bind_Oliteral() {\r\n}", "function getTranslationUrl(input) {\n return url+ \"?\"+ \"text=\"+ input\n}", "function search_scholars_portal_journals() {\n var url=\"http://proxy.library.carleton.ca/login?url=http://journals2.scholarsportal.info./search-advanced.xqy?q=\";\n var input_element = document.getElementById(\"search_terms\");\n var end_of_url = \"&search_in=anywhere&date_from=&date_to=&sort=relevance&sub=\";\n document.location = url + encodeURIComponent(input_element.value) + end_of_url;\n}", "function apply_filter(filter, value)\n {\n\t \n\tswitch (filter)\n\t{\n\t case \"assigned_to\":\n\t \n\t\t var initials = \"\";\n\t\t var name = value.split(\" \");\n\t\t for (var v = 0; name[v]; v++)\n\t\t {\n\t\t name[v] = name[v].trim();\n\t\t initials += name[v][0].toUpperCase();\n\t\t }\n\n\t\t /*\n\t\t //then add the initials\n\t\t var prefix = \"Région HdF / DPSR / SIG - \";\n \t\t if(initials === \"JB\") var prefix = \"Région HdF / DTr / \";\n\t\t else if(initials === \"SL\" || initials === \"HR\") var prefix = \"Région HdF / DPSR / SIG - \";\n\t\t else var prefix = \"Région HdF / Agence HdF 2020-2040 / SIG - \";\n\t\t value = prefix + initials;\n\t\t */\n\n\t\t // Correspondance entre les initials récupéré et les identifiants drupal (contenu de type contact)\n\t\t switch(initials){\n\t\t \tcase \"JB\":\n\t\t\t\tvalue = 1037;\n\t\t\t\tbreak;\n\t\t\tcase \"SL\":\n\t\t\t\tvalue = 1018;\n\t\t\t\tbreak;\n\t\t\tcase \"FD\":\n\t\t\t\tvalue = 18;\n\t\t\t\tbreak;\n\t\t\tcase \"HR\":\n\t\t\t\tvalue = 19;\n\t\t\t\tbreak;\n\t\t\tcase \"JT\":\n\t\t\t\tvalue = 20;\n\t\t\t\tbreak;\n\t\t\tcase \"RM\":\n\t\t\t\tvalue = 21;\n\t\t\t\tbreak;\n\t\t\tcase \"CB\":\n\t\t\t\tvalue = 17;\n\t\t\t\tbreak;\n\t\t\tcase \"CA\":\n\t\t\t\tvalue = 23;\n\t\t\t\tbreak;\n\t\t\tcase \"CP\":\n\t\t\t\tvalue = 24;\n\t\t\t\tbreak;\n\t\t\tcase \"TD\":\n\t\t\t\tvalue = 1039;\n\t\t\t\tbreak;\n\t\t\tcase \"RVB\":\n\t\t\t\tvalue = 1040;\n\t\t\t\tbreak;\n\t\t }\n\n\n\t\tbreak;\n\n\t case \"emprise geographique\":\n\n\t value = (\"Régional\" == value) ? \"Région\" : value;\n\t \n\t break;\n\n\t case \"echelle\":\n\n\t\t //récupération de l'échelle\n\t\t //espace + nombres seulement + :\n\n\t\tvar position_to_slice = value.indexOf(\"(\");\n\t\tif(position_to_slice >= 0) {\n\t\t\tvar value = value.slice(0, position_to_slice).trim();\n\t\t}\n\t \n\t break;\n\t\n\t}\n\treturn value;\n }", "function main(args) {\n // propagate errors\n if (args.error) return args\n // unescape params: { action, state, foo, params: { bar } } becomes { action, state, params: { foo, bar } }\n const action = args.action\n const state = args.state\n const params = args.params\n delete args.action\n delete args.state\n delete args.params\n return { action, state, params: Object.assign(args, params) }\n}", "function _addPreferredTerm(term, entry, typeOrLanguageValue) {\n if(!entry.hasOwnProperty(typeOrLanguageValue)) {\n entry[typeOrLanguageValue] = term;\n }\n }", "setParamValue(text, val) {\n console.log(\"IMPLEMENT ME\");\n }", "function I18nMutateOpCodes(){}", "function convert_CHANGE_ORDER(param) {\n switch (param) {\n case '1':\n return 'COP';\n case '2':\n return 'REF';\n case '3':\n return 'WHS';\n case '4':\n return 'FAC';\n case '5':\n return 'VEN';\n case '6':\n default:\n return 'UDF';\n }\n}", "function changeUrlTalents(talents) {\n $location.search('talents', generateUrlTalents(talents));\n }", "function processLitAutoSuggest(value, label, id)\n{\n\t// If value is \"http\" redirect to profile page\n\tif (value.substring(0,5) == \"https\")\n\t{\n\t\tjsCBDgoToUrl(value.substring(7, value.length));\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(id).value = value; \n\t\t\n\t\tquery = document.getElementById('autoSuggestForm:targetedQuery');\n\t\tif(query!=null)\n\t\t{\n\t\t\tif(validateQuery(query.value))\n\t\t\t{\n\t\t\t\tcategory = document.getElementById('autoSuggestForm:targetedCategory').value;\n\t\t\t\turl=jsCBDgetContextRoot()+\"JSP/UtilityBar/Search/SearchGlobalContent.jsf\"; \n\t\t\t\turl=jsCBDaddQueryStringParam(url, \"targetedQuery\", query.value); \n\t\t\t\turl=jsCBDaddQueryStringParam(url, \"targetedCategory\", category);\n\t\t\t\tjsCBDgoToUrl(url, null, true);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n}", "function main(params) {\n var name = params.name || params.payload || 'stranger';\n var place = params.place || 'somewhere';\n return {payload: 'Hello, ' + name + ' from ' + place + ' !'};\n}", "static initialize(obj) { \n obj['rightToLiteral'] = rightToLiteral;\n }", "function reasonml(hljs) {\n function orReValues(ops){\n return ops\n .map(function(op) {\n return op\n .split('')\n .map(function(char) {\n return '\\\\' + char;\n })\n .join('');\n })\n .join('|');\n }\n\n var RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*';\n var RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*';\n\n var RE_PARAM_TYPEPARAM = '\\'?[a-z$_][0-9a-z$_]*';\n var RE_PARAM_TYPE = '\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*(' + RE_PARAM_TYPEPARAM + '\\s*(,' + RE_PARAM_TYPEPARAM + ')*)?\\s*\\))?';\n var RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + ')?(' + RE_PARAM_TYPE + ')?';\n var RE_OPERATOR = \"(\" + orReValues(['||', '&&', '++', '**', '+.', '*', '/', '*.', '/.', '...', '|>']) + \"|==|===)\";\n var RE_OPERATOR_SPACED = \"\\\\s+\" + RE_OPERATOR + \"\\\\s+\";\n\n var KEYWORDS = {\n keyword:\n 'and as asr assert begin class constraint do done downto else end exception external ' +\n 'for fun function functor if in include inherit initializer ' +\n 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' +\n 'object of open or private rec sig struct then to try type val virtual when while with',\n built_in:\n 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ',\n literal:\n 'true false'\n };\n\n var RE_NUMBER = '\\\\b(0[xX][a-fA-F0-9_]+[Lln]?|' +\n '0[oO][0-7_]+[Lln]?|' +\n '0[bB][01_]+[Lln]?|' +\n '[0-9][0-9_]*([Lln]|(\\\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)';\n\n var NUMBER_MODE = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: RE_NUMBER\n },\n {\n begin: '\\\\(\\\\-' + RE_NUMBER + '\\\\)'\n }\n ]\n };\n\n var OPERATOR_MODE = {\n className: 'operator',\n relevance: 0,\n begin: RE_OPERATOR\n };\n var LIST_CONTENTS_MODES = [\n {\n className: 'identifier',\n relevance: 0,\n begin: RE_IDENT\n },\n OPERATOR_MODE,\n NUMBER_MODE\n ];\n\n var MODULE_ACCESS_CONTENTS = [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT, returnBegin: true,\n end: \"\\.\",\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n var PARAMS_CONTENTS = [\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT, returnBegin: true,\n end: \"\\.\",\n relevance: 0,\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n var PARAMS_MODE = {\n begin: RE_IDENT,\n end: '(,|\\\\n|\\\\))',\n relevance: 0,\n contains: [\n OPERATOR_MODE,\n {\n className: 'typing',\n begin: ':',\n end: '(,|\\\\n)',\n returnBegin: true,\n relevance: 0,\n contains: PARAMS_CONTENTS\n }\n ]\n };\n\n var FUNCTION_BLOCK_MODE = {\n className: 'function',\n relevance: 0,\n keywords: KEYWORDS,\n variants: [\n {\n begin: '\\\\s(\\\\(\\\\.?.*?\\\\)|' + RE_IDENT + ')\\\\s*=>',\n end: '\\\\s*=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: RE_IDENT\n },\n {\n begin: RE_PARAM\n },\n {\n begin: /\\(\\s*\\)/,\n }\n ]\n }\n ]\n },\n {\n begin: '\\\\s\\\\(\\\\.?[^;\\\\|]*\\\\)\\\\s*=>',\n end: '\\\\s=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n relevance: 0,\n variants: [\n PARAMS_MODE\n ]\n }\n ]\n },\n {\n begin: '\\\\(\\\\.\\\\s' + RE_IDENT + '\\\\)\\\\s*=>'\n }\n ]\n };\n MODULE_ACCESS_CONTENTS.push(FUNCTION_BLOCK_MODE);\n\n var CONSTRUCTOR_MODE = {\n className: 'constructor',\n begin: RE_MODULE_IDENT + '\\\\(',\n end: '\\\\)',\n illegal: '\\\\n',\n keywords: KEYWORDS,\n contains: [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'params',\n begin: '\\\\b' + RE_IDENT\n }\n ]\n };\n\n var PATTERN_MATCH_BLOCK_MODE = {\n className: 'pattern-match',\n begin: '\\\\|',\n returnBegin: true,\n keywords: KEYWORDS,\n end: '=>',\n relevance: 0,\n contains: [\n CONSTRUCTOR_MODE,\n OPERATOR_MODE,\n {\n relevance: 0,\n className: 'constructor',\n begin: RE_MODULE_IDENT\n }\n ]\n };\n\n var MODULE_ACCESS_MODE = {\n className: 'module-access',\n keywords: KEYWORDS,\n returnBegin: true,\n variants: [\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\" + RE_IDENT\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\\\\(\",\n end: \"\\\\)\",\n returnBegin: true,\n contains: [\n FUNCTION_BLOCK_MODE,\n {\n begin: '\\\\(',\n end: '\\\\)',\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+{\",\n end: \"}\"\n }\n ],\n contains: MODULE_ACCESS_CONTENTS\n };\n\n PARAMS_CONTENTS.push(MODULE_ACCESS_MODE);\n\n return {\n name: 'ReasonML',\n aliases: ['re'],\n keywords: KEYWORDS,\n illegal: '(:\\\\-|:=|\\\\${|\\\\+=)',\n contains: [\n hljs.COMMENT('/\\\\*', '\\\\*/', { illegal: '^(\\\\#,\\\\/\\\\/)' }),\n {\n className: 'character',\n begin: '\\'(\\\\\\\\[^\\']+|[^\\'])\\'',\n illegal: '\\\\n',\n relevance: 0\n },\n hljs.QUOTE_STRING_MODE,\n {\n className: 'literal',\n begin: '\\\\(\\\\)',\n relevance: 0\n },\n {\n className: 'literal',\n begin: '\\\\[\\\\|',\n end: '\\\\|\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n {\n className: 'literal',\n begin: '\\\\[',\n end: '\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n CONSTRUCTOR_MODE,\n {\n className: 'operator',\n begin: RE_OPERATOR_SPACED,\n illegal: '\\\\-\\\\->',\n relevance: 0\n },\n NUMBER_MODE,\n hljs.C_LINE_COMMENT_MODE,\n PATTERN_MATCH_BLOCK_MODE,\n FUNCTION_BLOCK_MODE,\n {\n className: 'module-def',\n begin: \"\\\\bmodule\\\\s+\" + RE_IDENT + \"\\\\s+\" + RE_MODULE_IDENT + \"\\\\s+=\\\\s+{\",\n end: \"}\",\n returnBegin: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n className: 'module',\n relevance: 0,\n begin: RE_MODULE_IDENT\n },\n {\n begin: '{',\n end: '}',\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n MODULE_ACCESS_MODE\n ]\n };\n}", "function reasonml(hljs) {\n function orReValues(ops){\n return ops\n .map(function(op) {\n return op\n .split('')\n .map(function(char) {\n return '\\\\' + char;\n })\n .join('');\n })\n .join('|');\n }\n\n var RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*';\n var RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*';\n\n var RE_PARAM_TYPEPARAM = '\\'?[a-z$_][0-9a-z$_]*';\n var RE_PARAM_TYPE = '\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*(' + RE_PARAM_TYPEPARAM + '\\s*(,' + RE_PARAM_TYPEPARAM + ')*)?\\s*\\))?';\n var RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + ')?(' + RE_PARAM_TYPE + ')?';\n var RE_OPERATOR = \"(\" + orReValues(['||', '&&', '++', '**', '+.', '*', '/', '*.', '/.', '...', '|>']) + \"|==|===)\";\n var RE_OPERATOR_SPACED = \"\\\\s+\" + RE_OPERATOR + \"\\\\s+\";\n\n var KEYWORDS = {\n keyword:\n 'and as asr assert begin class constraint do done downto else end exception external ' +\n 'for fun function functor if in include inherit initializer ' +\n 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' +\n 'object of open or private rec sig struct then to try type val virtual when while with',\n built_in:\n 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ',\n literal:\n 'true false'\n };\n\n var RE_NUMBER = '\\\\b(0[xX][a-fA-F0-9_]+[Lln]?|' +\n '0[oO][0-7_]+[Lln]?|' +\n '0[bB][01_]+[Lln]?|' +\n '[0-9][0-9_]*([Lln]|(\\\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)';\n\n var NUMBER_MODE = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: RE_NUMBER\n },\n {\n begin: '\\\\(\\\\-' + RE_NUMBER + '\\\\)'\n }\n ]\n };\n\n var OPERATOR_MODE = {\n className: 'operator',\n relevance: 0,\n begin: RE_OPERATOR\n };\n var LIST_CONTENTS_MODES = [\n {\n className: 'identifier',\n relevance: 0,\n begin: RE_IDENT\n },\n OPERATOR_MODE,\n NUMBER_MODE\n ];\n\n var MODULE_ACCESS_CONTENTS = [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT, returnBegin: true,\n end: \"\\.\",\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n var PARAMS_CONTENTS = [\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT, returnBegin: true,\n end: \"\\.\",\n relevance: 0,\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n var PARAMS_MODE = {\n begin: RE_IDENT,\n end: '(,|\\\\n|\\\\))',\n relevance: 0,\n contains: [\n OPERATOR_MODE,\n {\n className: 'typing',\n begin: ':',\n end: '(,|\\\\n)',\n returnBegin: true,\n relevance: 0,\n contains: PARAMS_CONTENTS\n }\n ]\n };\n\n var FUNCTION_BLOCK_MODE = {\n className: 'function',\n relevance: 0,\n keywords: KEYWORDS,\n variants: [\n {\n begin: '\\\\s(\\\\(\\\\.?.*?\\\\)|' + RE_IDENT + ')\\\\s*=>',\n end: '\\\\s*=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: RE_IDENT\n },\n {\n begin: RE_PARAM\n },\n {\n begin: /\\(\\s*\\)/,\n }\n ]\n }\n ]\n },\n {\n begin: '\\\\s\\\\(\\\\.?[^;\\\\|]*\\\\)\\\\s*=>',\n end: '\\\\s=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n relevance: 0,\n variants: [\n PARAMS_MODE\n ]\n }\n ]\n },\n {\n begin: '\\\\(\\\\.\\\\s' + RE_IDENT + '\\\\)\\\\s*=>'\n }\n ]\n };\n MODULE_ACCESS_CONTENTS.push(FUNCTION_BLOCK_MODE);\n\n var CONSTRUCTOR_MODE = {\n className: 'constructor',\n begin: RE_MODULE_IDENT + '\\\\(',\n end: '\\\\)',\n illegal: '\\\\n',\n keywords: KEYWORDS,\n contains: [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'params',\n begin: '\\\\b' + RE_IDENT\n }\n ]\n };\n\n var PATTERN_MATCH_BLOCK_MODE = {\n className: 'pattern-match',\n begin: '\\\\|',\n returnBegin: true,\n keywords: KEYWORDS,\n end: '=>',\n relevance: 0,\n contains: [\n CONSTRUCTOR_MODE,\n OPERATOR_MODE,\n {\n relevance: 0,\n className: 'constructor',\n begin: RE_MODULE_IDENT\n }\n ]\n };\n\n var MODULE_ACCESS_MODE = {\n className: 'module-access',\n keywords: KEYWORDS,\n returnBegin: true,\n variants: [\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\" + RE_IDENT\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\\\\(\",\n end: \"\\\\)\",\n returnBegin: true,\n contains: [\n FUNCTION_BLOCK_MODE,\n {\n begin: '\\\\(',\n end: '\\\\)',\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+{\",\n end: \"}\"\n }\n ],\n contains: MODULE_ACCESS_CONTENTS\n };\n\n PARAMS_CONTENTS.push(MODULE_ACCESS_MODE);\n\n return {\n name: 'ReasonML',\n aliases: ['re'],\n keywords: KEYWORDS,\n illegal: '(:\\\\-|:=|\\\\${|\\\\+=)',\n contains: [\n hljs.COMMENT('/\\\\*', '\\\\*/', { illegal: '^(\\\\#,\\\\/\\\\/)' }),\n {\n className: 'character',\n begin: '\\'(\\\\\\\\[^\\']+|[^\\'])\\'',\n illegal: '\\\\n',\n relevance: 0\n },\n hljs.QUOTE_STRING_MODE,\n {\n className: 'literal',\n begin: '\\\\(\\\\)',\n relevance: 0\n },\n {\n className: 'literal',\n begin: '\\\\[\\\\|',\n end: '\\\\|\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n {\n className: 'literal',\n begin: '\\\\[',\n end: '\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n CONSTRUCTOR_MODE,\n {\n className: 'operator',\n begin: RE_OPERATOR_SPACED,\n illegal: '\\\\-\\\\->',\n relevance: 0\n },\n NUMBER_MODE,\n hljs.C_LINE_COMMENT_MODE,\n PATTERN_MATCH_BLOCK_MODE,\n FUNCTION_BLOCK_MODE,\n {\n className: 'module-def',\n begin: \"\\\\bmodule\\\\s+\" + RE_IDENT + \"\\\\s+\" + RE_MODULE_IDENT + \"\\\\s+=\\\\s+{\",\n end: \"}\",\n returnBegin: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n className: 'module',\n relevance: 0,\n begin: RE_MODULE_IDENT\n },\n {\n begin: '{',\n end: '}',\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n MODULE_ACCESS_MODE\n ]\n };\n}", "buildGoOption(term) {\n let isValidPatp = urbitOb.isValidPatp(term.substr(1));\n let isStation = isValidStation(term);\n let details = isStation && getStationDetails(term);\n // use collection description if it's a collection\n let displayTextTerm = isStation ? details.type == 'text' ? `${details.station.split(\"/\")[0]} / ${details.stationTitle}` : details.station.split(\"/\").join(\" / \") : term;\n\n let displayText = `go ${displayTextTerm}`;\n let helpText = isStation ?\n `Go to ${details.cir} on ~${details.host}` :\n `Go to the profile of ${term}`\n\n return {\n name: `go ${term}`,\n action: () => {\n let targetUrl;\n if (isValidPatp) {\n targetUrl = profileUrl(term.substr(1))\n this.props.transitionTo(targetUrl);\n } else if (isStation) {\n targetUrl = (details.type === \"text-topic\") ? details.postUrl : details.stationUrl\n this.props.transitionTo(targetUrl);\n }\n },\n displayText,\n helpText\n };\n }", "function setParams() {\r\n \r\n for(Entry<String,Double> e : body.metabolicParameters.get(body.bodyState.state).get(BodyOrgan.BRAIN.value).entrySet()) {\r\n switch (e.getKey()) {\r\n case \"glucoseOxidized_\" : { glucoseOxidized_ = e.getValue(); break; }\r\n case \"glucoseToAlanine_\" : { glucoseToAlanine_ = e.getValue(); break; }\r\n case \"bAAToGlutamine_\" : { bAAToGlutamine_ = e.getValue(); break; }\r\n }\r\n }\r\n //System.out.println(\"glucoseOxidized: \" + glucoseOxidized_);\r\n }", "changeContextParameter(param) {}", "function calculator(number1, number2, operator) {\n switch (operator) {\n case \"+\":\n value = number1 + number2;\n break;\n\n case \"-\":\n value = number1 - number2;\n break;\n\n case \"*\":\n value = number1 * number2;\n break;\n\n case \"/\":\n value = number1 / number2;\n break;\n\n case \"%\":\n value = number1 % number2;\n }\n\n return \"\".concat(number1, \" \").concat(operator, \" \").concat(number2, \" = \").concat(value, \".\"); //return result\n} //call function and pass parameters and write result", "function reasonml(hljs) {\n function orReValues(ops) {\n return ops\n .map(function(op) {\n return op\n .split('')\n .map(function(char) {\n return '\\\\' + char;\n })\n .join('');\n })\n .join('|');\n }\n\n const RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*';\n const RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*';\n\n const RE_PARAM_TYPEPARAM = '\\'?[a-z$_][0-9a-z$_]*';\n const RE_PARAM_TYPE = '\\\\s*:\\\\s*[a-z$_][0-9a-z$_]*(\\\\(\\\\s*(' + RE_PARAM_TYPEPARAM + '\\\\s*(,' + RE_PARAM_TYPEPARAM + '\\\\s*)*)?\\\\))?';\n const RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + '){0,2}';\n const RE_OPERATOR = \"(\" + orReValues([\n '||',\n '++',\n '**',\n '+.',\n '*',\n '/',\n '*.',\n '/.',\n '...'\n ]) + \"|\\\\|>|&&|==|===)\";\n const RE_OPERATOR_SPACED = \"\\\\s+\" + RE_OPERATOR + \"\\\\s+\";\n\n const KEYWORDS = {\n keyword:\n 'and as asr assert begin class constraint do done downto else end exception external ' +\n 'for fun function functor if in include inherit initializer ' +\n 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' +\n 'object of open or private rec sig struct then to try type val virtual when while with',\n built_in:\n 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ',\n literal:\n 'true false'\n };\n\n const RE_NUMBER = '\\\\b(0[xX][a-fA-F0-9_]+[Lln]?|' +\n '0[oO][0-7_]+[Lln]?|' +\n '0[bB][01_]+[Lln]?|' +\n '[0-9][0-9_]*([Lln]|(\\\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)';\n\n const NUMBER_MODE = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: RE_NUMBER\n },\n {\n begin: '\\\\(-' + RE_NUMBER + '\\\\)'\n }\n ]\n };\n\n const OPERATOR_MODE = {\n className: 'operator',\n relevance: 0,\n begin: RE_OPERATOR\n };\n const LIST_CONTENTS_MODES = [\n {\n className: 'identifier',\n relevance: 0,\n begin: RE_IDENT\n },\n OPERATOR_MODE,\n NUMBER_MODE\n ];\n\n const MODULE_ACCESS_CONTENTS = [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT,\n returnBegin: true,\n end: \"\\.\",\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n const PARAMS_CONTENTS = [\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT,\n returnBegin: true,\n end: \"\\.\",\n relevance: 0,\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n const PARAMS_MODE = {\n begin: RE_IDENT,\n end: '(,|\\\\n|\\\\))',\n relevance: 0,\n contains: [\n OPERATOR_MODE,\n {\n className: 'typing',\n begin: ':',\n end: '(,|\\\\n)',\n returnBegin: true,\n relevance: 0,\n contains: PARAMS_CONTENTS\n }\n ]\n };\n\n const FUNCTION_BLOCK_MODE = {\n className: 'function',\n relevance: 0,\n keywords: KEYWORDS,\n variants: [\n {\n begin: '\\\\s(\\\\(\\\\.?.*?\\\\)|' + RE_IDENT + ')\\\\s*=>',\n end: '\\\\s*=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: RE_IDENT\n },\n {\n begin: RE_PARAM\n },\n {\n begin: /\\(\\s*\\)/\n }\n ]\n }\n ]\n },\n {\n begin: '\\\\s\\\\(\\\\.?[^;\\\\|]*\\\\)\\\\s*=>',\n end: '\\\\s=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n relevance: 0,\n variants: [ PARAMS_MODE ]\n }\n ]\n },\n {\n begin: '\\\\(\\\\.\\\\s' + RE_IDENT + '\\\\)\\\\s*=>'\n }\n ]\n };\n MODULE_ACCESS_CONTENTS.push(FUNCTION_BLOCK_MODE);\n\n const CONSTRUCTOR_MODE = {\n className: 'constructor',\n begin: RE_MODULE_IDENT + '\\\\(',\n end: '\\\\)',\n illegal: '\\\\n',\n keywords: KEYWORDS,\n contains: [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'params',\n begin: '\\\\b' + RE_IDENT\n }\n ]\n };\n\n const PATTERN_MATCH_BLOCK_MODE = {\n className: 'pattern-match',\n begin: '\\\\|',\n returnBegin: true,\n keywords: KEYWORDS,\n end: '=>',\n relevance: 0,\n contains: [\n CONSTRUCTOR_MODE,\n OPERATOR_MODE,\n {\n relevance: 0,\n className: 'constructor',\n begin: RE_MODULE_IDENT\n }\n ]\n };\n\n const MODULE_ACCESS_MODE = {\n className: 'module-access',\n keywords: KEYWORDS,\n returnBegin: true,\n variants: [\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\" + RE_IDENT\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\\\\(\",\n end: \"\\\\)\",\n returnBegin: true,\n contains: [\n FUNCTION_BLOCK_MODE,\n {\n begin: '\\\\(',\n end: '\\\\)',\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\\\\{\",\n end: /\\}/\n }\n ],\n contains: MODULE_ACCESS_CONTENTS\n };\n\n PARAMS_CONTENTS.push(MODULE_ACCESS_MODE);\n\n return {\n name: 'ReasonML',\n aliases: [ 're' ],\n keywords: KEYWORDS,\n illegal: '(:-|:=|\\\\$\\\\{|\\\\+=)',\n contains: [\n hljs.COMMENT('/\\\\*', '\\\\*/', {\n illegal: '^(#,\\\\/\\\\/)'\n }),\n {\n className: 'character',\n begin: '\\'(\\\\\\\\[^\\']+|[^\\'])\\'',\n illegal: '\\\\n',\n relevance: 0\n },\n hljs.QUOTE_STRING_MODE,\n {\n className: 'literal',\n begin: '\\\\(\\\\)',\n relevance: 0\n },\n {\n className: 'literal',\n begin: '\\\\[\\\\|',\n end: '\\\\|\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n {\n className: 'literal',\n begin: '\\\\[',\n end: '\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n CONSTRUCTOR_MODE,\n {\n className: 'operator',\n begin: RE_OPERATOR_SPACED,\n illegal: '-->',\n relevance: 0\n },\n NUMBER_MODE,\n hljs.C_LINE_COMMENT_MODE,\n PATTERN_MATCH_BLOCK_MODE,\n FUNCTION_BLOCK_MODE,\n {\n className: 'module-def',\n begin: \"\\\\bmodule\\\\s+\" + RE_IDENT + \"\\\\s+\" + RE_MODULE_IDENT + \"\\\\s+=\\\\s+\\\\{\",\n end: /\\}/,\n returnBegin: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n className: 'module',\n relevance: 0,\n begin: RE_MODULE_IDENT\n },\n {\n begin: /\\{/,\n end: /\\}/,\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n MODULE_ACCESS_MODE\n ]\n };\n}", "function reasonml(hljs) {\n function orReValues(ops) {\n return ops\n .map(function(op) {\n return op\n .split('')\n .map(function(char) {\n return '\\\\' + char;\n })\n .join('');\n })\n .join('|');\n }\n\n const RE_IDENT = '~?[a-z$_][0-9a-zA-Z$_]*';\n const RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*';\n\n const RE_PARAM_TYPEPARAM = '\\'?[a-z$_][0-9a-z$_]*';\n const RE_PARAM_TYPE = '\\\\s*:\\\\s*[a-z$_][0-9a-z$_]*(\\\\(\\\\s*(' + RE_PARAM_TYPEPARAM + '\\\\s*(,' + RE_PARAM_TYPEPARAM + '\\\\s*)*)?\\\\))?';\n const RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + '){0,2}';\n const RE_OPERATOR = \"(\" + orReValues([\n '||',\n '++',\n '**',\n '+.',\n '*',\n '/',\n '*.',\n '/.',\n '...'\n ]) + \"|\\\\|>|&&|==|===)\";\n const RE_OPERATOR_SPACED = \"\\\\s+\" + RE_OPERATOR + \"\\\\s+\";\n\n const KEYWORDS = {\n keyword:\n 'and as asr assert begin class constraint do done downto else end exception external ' +\n 'for fun function functor if in include inherit initializer ' +\n 'land lazy let lor lsl lsr lxor match method mod module mutable new nonrec ' +\n 'object of open or private rec sig struct then to try type val virtual when while with',\n built_in:\n 'array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ',\n literal:\n 'true false'\n };\n\n const RE_NUMBER = '\\\\b(0[xX][a-fA-F0-9_]+[Lln]?|' +\n '0[oO][0-7_]+[Lln]?|' +\n '0[bB][01_]+[Lln]?|' +\n '[0-9][0-9_]*([Lln]|(\\\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)';\n\n const NUMBER_MODE = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: RE_NUMBER\n },\n {\n begin: '\\\\(-' + RE_NUMBER + '\\\\)'\n }\n ]\n };\n\n const OPERATOR_MODE = {\n className: 'operator',\n relevance: 0,\n begin: RE_OPERATOR\n };\n const LIST_CONTENTS_MODES = [\n {\n className: 'identifier',\n relevance: 0,\n begin: RE_IDENT\n },\n OPERATOR_MODE,\n NUMBER_MODE\n ];\n\n const MODULE_ACCESS_CONTENTS = [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT,\n returnBegin: true,\n end: \"\\.\",\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n const PARAMS_CONTENTS = [\n {\n className: 'module',\n begin: \"\\\\b\" + RE_MODULE_IDENT,\n returnBegin: true,\n end: \"\\.\",\n relevance: 0,\n contains: [\n {\n className: 'identifier',\n begin: RE_MODULE_IDENT,\n relevance: 0\n }\n ]\n }\n ];\n\n const PARAMS_MODE = {\n begin: RE_IDENT,\n end: '(,|\\\\n|\\\\))',\n relevance: 0,\n contains: [\n OPERATOR_MODE,\n {\n className: 'typing',\n begin: ':',\n end: '(,|\\\\n)',\n returnBegin: true,\n relevance: 0,\n contains: PARAMS_CONTENTS\n }\n ]\n };\n\n const FUNCTION_BLOCK_MODE = {\n className: 'function',\n relevance: 0,\n keywords: KEYWORDS,\n variants: [\n {\n begin: '\\\\s(\\\\(\\\\.?.*?\\\\)|' + RE_IDENT + ')\\\\s*=>',\n end: '\\\\s*=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: RE_IDENT\n },\n {\n begin: RE_PARAM\n },\n {\n begin: /\\(\\s*\\)/\n }\n ]\n }\n ]\n },\n {\n begin: '\\\\s\\\\(\\\\.?[^;\\\\|]*\\\\)\\\\s*=>',\n end: '\\\\s=>',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n className: 'params',\n relevance: 0,\n variants: [ PARAMS_MODE ]\n }\n ]\n },\n {\n begin: '\\\\(\\\\.\\\\s' + RE_IDENT + '\\\\)\\\\s*=>'\n }\n ]\n };\n MODULE_ACCESS_CONTENTS.push(FUNCTION_BLOCK_MODE);\n\n const CONSTRUCTOR_MODE = {\n className: 'constructor',\n begin: RE_MODULE_IDENT + '\\\\(',\n end: '\\\\)',\n illegal: '\\\\n',\n keywords: KEYWORDS,\n contains: [\n hljs.QUOTE_STRING_MODE,\n OPERATOR_MODE,\n {\n className: 'params',\n begin: '\\\\b' + RE_IDENT\n }\n ]\n };\n\n const PATTERN_MATCH_BLOCK_MODE = {\n className: 'pattern-match',\n begin: '\\\\|',\n returnBegin: true,\n keywords: KEYWORDS,\n end: '=>',\n relevance: 0,\n contains: [\n CONSTRUCTOR_MODE,\n OPERATOR_MODE,\n {\n relevance: 0,\n className: 'constructor',\n begin: RE_MODULE_IDENT\n }\n ]\n };\n\n const MODULE_ACCESS_MODE = {\n className: 'module-access',\n keywords: KEYWORDS,\n returnBegin: true,\n variants: [\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\" + RE_IDENT\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\\\\(\",\n end: \"\\\\)\",\n returnBegin: true,\n contains: [\n FUNCTION_BLOCK_MODE,\n {\n begin: '\\\\(',\n end: '\\\\)',\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n {\n begin: \"\\\\b(\" + RE_MODULE_IDENT + \"\\\\.)+\\\\{\",\n end: /\\}/\n }\n ],\n contains: MODULE_ACCESS_CONTENTS\n };\n\n PARAMS_CONTENTS.push(MODULE_ACCESS_MODE);\n\n return {\n name: 'ReasonML',\n aliases: [ 're' ],\n keywords: KEYWORDS,\n illegal: '(:-|:=|\\\\$\\\\{|\\\\+=)',\n contains: [\n hljs.COMMENT('/\\\\*', '\\\\*/', {\n illegal: '^(#,\\\\/\\\\/)'\n }),\n {\n className: 'character',\n begin: '\\'(\\\\\\\\[^\\']+|[^\\'])\\'',\n illegal: '\\\\n',\n relevance: 0\n },\n hljs.QUOTE_STRING_MODE,\n {\n className: 'literal',\n begin: '\\\\(\\\\)',\n relevance: 0\n },\n {\n className: 'literal',\n begin: '\\\\[\\\\|',\n end: '\\\\|\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n {\n className: 'literal',\n begin: '\\\\[',\n end: '\\\\]',\n relevance: 0,\n contains: LIST_CONTENTS_MODES\n },\n CONSTRUCTOR_MODE,\n {\n className: 'operator',\n begin: RE_OPERATOR_SPACED,\n illegal: '-->',\n relevance: 0\n },\n NUMBER_MODE,\n hljs.C_LINE_COMMENT_MODE,\n PATTERN_MATCH_BLOCK_MODE,\n FUNCTION_BLOCK_MODE,\n {\n className: 'module-def',\n begin: \"\\\\bmodule\\\\s+\" + RE_IDENT + \"\\\\s+\" + RE_MODULE_IDENT + \"\\\\s+=\\\\s+\\\\{\",\n end: /\\}/,\n returnBegin: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n className: 'module',\n relevance: 0,\n begin: RE_MODULE_IDENT\n },\n {\n begin: /\\{/,\n end: /\\}/,\n skip: true\n }\n ].concat(MODULE_ACCESS_CONTENTS)\n },\n MODULE_ACCESS_MODE\n ]\n };\n}" ]
[ "0.49727756", "0.49120852", "0.49065593", "0.48922473", "0.48867127", "0.48588923", "0.48551345", "0.4798961", "0.47860354", "0.47789928", "0.47789928", "0.4776643", "0.47615755", "0.47615755", "0.47145283", "0.4689574", "0.46878794", "0.46702182", "0.46512684", "0.46458772", "0.46447238", "0.46293393", "0.46163723", "0.46035394", "0.4594625", "0.4587826", "0.4582091", "0.4560823", "0.4558916", "0.45580864", "0.45519474", "0.4539317", "0.45331436", "0.45311594", "0.45308104", "0.45289466", "0.45163137", "0.45149", "0.4514094", "0.45108616", "0.45108616", "0.45064613", "0.44915926", "0.44775784", "0.44775623", "0.44688424", "0.4463942", "0.44636026", "0.44598565", "0.44587734", "0.4455642", "0.44546568", "0.44545862", "0.44523528", "0.44460362", "0.44389793", "0.44389793", "0.44389793", "0.44389793", "0.44389793", "0.44382623", "0.44290927", "0.44251862", "0.44203904", "0.44203904", "0.44193858", "0.44150907", "0.44116172", "0.4410517", "0.44046465", "0.44046465", "0.43999743", "0.4392669", "0.43883345", "0.4387109", "0.43858933", "0.43810555", "0.43799213", "0.43741086", "0.436661", "0.4366278", "0.43634686", "0.43632528", "0.43627635", "0.43621674", "0.43609616", "0.435896", "0.43586951", "0.43578735", "0.43554834", "0.43546662", "0.43545872", "0.4351985", "0.4351985", "0.4351074", "0.4350385", "0.43501145", "0.43458855", "0.43401164", "0.43401164" ]
0.5275294
0
StartQuiz function is for displaying questions and answers
function startQuiz(event){ content.textContent = ""; quizImage.remove(); quizBtn.remove(); if(arrQues[i] !== undefined){ ques.textContent = arrQues[i].q; for(var j=0 ; j<arrQues[i].options.length; j++){ var li = document.createElement("li"); li.innerHTML = (j+1) + ". " +arrQues[i].options[j]; li.setAttribute("id", j); ques.append(li); } i++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startQuiz() {\n hideElement(introEl);\n showElement(questionsContainerEl);\n availableQuestions = quiz;\n getNewQuestion();\n\n}", "function initiateQuiz() {\n startQuiz();\n renderFirstQuestion();\n answerChoice();\n renderNextQuestion();\n}", "function startQuiz () {}", "function startQuiz() {\n displayNo('startBtn');\n displayYes('card');\n displayYes('answers');\n nextQuestion();\n}", "function startQuiz() {\n //Start game bit to prevent game from being reset\n isStarted = true;\n //Show Answer buttons A-D\n answerA.style.display = \"block\";\n answerB.style.display = \"block\";\n answerC.style.display = \"block\";\n answerD.style.display = \"block\";\n\n //hide start button\n startButton.style.display = \"none\";\n //Start timer\n countdown();\n //Generate question/answer pair and display in window\n getQuestion();\n getAnswers();\n}", "function beginQuiz() {\n if (startQuiz) {\n header.style.display = 'none';\n quiz.style.display = 'block';\n createQuestions(mainQuestion);\n playTheme();\n }\n}", "function startQuiz(answer) {\n hideWelcome();\n questionDisplay(answer);\n timer();\n}", "function startQuiz() {\n //Removes the initial screen and displays the quiz questions; begins the quiz for the user\n showHide(getQuiz, introEl);\n\n //Start timer\n setTime();\n\n //Show the question based on index that increase by increments\n showQuestion();\n\n}", "function startQuiz() {\n handleAnswerClick();\n displayInterface();\n \n timer();\n}", "function startQuiz() {\n $landing.remove()\n $content.prepend($question)\n startTimer()\n nextQuestion()\n }", "function startQuiz() {\n // Hide title screen and scores button\n instructionsEl.classList.add(\"hide\");\n viewtopScores.classList.add(\"hide\");\n // show question container\n questionContainerEl.classList.remove(\"hide\");\n // Set timer\n startTimer();\n // Show first question\n getQuestion();\n}", "function startQuiz() {\n welcomeSection.style.display = \"none\";\n questionSection.style.display = \"block\";\n currentQuestion = 0;\n startTimer();\n askQuestions();\n}", "function startQuiz() {\n questionCounter = 0;\n hideMenu();\n showQuestions();\n startTimer();\n}", "function startQuiz() {\n beginQuiz.style.display = \"none\";\n welcomeQuiz.style.display = \"none\";\n titleHeader.style.display = \"none\";\n askQuestion();\n progressCounter();\n quiz.style.display = \"block\";\n question.style.display = \"inline\";\n qImages.style.display = \"block\";\n solution.style.display = \"inline\";\n counter.style.display = \"inline\";\n}", "function startQuiz() {\ndisplayQuestions();\nquizCountdown();\n\n}", "function doQuiz() {\n\n\trenderQuiz();\n\trenderQuestion();\n\tcheckAnswer();\n}", "function beginQuiz(){\n endQuiz.style.display = \"none\";\n if (currentQuestionSpot === finalQuestion){\n return finalScore();\n } \n var currentQuestion = quizQuestions[currentQuestionSpot];\n questionsEl.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\n choiceA.innerHTML = currentQuestion.optionA;\n choiceB.innerHTML = currentQuestion.optionB;\n choiceC.innerHTML = currentQuestion.optionC;\n choiceD.innerHTML = currentQuestion.optionD;\n}", "function startQuiz() {\n console.log('Started')\n startButton.classList.add('hide')\n shuffledQuestions = questions.sort(() => Math.random() - .5)\n currentQuestionIndex = 0\n score = 0\n questionSection.classList.remove('hide')\n nextButton.classList.remove('hide')\n restartBtn.classList.remove('hide')\n introSection.classList.add('hide')\n countdown(1);\n setNextQuestion()\n}", "function startQuiz() {\n start.style.display = \"none\"; // make the startQuiz container dissapear\n renderQuestion(); // run renderQuestion function, makes the question appear on screen\n quiz.style.display = \"block\"; //make the quiz container appear\n renderProgress(); // make the progress circles appear by running renderProgress function\n}", "function startQuiz(){\n\n start.style.display = \"none\";\n quiz.style.display = \"block\";\n \n timeStart();\n renderQuestions();\n}", "function beginquiz() {\n console.log(\"beginquiz()\");\n // Hides the instructions and the start button //\n instructionsEl.classList.add(\"hide\");\n startbuttonEl.classList.add(\"hide\");\n // Starts timer located in timer.js//\n countdown();\n // Begins the quiz //\n quizquestions();\n }", "function startQuiz(){\n firstPage.style.display = \"none\";\n quizEl.style.display = \"flex\";\n secondsRemaining = 75;\n console.log (currentQuestion)\n startClock();\n displayQuestions();\n}", "function startQuiz() {\n hide(\"start-button\");\n show(\"quiz\");\n timerSetting();\n currentQuestion = 0;\n getQuestion(0);\n questionClick();\n\n}", "function startQuiz()\n{\n resetQuestions(); // Reset list of questions since they get spliced out when generating quiz\n div_starter.style.display = \"none\"; // Hide starter div\n div_quizzer.style.display = \"flex\"; // Show quizzer div which had default of flex\n questionNum = 1;\n quiz = getQuiz(5);\n timer = 60.00;\n startTimer();\n txt_timer.innerHTML = timer.toFixed(2);\n txt_output.innerHTML = \"\";\n quizUser();\n}", "function startQuiz(quiz){\n //initilize the timer\n clearPage();\n var timer = setCountdown(quiz);\n count(timer);\n\n //if this isn't the first quiz in a session, it will show timer and line again\n $(\".feedback-line\").show();\n $(\".timer\").show();\n \n //print the current question to the screen\n printQuestion(quiz[currentQuestion], quiz);\n}", "function beginQuiz() {\n loadingPage.style.display = \"none\";\n showQuestion();\n setTime();\n quizEl.style.display = \"block\";\n}", "function startQuiz(){\n mainPage.style.display = \"none\";\n quizPage.style.display = \"block\";\n currentQuestion = 0;\n correctScore = 0;\n getScores();\n loadQuestion();\n loadAnswers();\n startTimer();\n}", "function startQuiz() {\n\t\tif (isLoaded) {\n\t\t\tbuttonUndo.setAttribute(\"disabled\",\"false\");\n\t\t\tbuttonUndo.setAttribute(\"display\",\"inline\");\n\t\t\tscoreText.innerText = \"\";\n\n\t\t\t//load quiz problems here\n\t\t\t//first get an array of the questions to be used this session\n\t\t\tlet newQuestions = [],\n\t\t\t defIndexList = []; //list of index numbers to assign randomly to quiz question definitions\n\t\t\tfor (var i=0; i<NUMPROBLEMS; i++) {\n\t\t\t\tvar problem = popRandom(quizJson,Object.keys(quizJson).length);\n\t\t\t\t//console.log(problem);\n\t\t\t\tnewQuestions.push(problem);\n\t\t\t\tdefIndexList.push(i);\n\t\t\t\t//move a random element from question pool to session pool\n\t\t\t}\n\n\t\t\t//answers matched to definitions based on server side memory of number pairs\n\t\t\t//as opposed to having correct pairs having matching indices which could be inspected by user\n\t\t\tanswerMap = []; //clear answers\n\t\t\tfor (var i=0; i<NUMPROBLEMS; i++) {\n\t\t\t\tlet term = newQuestions[i][0].term;\n\t\t\t\tlet definition = newQuestions[i][0].definition;\n\t\t\t\t$.get(\"termWidget\"+(i+1)).innerText = term;\n\t\t\t\tdefIndex = popRandom(defIndexList, defIndexList.length);\n\t\t\t\tanswerMap.push(defIndex);\n\t\t\t\t$.get(\"definitionText\"+defIndex).innerText = definition;\n\t\t\t}\n\t\t\t//correct definition for term 1 is the number located in answerMap[1]\n\n\t\t\t//clear any prior moves\n\t\t\tactionHistory = [];\n\n\n\t\t\t//fix button state\n\t\t\tvar button = buttonControl;\n\t\t\tbutton.value=\"End\";\n\t\t\tbutton.disabled=false;\n\t\t\tbuttonUndo.disabled=false;\n\n\t\t\t//unlock and display all terms\n\t\t\tvar terms = termsContainer.getElementsByClassName(\"termWidget\");\n\t\t\tfor (var i = 0; i < terms.length; i++) {\n\t\t\t\trestoreTerm(terms[i]);\n\n\t\t\t}\n\n\t\t\t//initialize start time\n\t\t\ttimerStart = Date.now();\n\t\t\ttimer();\n\t\t\tlet refreshInterval = 1000/30; //update time at 30 fps\n\t\t\ttimerInterval = setInterval(timer,refreshInterval);\n\t\t}\n\t}", "function startQuiz() {\n // hide the title screen,\n titleScreen.setAttribute(\"class\", \"hide\");\n // then show quiz questions, choices\n quizScreen.setAttribute(\"class\", \"show\");\n //starting timer at the end, instead of the beginning to be fair.\n setTime();\n}", "function makeQuiz () {\n renderChristmasTunesQuiz();\n }", "function startQuiz() {\n score = 0;\n setTime();\n hideStartScreen.classList.add('hide');\n displayedQuestion.classList.remove('hide');\n shuffleQuestions = quizQuestions.sort(() => Math.random () - .5);\n currentQuestionIndex = 0;\n nextQuestion();\n}", "function runQuizApp() {\r\n startButton();\r\n questionDisplay();\r\n submit();\r\n next();\r\n \r\n}", "function startQuiz() {\n $(\".scoreboardPTags\").hide();\n $(\".welcome-p\").hide();\n $(\".welcome-p2\").hide();\n $(\"#startBtn\").hide();\n\n questionPlusAnswer += 1;\n currentQuestion = quizquestions[questionPlusAnswer];\n $(\"h1\").text(currentQuestion[0]);\n $(\"h1\").css(\"text-align\", \"left\");\n for (let i = 0; i < currentQuestion[1].length; i++) {\n var pTag = $(\"<button>\");\n pTag.addClass(\"userAnswer btn\");\n pTag.attr(\"id\", \"answer:\" + i);\n pTag.text(currentQuestion[1][i]);\n $(\"main\").append(pTag);\n }\n }", "function startQuiz() {\n $(\"#garbage\").empty();\n $(\"#stopwatch-title\").text(\"Seconds Left\");\n $(\"#stopwatch-time\").text(secondsLeft);\n startStopwatch();\n $(\"#start-btn\").hide();\n console.log(\"quiz started\");\n promptQuestion(questionList);\n}", "function startQuiz() {\n // Add/Remove classes\n startQuizBtn.classList.add('hide');\n questionArea.classList.remove('hide');\n var instructions = document.querySelector('.instructions');\n instructions.classList.add('hide');\n\n // Start Timer\n startTimer();\n\n // Get Question\n getQuestion();\n}", "function startQuiz() {\n $(\"#trivia-questions\").show(500);\n $(\"#start-trivia\").hide(1000);\n // calls the render function to populate page with html quiz structure\n renderQuiz(questions);\n // calls function to start timer\n jQuery(function($) {\n const tMinutes = 60 * 2,\n display = $(\"#main-timer\");\n startTimer(tMinutes, display);\n });\n}", "function startQuiz() {\n homePage.style.display = \"none\";\n quizEl.style.display = \"block\";\n questionStat.style.display = \"block\";\n userStats.style.display = \"none\";\n tryAgainEl.style.display = \"none\";\n questionNum = 0;\n correctAnswer = 0;\n showQuestion();\n}", "function beginQuiz() {\n // Set the countdown\n countdown = 60;\n // Shuffle the questions array\n shuffledQuizArr = quizArr.sort(() => Math.random() - 0.5); // Credit: https://flaviocopes.com/how-to-shuffle-array-javascript/\n // Disable buttons while quiz is active\n beginBtn.disabled = true;\n highscoreBtn.disabled = true;\n restartBtn.disabled = true;\n // Start countdown\n countdownTimer();\n // Show the question and list of answers\n showQuiz();\n}", "function startQuiz () {\n startButton.style.display = 'none';\n displayQuestion();\n questionBox.style.display = \"block\";\n quizLoop();\n checkAnswer();\n}", "function startQuiz() {\n startPage.style.display = \"none\";\n quizPage.style.display = \"block\";\n countDown();\n giveQuestion(currentQuestion)\n}", "function startQuiz() {\n questionCounter = 0;\n score = 0;\n availableQuestions = [...questions];\n newQuestion();\n}", "function startQuiz () {\n $('#start').on('click', function() {\n renderFieldsetForm('question', STORE);\n });\n}", "function handleStartQuiz() {\n $(\"article.quiz-details\").html($(\"#js-start-template\").clone());\n $(\"form[name='quiz-start']\").submit(function(event) {\n var quiz = newQuiz();\n event.preventDefault();\n $(\"article.quiz-details\").html(makeCurrentQuestionElem(quiz));\n handleAnswers(quiz);\n handleRestarts();\n });\n }", "function handleStartQuiz() {\n $(\"article.quiz-details\").html($(\"#js-start-template\").clone());\n $(\"form[name='quiz-start']\").submit(function(event) {\n var quiz = newQuiz();\n event.preventDefault();\n $(\"article.quiz-details\").html(makeCurrentQuestionElem(quiz));\n handleAnswers(quiz);\n handleRestarts();\n });\n }", "function renderQuiz() {\n startPage();\n handleAnswerSubmitButton();\n handleNextQuestionButton();\n restartQuiz();\n}", "function createQuiz() {\n audioTest();\n quizStart();\n nextQuestion();\n}", "function startQuiz() {\n displayCurrentQuestion();\n $(\"#nextButton\").show();\n $(\"#startButton\").hide();\n $(\".row\").show();\n startTimer();\n}", "function showQuestions() {\n if (quizBank.length == questionCounter) {\n endQuiz();\n } else {\n questionDisplay.innerText = quizBank[questionCounter].question;\n showAnswers();\n }\n}", "function startQuiz(){\n start.style.display = \"none\";\n quiz.style.display = \"block\";\n timerContainer.style.display = \"block\";\n scoreContainer.style.display = \"block\";\n showQuestion();\n setTime();\n setScore();\n}", "function startQuiz() {\n startSound.play();\n landingPage.style.display = \"none\";\n quizPage.style.display = \"block\";\n isCorrect = null;\n renderQuestion();\n timeCountDown = setInterval(timeCount, 1000);\n}", "function startQuiz() {\r\n startBtn.classList.add('hide')\r\n\r\n randomQ = quizQs.sort(() => Math.random() - .5)\r\n currentIndex = 0\r\n\r\n questionContainerEl.classList.remove('hide')\r\n // function allocates info for the next question\r\n nextQues()\r\n}", "function startQuiz() {\n startScreen.style.display = 'none';\n questionDiv.style.display = 'flex';\n shuffledQuestions = quizQuestions.sort(() => Math.random() - 0.5)\n currentQuestionIndex = 0\n \n nextQuestion()\n\n}", "function startQuiz() {\n //console.log('Started')\n\n startBtn.classList.add(\"hide\");\n\n timerId = setInterval(timer, 1000);\n\n // generateQueztion()\n generateQuestions();\n }", "function startQ(){\n $(\"main\").on(\"click\", \".startButton\", event => {\n event.preventDefault();\n submitQuestion();\n submitFeedback();\n store.quizStarted = true;\n renderQuestionView();\n })\n}", "function startQuiz() {\n duringQuiz = true;\n timeLeft = timeTotal;\n quizInterval = setInterval(function() {\n timeLeft--;\n timeLeftEl.textContent = \"Time left: \" + timeLeft + \"s\";\n }, 1000 * 1);\n setTimer(timeLeft);\n currentQuestionIndex = 0;\n createQuestionContainer();\n loadQuestion(questions[currentQuestionIndex]);\n}", "function startQuiz() { \r\n quizQuestionpage.style.display = \"block\";\r\n finalScorePage.style.display = \"none\"; // Hide Final Core Page \r\n quizChallengePage.style.display = \"none\"; // Hide Quiz Challenge Page \r\n choice1.style.display = \"block\";\r\n choice2.style.display = \"block\";\r\n choice3.style.display = \"block\";\r\n choice4.style.display = \"block\";\r\n choice5.style.display = \"block\";\r\n \r\n var timerInterval = setInterval(function() { \r\n secondsLeft--;\r\n timer.textContent = \"Time: \" + secondsLeft;\r\n\r\n if (secondsLeft === 0 || quizQuestions.length === questionIndex+1) {\r\n clearInterval(timerInterval);\r\n // showFinalScore();\r\n }\r\n \r\n },1000); \r\n //crear header y choices \r\n //for (var i = 0; i > quizQuestions.length; i++){\r\n \r\n //};\r\n if(questionIndex < quizQuestions.length){\r\n generateQuestions(questionIndex)\r\n }\r\n else{\r\n generateQuestions.text(\"Game over\")\r\n }\r\n \r\n}", "function startQuiz() {\n startButton.classList.add('hide')\n shuffledQuestions = questions.sort(() => Math.random() - .5)\n currentQuestionIndex = 0\n quizBoxEl.classList.remove('hide')\n nextQuestion()\n}", "function handleQuizApp(){\r\n renderStartTemplate();\r\n checkIfCorrect();\r\n changeToQuizTemplate();\r\n nextQuestion();\r\n}", "function startQuiz() {\n showQuestion();\n startTimer();\n}", "function startQuiz(){\r\n\ttitle.style.display = \"none\";\r\n start.style.display = \"none\";\r\n renderQuestion();\r\n quiz.style.display = \"block\";\r\n renderCounter();\r\n renderLives();\r\n renderScore();\r\n TIMER = setInterval(renderCounter,1000); // 1000ms = 1s\r\n}", "function startQuiz(){\n console.log('started!')\n\n //hide start page\n var startingPage = document.getElementById('startPage');\n startingPage.setAttribute(\"hidden\", \" \");\n\n //hide scorePage\n scorePage.setAttribute('hidden',\" \")\n\n //show questions\n showQuestions.removeAttribute(\"hidden\");\n\n //show timer\n countdown.removeAttribute(\"hidden\")\n \n questionNum = 0;\n i = 0;\n timeleft = 75;\n getQuestions()\n timer()\n \n}", "function quiz() {\n render();\n handleStart();\n handleQuestion();\n handleScore();\n handleEnd();\n}", "function renderQuiz () {\n if(store.quizStarted === false) {\n if(store.questionNumber === store.questions.length){\n const quizResultsString = generateQuizResultsString();\n $('main').html(quizResultsString); \n } else {\n const quizWelcomeInterfaceString = generateWelcomeString();\n $('main').html(quizWelcomeInterfaceString);\n }\n } else if (store.quizStarted === true) {\n if(store.submittingAnswer === false) {\n const quizInterfaceString = generateQuizForm(currentQuestion());\n $('main').html(quizInterfaceString);\n } else if (store.submittingAnswer === true) {\n const quizAnswerResponseString = generateAnswerResults();\n $('main').html(quizAnswerResponseString);\n }\n } \n}", "function startQuizButton() {\n $('.start-quiz').on('click', function (event) {\n event.preventDefault();\n store.quizStarted = true;\n store.score = 0;\n store.questionNumber = 0;\n $('main').html(generateQuestion());\n showQuestion();\n });\n}", "function startQuiz() {\n $('#start').on('click', function (event) {\n displayQuestion();\n }\n );\n}", "function renderQuiz() {\n if (store.quizStarted === false) {\n $('main').html(generateStartPage());\n return;\n } else if (store.questionNumber < store.questions.length) {\n $('main').html(generateQuestionPage());\n return;\n } else {\n $('main').html(generateFinalPage());\n return;\n }\n}", "function startQuiz() {\n console.log(\"start\"); \n buildQuestionCard();\n startTimer();\n}", "function startQuiz(){\r\n start.style.display = \"none\";\r\n showQuestion();\r\n quiz.style.display = \"block\";\r\n Progress();\r\n renderCounter();\r\n timer = setInterval(renderCounter,1000); // 1000ms = 1s\r\n}", "function startQuiz(){\n $(\".startButton\").on(\"click\", function(event) {\n $(\".startQuiz\").hide();\n $(\".hideForm\").toggle();\n $(\"#question\").text(1);\n renderQuestion();\n event.preventDefault();\n });\n}", "function startQuiz() {\n // Hide start screen elements and unhide question contatiner\n startButton.classList.add(\"hide\");\n startTextEl.classList.add(\"hide\");\n questionContainerEl.classList.remove(\"hide\");\n // Initialize countdown timer\n timerId = setInterval(clock, 1000);\n timeEl.textContent = time;\n //Populate first question\n showQuestion();\n}", "function initQuiz(STORE, questionNumber, totalQuestions) {\r\n let score = 0;\r\n let questionNumberDisp = questionNumber + 1;\r\n\r\n $('.questionAnswerForm').html(initHTML(STORE, questionNumber));\r\n $('.quizStart').on('click', '.startButton', function (event) {\r\n\r\n $('.quizStart').remove();\r\n updateAnswerList(STORE, questionNumber, totalQuestions, questionNumberDisp, score);\r\n $('.quizQuestions').css('display', 'block');\r\n }\r\n );\r\n}", "function startQuiz() {\n updateTime(0); //sets initial time\n startScreenEl.setAttribute(\"class\", \"hide\"); \n questionsEl.removeAttribute(\"class\");\n questionCounter = 0;\n getQuestions(); \n quizTimer = setInterval(updateTime, 1000);\n}", "function startQuiz() {\n \n \n startScreen.style.display = \"none\";\n quiz.style.display = \"block\";\n renderQuestions();\n timer = setInterval(countdown, 1000);\n counter.textContent = count;\n \n}", "function quizStart() {\n $('#start-button').on('click', function(event){\n event.preventDefault();\n $('#js-starting-screen').hide();\n renderQuestion();\n console.log('`quizStart` ran');\n });\n}", "function startQuiz() {\n console.log(\"the game has started\");\n score = 0;\n timerEl.classList.remove('hide'); \n countDown();\n $(\"#welcome\").hide();\n nameEl.classList.add('hide');\n displayScoreEl.classList.add('hide');\n finalScoreEl.classList.add('hide');\n startBtn.classList.add('hide');\n currentQuestionIndex = 0;\n questionContainerEl.classList.remove('hide');\n setNextQuestion();\n}", "function startQuiz() {\n\ttimerInterval = setInterval(function () {\n\t\ttimerNav.innerHTML = secondsLeft;\n\t\tsecondsLeft = secondsLeft - 1;\n\t\ttimerNav.innerHTML = secondsLeft;\n\n\t\tif (secondsLeft === 0) {\n\t\t\ttimerNav.innerHTML = secondsLeft;\n\t\t\tclearInterval(timerInterval);\n\t\t}\n\t}, 1000);\n\n\tintroDiv.classList.toggle(\"collapse\");\n\tquizcontentDiv.classList.toggle(\"collapse\");\n\tactiveDiv = quizcontentDiv;\n\tloadQuestion(i);\n}", "function main() {\r\n renderPage();\r\n startQuiz();\r\n submitAnswer();\r\n resumeQuiz();\r\n restartQuiz();\r\n}", "function startQuiz() {\n //css style\n hideDiv.style.visibility = 'hidden';\n nextButton.style.display = 'block';\n scoreContainer.style.display = 'block';\n\n // timer\n let duration = 30 * questions.length;\n // let duration = 30 * 1;\n startTimer(duration, timerContainer);\n\n // displaying question function\n return displayQuestion();\n}", "startQuiz() {\n this.loadingScreen[\"loading-container\"].classList.add(\"hidden\")\n this.quizScreen[\"quiz-container\"].classList.remove(\"hidden\")\n this.currentScreen = \"awaitingAnswer\"\n this.createNextQuestion()\n }", "function runQuestions() {\n startTimer();\n welcome.classList.add('invisible');\n getQuestions();\n quizContent.classList.remove('invisible');\n shouldSubmit = true;\n}", "function handleQuiz() {\n startQuiz();\n handleAnswers();\n nextQuestion();\n restartQuiz();\n}", "function quizStart() {\n $(\".startQuiz\").on(\"click\", \".startButton\", function(event){\n renderQuestion();\n $(\".startQuiz\").css(\"display\",\"none\");\n $(\".questionPage\").css(\"display\",\"block\");\n $(\"#instrument\").css(\"visibility\",\"visible\");\n $(\"#score\").css(\"visibility\",\"visible\");\n $(\".credits\").css(\"display\",\"none\");\n submitAnswer();\n });\n}", "function startQuiz() {\n $('.startPage').on('click', '#start', function(event) {\n $('.startPage').hide();\n $('.quizMain').show();\n $('.questionNumber').text(1);\n generateQuizForm();\n })\n}", "function runQuiz() {\n //$('.quizLength').text(length);\n takeQuiz();\n answerSubmit();\n checkAnswer();\n handleNextButton();\n playAgain();\n console.log(\"runQuiz ran\");\n}", "function startQuiz(){\n start.style.display = \"none\";\n renderQuestion();\n quiz.style.display = \"block\";\n renderProgress();\n renderCounter();\n TIMER = setInterval(renderCounter,1000); // 1000ms = 1s\n}", "function startQuiz() {\r\n $('.altBox').hide();\r\n $('.beginQuiz').on('click', '.startButton', function (event) {\r\n $('.beginQuiz').hide();\r\n $('.questionNum').text(1);\r\n $('.questionBox').show();\r\n $('.questionBox').prepend(renderQuestion());\r\n });\r\n}", "function startQuiz() {\n score = 0;\n startButton.classList.add('hide')\n shuffledQuestions = quizQuestions.sort(() => Math.random() - .5)\n currentQuestionIndex = 0\n questionContainerElements.classList.remove('hide')\n setNextQuestion()\n}", "function runQuiz() {\n // If past last question, deal with high scores instead of continuing questions:\n if (questionNumber === questionArray.length) {\n youGotAHighScore();\n return;\n }\n // Display next question:\n quizLayout.innerHTML = \"\";\n createLayout(questionArray[questionNumber]);\n questionNumber++;\n}", "function startQuiz() {\n //creates a jQuery object that looks for the button \"startButton\".click event.\n //then...\n $(\"#startButton\").click(e => {\n //sets the page to the question page,\n STORE.page = \"question\"\n //sets the score back to zero,\n STORE.score = 0;\n //sets the current question to zero,\n STORE.currentQuestion = 0;\n //and renders the question page.\n render();\n });\n}", "function startQuiz() {\n mainContainer.setAttribute(\"style\", \"display: none;\")\n countDown()\n cycleQuestions()\n}", "function startQuiz() {\n\n // hide start screen\n var startScreenEl = document.getElementById(\"start-screen\");\n startScreenEl.setAttribute(\"class\", \"hide\");\n\n // un-hide questions container\n questionsEl.removeAttribute(\"class\");\n\n // start timer\n timerId = setInterval(clockTick, 1000);\n\n // show starting time\n timerEl.textContent = time;\n\n // call the function that gets the next question \n getQuestion();\n\n}", "function startQuestion() {\n\n // if you want to try again, it will remove all answers\n answers = [];\n // enables questionPage and disables startPage\n startPage.style.display = \"none\";\n questionPage.style.display = \"block\";\n\n // sets the progress bar to the correct percentage\n progressBar.style.width = (100 / subjects.length + 1) + \"%\";\n\n // resets the index to 0 and calls the ShowQuestion function\n index = 0;\n showQuestion();\n}", "function listenForStartNewQuiz () {\n\n $('.js-start-quiz-btn').click(function(){\n\n // update current theme index\n currentTheme = Number(event.target.id.toString().replace('quiz', ''));\n\n // reset step indicator\n $('.step-indicator').html('');\n\n // show feedback view\n $('.feedback-view').fadeOut(function(){\n $('.questions-view').fadeIn();\n });\n\n resetQuiz(currentTheme);\n initQuestionsView();\n openQuestionsView();\n });\n\n}", "function generateQuiz(){\n if(quizStarted == false){\n showQuestions(currentQuestion)\n timer()\n }\n//showquestions(){\n//clear the current question and possible answers\n//increase myquestion index\n//display new question and possible answers\n//}\n}", "function quizStart()\n\t\t\t{\n\t\t\t\t$(\".instruction\").hide();\n\t\t\t\t$(\".middle\").show();\n\t\t\t\tdocument.getElementById(\"score_right\").value = correct;\n\t\t\t\tdocument.getElementById(\"score_wrong\").value = wrong;\n\t\t\t\t\n\t\t\t\twindow.milisec = 15 * 60 * 1000;\n\t\t\t\t\n\t\t\t\t//Timer functionality\n\t\t\t\tvar timer = setInterval(function()\n\t\t\t\t{\t\n\t\t\t\t\tmilisec -= 1000;\n\t\t\t\t\tvar min = Math.floor( milisec / (60 * 1000) );\n\t\t\t\t\tvar sec = Math.floor(( milisec - (60 * 1000 * min)) / 1000 );\n\t\t\t\t\tif(milisec <= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\t\tendQuiz();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(min<10)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin = \"0\"+min;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(sec<10)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsec = \"0\"+sec;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar result = \"00:\"+min+\":\"+sec;\n\t\t\t\t\t\tdocument.getElementById(\"timer\").innerHTML = result;\n\t\t\t\t\t}\n\t\t\t\t},1000);\n\t\t\t\t\n\t\t\t\tnextQuestion();\n\t\t\t}", "function handleScienceQuiz() {\n\trenderStartPage();\n\thandleStartButtonClicked();\n}", "function startQuiz(){\r\n startEl.style.display = \"none\";\r\n quizEl.style.display = \"block\";\r\n timer = setInterval(renderCounter,1000); \r\n askQuestion(); \r\n}", "function startQuiz() {\n $(\"#start\").hide();\n $(\"#question1\").show();\n startTimer();\n }", "function main() {\r\n handleStartQuiz();\r\n handleSubmitAnswer();\r\n handleNextQuestion();\r\n handleRestartQuiz();\r\n render();\r\n}", "function startQuiz(){\n startButton.classList.add('hide');\n qBox.classList.remove('hide');\n nextQuestion = 0; //Resets question index for beginning of gameplay\n timer = 30; //Setting timer to start at 30 seconds\n score = 0; //Clearing score for either initial gameplay or reset\n setNextQuestion(); //Serve user first question\n timerTick(); //Start timer\n}", "function handleBeginQuiz() {\n $('.quiz-field').on('click', '.start-quiz', () => loadNextQuestion());\n }" ]
[ "0.8685266", "0.8640112", "0.8627268", "0.85287374", "0.8505236", "0.844439", "0.83431077", "0.832672", "0.8224872", "0.82164794", "0.81903255", "0.8170914", "0.816454", "0.81275296", "0.81127256", "0.8082588", "0.8078522", "0.80443627", "0.8015529", "0.79966784", "0.7990124", "0.79869723", "0.79828715", "0.7955559", "0.7947901", "0.7934536", "0.79221714", "0.7918345", "0.78909886", "0.787934", "0.78720707", "0.7859618", "0.7847382", "0.78435177", "0.7841568", "0.78291833", "0.7825868", "0.7808414", "0.78062", "0.7785825", "0.77786297", "0.77755207", "0.77737594", "0.77737594", "0.7748527", "0.7740059", "0.7723649", "0.77212626", "0.77197075", "0.77173626", "0.7705889", "0.7693223", "0.7671065", "0.7652044", "0.76319206", "0.7629659", "0.7606513", "0.7603219", "0.760206", "0.75966096", "0.7587191", "0.75714403", "0.7570144", "0.755777", "0.75530463", "0.75518775", "0.7549266", "0.75487304", "0.753165", "0.7519163", "0.7508521", "0.750057", "0.7497958", "0.7490655", "0.7473935", "0.7473684", "0.7470878", "0.74690944", "0.74635845", "0.7450373", "0.7436271", "0.74339205", "0.74327636", "0.7429528", "0.7426756", "0.74266803", "0.7424355", "0.7417812", "0.74087167", "0.74055713", "0.74045223", "0.74030876", "0.7395171", "0.7387232", "0.7384316", "0.73824424", "0.7381898", "0.73753124", "0.7374222", "0.7365788", "0.7363569" ]
0.0
-1
This function is for evaluating the answer and saving the score value
function ansSelection(event){ event.preventDefault(); if(event.target.matches("li")){ userId = event.target.id; var userAns = arrQues[k].options[userId]; if(typeof userId !== "undefined"){ resultDisplay.textContent = ""; if(userAns === arrQues[k].a){ resultDisplay.textContent = "Hurray Correct!!" resultDisplay.setAttribute("style", "background-color:green; margin: 8px; width:150px; font-size: 20px;"); score = score+10; }else{ resultDisplay.textContent = "Oops Wrong!!" resultDisplay.setAttribute("style", "background-color:red; margin: 8px; width:150px; font-size: 20px;"); totalSeconds = totalSeconds - 10; } k++; } // StartQuiz is being called to display successive questions startQuiz(); if(liCount === arrQues.length){ showResults(); } liCount++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scoreAnswers(){}", "function result()\n\t{\n\t\t{\n\t\t\t/* for( i=0; i<questions.length; i++ )\n\t\t\t\t {\n\t\t\t\t checkAnswers( questions[i]);\t\t\n\t\t\t\t } */\n\t\t\t\t\n\t\t\t//To test in console.log\n\t\t\tconsole.log( \"a1 Score is: \" + checkAnswers( questions[0] ) );\n\t\t\tconsole.log( \"a2 Score is: \" + checkAnswers( questions[1] ) );\n\t\t\tconsole.log( \"a3 Score is: \" + checkAnswers( questions[2] ) );\n\t\t\tconsole.log( \"a4 Score is: \" + checkAnswers( questions[3] ) );\n\t\t\tconsole.log( \"a5 Score is: \" + checkAnswers( questions[4] ) );\n\t\t\t\n\t\t\t// To accumulate total marks in to one variable \n\t\t\tvar m1 = parseInt( checkAnswers( questions[0] ) );\n\t\t\tvar m2 = parseInt( checkAnswers( questions[1] ) );\n\t\t\tvar m3 = parseInt( checkAnswers( questions[2] ) );\n\t\t\tvar m4 = parseInt( checkAnswers( questions[3] ) );\n\t\t\tvar m5 = parseInt( checkAnswers( questions[4] ) );\n\n\t\t\tvar total = m1 + m2 + m3 + m4 + m5;\n\n\t\t\tconsole.log( \"Total Score is: \" + total );\n\t\t\t\n\t\t\tquiz.answersBox.value = \"Total Score is: \" + total;\n\t\t}\n\t}", "evaluate() {\n let highest = 0.0;\n let index = 0;\n for (let i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > highest) {\n index = i;\n highest = this.population[i].fitness;\n }\n }\n\n this.best = this.population[index].getPhrase();\n if (highest === this.perfectScore) {\n this.finished = true;\n }\n }", "function getResult(x){\n if(x===1)\n {score+=questions[questionIndex].a1.s;\n \n if(answersScoreArray[questionIndex]!==\"NULL\") score-=answersScoreArray[questionIndex];\n answersScoreArray[questionIndex]=questions[questionIndex].a1.s;\n console.log(score);}\n\n else if(x===2)\n {score+=questions[questionIndex].a2.s;\n \n if(answersScoreArray[questionIndex]!==\"NULL\") score-=answersScoreArray[questionIndex];\n answersScoreArray[questionIndex]=questions[questionIndex].a2.s;console.log(score);}\n\n \n else if(x===3)\n {score+=questions[questionIndex].a3.s;\n \n if(answersScoreArray[questionIndex]!==\"NULL\") score-=answersScoreArray[questionIndex];\n answersScoreArray[questionIndex]=questions[questionIndex].a3.s;console.log(score);}\n\n\n else \n {score+=questions[questionIndex].a4.s;\n \n if(answersScoreArray[questionIndex]!==\"NULL\") score-=answersScoreArray[questionIndex];\n answersScoreArray[questionIndex]=questions[questionIndex].a4.s;console.log(score);}\n return score;\n}", "function validity(e) {\n var optionElement = document.getElementsByClassName(\"active\")\n \n if (optionElement[0].innerHTML == questionarry[e].answer) {\n score += 10\n console.log(score)\n // break\n } \n\n// ********pushing score to local storage *********\nwindow.localStorage.setItem(\"score\",score);\n\n\n\n}", "function evaluateAnswers() {\n arrAnswers.forEach(objAnswer => {\n arrAnswerVotes[objAnswer.answer]++;\n\n // If answer is correct, we give the user points\n if(currentReactive.correct[objAnswer.answer] == true)\n {\n let points = 100 - 40*(objAnswer.pastTime/totalTime);\n points = Math.ceil(points);\n objGame.Players.forEach(player => {\n if(player.username === objAnswer.username) player.points = Number(player.points) + points;\n });\n }\n });\n}", "function outputResults(score) {\n\n\n}", "function assessAnswer(userLevel, userScore) {\n let a = correctAnswer[userLevel];\n // targets input answer based on userLevel\n let aGiven = document.querySelector('input[name=\"' + answerSelector[userLevel] + '\"]:checked').value\n //let aGiven = document.querySelector('input[name=\"q1\"]:checked').value\n if (aGiven == a){\n userLevel ++;\n // userScore += seconds;\n\n // load next question\n // displayQuestion(userLevel, userScore)\n\n runQuiz(userLevel, userScore)\n }\n else {\n failModal()\n }\n }", "calculateScore () {\n this.allCorrectAnswers = {};\n this.allSelectedAnswers = readFromCache('selectedAnswers');\n this.quizData.map((qA) => {\n const correctAnswers = [];\n for (const [key, value] of Object.entries(qA.correct_answers)) {\n if (value == 'true') {\n const correctAnswer = helpers.splitter(key, '_', 2);\n correctAnswers.push(correctAnswer);\n }\n }\n this.allCorrectAnswers[qA.id] = correctAnswers;\n });\n for (const [key, value] of Object.entries(this.allSelectedAnswers)) {\n if (value.sort().join(',') === this.allCorrectAnswers[key].sort().join(',')) {\n this.score++;\n }\n }\n this.score = this.score / Object.keys(this.allSelectedAnswers).length * 100;\n this.score = this.score.toFixed(2);\n let allScores = readFromCache('scores');\n allScores = allScores || {};\n allScores[new Date().toLocaleString()] = this.score;\n writeToCache('scores', allScores);\n }", "function answerIsCorrect () {\r\n feedbackForCorrect();\r\n updateScore();\r\n}", "function evaluate() {\n $('#quizBoard').hide();\n $('#results').show();\n if ($('#q1f').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q2t').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q3f').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q4f').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q5t').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q6t').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q7f').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q8f').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n if ($('#q9f').is(':checked')) {\n correct++\n } else {\n incorrect++\n }\n $('#corr').html(correct)\n $('#incorr').html(incorrect)\n $('#percent').html(correct/9)\n}", "function getResult() {\n var score = (parseInt(getCheckedRadio('op1'))\n + parseInt(getCheckedRadio('op2'))\n + parseInt(getCheckedRadio('op3'))\n + parseInt(getCheckedRadio('op4')));\n return score;\n}", "function scoreSolution(solution) {\n\n}", "function computeScore()\n{\n var currvalue, values, i;\n\t\n values = [];\n\tcurrvalue = 0; // 0 = invalid; 1 = valid\n\t\n\tfor(i=0; i<IndexList.length; i++)\n\t{\n\t\tcurrvalue = validateAnswer(i);\n\t\tvalues[i] = currvalue;\n\t}\n\t\n\treturn values;\n}", "function answer() {\n if (choice === qArr[index].correct) {\n score += 100;\n document.getElementById(\"results\").innerHTML = `Great job!`\n } else {\n document.getElementById(\"results\").innerText = `Wrong! The correct answer is ${qArr[index].rightAns}.`\n }\n}", "function evaluator (userAnswer) {\n currentTour;\n correctAnswer;\n if (userAnswer === correctAnswer) {\n currentTour = currentTour + 1;\n console.log(\"User wrigt\");\n console.log(\"Tour\",currentTour)\n answerCorrect();\n quizExecutor(currentTour);\n } else {\n currentTour = currentTour + 1;\n console.log(\"User wrong\");\n console.log(\"Tour\",currentTour);\n answerWrong();\n quizExecutor(currentTour);\n };\n }", "function scoreQ8a() {\n console.log(\"q8a answer: \" + q8a)\n console.log(\"Q8a correct: \" + q8aCorrect)\n return (q8a == q8aCorrect);\n}", "function checkAnswer() {\n //console.log('Answer is being checked')\n const currentAnswer = $( \"input:checked\" ).val();\n const correctAnswerText = getCorrectAnswer();\n \n if (currentAnswer === correctAnswerText) {\n STORE.currentAnswer = 'correctAnswer';\n updateUserScore();\n } else {\n STORE.currentAnswer = 'wrongAnswer';\n } \n}", "function check() {\n if ($(\"this\").val() == questions[i].answer) {\n score++; \n } else {\n score--;\n } \n }", "function compareAnswer(answer){\n if(getText() === answer){\n alert(\"You Answered Correctly!\")\n $(\"#score\").html(parseInt($(\"#score\").html()) + parseInt($(\"#point-value\").html()))\n } else {\n alert(\"Better luck next time...\")\n }\n }", "function question5(answer) {\n console.log(answer);\n if (parseInt(answer) === 20) {\n (finalscore += 20);\n console.log(finalscore);\n localStorage.setItem(\"score\", finalscore);\n document.location.href = \"finalscore.html\"\n } else {\n document.location.href = \"finalscore.html\"\n \n }\n}", "function testResponse(){\n var result = false ;\n // console.log($scope.lastVote,$scope.correctAnswer) ; \n if($scope.lastVote == $scope.correctAnswer) {\n result = true;\n var oldScore = $scope.userScore.$value || 0;\n console.log(new Date().getTime(),'oldScore',oldScore,$scope.lastVote,$scope.correctAnswer );\n\n var newScore = oldScore + 1;\n // console.log('newScore',newScore, new Date().getTime());\n $scope.userScore.$set(newScore);\n // debugger;\n // savedScore = true;\n \n \n // $scope.userScore.$set(newScore);\n }\n else {\n console.log('Wrong Answer!');\n }\n \treturn result;\n }", "function evaluateAnswers(answer) {\n\n\tif(answer === answers[0].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[0].isCorrect;\n\t}\n\n\telse if(answer === answers[1].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[1].isCorrect;\n\t}\n\telse if(answer === answers[2].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[2].isCorrect;\n\t}\n\telse if(answer === answers[3].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[3].isCorrect;\n\t}\n\n\telse {\n\t\tunanswered = true;\n\t}\n}", "function checkAnswer() {\r\n STORE.view = 'feedback';\r\n let userSelectedAnswer = STORE.userAnswer;\r\n let correctAnswer = STORE.questions[STORE.questionNumber].correctAnswer;\r\n console.log('Checking answer...');\r\n if (userSelectedAnswer == correctAnswer) {\r\n STORE.score++;\r\n STORE.correctAnswer = true;\r\n }\r\n else {\r\n STORE.correctAnswer = false;\r\n }\r\n}", "function update_question_result(correct) {\n if (correct == true) {\n score++;\n return displayQuestionResult.innerText = \"Success!\";\n } else {\n return displayQuestionResult.innerText = \"Incorrect!\";\n }\n}", "function evaluateAnswer(userAnswer, correctAnswer){\n console.log('evaluating answer');\n if(userAnswer === correctAnswer){\n return true;\n }else {\n return false;\n } \n}", "function SubmitAnswer(CardQuestion,block){\n\n // See if the user picked the correct answer\n let correctAnswer = 'radio_button_' + CardQuestion[2].split(\" \").join(\"-\")\n // Gets correct answer \n let ChooseCorrectly = document.getElementById(correctAnswer).checked \n \n\n\n\n // If chose correctly then move question to next block level and add 2 points \n if(ChooseCorrectly == true){\n\n PickedCorrect(CardQuestion)\n ClearQuizCards()\n PresentCards()\n \n\n } else {\n PickedIncorrectly(CardQuestion)\n ClearQuizCards()\n PresentCards()\n }\n\n\n\n\n\n // Log score\n console.log('Score',score)\n\n }", "function scoreEvaluate() {\n for ( i = 0; i < userAnswers.length; i++) {\n const element = userAnswers[i];\n if (element == correct[i]) {\n correctUserAnswers.push(element);\n console.log(correctUserAnswers) \n }\n }\n if (correctUserAnswers.length == 5) {\n $(\"#messageArea\").text(\"YOU GOT A PERFECT SCORE! HASTA LA VICTORIA SIEMPRE!\")\n // alert(\"YOU GOT A PERFECT SCORE! HASTA LA VICTORIA SIEMPRE!\")\n stop(); \n }\n else{ \n // amtCorrect();\n // alert(\"ONWARD COMRADE, you got \" + correctUserAnswers.length + \" out of 5 correct!\")\n $(\"#messageArea\").text(\"ONWARD COMRADE, you got \" + correctUserAnswers.length + \" out of 5 correct!\")\n stop();\n } \n }", "function getScore(score) {\n $(\".submit\").on(\"click\", function(){\n //see what was selected \n $( \"input[type=radio]:checked\" ).val();\n //if something was selected, add one to answered questions \n if (\":checked\", \"true\") {\n questionsAnswered++;\n //check to see if selected answers are correct \n if (questionsAnswered.val([i]) === correctAnswers[i]) {\n score++;\n }\n }\n else {\n questionsNotAnswered++;\n }\n\n \n \n\n })\n }", "function scoreKeep(){\n var userAnswer1 = $(\"input[name='answer1']:checked\").val();\n var userAnswer2 = $(\"input[name='answer2']:checked\").val();\n var userAnswer3 = $(\"input[name='answer3']:checked\").val();\n var userAnswer4 = $(\"input[name='answer4']:checked\").val();\n var userAnswer5 = $(\"input[name='answer5']:checked\").val();\n var userAnswer6 = $(\"input[name='answer6']:checked\").val();\n var userAnswer7 = $(\"input[name='answer7']:checked\").val();\n\n //now keep score for all questions and answers\n if (userAnswer1 === undefined) {\n\n unanswered++;\n } else if (userAnswer1 == questions[0].answer) {\n\n correctAnswers++;\n } else {\n\n incorrectAnswers++;\n }\n if(userAnswer2 === undefined) {\n unanswered++;\n } else if (userAnswer2 == questions[1].answer){\n correctAnswers++;\n } else {\n incorrectAnswers++;\n }\n if(userAnswer3 === undefined) {\n unanswered++;\n } else if (userAnswer3 == questions[2].answer){\n correctAnswers++;\n } else {\n incorrectAnswers++;\n }\n if(userAnswer4 === undefined) {\n unanswered++;\n } else if (userAnswer4 == questions[3].answer){\n correctAnswers++;\n } else {\n incorrectAnswers++;\n }\n if(userAnswer5 === undefined) {\n unanswered++;\n } else if (userAnswer5 == questions[4].answer){\n correctAnswers++;\n } else {\n incorrectAnswers++;\n }\n if(userAnswer6 === undefined) {\n unanswered++;\n } else if (userAnswer6 == questions[5].answer){\n correctAnswers++;\n } else {\n incorrectAnswers++;\n }\n if(userAnswer7 === undefined) {\n unanswered++;\n } else if (userAnswer7 == questions[6].answer){\n correctAnswers++;\n } else {\n incorrectAnswers++;\n }\n}", "function evalAnswer() {\n console.log(\"chose: \" + this.value);\n console.log(\"answer was: \" + questions[Q].answer)\n if (this.value === questions[Q].answer) {\n console.log(\"correct\");\n secondsLeft += 5;\n score++;\n\n\n }\n else {\n console.log(\"wrong\");\n secondsLeft -= 10\n }\n \n // ending the quiz portion and stopping the clock\n if (Q === (questions.length - 1)) {\n endGameCard();\n clearInterval(timerInterval);\n }\n else {\n Q++;\n buildQuestionCard()\n }\n}", "function scoreQ9() {\n console.log(\"q9a answer: \" + q9a)\n console.log(\"q9b answer: \" + q9b)\n \n return 0; \n}", "function answerCheck() {\n\n var question1 = $(\"input[type='radio'][name='question1']:checked\").val();\n var question2 = $(\"input[type='radio'][name='question2']:checked\").val();\n var question3 = $(\"input[type='radio'][name='question3']:checked\").val();\n var question4 = $(\"input[type='radio'][name='question4']:checked\").val();\n var question5 = $(\"input[type='radio'][name='question5']:checked\").val();\n\n // if statements compare checked value vs pre determined html values\n if (question1 == timechecks()) {\n score += 1;\n }\n if (question2 == \"B\") {\n score += 1;\n }\n if (question3 == \"C\") {\n score += 1;\n }\n if (question4 == \"D\") {\n score += 1;\n }\n if (question5 == \"A\") {\n score += 1;\n }\n return score;\n}", "function checkAnswer(i,j,k) {\n let scoreValue = parseInt(value[i].replace('$',\"\"))\n $('.text_box').toggleClass('result')\n setTimeout(() => clickOut = true, 500)\n if(answers[k][i][j].value == true){ \n $('.text_box').empty()\n $('.text_box').text(\"CORRECT!\").css('font-size','70px')\n score += scoreValue\n $('.score').text(score) \n }else{\n $('.text_box').text(\"I'M SORRY THE CORRECT ANSWER WAS \" + correctAnswer(k, i).toUpperCase()).css('font-size','35px')\n score -= scoreValue\n $('.score').text(score) \n }\n }", "function evaluate(answer){\n $(\"#answer\").removeClass('d-none');\n $(\"#answer\").show();\n if(answer == ansBank[index]){\n console.log(\"Answer inside equal if loop : \"+answer);\n console.log(\"Inside equal if loop: \"+ansBank[index]+\"value of i is : \"+i);\n // $(answer).addClass(\"active\");\n $(\"#answer\").html(\"<p>Yay! Correct answer</p>\");\n console.log(\"inside equal if loop: \"+answer);\n askQuestionsHide();\n stopTimer();\n // scoreCard();\n score = score + 1;\n correctAnswers++;\n i++;\n //Breaks the loop if all questions in array were asked\n ifAllQuestionsAsked();\n }\n else if(answer != ansBank[index]){\n $(\"#answer\").html(\"<p>Oops! Wrong answer</p>\");\n console.log(\"Prints i inside second if \"+i);\n // $(\"#answer\").append(\"<p>Correct answer is \" +ansBank[i]+\"</p>\");\n showCorrectAnswer();\n // $(\"#answer\").empty();\n // console.log(\"Prints i inside second if \"+i);\n askQuestionsHide();\n stopTimer();\n // calcWrongAnswers();\n wrongAnswers = wrongAnswers + 1;\n i++;\n //Breaks the loop if all questions in array were asked\n ifAllQuestionsAsked();\n }\n else{\n // i++;\n }\n }", "function scoreQ10a() {\n console.log(\"q10a answer: \" + q10a)\n}", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "function calculateScore(oriRes)\r\n{\r\n oriRes=oriRes.split(\",\");\r\n \r\n var score=0;\r\n for (var k = 0; k < oriRes.length; k++)\r\n {\r\n let r=\"choice+\"+k;\r\n var radios = document.getElementsByName(`${r}`);\r\n var val= \"\";\r\n for (var i = 0, length = radios.length; i < length; i++)\r\n {\r\n if (radios[i].checked)\r\n {\r\n val = radios[i].value; \r\n break;\r\n }\r\n }\r\n //console.log(\"Val : \"+val);\r\n //console.log(\"Res : \"+oriRes[k]);\r\n if (val == oriRes[k] ) \r\n {\r\n score=score+1;\r\n } \r\n \r\n }\r\n //console.log(oriRes);\r\n //console.log(score);\r\n let temp=document.getElementById(\"body\");\r\n temp.parentNode.removeChild(temp);\r\n let sol=document.createElement(\"div\");\r\n sol.setAttribute(\"id\",\"sol\");\r\n sol.setAttribute(\"class\",\"container\");\r\n sol.innerHTML=`Congrats!<br>`;\r\n sol.innerHTML+=`You have scored : <h1 id=\"sol1\"><b>${score}</b></h1>`;\r\n\r\n let pp=document.getElementById(\"grand\");\r\n pp.appendChild(sol);\r\n\r\n}", "function evaluateAnswer(){\n\tvar y = parseInt(second.innerHTML);\n\tvar x = parseInt(first.innerHTML);\n\tvar i = operator.innerHTML;\n\t// checks the operator passed\n\tswitch(i){\n\t\tcase '+':\n\t\t\tcompute = x + y;\n\t\t\tbreak;\n\t\tcase '-': \n\t\t\tcompute = x - y;\n\t\t\tbreak;\n\t\tcase '*':\n\t\t\tcompute = x * y;\n\t\t\tbreak;\n\t\tcase '/': \n\t\t\tcompute = x / y;\n\t\t\tbreak;\n\t}\n\n\tif (compute === parseFloat(document.getElementById('result').value)){\n\t\tdocument.getElementById('right').innerHTML = ++right;\n\t\tdisplayMessage('Congrats, you have won the game');\n\t}\n\telse{\n\t\tdocument.getElementById('wrong').innerHTML = ++wrong;\n\t\tdisplayMessage('That is not correct, Please try next problem');\t\t\n\t}\n\tsetTimeout(init, 5000);\n }", "function calcScore(quizScore, essayScore) {\n\n var score = quizScore + essayScore;\n\n return score;\n\n}", "function add_check() {\n\t\tvar ans = [];\n\t\tvar localScore = 0;\n\t\t// console.log(curOperation);\n\t\t\n\t\t// Get answer vals and put in an array\n\t\t$('#'+curOperation+'-quest .answer').each(function (){\n\t\t\tans.push(this.value);\n\t\t})\n\n\t\t// Problems here with undefined rs\n\t\t// console.log(probArr.length)\n\t\tif(probArr.length > 0 ) {\n\t\t\t// console.log(probArr.length)\n\t\t\tfor(var i = 0;i<probArr.length;i++){\n\t\t\t\t// var a = $('#add-quest .answer').get(i)\n\t\t\t\t// console.log(probArr)\n\t\t\t\tif(probArr[i] !== undefined) {\n\n\t\t\t\t\tif(probArr[i].r !== parseInt(ans[i])){\n\t\t\t\t\t\t// console.log(i+': incorrrect');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlocalScore += 1;\n\t\t\t\t\t\t// console.log(\"localScore: \"+localScore)\n\t\t\t\t\t} \n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tif(!played){\n\t\t\t// console.log(\"adding \"+score+' plus '+localScore)\n\t\t\tscore += localScore;\n\t\t\tupdate_score();\n\t\t\tplayed = true;\t\n\t\t}\t\n\t\tadd_sub_nums(curOpMax);\n\t}", "function checkAnswer(selectedAnswer) {\n const correctAnswer = quiz[currentQuestion].answer;\n \n if (selectedAnswer === correctAnswer) {\n score++;\n }\n \n currentQuestion++;\n \n if (currentQuestion < quiz.length) {\n displayQuestion();\n } else {\n showResult();\n }\n }", "function scoreQ5a() {\n console.log(\"Q5a answer: \" + q5a)\n console.log(\"Q5a correct: \" + q5aCorrect)\n\n return (q5a == q5aCorrect);\n\n}", "function evaluateAnswer(i){\n\tclearInterval(counter); \n\tvar answerPos = parseInt(i);\n\tvar thisq\t = question[standing['u']]; \n\tvar correctPos = thisq['k'];\n\tif (correctPos === answerPos){\n\t\ttoastr.success('Jawaban '+ thisq['v'] +' benar! '+thisq['s']+' adalah '+ thisq['b']);\n\t\tstanding['b'] += 1;\n standing['u'] += 1;\n\t} else {\n\t\ttoastr.error('Jawaban '+ thisq['j'][answerPos] +' salah! Seharusnya '+ thisq['v'] +'!<br /><br />'+thisq['s']+' adalah '+ thisq['b'] + '<br /><br />Tetap Semangat!');\n\t\tstanding['s'] += 1;\n standing['u'] += 1;\n }\n if(!isGameOver()){\n \tdisplayBoard();\n }\n\treturn null;\n}", "function myFunction() {\n\n //Create variable to count correct answers \n // var correctAnswers = 0;\n var answers = 0;\n //Create variables for each question's input value\n //Create variables for each question's input value\n var quizOne = $(\"input:radio[name=question1]:checked\").val();\n var quizTwo = $(\"input:radio[name=question2]:checked\").val();\n var quizThree = $(\"input:radio[name=question3]:checked\").val();\n var quizFour = $(\"input:radio[name=question4]:checked\").val();\n var quizFive = $(\"input:radio[name=question5]:checked\").val();\n var quizSix = $(\"input:radio[name=question6]:checked\").val();\n var quizSeven = $(\"input:radio[name=question7]:checked\").val();\n var quizEight = $(\"input:radio[name=question8]:checked\").val();\n\n\n\n\n\n\n if (quizOne == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizTwo == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizThree == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizFour == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizFive == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizSix == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizSeven == \"correct\") {\n answers = answers + 12.5;\n }\n if (quizEight == \"correct\") {\n answers = answers + 12.5;\n }\n\n\n\n document.getElementById(\"message\").innerHTML = \"Score is \" + answers + \"%\";\n document.getElementById(\"result\").style.visibility = \"visible\";\n}", "evaluateAnswer(userAnswer){\n \tconst {value1, value2, value3, proposedAnswer} = this.state;\n \tconst corrAnswer = value1 + value2 + value3;\n \treturn(\n \t\t (corrAnswer === proposedAnswer && userAnswer === 'true') ||\n \t\t (corrAnswer !== proposedAnswer && userAnswer === 'false')\n \t);\n }", "function checkAnswer () {\n console.log(userSelected.text);\n\n if (userSelected === questions[i].correctAnswer) {\n score ++;\n $(\"#score\").append(score);\n $(\"#answerCheck\").append(questions[i].rightReply);\n i++;\n } else {\n $(\"#answerCheck\").append(questions[i].wrongReply);\n i++;\n } \n }", "function checkAnswer(answer) {\n if (answer[userAnswer].isCorrect) {\n console.log('Your answer is correct! :D');\n score++;\n } else {\n console.log('Your answer is incorrect! D:');\n if (score > 0) {\n score--;\n }\n }\n}", "function checkAnswer(answer) {\n correctAns = quizQuestions[currentQuestionIndex].correctAnswer;\n\n // if the argument inside the function is the correct answer for that question & current question is not the final question \n // add +1 to the score\n if (answer === correctAns && currentQuestionIndex !== finalQuestionIndex) {\n // add +1 to the score\n score++;\n\n // alert the user they're correct\n alert(\"Correct!\");\n\n // jump to the next question\n currentQuestionIndex++;\n\n // generate the quiz again but current index updating \n generateQuiz();\n }\n\n // else if the answer is not correct and current question is not the final question \n // jump to the next question \n // alert the user they're wrong\n else if (answer !== correctAns && currentQuestionIndex !== finalQuestionIndex) {\n // alert the user they're wrong\n alert(\"Wrong!\");\n\n // jump to the next question\n currentQuestionIndex++;\n\n // generate the quiz again but current index updating\n generateQuiz();\n }\n // if the current question is the last question ask the question and then show the final score \n else {\n userScore();\n }\n}", "function checkAnswer(selected){\n let rightAnswer = questionsArray[questionCounter].correctAnswer;\n \n if(selected === rightAnswer){\n score++;\n displayPopup(true, rightAnswer);\n } \n else{\n displayPopup(false, rightAnswer);\n }\n}", "function gradeTestME() {\n \n var i;\n for (var i = 0; i < questionsME.length; i++) {\n if (Response = Answer){\n totalScore++;\n }\n if (q2 = a2){\n totalScore++;\n }\n if (q3 = a3){\n totalScore++;\n }\n if (q4 = a5){\n totalScore++;\n } \n if (q6 = a7){\n totalScore++;\n } \n if (q8 = a8){\n totalScore++;\n }\n if (q9 = a9){\n totalScore++;\n }\n if (q10 = a10){\n totalScore++;\n }\n if (q11 = a11){\n totalScore++;\n }\n if (q12 = a12){\n totalScore++;\n }\n return totalScore;\n }\n}", "function submitAnswer(){\r\n\ty = document.getElementById(\"qans\").value\r\n\tvar yy=y.toUpperCase();\r\n\tx = document.getElementById(\"question\").value\r\n \r\n\tif (ans===1){\r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"B\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===2){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"A\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===3){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"C\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===4){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"D\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===5){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"D\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===6){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"B\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===7){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"B\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===8){ \r\n\t\ty = document.getElementById(\"qans\").value;\r\n\t\tif(yy===\"D\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===9){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"C\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===10){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"B\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===11){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"A\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===12){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"A\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===13){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"C\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===14){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"D\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===15){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"B\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\t}\r\n\telse if (ans===16){ \r\n\t\ty = document.getElementById(\"qans\").value\r\n\t\tif(yy===\"D\"){\r\n\t\t\tcorrectAnswer();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twrongAnswer();\r\n\t\t}\r\n\t\tdocument.view.qscore.value=score\r\n\t\tdocument.view.streakscore.value=current_streak\r\n\r\n\t\t// as this is the last question in the quiz, update the text of \"Next Question\" to make it more appropriate\r\n\t\tdocument.view.go.value=\"End Quiz...\"\r\n\t}\r\n\r\n\t// enable selection of \"Next Question\"\r\n\tdocument.getElementById(\"go_id\").disabled = false\r\n\tdocument.getElementById(\"go_id\").style.opacity = \"1\"\r\n\r\n\t// disable selection of \"Submit Answer\" to avoid logic issues\r\n\tdocument.getElementById(\"user_submit\").disabled = true\r\n\tdocument.getElementById(\"user_submit\").style.opacity = \"0.5\"\r\n\r\n\t// update var ans\r\n\tans++; \r\n}", "evaluate() {\n let worldrecord = -1;\n let index = 0;\n for (let i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > worldrecord) {\n index = i;\n worldrecord = this.population[i].fitness;\n }\n }\n \n this.best = this.population[index].getPhrase();\n }", "function scoreQ3() {\n console.log(\"Q3 answer: \" + q3)\n console.log(\"Q3 correct: \" + q3Correct)\n\n return (q3 == q3Correct);\n\n}", "function checkAnswer(answer) {\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex) {\n score++;\n alert(\"That Is Correct!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n //If correct.\n } else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex) {\n alert(\"That Is Incorrect.\")\n currentQuestionIndex++;\n generateQuizQuestion();\n //If wrong.\n } else {\n showScore();\n }\n}", "function checkAnswer(answer, answerSelection) {\n //Write your code in here\n // if the \"veryPositive\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"very positive\"\n if (possibleAnswers.veryPositive.includes(answer, [answerSelection])) {\n return \"very positive\";\n }\n // if the \"positive\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"positive\"\n else if (possibleAnswers.positive.includes(answer, [answerSelection])) {\n return \"positive\";\n }\n // if the \"negative\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"negative\"\n else if (possibleAnswers.negative.includes(answer, [answerSelection])) {\n return \"negative\";\n }\n // if the \"veryNegative\" values in the possibleAnswers object include the string assigned to \"answer\" at the index specified by \"answerSelection\", then return \"very negative\"\n else if (possibleAnswers.veryNegative.includes(answer, [answerSelection])) {\n return \"very negative\";\n }\n}", "function checkSum(answer,observation){\n console.log(answer[0]);\n var correctAns = model.prob_OnS()[observation];\n var sum = 0;\n for (var i = 0; i < Object.keys(correctAns).length; i++){\n sum += correctAns[i];\n }\n // console.log(sum);\n if (answer[0].toFixed(3) == sum.toFixed(3)) {return 1;}\n else {return 0;}\n }", "function isCorrect(){\n score++;\n setScore();\n}", "function checkAnswer() {\n let userAnswer = document.getElementsByName('ans');\n let cAns;\n for (i = 0; i < userAnswer.length; i++) {\n if (userAnswer[i].checked) {\n cAns = userAnswer[i].value;\n }\n }\n if (cAns == correct[qtrack]) {\n score++;\n wright.push(qtrack);\n }\n else wrong.push(qtrack);\n}", "function quizResult(){\n document.querySelector(\".total-questions\").innerHTML=myApp.length;\n document.querySelector(\".correct\").innerHTML=score;\n document.querySelector(\".wrong\").innerHTML=score;\n const percentage=(score/myApp.length)*100;\n document.querySelector(\".percentage\").innerHTML=percentage.toFixed(2) + \"%\";\n}", "function calculateScore(){\n let score =0;\n let index =0;\n const formResults = new FormData(quizForm);\n for(let value of formResults.values()){\n // console.log(value);\n if(value === answers[index]){\n score = score+1;\n }\n index = index +1;\n }\n // console.log(score);\n output.innerText =\"Your score is \" + score;\n}", "function result() {\r\n var score = 0;\r\n if (document.getElementById('correct1').checked) {\r\n score++;\r\n }\r\n if (document.getElementById('correct2').checked) {\r\n score++;\r\n }\r\n if (document.getElementById('correct3').checked) {\r\n score++;\r\n }\r\n alert(\"your score is: \"+score)\r\n}", "function calculateResult() {\r\n var PRACTICALITY_RATIO = 0.7; \r\n var MARKET_RATIO = 0.3; \r\n practicalityScore = $('#results_practicality_hidden').val();\r\n marketScore = $('#results_market_hidden').val();\r\n var effectScore = (practicalityScore * PRACTICALITY_RATIO) +\r\n (marketScore * MARKET_RATIO);\r\n // we round the result to the second decimal place \r\n return effectScore;\r\n}", "function keepingScore() {\n\n var userAnswer1 = $(\"input[name='answer1']:checked\").val();\n var userAnswer2 = $(\"input[name='answer2']:checked\").val();\n var userAnswer3 = $(\"input[name='answer3']:checked\").val();\n var userAnswer4 = $(\"input[name='answer4']:checked\").val();\n var userAnswer5 = $(\"input[name='answer5']:checked\").val();\n var userAnswer6 = $(\"input[name='answer6']:checked\").val();\n var userAnswer7 = $(\"input[name='answer7']:checked\").val();\n var userAnswer8 = $(\"input[name='answer8']:checked\").val();\n var userAnswer9 = $(\"input[name='answer9']:checked\").val();\n var userAnswer10 = $(\"input[name='answer10']:checked\").val();\n \n \n // Question 1\n if (userAnswer1 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer1 == questions[0].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 2\n if (userAnswer2 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer2 == questions[1].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 3\n if (userAnswer3 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer3 == questions[2].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 4\n if (userAnswer4 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer4 == questions[3].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 5\n if (userAnswer5 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer5 == questions[4].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 6\n if (userAnswer6 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer6 == questions[5].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 7\n if (userAnswer7 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer7 == questions[6].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 8\n if (userAnswer8 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer8 == questions[7].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 9\n if (userAnswer9 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer9 == questions[8].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n // Question 10\n if (userAnswer10 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer10 == questions[9].answer) {\n\n correctAnswers++;\n }\n else {\n\n incorrectAnswers++;\n }\n\n \n}", "function addScore(answer) {\n _scores[answer[0]] = answer[1];\n}", "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionSpot].rightAnswer;\n\n if (answer === correct && currentQuestionSpot !== finalQuestion){\n score++;\n alert(\"That Is Correct!\");\n currentQuestionSpot++;\n beginQuiz();\n }else if (answer !== correct && currentQuestionSpot !== finalQuestion){\n alert(\"That Is Incorrect.\")\n currentQuestionSpot++;\n beginQuiz();\n }else{\n finalScore();\n }\n}", "function scoreQuiz() {\n\t\t//fix button state\n\t\tvar button = buttonControl;\n\t\tbutton.value=\"Start\";\n\t\tbutton.disabled = true;\n\n\t\tanswerScore = []; //clear scoring\n\t\tfor (var i=0; i<NUMPROBLEMS; i++) {\n\t\t\tanswerScore.push(0);\n\t\t\t//each key(=term) defaults to wrong until checked\n\t\t}\n\t\tvar definitionsContainer = $.get(\"definitionsContainer\");\n\t\tvar assignedTerms = definitionsContainer.getElementsByClassName(\"termWidget\");\n\t\tfor (var i=0; i<assignedTerms.length; i++) {\n\t\t\t//calc scoring\n\t\t\tlet term = assignedTerms[i]; //term being evaluated\n\t\t\tlet termIndex = term.getAttribute(\"index\"); //index of term\n\t\t\tlet correctDefIndex = answerMap[termIndex]; //index of correct definition\n\t\t\tlet userDefIndex = term.parentNode.getAttribute(\"index\"); //index of user's definition\n\t\t\tif (userDefIndex==correctDefIndex) {\n\t\t\t\tanswerScore[termIndex] = 1; //score as correct\n\t\t\t\tterm.setAttribute(\"correct\", true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tterm.setAttribute(\"correct\", false);\n\t\t\t}\n\n\t\t}\n\t\tscoreText.innerText = scoreMessage(); //update score text area on page\n\n\t\t//check if enough questions to continue, then prompt user\n\t\tsetTimeout( function() {\n\t\t\tif (Object.keys(quizJson).length >= NUMPROBLEMS && window.confirm(\"Would you like to play again?\") ) {\n\t\t\t\tsetupQuiz();\n\t\t\t\tscoreText.innerText = \"\";\n\t\t\t}\n\t\t}, 3000);\n\n\t}", "function answerScore (qName) {\r\n\t\t\tvar checkboxNo = document.getElementsByName(qName);\r\n\t\t\tvar answerValue = 0;\r\n\t\t\tfor (var i = 0, length = checkboxNo.length; i < length; i++) {\r\n \t\t\t\tif (checkboxNo[i].checked) {\r\n\t\t\t// do something with checkboxNo\r\n\t\t\t\t\tanswerValue = answerValue + Number(checkboxNo[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t// change NaNs to zero\r\n\t\t\tif (isNaN(answerValue)) {\r\n\t\t\t\tanswerValue = 0;\r\n\t\t\t}\r\n\t\t\treturn answerValue;\r\n\t\t}", "function checkAnswer() {\n let userAnswer = parseInt(document.getElementById(\"answer-box\").value);\n let calculatedAnswer = calculateCorrectAnswer();\n let isCorrect = userAnswer === calculatedAnswer[0];\n\n if (isCorrect) {\n alert(\"Hey! You got it right! :D\");\n incrementScore();\n } else {\n alert(`Awwww.....you answered ${userAnswer}. The correct answer was ${calculatedAnswer[0]}!`);\n incrementWrongAnswer();\n }\n\n runGame(calculatedAnswer[1]);\n\n\n}", "function checkAnswer(answer, questionNumber, questions) {\n if (answer == questions[questionNumber].a) {\n questions[questionNumber].correct = 1;\n score.push(questions[questionNumber].correct);\n } else {\n score.push(questions[questionNumber].correct);\n }\n }", "function athena() {\n athenaScore = athenaScore + 1;\n questionCount = questionCount + 1;\n\n if (questionCount >= 5) {\n updateResult();\n }\n}", "function handleScore(choice, correctAnswer){\n if (choice === correctAnswer){\n triviaScore += 10;\n } else {\n triviaScore -= 5;\n }\n scoreSpan.innerText = triviaScore;\n }", "function getScoreStatus() {\n if (correctAnswers >= passingScore) {\n return \"passed\";\n }\n return \"failed\";\n}", "function checkAnswer(questionNumber, answer) {\n\n}", "function checkAnswer() {\n disableAnswerBtns();\n const userAnswer = this.firstElementChild.innerText;\n const correctAnswer = startRound()\n \n if (userAnswer === correctAnswer[\"category\"]) {\n updateScore();\n showFeedbackModal(true, correctAnswer)\n } else {\n showFeedbackModal(false, correctAnswer)\n }\n}", "function question2(answer) {\n // debugger;\n console.log(answer);\n if (parseInt(answer) === 20) {\n (finalscore += 20);\n console.log(finalscore);\n localStorage.setItem(\"score\", finalscore);\n $(\".question2\").hide();\n $(\".question3\").addClass(\"show\");\n } else {\n foo = 1;\n $(\".question2\").hide();\n $(\".question3\").addClass(\"show\");\n }\n\n}", "function scoreQ2() {\n console.log(\"Q2 answer: \" + q2)\n console.log(\"Q2 correct: \" + q2Correct)\n return (q2 == q2Correct);\n}", "function ScoreCheck() {\n an1 = $('input:radio[name=q1]:checked').val();\n an2 = $('input:radio[name=q2]:checked').val();\n an3 = $('input:radio[name=q3]:checked').val();\n an4 = $('input:radio[name=q4]:checked').val();\n\n console.log(\"an1: \" + an1);\n console.log(\"an2: \" + an2);\n console.log(\"an3: \" + an3);\n console.log(\"an4: \" + an4);\n\n if (an1 == 'answer1') {\n correct++;\n } else if (an1 == undefined) {\n unAnswered++;\n } else {\n incorrect++;\n }\n \n if (an2 == 'answer2') {\n correct++;\n } else if (an2 == undefined) {\n unAnswered++;\n } else {\n incorrect++;\n }\n \n if (an3 == 'answer3') {\n correct++;\n } else if (an3 == undefined) {\n unAnswered++;\n } else {\n incorrect++;\n }\n \n if (an4 == 'answer4') {\n correct++;\n } else if (an4 == undefined) {\n unAnswered++;\n } else {\n incorrect++;\n }\n\n DisplayResults();\n}", "function scoreQ10b() {\n console.log(\"q10b answer: \" + q10b)\n\n}", "function getScore(correct, missed, noAnswer){\n let x = (correct / (correct + missed + noAnswer)) * 100;\n return x;\n }", "function question3(answer) {\n console.log(answer);\n if (parseInt(answer) === 20) {\n (finalscore += 20);\n console.log(finalscore);\n localStorage.setItem(\"score\", finalscore);\n $(\".question3\").hide();\n $(\".question4\").addClass(\"show\");\n } else {\n foo = 1;\n $(\".question3\").hide();\n $(\".question4\").addClass(\"show\");\n }\n}", "function answerIsCorrect() {\n correctAnswerFeedback();\n nextQuestion();\n addToScore();\n}", "function showResult() {\n\n $.ajax({\n type: \"POST\",\n url: $(\"#review\").attr(\"action\"),\n data: $(\"#review\").serialize(),\n success: function (data) {\n //some actions\n //$(\"#review\").unbind(\"submit\").submit();\n\n return false;\n }\n });\n\n\n globalId = null;\n\n var score = checkPoints();\n\n $(\".qcm_result\").show('slow');\n\n var score = parseInt(score * 100 / $('.container-question').length);\n\n if (score < 33) {\n $(\"#result-by-response-text\").addClass(\"alert alert-danger\");\n } else if (score < 66) {\n $(\"#result-by-response-text\").addClass(\"alert alert-block\");\n } else {\n $(\"#result-by-response-text\").addClass(\"alert alert-success\");\n }\n\n $(\"#result-by-response\").attr('value', score);\n\n var minusPoint = 0;\n $(\"div[itemtype=0] input:checked\").each(function () {\n $(this).parent().addClass(\"alert-danger\");\n minusPoint--;\n\n $(this).parent().addClass(\"alert-danger\");\n\n\n var $bigFather = $(this).parent().parent();\n\n $(\".counter\", $bigFather).addClass(\"badge-important\");\n $(\".question\", $bigFather).removeClass(\"well\").addClass(\"alert alert-danger\");\n });\n\n $(\"div[itemtype=1] input\").each(function () {\n\n $(this).parent().addClass(\"alert-success\");\n });\n\n $(\"div[itemtype=1] input:checked\").each(function () {\n\n var $bigFather = $(this).parent().parent();\n $(\".counter\", $bigFather).addClass(\"badge-success\");\n $(\".question\", $bigFather).removeClass(\"well\").addClass(\"alert alert-success\");\n });\n\n $(\"#result-by-response-text\").html(Math.abs(minusPoint) + \" fautes ( \" + score + \" % de réussite )\");\n\n $(\".answer-0\").each(function () {\n\n $(this).css(\"text-decoration\", \"line-through\");\n });\n\n $(\".container-question input\").attr(\"disabled\", \"disabled\");\n\n $(\".container-btn .finish, .container-btn .stop\").hide();\n $(\".container-question progress\").hide();\n $(\".container-question\").first().show();\n $(\".container-question .container-btn .next\").click(function () {\n\n var $id = $(this).parent().parent();\n $id.hide();\n $(\"#\" + $id.attr(\"id\") + \" ~ .container-question\").first().show();\n });\n\n $(\".container-question .container-btn .next\").last().html(\"Terminé\");\n\n $(\".container-question .container-btn .next\").last().click(function () {\n\n $(\".exam-title\").hide('slow');\n $(\"#fxl_qcm\").hide('slow');\n $(\".emend\").show('slow');\n\n\n });\n}", "function question4(answer) {\n console.log(answer);\n if (parseInt(answer) === 20) {\n (finalscore += 20);\n console.log(finalscore);\n localStorage.setItem(\"score\", finalscore);\n $(\".question4\").hide();\n $(\".question5\").addClass(\"show\");\n } else {\n foo = 1;\n $(\".question4\").hide();\n $(\".question5\").addClass(\"show\");\n }\n}", "answerScore (index) { return this.answers[index].score; }", "function checkAnswer(answer) {\n //Write your code in here\n}", "function exam(a)\r\n{\r\n //solving fexam\r\nlet fexam = (60/100)*a\r\n//allowing access to fexam result\r\nreturn fexam\r\n\r\n}", "function quiz(question, choice, answer){ \n //getting user's answer\n var playerAnswer = readlineSync.keyInSelect(choice, question);\n //checkAnswer\n var check;\n if (playerAnswer === answer){\n check = 1;\n score++;\n } else if(playerAnswer === -1){\n check = -1;\n } else{\n check = 0;\n score -= 0.25; \n }\n return check;\n}", "function checkAnswer(object) {\n console.log(object.value);\n console.log(correctAnswer);\n\n if (correctAnswer == object.value) {\n score++;\n } else {\n secondLeft -= 10;\n }\n\n console.log(score);\n renderQuestion();\n document.getElementById(\"currentScore\").textContent = score.toString();\n}", "function score_indicate (){\r\n //\r\n Substitute the array of [national score, English score, math score, science score, social score] into the variable \"subject_points\"\r\n let subject_points = [Number ( $ ( ' #national_language ' ).val()),\r\n Number( $ ( ' #english ' ).val()),\r\n Number( $ ( ' #mathematics ' ).val()),\r\n Number( $ ( ' #science ' ).val()),\r\n Number( $ ( ' #society ' ).val())\r\n ]; // in the variable \"sum\" // [National score, English score, math [Score, Science score, Social score] respectively. // Hint! Take out the arrays one by one and add them.\r\n let sum = subject_points[ 0 ];\r\n sum = sum + subject_points[ 1 ];\r\n sum = sum + subject_points[ 2 ];\r\n sum = sum + subject_points[ 3 ];\r\n sum = sum + subject_points[ 4 ];\r\n\r\n\r\n\r\n // Output the variable \"sum\" (total points) to \"Total points:\" (class=\"sum_indicate\").\r\n $ ( \" #sum_indicate \" ).text(sum);\r\n let average = sum / subject_points.length;\r\n $ (\"#average_indicate\").text(average);\r\n //\r\n Assign the average value to the\r\n variable \"average\" . (Total number of points you want to average (sum) / total number) // Hint! Use the length method to find the total number. (length method: a method to get the length of the string and the number of elements in the array)\r\n }", "function checkAnswer(question, answer) {\n console.log(\"question: \", question);\n console.log(\"asnwer: \", answer);\n let correctAnswer = questions.answer;\n let userAnswer = questions[question].options[answer];\n if (userAnswer == correctAnswer) {\n index = index + 1;\n console.log(score);\n console.log(\"Correct!!\");\n }\n else {\n index = index + 1;\n countDown = countDown - 15;\n score = score - 15;\n console.log(score);\n console.log(\"Next question: \", index);\n console.log(\"Incorrect!\");\n }\n clearQuestion();\n renderAllQuestions();\n // quizOver();\n }", "function keepingScore() {\n\n var userAnswer1 = $(\"input[name='answer1']:checked\").val();\n var userAnswer2 = $(\"input[name='answer2']:checked\").val();\n var userAnswer3 = $(\"input[name='answer3']:checked\").val();\n var userAnswer4 = $(\"input[name='answer4']:checked\").val();\n var userAnswer5 = $(\"input[name='answer5']:checked\").val();\n var userAnswer6 = $(\"input[name='answer6']:checked\").val();\n var userAnswer7 = $(\"input[name='answer7']:checked\").val();\n\n // Q1\n if (userAnswer1 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer1 == questions[0].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q2\n if (userAnswer2 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer2 == questions[1].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q3\n if (userAnswer3 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer3 == questions[2].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q4\n if (userAnswer4 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer4 == questions[3].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q5\n if (userAnswer5 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer5 == questions[4].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q6\n if (userAnswer6 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer6 == questions[5].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n }\n\n // Q7\n if (userAnswer7 === undefined) {\n\n unanswered++;\n }\n else if (userAnswer7 == questions[6].answer) {\n\n correctAnswers++;\n }\n else {\n\n wrongAnswers++;\n } \n\n}", "function checkAnswer() {\n const currentQuestion = questions[questionIndex];\n const correctChoice = currentQuestion[\"choices\"][0];\n const selector = document.querySelector(`input[name=question${questionIndex}]:checked`);\n let userAnswer = \"\";\n if (selector !== null)\n userAnswer = currentQuestion[\"choices\"][selector.value];\n\n if (userAnswer === correctChoice) {\n swal(\"Correct!\", `${currentQuestion.explanation}`, \"success\");\n score++;\n\tif(score != maxScore)\n\t yaySound.play();\n movePlayerForward();\n } else {\n swal(\"Incorrect\", `${currentQuestion.explanation}`, \"warning\");\n n_score++;\n\tif(n_score != minScore)\n\t noSound.play();\n movePlayerBackward();\n }\n console.log(`Score is now ${score}`);\n\n if (score == maxScore) {\n winSound.play(); // terminate game upon reaching a certain score\n swal(\"Congratulations! \\n you won! \\n Try a new game again\");\n endGame();\n return;\n }\n\n if (n_score == minScore) {\n GameoverSound.play();\n swal(\"Game Over! \\n Try a new game\");\n endGame();\n return;\n }\n\n questionIndex = (questionIndex + 1) % questions.length;\n displayQuestion();\n}", "function submitAnswers() {\n // grab the value of result (1 to 4)\n const answer = +document.forms[\"quizForm\"][\"q1\"].value - 1;\n\n if (answer === state.solution.index) {\n //update the level and the score\n state.current.level += 1;\n state.current.score += state.solution.bonus;\n\n // update the DOM\n document.getElementById(\"message\").innerHTML =\n yesses[getRandomIndex(yesses.length)];\n document.getElementById(\"section\").style.backgroundColor = \"#FCFAF2\";\n document.getElementById(\"att\").style.backgroundColor = \"#FCFAF2\";\n } else {\n // reset state\n state.current.level = 1;\n state.current.score = 0;\n remap = 1;\n\n // Update the DOM\n document.getElementById(\"message\").innerHTML =\n \"<b>Game Over :(</b> <br><br>&nbsp;the correct answer was<br>&nbsp;\" +\n state.solution.name +\n \"<br><br>&nbsp;please restart\";\n document.getElementById(\"section\").style.backgroundColor = \"#FF9D70\";\n document.getElementById(\"att\").style.backgroundColor = \"#FF9D70\";\n }\n\n // update high level and score (they are nto directly related!)\n state.best.level = Math.max(state.current.level, state.best.level);\n state.best.score = Math.max(state.current.score, state.best.score);\n\n // Update the DOM\n document.getElementById(\"level\").innerHTML = state.current.level + \"\";\n document.getElementById(\"score\").innerHTML = state.current.score + \"\";\n document.getElementById(\"hlevel\").innerHTML = state.best.level + \"\";\n document.getElementById(\"hscore\").innerHTML = state.best.score + \"\";\n\n // show the next map\n showMap();\n\n return false;\n}", "function checkAnswer(){\n trueAnswer = returnCorrectAnswer();\n userAnswer = getInput();\n// this if statement is stating if user inputs the right answer what happens and if not what happens\n if(userAnswer === trueAnswer){\n var messageCorrect = array[global_index].messageCorrect;\n score ++;\n swal({\n title: messageCorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n else{\n var messageIncorrect = array[global_index].messageIncorrect;\n swal({\n title: messageIncorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n }", "function checkAnswer(){\n let userAnswer = document.getElementById(\"answer-box\").value;\n let result = calculateCorrectAnswer();\n // 1- OPTION\n\n // if(userAnswer === result){\n // alert(userAnswer + \" es igual a \" + result);\n // }else{\n // alert(`bad luck, your answer ${userAnswer} is not correct, the correct answer is ${result[0]}`);\n // }\n \n // 2- OPTION (this allows us to run the game again\n // by calling the function and passing in the second value of the array as bellow)\n \n let isCorrect = userAnswer === result[0];\n if(isCorrect){\n alert(\"congartulations,\" + userAnswer + \" is equal to\" + result[0]);\n incrementScore();\n }else{\n alert(`bad luck, your answer \"${userAnswer}\" is not correct, the correct answer is ${result[0]}`);\n incrementWrongAnswer();\n }\n // document.getElementById(\"answer-box\").innerHTML =reset();\n runGame(result[1]);\n}", "function correctAnswer() {\n alert('Correct Answer');\n score += 100;\n}", "function userCorrectAnswerSubmitted(answer) {\n store.score++;\n $('.correct-updater').html('Correct!');\n}", "function generateResults(){\n //grabs answer user selected, current question number, and correct answer\n let selected = $('input[type=radio]:checked', '#question-form').val();\n let allQuestions = store.questions;\n let currentQuestionNumber = store.questionNumber;\n let correct = Object.values(allQuestions)[currentQuestionNumber].correctAnswer;\n \n //determines which view to generate based on if users selected the correct answer. if so, increments the score. determines\n if (correct === selected && currentQuestionNumber < store.questions.length) {\n store.score++;\n return generateCorrectPage();\n }\n else if (correct !== selected && currentQuestionNumber < store.questions.length) {\n return generateWrongPage();\n }\n}", "function Evaluate() {\n var formula = document.getElementById('FormulaDisplay').getElementsByTagName('span')[0].innerHTML;\n if (formula == \"Formula\") {\n return;\n }\n\n var status = document.getElementById('AlgoSwitchBtn').innerHTML;\n var ret = 0;\n if (status == \"eval()\") {\n ret = EvaluateWithInnerEval(formula);\n } else if (status == \"Shunt-Yard\") {\n ret = EvaluateWithShuntingYardAlgo(formula);\n } else {\n // Something happened\n console.log(\"Internal error: We do not have a calculating method called \", status.tostring, \".\");\n }\n\n if (ret != null) {\n document.getElementById('ResultDisplay').getElementsByTagName('span')[0].innerHTML = ret;\n } else {} // Something happened (already handled).\n}", "function question1(answer) {\n \n debugger;\n console.log(globalseconds);\n console.log(answer);\n if (parseInt(answer) === 20) {\n (finalscore += 20);\n console.log(finalscore); \n localStorage.setItem(\"score\", finalscore);\n $(\".question1\").hide();\n $(\".question2\").addClass(\"show\");\n } else {\n foo = 1;\n console.log(display);\n $(\".question1\").hide();\n $(\".question2\").addClass(\"show\");\n }\n\n}" ]
[ "0.73082155", "0.69914305", "0.6984815", "0.6937844", "0.6906641", "0.6876439", "0.68623495", "0.6861087", "0.68555605", "0.684543", "0.6824714", "0.68188006", "0.6777512", "0.6695989", "0.6666297", "0.66650146", "0.66630757", "0.66556585", "0.6644925", "0.66420937", "0.66277975", "0.6626847", "0.6609014", "0.6607029", "0.6594735", "0.65830094", "0.6581456", "0.65729344", "0.6570824", "0.65569615", "0.6555542", "0.6554849", "0.65418786", "0.6541143", "0.65363556", "0.6530774", "0.6528362", "0.6526998", "0.65175784", "0.6517554", "0.651641", "0.6504779", "0.6499763", "0.6499286", "0.6491358", "0.64866656", "0.64824176", "0.6468925", "0.6452224", "0.6444383", "0.64382553", "0.6436601", "0.6436415", "0.6423963", "0.6416133", "0.6404571", "0.6391091", "0.63901085", "0.63872755", "0.638683", "0.6386241", "0.63833404", "0.63767713", "0.636801", "0.63580346", "0.6353538", "0.63502157", "0.6343158", "0.63373554", "0.6335209", "0.6321471", "0.6318105", "0.6313722", "0.6303615", "0.63024503", "0.6302135", "0.63017625", "0.6300599", "0.62971777", "0.6297092", "0.62946486", "0.62937343", "0.6289267", "0.62856215", "0.62811345", "0.62781304", "0.62777895", "0.62772334", "0.6275281", "0.6272392", "0.6270675", "0.62689173", "0.6262147", "0.6260554", "0.62579644", "0.6257028", "0.6253295", "0.62518984", "0.62469625", "0.6240923", "0.62400496" ]
0.0
-1
ShowResults for displaying the results page
function showResults(){ stopTimer(); resultDisplay.textContent=""; content.textContent = ""; queslistEl.innerHTML = ""; var ptag = document.createElement("p"); ptag.setAttribute("class", "mt-4") ptag.textContent = "Completed!!! You secured " +(score/50)*100 +" percentage "; content.append(ptag); var ptag2 = document.createElement("p"); ptag2.textContent = "Your final score: " +score; content.append(ptag2); var form = document.createElement("form"); var div = document.createElement("div"); div.setAttribute("class", "form-group"); var label = document.createElement("label"); label.setAttribute("for", "initials"); label.textContent = "Your Initials: "; label.setAttribute("style", "margin-right:8px;"); input = document.createElement("input"); input.setAttribute("type", "text"); input.setAttribute("id", "initials"); input.setAttribute("class", "form-control"); input.setAttribute("placeholder","JS"); input.setAttribute("required","true"); var button = document.createElement("button"); button.setAttribute("type", "submit"); button.setAttribute("class", "btn btn-primary"); button.setAttribute("id", "submitBtn"); button.textContent = "Submit"; div.append(label); div.append(input); form.append(div); form.append(button); content.append(form); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showResults(results){\n\t\n}", "function show_results() {\n\t\t$('#mc_btns').hide();\n\t\t$('#progress-box').hide();\n\t\t$('#result-btns').show();\n\t\t$('#page-title').html('Results').hide().fadeIn(500);\n\t}", "function showResults() {\n $(\"#results\").show();\n $(\"#correctanswers\").html(\"<h3> Correct Answers: \"+correctAnswers+\"</h3>\");\n $(\"#incorrectanswers\").html(\"<h3> Incorrect Answers: \"+incorrectAnswers+\"</h3>\");\n $(\"#unansweredquestions\").html(\"<h3> Unanswered Questions: \"+unansweredQuestions+\"</h3>\");\n }", "function displayResults() {\n\n $(\"#resultsPage\").show();\n $('#questionPage').hide();\n setTimeout(reset, 1000 * 10);\n }", "function displayResults() {\n\n $('.btn').focus();\n $('#top-result').fadeIn();\n $('.container__outside--output').fadeIn();\n $('#map').html('<img src=' + mapUrl + '>');\n $('#result').text(venue.name);\n $('#location').text(venue.address);\n $('#url').html('<a href=\"' + venue.url + '\" target=\"_blank\">Vist website</a>');\n $('#category').html('<img src=\"' + venue.icon + '64.png\">');\n \n }", "function displayResults(){\n\t\t//Clear the Options section\n\t\t$(\"#options\").empty();\n\n\t\t//Display Text Results in various sections\n\t\t$(\"#questionResponse\").text(\"Here is your tally!\");\n\n\t\t$(\"#options\").append(\"<p>Correct Answers: \" + correctCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Incorrect Answers: \" + incorrectCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Unanswered: \" + unansweredCount + \" </p>\");\n\n\t\t//Display Start Over Button\n\t\t$(\"#startOver\").show();\n\t}", "function showResults() {\n self.showResults(true);\n if (self.numPlaces() === 0) {\n self.showResults(false);\n return;\n }\n var winWidth = window.innerWidth;\n\n if (winWidth > 750) {\n self.showResults(true);\n self.showSlider(true);\n } else {\n self.showResults(false);\n self.showSlider(false);\n zoom = 500;\n }\n }", "function showResults () {\n $('#results').fadeIn();\n }", "function displayQueryResults() {\n\t\t\t$scope.resultsAvailable = true;\n\t\t\tresultsOffset = 0;\n\t\t\t$scope.getNextResultsPage();\n\n\t\t}", "function showResults() {\n\n\t$(\"#resultstab\").removeClass('hide');\n\t$(\"#results\").removeClass('hide');\n\t$(\"#web100varstab\").removeClass('hide');\n\t$(\"#web100varsmessages\").removeClass('hide');\n\n\tinterpretResults();\n\n\t$('#ndtTab a[href=\"#results\"]').tab('show');\n\n\tdocument.getElementById(\"avgrtttext\").innerHTML = clientResults.avgrtt;\n\tsetGaugeValue(\"download\", clientResults.clientDerivedDownloadSpd);\n\tsetGaugeValue(\"upload\", clientResults.serverDerivedUploadSpd);\n\n\t// Printing property names and values using Array.forEach\n\tObject.getOwnPropertyNames(clientResults).forEach(function(val, idx, array) {\n\t\tif (clientResults[val] !== null && clientResults[val].length !== undefined && clientResults[val].length > 0 && clientResults[val].indexOf(\"function\") == -1) {\n\t\t\twriteToScreen((val + ': ' + clientResults[val]), 'web100vars');\n\t\t}\n\t});\n\n}", "function displayResults (data) {\n displayList(data);\n initMap(data);\n unhideHtml();\n}", "function displayResults(data) {\n console.log('Results that will be displayed in HTML looks like this first:', data);\n $('#results').append(resultsHTML(data));\n }", "function showResults(results) {\n\t\tvar ul = document.getElementById(\"matchResultsList\");\n\t\tclearResultsList(ul);\n\t\tvar frag = document.createDocumentFragment();\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tli.innerHTML = results[i];\n\t\t\tfrag.appendChild(li);\n\t\t}\n\t\tul.appendChild(frag);\n\t}", "function showResultsPage(data) {\n state = 1;\n locations = [];\n errorMessage = '';\n\n // if search was by term, stores it in recent searches\n if (searchTerm !== '') {\n rss.store({\n term: searchTerm,\n results: data.results \n });\n }\n\n // prepare next page data\n app.template7Data['page:results'] = ps.getLastQueryResults();\n app.template7Data['page:results'].loadMore = {\n label: 'Load more ...',\n canLoad: app.template7Data['page:results'].page < app.template7Data['page:results'].pages\n };\n\n app.hidePreloader();\n\n window.mainView.router.loadPage('pages/results/results.html');\n }", "function showResults(results){\n var result = \"\";\n // got through each array and get the value of the Title only\n $.each(results, function(index,value){\n result += '<p>' + value.Title + '</p>';\n });\n // append the information into search-results div.\n $('#search-results').append(result);\n }", "function showResults()\n{\n\n\tvar perviousTitle = '',\n\tresultsToShow = getSortedResults(), \n\tunits = localStorage[BG_UNITS_LOCAL_STORAGE];\n\t\n\tresetList();\n\t\n\tfor(i in resultsToShow)\n\t{\n\t\tvar title = resultsToShow[i].groupingdate;\n\t\t\n\t\tif(perviousTitle != title)\n\t\t{\n\t\t\tvar seperator = '<li class=\"sep\">'+title+'</li>';\n\t\t\tvar seperatorItem = $(seperator);\n\t\t\t$('#resultslist').append(seperatorItem);\n\t\t\tperviousTitle = title;\n\t\t}\n\t\t\n\t\tvar result = '<li class=\"arrow\"><a href=\"#edit\" id=\"result\">'+resultsToShow[i].sugar+' '+units+'<small>'+resultsToShow[i].displaytime +'</small></a></li>';\n\t\tvar resultItem = $(result);\n\t\tresultItem.bind('click',{IdForResult:resultsToShow[i].id},showResultForEditing);\n\t\t\n\t\t$('#resultslist').append(resultItem);\n\t\t\n\t}\n}", "function display_results() {\n}", "function showResults() {\n\n\t\t//var results = \"<p>Wins: \" + wins + \"</p>\" + \"<p>Losses: \" + losses + \"</p>\" + \"<p>Guesses Left: \" + guessesLeft + \"</p>\" + \"<p>Your Guesses So Far: \" + guessesMade + \"</p>\";\n\n\t\tdocument.querySelector(\"#wins\").innerHTML= wins;\n\t\tdocument.querySelector(\"#losses\").innerHTML= losses;\n\t\tdocument.querySelector(\"#left\").innerHTML= \" \" + guessesLeft;\n\t\tdocument.querySelector(\"#guesses\").innerHTML= guessesMade;\n\t\t\n\n\t}// END showResults()", "function showResults(searchResults){\t\n\t\tif (searchResults.length ==0 ) {\n\t\t\ttoShow = \"There aren't any movies with this keyword. Try a different spelling!\"\n\t\t}\n\t\telse {\n\t\t\ttoShow = \" \"\n\t\t\t//Print details of each movie here \n\t\t\tfor (i=0;i<searchResults.length;i++) {\n\t\t\t\tmovieDesc\t= searchResults[i].overview;\n\t\t\t\talttext \t= \"movie poster for\"+searchResults[i].title+\" \";\n\t\t\t\tif (searchResults[i].poster_path == null) {\n\t\t\t\t\talttext = \"No\"+alttext;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tmovieImg\t= \"https://image.tmdb.org/t/p/w185//\"+searchResults[i].poster_path;\n\t\t\t\t} \n\t\t\t\timgHTML\t\t= \"<img src='\"+movieImg+\"' alt=\"+alttext+\">\";\n\t\t\t\tmovieTitle\t= \"<h4>\"+ searchResults[i].title + \"</h4>\";\n\t\t\t\ttoShow = toShow+\n\t\t\t\t\t\t\"<table>\"+\n\t\t\t\t\t\t\t\"<thead>\"+\"<tr>\"+\n\t\t\t\t\t\t\t\t\"<th>\"+movieTitle+\"</th>\"+\n\t\t\t\t\t\t\t\"</tr>\"+\"</thead>\"+\n\t\t\t\t\t\t\t\"<tbody>\"+\"<tr>\"+\n\t\t\t\t\t\t\t\t\"<td>\"+imgHTML+\"</td>\"+\n\t\t\t\t\t\t\t\t\"<td>\"+movieDesc+\"</td>\"+\n\t\t\t\t\t\t\t\"</tbody>\"+\"</tr>\"+\n\t\t\t\t\t\t\"</table>\";\n\t\t\t\t$('tbody').hide();\n\t\t\t}\n\t\t\t\n\t\t}\n/*https://stackoverflow.com/questions/17336564/hide-tables-tbody-when-clicked-on-thead */\n\t\t//Toggle showing & hiding details \n\t\t$(document).on('click','thead',function(){\n\t\t\t$(this).next('tbody').toggle();\n\t\t});\n\t\t$(document).on('click','tbody',function(){\n\t\t\t$(this).toggle();\n\t\t});\n\t\tdocument.getElementById(\"results\").innerHTML = toShow;\t\t\t\n\t\t//looking for the events to see if they're even bound\n\t\t//console.log($.data($(\".mDetails\")[0],'events'));\n\t\t\n\t}", "function displaySearchResults (query, results) {\n\n // We're using data-attributes to govern CSS properties of the search form/results panel\n _root.setAttribute('data-displayresults','true');\n _root.removeAttribute('data-searchinit');\n _results.removeAttribute('aria-hidden');\n _results.removeAttribute('hidden');\n\n // Display number of results found above the results list\n _results\n .querySelector('div>h2')\n .textContent = results.length +\n (results.length === 1 ? ' result' : ' results') +\n ' found for \"' + query + '\"';\n\n if (results.length < 1) { return; }\n _results.querySelector('div').insertAdjacentHTML('beforeend',\n // The fun part:\n generateMarkup(results)\n );\n }", "function renderResults(results) {\n\n}", "async showResults() {\r\n document.getElementById('scenario').hidden = true;\r\n document.getElementById('results').hidden = false;\r\n\r\n const game = await this.api.getResult(this.answers);\r\n document.getElementById('game-title').innerText = game.title;\r\n document.getElementById('game-background').setAttribute('src', game.backgroundImage);\r\n document.getElementById('game-rating').innerText = game.avgRating;\r\n }", "function _showResults(response){\r\n\t\r\n\t\r\n\t$('#sql-query').text(response.data.qberesult.query);\r\n\tvar resultColumns = response.data.qberesult.values;\r\n\r\n\tif(resultColumns.length > 1){\r\n\t\tvar htmlString = '<table class=\"table table-bordered caption-bottom\"><thead><tr>';\r\n\t\tfor(var i in resultColumns[0]){\r\n\t\t\thtmlString += '<th>'+resultColumns[0][i] + '</th>';\r\n\t\t}\r\n\t\thtmlString += '</thead><tbody>';\r\n\t\tfor(i=1;i<resultColumns.length;i++){\r\n\t\t\thtmlString += '<tr>';\r\n\t\t\tfor(var j in resultColumns[i]){\r\n\t\t\t\thtmlString += '<td>' + resultColumns[i][j] + '</td>';\r\n\t\t\t}\r\n\t\t\thtmlString += '</tr>';\r\n\t\t}\r\n\t\thtmlString += '</tbody></table>';\r\n\t\t$('#results').html(htmlString);\r\n\t}\r\n\telse{\r\n\t\t$('#results').html(\"No results found.\");\r\n\t}\r\n\t\r\n\t\r\n\t$('#qbe-result').show();\r\n\t\r\n $('html, body').animate({\r\n scrollTop: $(\"#qbe-result\").offset().top\r\n }, 2000);\r\n\r\n\r\n}", "function showResults(){\n \n $('#correct-result').show();\n $('#correct-result').html('You got ' + correct + ' questions right');\n $('#incorrect-result').show();\n $('#incorrect-result').html('You got ' + incorrect + ' questions wrong');\n $('#unanswered-result').show();\n $('#unanswered-result').html('You did not answer ' + unanswered + ' questions');\n $('#restart-result').show();\n $('#restart-result').html('Select the start button below to restart the game.');\n }", "function showResults() {\n document.getElementById(\"records-start\").innerHTML = pageStart;\n document.getElementById(\"records-end\").innerHTML =\n pageStart + pageEntries - 1;\n\n document.getElementById(\"records-total\").innerHTML = ndx.size();\n\n // these two lines determine whether to disable the previous/next buttons\n // depending on where we are in the records.\n d3.select(\"#page-prev\").attr(\n \"disabled\",\n pageStart - pageEntries < 0 ? \"true\" : null\n );\n d3.select(\"#page-next\").attr(\n \"disabled\",\n pageStart + pageEntries >= ndx.size() ? \"true\" : null\n );\n }", "function DisplayResults(){\n console.log(\"inscoreboard\");\n $(\"#results\").show();\n $(\"#startOverBtn\").show();\n $('#timeLeft').empty();\n $('#message').empty();\n $('#correctedAnswer').empty(); \n $('#finalMessage').html(messages.finished);\n $('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n $('#wrongAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n $('#unanswered').html(\"Unanswered: \" + unanswered);\n //$('#startOverBtn').addClass('reset');\n //$('#startOverBtn').show();\n //$('#startOverBtn').html('Start Over?');\n }", "function showResult(response) {\n const resList = response.data;\n console.log(response.data);\n drawResultList(\n $(\"#results-container\"),\n resList,\n \"Sorry, no matched results...\"\n );\n}", "function displaySearchResults(results) {\n // Hide the spinner.\n spinner.style.display = \"none\";\n\n if (results.length) {\n // Group the results by category.\n var categoryMap = {};\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var categoryName = getCategoryName(result.url);\n var category = categoryMap[categoryName] = categoryMap[categoryName] || [];\n prepareResult(result, categoryName);\n category.push(result);\n }\n\n // Build up the HTML to display.\n var appendString = \"\";\n for (var i = 0; i < categories.length; i++) {\n var categoryName = categories[i].name;\n var category = categoryMap[categoryName];\n if (category && category.length > 0) {\n appendString += buildCategoryString(categoryName, category);\n }\n }\n searchResultsContainer.innerHTML = appendString;\n } else {\n searchResultsContainer.innerHTML = \"<p>No results found.</p>\";\n }\n }", "function showResults(results) {\n resultHead.innerHTML = results[0];\n resultDesc.innerHTML = results[1];\n\n body.classList.add('animated');\n modal.classList.add(results[2]);\n modal.classList.remove('hidden');\n modal.classList.add('slideInLeft');\n}", "function renderResults(){\n console.log(results)\n}", "function displayResults(data){\r\n // remove all past results\r\n $(\".results\").remove();\r\n // lift WikiSearch title to top of page\r\n $(\".titleClass\").css(\"padding-top\",\"0px\");\r\n // show results\r\n \r\n const result = data[\"query\"][\"search\"][0][\"title\"];\r\n // create div for all search results\r\n $(\".searchMenu\").append(\"<div class = 'searchResults results'></div>\");\r\n // main search result title\r\n $(\".searchResults\").append(\"<div class='searchTitle'></div>\");\r\n $(\".searchTitle\").html(\"Search Results for <a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+result+\"\\'>\"+result+\"</a>\"); // push titleClass to top of page\r\n \r\n // results\r\n for (var ii =1; ii < data[\"query\"][\"search\"].length -1; ii++){\r\n // create div for each result\r\n $(\".searchResults\").append(\"<div class='key\" + ii + \" result'></div>\");\r\n // append to div\r\n var searchResult = data[\"query\"][\"search\"][ii][\"title\"];\r\n $(\".key\" + ii).append(\"<p class = 'resultTitle'><a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+searchResult+\"\\'>\"+searchResult+\"</a></p>\");\r\n $(\".key\"+ii).append(\"<p class = 'resultText'>\" + data[\"query\"][\"search\"][ii][\"snippet\"]+\"...\" + \"</p>\");\r\n }\r\n}", "function displayResults() {\n const results = $(\"<div>\");\n \n //If there were no results, display a message\n if(venues.length === 0) {\n results.addClass(\"results__no-result-text\");\n results.append(document.createTextNode(\"No results found.\"));\n }\n //Otherwise display the results\n else { \n results.addClass(\"results__detail\");\n \n for(const venue of venues) {\n const venueObject = Venue(venue.name, venue.location.address, venue.location.postalCode, venue.location.city); \n \n //Create a div for the individual venue\n const venue_div = $(\"<div>\", {\"class\": \"results__result\"});\n \n //Create a div for the venue name and append it to the venue div\n const venue_name = $(\"<div>\", {\"class\": \"result__header\"});\n venue_name.text(venueObject.getName());\n venue_div.append(venue_name);\n \n //Append the text of the address and phone number to the venue div\n const venue_details = $(\"<div>\", {\"class\": \"result__details\"});\n venue_details.html(venueObject.getAddressString());\n venue_div.append(venue_details);\n \n //Append the venue div to the container results div\n results.append(venue_div);\n }\n }\n //Append the full list of results to the DOM\n $(\".results\").append(results);\n \n }", "function showResults( results ) {\n\n var html = '';\n $.each(results, function( index, value ) {\n html += \"<iframe src='http://www.youtube.com/embed/\" + value.id.videoId + \"' frameborder='0' allowfullscreen></iframe><br>\";\n });\n $(\"#search-results\").append(html);\n }", "function displayResults() {\n var res = \"\";\n if (sStatement.length > 0 ) {\n res += \"Successfully posted: \" + sStatement + \"\\n\";\n }\n if (fStatement.length > 0 ) {\n res += \"Unsuccessfully posted: \" + fStatement;\n }\n\n nDlg.show($scope, res)\n .then(function() {\n $state.go(\"term-edit\", {id : $scope.termID});\n });\n }", "function displaySearchResults(results, store) {\n\t\tvar searchResults = document.getElementById('search-results');\n\t\tif (results.length) { // Are there any results?\n\t\t\tvar appendString = '';\n\n\t\t\tfor (var i = 0; i < results.length; i++) { // Iterate over the results\n\t\t\t\tvar item = store[results[i].ref];\n\t\t\t\tappendString += '<h3><a href=\".' + item.url + '\">' + item.title + ' <div class=\"fa fa-arrow-right\" aria-hidden=\"true\"></div></a></h3>';\n\t\t\t\tappendString += '<p>' + item.content.substring(0, 150) + '...</p></li>';\n\t\t\t}\n\t\t\tsearchResults.innerHTML = appendString;\n\t\t} else {\n\t\t\tdisplayFailureMessage('No results found for \"' + searchTerm);\n\t\t}\n\n\n\t}", "function showResults() {\n\t\t\t\tconsole.clear();\n\t\t\t\tconsole.log(data);\n\t\t\t}", "function displayResults() {\n $.ajax({\n type: 'POST',\n url: 'responder_search.php',\n dataType: 'json',\n success: function (data) {\n _results = data;\n _redrawTable();\n },\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n alert('Error. Check the console for more details.');\n console.log(XMLHttpRequest);\n console.log(textStatus);\n console.log(errorThrown);\n }\n });\n }", "function showTriviaResults() {\n\tshowSection(resultsPage);\n\t$(\"#correct-answers\").html(correctAnswers);\n\t$(\"#incorrect-answers\").html(incorrectAnswers);\n\t$(\"#unanswered\").html(unanswered);\n}", "function showResults(exercisePassed ) {\n self.exercise.blockUIElements();\n\n self.dom.buttons.done.hide()\n self.dom.buttons.tryAgain.show();\n self.dom.buttons.showCorrectAnswer.hide();\n\n self.data.exercisePassed = exercisePassed;\n\n renderResultBlock();\n\n if (self.config.showDetails) {\n self.dom.buttons.details.show();\n } else {\n self.dom.buttons.details.hide();\n }\n }", "function displayResults() {\n\tif (h2hSelectors.player1 && h2hSelectors.player2) {\n\t\tdocument.getElementById(\"h2hWrapper\").classList.remove(\"hidden\");\n\t\tdc.renderAll(\"matchUp\");\n\t}\n}", "function renderResults(result) {\n\t\tif(result && result.searchHits && result.searchHits.length) {\t\n\t\t\tlistOfMyListItems = result.searchHits;\n\t\t\tdisplayMyList(result.searchHits);\n\t\t\tpagingControl.updatePaging(result);\n\t\t}\n\t}", "function showResults() {\t\n\t//prepare DOM to show results\t\t\t\t\t\t\t\t\t\n\tdocument.getElementById(\"empty-state\").style.display = 'none';\n\tdocument.getElementById(\"titlResult\").style.display = 'block';\n\tdocument.getElementById(\"numFoundTit\").style.display = 'block';\n\tdocument.getElementById(\"focusButton\").style.display = 'block';\n\t\t\t\t\t\n\t//load arrays from localStorage and from API\n\t//var filters = allFiltersT;\n\tvar filtersT = JSON.parse(window.localStorage.getItem('allFiltersT'));\n\tvar filtersO = JSON.parse(window.localStorage.getItem('allFiltersO'));\n\tvar filtersS = JSON.parse(window.localStorage.getItem('allFiltersS'));\n\t\t\t\t\t\n\t// generate different HTML elements to create the results list\n\t// iterative building of each result box\n\tvar resultDiv = document.getElementById(\"resultList\"); //define main results wrapper\n\n\tpageTitle.innerHTML += \"'\"+keyWord+\"'\"; //create title\n\n\t//count results\n\tvar resultsNum = 0;\n\n\t// CREATE RESULT ITEMS\n\tfor (var i = 0; i < results.length; i++) { //iterate results array\n\n\t\t//Verify existing filters and skip loop if filter is present in result item\n\t\t//This component filters results vs checkboxes\n\t\tif (filtersT[0] != \"cbTopicAll\") {\n\t\t\tfor (let y = 0; y < filtersT.length; ++y) {\n\t\t\t\tvar filterTopic = filtersT[y].match(/(\\d+)/); //extract the number\n\t\t\t\tvar topicX = results[i].item.topic;\n\t\t\t\tfor (let x = 0; x < topicX.length; ++x) {\n\t\t\t\t\tvar found = 0;\n\t\t\t\t\tif (topicX[x].topic_id === filterTopic[0]) {\n\t\t\t\t\t\tvar found = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (found === 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (found === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Verify existing filters and skip loop if filter is present in result item\n\t\t//This component filters results vs checkboxes\n\t\tif (filtersO[0] != \"cbOdsAll\") {\n\t\t\tfor (let y = 0; y < filtersO.length; ++y) {\n\t\t\t\tvar filterOds = filtersO[y].match(/(\\d+)/); //extract the number\n\t\t\t\tvar odsX = results[i].item.ods;\n\t\t\t\tfor (let x = 0; x < odsX.length; ++x) {\n\t\t\t\t\tvar found = 0;\n\t\t\t\t\tif (odsX[x].ods_id === filterOds[0]) {\n\t\t\t\t\t\tvar found = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (found === 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (found === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Verify existing filters and skip loop if filter is present in result item\n\t\t//This component filters results vs checkboxes\n\t\tif (filtersS[0] != \"cbSesAll\") {\n\t\t\tfor (let y = 0; y < filtersS.length; ++y) {\n\t\t\t\tvar filterSes = filtersS[y].match(/(\\d+)/); //extract the number\n\t\t\t\tvar sesX = results[i].item.session;\n\t\t\t\tvar found = 0;\n\t\t\t\tif (sesX === filterSes[0]) {\n\t\t\t\t\tvar found = 1;\n\t\t\t\t}\n\t\t\t\tif (found === 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (found === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t\t\t\t\t\t\n\t\t// Create HTML result box elements\n\t\tvar recomWrap = document.createElement(\"div\");\n\t\tvar recomSession = document.createElement(\"span\");\n\t\tvar recomDesc1 = document.createElement(\"p\"); //description part 1\n\t\tvar recomDesc2 = document.createElement(\"span\"); //description part 2\n\t\tvar recomDescLink = document.createElement(\"a\");\n\t\tvar recomH3SubtTop = document.createElement(\"h3\");\n\t\tvar recomWrapTopic = document.createElement(\"div\");\n\t\tvar recomH3SubtODS = document.createElement(\"h3\");\n\t\tvar recomWrapODS = document.createElement(\"div\");\n\t\tvar recomTit = document.createElement(\"h2\"); //create h2 title\n\t\tvar recomTitLink = document.createElement('a'); //create link (a) title\n\t\t\n\t\t// Define values before inserting into box elements\n\t\t// vRecomDesc pulls the recomendation from the results array (Fuse)\n\t\t// topicArray is an array created from the topic_ids, turning a string into an \n\t\t// array the separated by comma [1,2,3]\n\t\t// vRecomDesc1 & vRecomDesc2 is recomm description in 2 parts to create later \n\t\t// the \"view more\" link\n\t\t// odsArray, the same as topicArray\n\t\tvar vRecomTit = \"Recommendation \"+results[i].item.session+\".\"+results[i].item.paragraph+\": \"+results[i].item.title.title_recommendation_en+\" »\"; \n\t\tvar vRecomSession = \"Session #\"+results[i].item.session+\" (\"+results[i].item.year+\")\";\n\t\tvar vRecomDesc = results[i].item.title.recommendation_en;\n\t\tvar vRecomDesc1 = vRecomDesc.slice(0, 370); //part 1 description of 370 chars\n\t\tvar vRecomDesc2 = vRecomDesc.slice(370, 5000); // part 2\n\t\tvar vRecomH3SubtTop = \"Topic\";\n\t\tvar vRecomH3SubtODS = \"SDG\";\n\t\t\n\t\t// Build Recommendation link to detail page\n\t\t// Here is when the individual recommendation link is created\n\t\trecomTit.innerHTML = vRecomTit; //insert text in h2\n\t\trecomTitLink.setAttribute(\"class\", \"recom-title\"); //add class to link (a)\n\t\trecomTitLink.appendChild(recomTit); // insert h2 in link (a)\n\t\trecomTitLink.href = \"recomm_detail-en.htm?rcm=\"+results[i].item.id; //insert href in (a)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t// Insert values in HTML elements\n\t\trecomSession.innerHTML = vRecomSession; //insert session in span\n\t\trecomH3SubtTop.innerHTML = vRecomH3SubtTop; // insert Topic subtitle in h3 \n\t\trecomH3SubtODS.innerHTML = vRecomH3SubtODS; // insert ODS subtitle in h3\n\t\trecomDesc1.innerHTML = vRecomDesc1; // insert description part1 (p)\n\t\trecomDesc2.innerHTML = vRecomDesc2; // insert description part2 (span)\n\t\t\t\t\t\t\t\n\t\t// Build link of session\n\t\tvar sessionLink = document.createElement('a'); //create link (a) session\n\t\tsessionLink.setAttribute(\"class\", \"miniButton\"); //add class to span\n\t\tsessionLink.appendChild(recomSession); // insert span in link\n\t\tsessionLink.href = \"cluster-en.htm?type=session&id=\"+results[i].item.year;\n\t\t//insert href in topic link\n\t\n\t\t// Build recommendation description with link \"view more\"\n\t\t// Verify if description usses the part 2, otherwise don't insert link \"view more\"\n\t\tjavascriptText = \"document.getElementById('descrip\"+i+\"').style.display = 'inline';document.getElementById('vermas\"+i+\"').style.display = 'none'\"; // build javascript to insert in a\n\t\trecomDescLink.href = \"javascript:void(0);\"; //insert href into a with JS to avoid scroll\n\t\trecomDescLink.setAttribute(\"onclick\", javascriptText); //insert onclick into a\n\t\trecomDescLink.innerHTML = \"(..view more)\"; // insert text in link\n\t\trecomDescLink.setAttribute(\"id\", \"vermas\"+i); //add id to link\n\t\trecomDesc1.appendChild(recomDesc2); // insert span in p (description)\n\t\tif (vRecomDesc2 != \"\") { //verify if description part 2 is not empty\n\t\t\trecomDesc1.appendChild(recomDescLink); // then insert a in p\n\t\t}\n\t\trecomDesc2.setAttribute(\"style\", \"display:none\"); //add hidden style\n\t\trecomDesc2.setAttribute(\"id\", \"descrip\"+i); //add hidden style\n\t\t\t\t\t\t\t\n\t\t// Build topics list\n\t\t// Iterates topics *1*\n\t\t// Creates individual links\n\t\tif (results[i].item.topic.length != 0) { // if topics is empty\n\t\t\tfor (let x = 0; x < results[i].item.topic.length; ++x) { // loop - number of topics\n\t\t\t\tvar recomTopic = document.createElement(\"span\"); //create span\n\t\t\t\tvar topicLink = document.createElement('a'); //create link (a) topics\n\t\t\t\t//find and pick a topic regarding the topic_id\n\t\t\t\trecomTopic.innerHTML = results[i].item.topic[x].topic_en; //insert topic in span\n\t\t\t\ttopicLink.setAttribute(\"class\", \"miniButton\"); //add class to span\n\t\t\t\ttopicLink.appendChild(recomTopic); // insert span into link\n\t\t\t\ttopicLink.href = \"cluster-en.htm?type=topic&id=\"+results[i].item.topic[x].topic_id;\n\t\t\t\t//insert href into topic link\n\t\t\t\trecomWrapTopic.appendChild(topicLink); //append span in div wrapper\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Build ODS list\n\t\t// Iterates ods *2*\n\t\t// Creates individual links\n\t\t// Create individual classes for color purposes\n\t\tif (results[i].item.ods.length != 0) { // if ods is empty\n\t\t\tfor (let x = 0; x < (results[i].item.ods).length; ++x) { // loop -number of ods\n\t\t\t\tvar recomODS = document.createElement(\"span\");\n\t\t\t\tvar odsLink = document.createElement('a'); //create link (a) odss\n\t\t\t\t//find and pick a ods in the loop\n\t\t\t\trecomODS.innerHTML = results[i].item.ods[x].ods_en; //insert ods in span\n\t\t\t\t// put color on ODS\n\t\t\t\tvar n_id = results[i].item.ods[x].ods_id;\n\t\t\t\tif (n_id === \"1\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-1\"); //add class\n\t\t\t\t} else if (n_id === \"2\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-2\");\n\t\t\t\t} else if (n_id === \"3\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-3\");\n\t\t\t\t} else if (n_id === \"4\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-4\");\n\t\t\t\t} else if (n_id === \"5\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-5\");\n\t\t\t\t} else if (n_id === \"6\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-6\");\n\t\t\t\t} else if (n_id === \"7\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-7\");\n\t\t\t\t} else if (n_id === \"8\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-8\");\n\t\t\t\t} else if (n_id === \"9\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-9\");\n\t\t\t\t} else if (n_id === \"10\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-10\");\n\t\t\t\t} else if (n_id === \"11\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-11\");\n\t\t\t\t} else if (n_id === \"12\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-12\");\n\t\t\t\t} else if (n_id === \"13\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-13\");\n\t\t\t\t} else if (n_id === \"14\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-14\");\n\t\t\t\t} else if (n_id === \"15\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-15\");\n\t\t\t\t} else if (n_id === \"16\") {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-16\");\n\t\t\t\t} else {\n\t\t\t\t\todsLink.setAttribute(\"class\", \"miniButton color-ods-17\");\n\t\t\t\t}\n\t\t\t\todsLink.appendChild(recomODS); // insert span in link\n\t\t\t\todsLink.href = \"cluster-en.htm?type=ods&id=\"+n_id; //insert href in ods link\n\t\t\t\trecomWrapODS.appendChild(odsLink); //append span in div wrapper\n\t\t\t}\n\t\t}\n\t\t// Build individual recommendation boxes\n\t\trecomWrap.setAttribute(\"class\", \"recomWrap\");\n\t\tresultDiv.appendChild(recomWrap);\n\t\trecomWrap.appendChild(recomTitLink);\n\t\trecomWrap.appendChild(sessionLink);\n\t\trecomWrap.appendChild(recomDesc1);\n\t\tif (results[i].item.topic.length != 0) {\n\t\t\trecomWrap.appendChild(recomH3SubtTop);\n\t\t\trecomWrap.appendChild(recomWrapTopic);\n\t\t}\n\t\tif (results[i].item.ods.length != 0) {\n\t\t\trecomWrap.appendChild(recomH3SubtODS);\n\t\t\trecomWrap.appendChild(recomWrapODS);\n\t\t}\n\t\t//calc number of results\n\t\tvar resultsNum = resultsNum + 1;\n\t}\n\n\t//insert number of results\n\tdocument.getElementById(\"numFound\").innerHTML = resultsNum;\n\t//if results is empty\n\tif (resultsNum === 0) {\n\t\tdocument.getElementById(\"empty-state\").style.display = 'block';\n\t\tdocument.getElementById(\"titlResult\").style.display = 'none';\n\t\tdocument.getElementById(\"numFoundTit\").style.display = 'none';\n\t\tdocument.getElementById(\"focusButton\").style.display = 'none';\n\t}\n}", "function showResults() {\n resultHeaderBefore.style.display = 'none';\n resultHeaderAfter.style.display = 'block';\n nav.style.display = 'flex';\n list.innerHTML = songsData.data\n .map(\n ({ artist, title }) =>\n `<li class=\"list-item\">\n <p class=\"list-item--text\">\n <span class=\"artist\">${artist.name}</span> - ${title}\n </p>\n <button class=\"list-item--btn\"\n data-artist=\"${artist.name}\" data-title=\"${title}\">Get the Lyrics</button>\n </li>`\n )\n .join('');\n}", "function showResults() {\r\n $(\"#optimalSolutionPanel\").hide();\r\n \r\n $('#results').show();\r\n experimentComplete();\r\n// enablePlayAgain();\r\n \r\n if (numRoundsWithStar >= 3) {\r\n writeAward(\"No Instruction Needed\");\r\n payAMT(true,0.20); \r\n } else {\r\n payAMT(true,0.0); \r\n }\r\n \r\n// quit();\r\n \r\n}", "function Results ({ results, openPopup }) {\n\treturn (\n\t\t<section className=\"results\">\n\t\t\t{results.map(result => (\n\t\t\t\t<Result key={result.imdbID} result={result} openPopup={openPopup} />\n\t\t\t))}\n\t\t</section>\n\t)\n}", "function showResult() {\n $('main').html(resultTemplate());\n}", "function showResults () {\n const value = this.value\n const results = index.search(value, 8)\n // console.log('results: \\n')\n // console.log(results)\n let suggestion\n let childs = suggestions.childNodes\n let i = 0\n const len = results.length\n\n for (; i < len; i++) {\n suggestion = childs[i]\n\n if (!suggestion) {\n suggestion = document.createElement('div')\n suggestions.appendChild(suggestion)\n }\n suggestion.innerHTML = `<b>${results[i].tablecode}</>: ${results[i].label}`\n // `<a href = '${results[i].tablecode}'> ${results[i]['section-name']} ${results[i].title}</a>`\n\n // console.log(results[i])\n }\n\n while (childs.length > len) {\n suggestions.removeChild(childs[i])\n }\n //\n // // const firstResult = results[0].content\n // // const match = firstResult && firstResult.toLowerCase().indexOf(value.toLowerCase())\n // //\n // // if (firstResult && (match !== -1)) {\n // // autocomplete.value = value + firstResult.substring(match + value.length)\n // // autocomplete.current = firstResult\n // // } else {\n // // autocomplete.value = autocomplete.current = value\n // // }\n }", "function showResults() {\n countdown = 5;\n clearInterval(timer);\n clearContent();\n }", "function displayResults() {\n if (lyric === \"\") {\n lyric = \"Couldn't find any lyrics from this track\"\n }\n id(\"lyric\").innerText = lyric;\n id(\"song-name\").innerText = trackName;\n id(\"artist-name\").innerText = artistName;\n qs(\"blockquote\").classList.remove(\"hidden\");\n qs(\"#quote\").classList.remove(\"hidden\");\n id(\"tracking\").src = tracking;\n let error = id(\"error\");\n error.innerText = \"\";\n }", "function results() {\n calcResults();\n document.getElementById(\"question5\").style.display = \"none\";\n document.getElementById(\"results\").style.display = \"block\";\n}", "function showTriviaResults() {\n\n showSection(resultsPage);\n\n $(\"#correct-answers\").html(correctAnswers);\n\n $(\"#incorrect-answers\").html(incorrectAnswers);\n\n $(\"#unanswered\").html(unanswered);\n\n}", "function showResults(search) {\n\t//show loading icon in btn\n\tvar btn = $('#search');\n\t\tbtn.addClass('searching');\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=search&search='+search,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\t// console.log(data.length);\n\t\t\t// console.log(typeof data[0] !== 'object');\n\t\t\t// var result = JSON.parse(data);\n\t\t\tappendResultToDom(data);\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t},\n\t\terror: function(response) {\n\t\t\t//log js errors\n\t\t\tshortTimeMesg('Alert! Search failed!', 'short-time-msg-failure');\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t}\n\t}\n\t);\n}", "function renderResults(results) {\n\t$('.js-results').html(`You answered <span>${results}</span> out of 10 questions correctly!`);\n}", "function showResults() {\n let output2 = document.createElement(\"P\");\n output2.id = \"output-score\";\n let outputText2 = document.createTextNode(\"Wins: \" + wins + \" Losses: \" + losses + \n \" Ties: \" + ties);\n\n output2.appendChild(outputText2);\n $(\"output-section\").replaceChild(output2, $(\"output-results\"));\n }", "function results(data) {\n $(\"#movie_results\").html(data.results.length+\" Results for search '\"+$(\"#movieQuery\").val()+\"'\");\n data.results.forEach(function(item){$(\"#movie_results\").append(\"<hr><ul>\").append(\"<li>Title: \"+item.title+\"</li>\").append(\"<li><img src=\"+img_base_url+item.poster_path+\"></img></li>\").append(\"<li>Popularity: \"+item.popularity+\"</li>\").append(\"</ul><hr>\")});\n}", "function onShowSearchResultPanel() {\n mediator.getView('searchResult');\n }", "function showResultPage() {\n if (console.log('test completed')) {\n\n //log \"time/score\" to High Scores page//\n\n //Automatically open High Scores HTML//\n\n }\n}", "function renderResultsPage(results) {\n\t$(\".js-question_page\").hide();\n\t$(\".js-results_page\").show();\n\trenderResults(results);\n\thandleRestartButtonClicked()\n\tif (results == 10) {\n\t\treturn $('.js-message').html(`Congratulations! You are a Science Nerd!`);\n\t} else if (results < 10 && results > 6) {\n\t\treturn $('.js-message').html(`Way to go, you are a science buff. Try again for nerd status!`);\n\t} else if (results == 6) {\n\t\treturn $('.js-message').html(`Cool! You know some science but you're no nerd. Try again!`);\n\t} else if (results == 5) {\n\t\treturn $('.js-message').html(`Not bad, but not too good either. Try Again.`);\n\t} else {\n\t\treturn $('.js-message').html(`Science seems to have escaped you. Hope you find it soon!`);\n\t}\n}", "function showResultPage() {\n //Hier word een alert gegeven als geen van de knoppen is ingedrukt\n if (topParties.length === 0) {\n return alert(\"Klik op een van de onderstaande knoppen s.v.p.\");\n }\n partyPage.style.display = \"none\";\n resultSection.style.display = \"block\";\n\n //De top 3 partijen worden laten zien en voegt de waarde toe aan de array\n firstPlace.innerHTML += topParties[0].name;\n secondPlace.innerHTML += topParties[1].name;\n thirdPlace.innerHTML += topParties[2].name;\n}", "function showResults(result) {\n\n // set t\n var content = '';\n var nextButton = document.querySelector('#next-button');\n var prevButton = document.querySelector('#prev-button');\n\n\n\n result.items.forEach(function(item){\n content +=\n '<div class=\"col-md-4\"><div class=\"thumbnail\"><a href=\"https://www.youtube.com/watch?v=' + item.id.videoId + '\" data-youtube-id=\"' + item.id.videoId + '\"><img src=\"' + item.snippet.thumbnails.medium.url + '\" alt=\"...\"/></a><div class=\"caption\"><h3><a href=\"https://www.youtube.com/channel/' + item.snippet.channelId + '\">More from this channel</h3></div></div></div>';\n });\n\n document.querySelector('#search-results').innerHTML = content;\n\n\n if (result.nextPageToken) {\n nextButton.setAttribute('data-token', result.nextPageToken);\n nextButton.setAttribute('data-show', true);\n } else {\n nextButton.setAttribute('data-show', false);\n }\n\n if (result.prevPageToken) {\n prevButton.setAttribute('data-token', result.prevPageToken);\n prevButton.setAttribute('data-show', true);\n } else {\n prevButton.setAttribute('data-show', false);\n }\n}", "function displayResults() {\n\n // hide time, questions and answers \n $(\"#time\").hide();\n $(\"#question1\").hide();\n $(\"#answer1\").hide();\n $(\"#question2\").hide();\n $(\"#answer2\").hide();\n $(\"#question3\").hide();\n $(\"#answer3\").hide();\n $(\"#question4\").hide();\n $(\"#answer4\").hide();\n $(\"#question5\").hide();\n $(\"#answer5\").hide();\n $(\"#question6\").hide();\n $(\"#answer6\").hide();\n $(\"#question7\").hide();\n $(\"#answer7\").hide();\n $(\"#question8\").hide();\n $(\"#answer8\").hide();\n $(\"#question9\").hide();\n $(\"#answer9\").hide();\n $(\"#question10\").hide();\n $(\"#answer10\").hide();\n $(\"#submit\").hide();\n \n // show results of correctAnswers, incorrectAnswers and unanswered.\n $(\"#resultsMessage\").html(\"<h3>Done!</h3>\");\n $(\"#correct\").html(\"Correct Answers: \" + correctAnswers);\n $(\"#incorrect\").html(\"Incorrect Answers: \" + incorrectAnswers);\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n}", "function displayResults() {\n\n $(\"#time\").hide();\n $(\"#question1\").hide();\n $(\"#answer1\").hide();\n $(\"#question2\").hide();\n $(\"#answer2\").hide();\n $(\"#question3\").hide();\n $(\"#answer3\").hide();\n $(\"#question4\").hide();\n $(\"#answer4\").hide();\n $(\"#question5\").hide();\n $(\"#answer5\").hide();\n $(\"#question6\").hide();\n $(\"#answer6\").hide();\n $(\"#question7\").hide();\n $(\"#answer7\").hide();\n $(\"#question8\").hide();\n $(\"#answer8\").hide();\n $(\"#question9\").hide();\n $(\"#answer9\").hide();\n $(\"#question10\").hide();\n $(\"#answer10\").hide();\n $(\"#submit\").hide();\n\n $(\"#results\").html(\"<h3>All Done!</h3>\");\n $(\"#correct\").html(\"Correct!: \" + correctAnswers);\n $(\"#incorrect\").html(\"Incorrect: \" + incorrectAnswers);\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n}", "function displayResult(results) {\n $(\"#songs\").html(\"\");\n\n for (i = 0 ; i < 20 && i < results.length ; i++) {\n $(\"#songs\").append(composeSongHTML(results[i], currIndex++));\n }\n bindEvents();\n}", "function renderResults () {\n $('#my-quiz').addClass('hidden');\n $('#results').removeClass('hidden');\n $('.js-results-text').append('<h2>' + 'You got ' + correctAnswers + ' out of ' + questionsTotal + ' right! ' + '</h2>');//remove questions and progress and show results page\n}", "function displayResults(resJson) {\n // if there are previous results, remove them\n $(\"#starting-screen\").hide();\n $(\"#js-error-screen\").empty();\n // iterate through the items array\n\n let records = shuffleArray(resJson.records);\n let ages = {};\n let races = {};\n let genders = {};\n records.forEach((record) => {\n if (genders[record.fields.gender]) {\n genders[record.fields.gender]++;\n } else {\n genders[record.fields.gender] = 1;\n }\n if (races[record.fields.raceethnicity]) {\n races[record.fields.raceethnicity]++;\n } else {\n races[record.fields.raceethnicity] = 1;\n }\n const age = Math.floor(record.fields.computedmissingmaxage / 10) * 10;\n if (ages[age]) {\n ages[age]++;\n } else {\n ages[age] = 1;\n }\n });\n createAgeChart(ages);\n createRaceChart(races);\n createPieChart(genders);\n\n state.records = records;\n state.page = 0;\n if (records.length > 10) {\n records = records.slice(0, 10);\n }\n\n renderItems(records);\n\n // 7. display new search button\n // 8. Show CTA message to user\n $(\"#new-search-section\").append(\n `<section class=\"new-search-container\">\n <h2 class=\"message-footer title\">Want to search in a new location?</h2>\n <button class=\"new-search-btn\">Let's Go!</button>\n </section>`\n );\n //display the results section\n $(\".results-txt\").removeClass(\"hidden\").show();\n $(\".results-container\").removeClass(\"hidden\").show();\n $(\".results\").show();\n $(\"#new-search-section\").show();\n}", "function displayResults(results) {\n if (results) {\n if (prg.json && prg.inspect) {\n console.log(inspect(JSON.parse(results), false, 2, true));\n } else {\n console.log(results);\n }\n }\n}", "function displayResults(data) {\n\n\t\tvar postData = {\n\t\t\t\taction: 'spAjaxResults',\n\t\t\t\tpollid: data.pollid\n\t\t\t},\n\t\t\n\t\t\thtml = $.ajax({\n\t\t\t\ttype:\t\t'POST',\n\t\t\t\tasync:\t\tfalse,\n\t\t\t\turl:\t\tspAjax.url,\n\t\t\t\tdata:\t\tpostData,\n\t\t\t\tdataType:\t'html',\n\t\t\t\terror:\t\tfunction(e, textStatus, errorThrown) {\n\t\t\t\t\t\t\t\tconsole.log('An error occured with `displayResults()`');\n\t\t\t\t\t\t\t\tconsole.log(textStatus, errorThrown, e);\n\t\t\t\t\t\t\t}\n\t\t\t}).responseText,\n\t\t\n\t\t\tpollID = '#poll-'+data.pollid;\n\t\t\n\t\t$(pollID).append(html);\n\t}", "function showResultsDiv() {\n \"use strict\";\n document.getElementById('results').style.display = 'block';\n}", "function results() {\n $(\"#questions\").hide();\n $(\"#options\").hide();\n $(\"#time-left\").hide();\n $(\"#results\").show();\n $(\"#correct\").html(\"Correct Answers:\" + correctAnswersCount);\n $(\"#incorrect\").html(\"Wrong Answers:\" + incorrectAnswersCount);\n\n\n}", "function getResults(p_oEvent){\n\t\tvar sUrl, sMovie;\n\t\tvar oData;\n\t p_oEvent.preventDefault();\n\t\tsMovie = $Form.find('#title').val();\n\t\tsUrl = 'https://api.themoviedb.org/3/search/movie?api_key=97058a18f3b899a2e57452cec18ee321&query=' + sMovie;\n\t $.ajax(sUrl, { \t\n\t complete: function(p_oXHR, p_sStatus){\n\t oData = $.parseJSON(p_oXHR.responseText);\n\t\t\t\tif (oData.Response === \"False\") {\n\t\t\t\t\t$Container.hide();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tqResults = oData;\n\t\t\t\t\tif(qResults.results.length>0){\n\t\t\t\t\t\t$(\"#noResults\").hide();\n\t\t\t\t\t\tfillOutResults(0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(\"#noResults\").show();\n\t\t\t\t\t\t$Container.hide();\n\t\t\t\t\t}\n\t\t\t\t} \n\t }\n\t });\n\t}", "function displayResults( query, results ){\n\t\t\n\t\tif(results.rows.length == 0) {\n\t\t\tconsole.log(\"failed\");\n\t\t\talert(\"Failed\");\n\t\t\twindow.location.href = \"index.html\";\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"Login Successful\");\n\t\t\talert(\"Login Successful\");\n\t\t\twindow.location.href = \"setprofile.html\";\n\t\t\t\n\t\t}\n}", "function displayResults() {\n loader.style.display = \"none\";\n resultsDiv.style.display = \"block\";\n}", "function displayResults(objectarray) {\n\t$(\"#search-documents\").empty();\n\t$(\"#chaplain-docs\").empty();\n\tif (objectarray.length == 0) {\n\t\t$(\"#search-documents\").append(\"<p>No results found</p>\");\n\t\t$(\"#chaplain-docs\").append(\"<p>No Documents found</p>\");\n\t}\n\tobjectarray.forEach(function(e) {\n\t\t$(\"#search-documents\").append('<hr><article class=\"search-result\"> ' +\n\t\t\t'<h3><a href=\"' + e.link + '\" target=\"_blank\">' + e.title + '</a></h3>' +\n\t\t\t'<h5>' + e.location + '</h5>' +\n\t\t\t'<h5>' + e.date + '</h5>' +\n\t\t\t'</article>')\n\n\t\t$(\"#chaplain-docs\").append('<a href=\"' + e.link + '\" target=\"_blank\">' + e.title + '</a> <br>');\n\t})\n}", "function showResults(){\n\n\t// gather answer containers from our quiz\n\tconst answerContainers = quizContainer.querySelectorAll('.answers');\n \n\t// keep track of user's answers\n\tlet numCorrect = 0;\n \n\t// for each question...\n\tmyQuestions.forEach( (currentQuestion, questionNumber) => {\n \n\t // find selected answer\n\t const answerContainer = answerContainers[questionNumber];\n\t const selector = `input[name=question${questionNumber}]:checked`;\n\t const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n\t // if answer is correct\n\t if(userAnswer === currentQuestion.correctAnswer){\n\t\t// add to the number of correct answers\n\t\tnumCorrect++;\n \n\t\t//color the answers green\n\t\tanswerContainers[questionNumber].style.color = 'blue';\n\t }\n\t // if answer is wrong or blank\n\t else{\n\t\t// color the answers red\n\t answerContainers[questionNumber].style.color = 'red';\n\t }\n\t});\n \n\t// show number of correct answers out of total\n\tresultsContainer.innerHTML = `Your score is : ${numCorrect} out of ${myQuestions.length}`;\n }", "function show_results(data, tsearch) \n { sout = '<table id=\"search_table\">';\n sout += result_content (data.nct);\n\n // page navigation\n sout += '<tr><td colspan=\"3\"><p id=\"nav_search\">'\n first = parseInt(data.nct[0][1]);\n last = parseInt(data.nct[data.nct.length-1][1]);\n np = parseInt(data.npag);\n // previous\n if (np > 1)\n sout += '<span id=\"rprev\" class=\"nav_page\"> Previous Page (' + (first-20) + ' - ' + (last-20) + ')</span>';\n else\n sout += '<span> Previous Page </span>'\n // current\n sout += '<span id=\"rshow\"> Showing (' + first + ' - ' + last + ')</span>'\n // next\n pmax = Math.ceil(parseInt(data.n.replace(',',''))/20);\n if (np+1 <= pmax)\n sout += '<span id=\"rnext\" class=\"nav_page\"> Next Page (' + (first+20) + ' - ' + (last+20) + ')</span>'\n else\n sout += '<span> Next Page </span>'\n sout += '</p></td></tr></table>';\n $(\"#results\").html(sout); \n \n // navigation clicks\n $('#rprev').bind('click', function() \n { if (tsearch == 'advanced')\n advanced_search(parseInt(data.npag)-1);\n else\n search(parseInt(data.npag)-1);\n\t$(document).scrollTop(0);\n });\n\n $('#rnext').bind('click', function() \n { if (tsearch == 'advanced')\n advanced_search(parseInt(data.npag)+1);\n else\n search(parseInt(data.npag)+1);\n\t$(document).scrollTop(0);\n });\n\n $('.filter_link').bind('click', function() \n { tag_cloud_filtering (tsearch); });\n }", "function displayResults(data) {\n // Add to the table here...\n}", "function showSearchResults(searchQuery) {\n searchData(searchQuery).then(results => {\n const html = results.map(movie => `\n <li>\n <span class=\"title\">${movie.title}</span>\n <span class=\"rating\">${movie.rating}</span>\n </li>\n `);\n\n resultsElement.innerHTML = html.join('');\n });\n }", "function displaySearchResults(query, results, data) {\n\t$('.content').empty();\n\t\n\t// Hides OR shows and sets results summary\n\tif (query == \"\") {\n\t\t$('.summary-wrapper').hide();\n\t}\n\telse {\n\t\t$('.summary-wrapper').show();\n\t\t$('#numresults').text(results.length);\n\t\tif (results.length == 1) {\n\t\t\t$('#results-plural').text('');\n\t\t}\n\t\telse {\n\t\t\t$('#results-plural').text('s');\n\t\t}\n\t}\n\n\tif (results.length) {\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tif (query == \"\")\n\t\t\t\titem = data[i]; // empty query --> show all results\n\t\t\telse\n\t\t\t\titem = data[results[i].ref]; // show query results\n\n\t\t\tvar rockList, hhList, electronicList, otherList;\n\t\t\trockList = \"\";\n\t\t\thhList = \"\";\n\t\t\telectronicList = \"\";\n\t\t\totherList = \"\";\n\n\t\t\titem['rock-artists'].forEach(function(artist) {\n\t\t\t\trockList += \"<li>\" + artist + \"</li>\";\n\t\t\t});\n\t\t\titem['hh-artists'].forEach(function(artist) {\n\t\t\t\thhList += \"<li>\" + artist + \"</li>\";\n\t\t\t});\n\t\t\titem['electronic-artists'].forEach(function(artist) {\n\t\t\t\telectronicList += \"<li>\" + artist + \"</li>\";\n\t\t\t});\n\t\t\titem['other-artists'].forEach(function(artist) {\n\t\t\t\totherList += \"<li>\" + artist + \"</li>\";\n\t\t\t});\n\n\t\t\tvar image = '<div class=\"image\"><img src=\"images/' + item.image.url + '\" alt=\"' + item.title + '\"></div>';\n\t\t\tvar title = '<div class=\"title\"><a href=\"' + item.url + '\">' + item.title + '</a></div>';\n\t\t\tvar date = '<div class=\"date\">' + item.date + '</div>';\n\t\t\tvar location = '<div class=\"location\">' + item.location + '</div>';\n\t\t\tvar artistGroup = '<div class=\"artists-container\">';\n\n\t\t\tif (rockList !== \"\")\n\t\t\t\tartistGroup += '<div class=\"artists col1\"><p class=\"heading\">Rock</p><ul class=\"list rock-artists\">' + rockList + '</ul></div>';\n\t\t\tif (hhList !== \"\")\n\t\t\t\tartistGroup += '<div class=\"artists col2\"><p class=\"heading\">Hip-Hop</p><ul class=\"list hh-artists\">' + hhList + '</ul></div>';\n\t\t\tif (electronicList !== \"\")\n\t\t\t\tartistGroup += '<div class=\"artists col3\"><p class=\"heading\">Electronic</p><ul class=\"list electronic-artists\">' + electronicList + '</ul></div>';\n\t\t\tif (otherList !== \"\")\n\t\t\t\tartistGroup += '<div class=\"artists col4\"><p class=\"heading\">Everything Else</p><ul class=\"list other-artists\">' + otherList + '</ul></div>'\n\t\t\tartistGroup += '</div><div class=\"toggle\">+ Show More</div>';\n\t\t\tartistGroup += '<a class=\"attribution\" target=\"_blank\" href=\"' + item.image.source + '\">' + item.image.author + '</a>';\n\n\t\t\tvar container = '<section>' + image + '<div class=\"card\">' + title + date + location + artistGroup + '</div></section>';\n\t\t\t$('.content').append(container);\n\t\t}\n\t}\n\n\t// Use mark.js to add span.higlight around search terms\n\t$(\".artists-container\").mark(query, {\n\t \"element\": \"span\",\n\t \"className\": \"highlight\",\n\t \"accuracy\": \"exactly\"\n\t});\n}", "function showResults(evt) {\n\t\t\tmap.graphics.clear();\n\t\t var point = evt.result.feature.geometry;\n\t\t\tvar symbol = new SimpleMarkerSymbol();\n\t\t\tsymbol.setStyle(SimpleMarkerSymbol.STYLE_DIAMOND);\n\t\t\tsymbol.setColor(new Color([0,255,255]));\n\t\t\tvar graphic = new Graphic(point, symbol);\n\t\t\tmap.graphics.add(graphic);\n\t\t\tvar result = \"<p>Click/Zoom anywhere near your search result (<img src='/assets/img/blue_diamond.gif'>) to view solar radiation per square meter.</p><p>Struggling to find what you are looking for? Try using the basemap toggle button at left to bring up satellite imagery for further help finding the spot you wish to analyze.</p>\";\n\n document.getElementById('r').innerHTML = result;\n\t\t}", "function displayResults() {\n\n $(\"#time\").hide();\n $(\"#question1\").hide();\n $(\"#answer1\").hide();\n $(\"#question2\").hide();\n $(\"#answer2\").hide();\n $(\"#question3\").hide();\n $(\"#answer3\").hide();\n $(\"#question4\").hide();\n $(\"#answer4\").hide();\n $(\"#question5\").hide();\n $(\"#answer5\").hide();\n $(\"#question6\").hide();\n $(\"#answer6\").hide();\n $(\"#question7\").hide();\n $(\"#answer7\").hide();\n $(\"#submit\").hide();\n\n //This will disply the count of each correct, wrong and unanswered questions.\n $(\"#resultsMessage\").html();\n $(\"#correct\").html(\"Correct Answers: \" + correctAnswers);\n $(\"#wrong\").html(\"Wrong Answers: \" + wrongtAnswers);\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n}", "function displayResult(result) {\n // put result on the page\n // console.log(result);\n $(\"#result\").html(result);\n\n\n // console.log(result);\n }", "function displayResults(){\n $(\"#time\").hide();\n $(\"#question1\").hide();\n $(\"#answer1\").hide();\n $(\"#question2\").hide();\n $(\"#answer2\").hide();\n $(\"#question3\").hide();\n $(\"#answer3\").hide();\n $(\"#question4\").hide();\n $(\"#answer4\").hide();\n $(\"#question5\").hide();\n $(\"#answer5\").hide();\n $(\"#question6\").hide();\n $(\"#answer6\").hide();\n $(\"#question7\").hide();\n $(\"#answer7\").hide();\n $(\"#submit\").hide();\n\n stopCount();\n\n $(\"#resultsMessage\").html(\"<h3>Congrats you're done!</h3>\");\n $(\"#correct\").html(\"Correct Answers: \" + correctAnswers);\n $(\"#incorrect\").html(\"Incorrect Answers: \" + incorrectAnswers);\n $(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n}", "function displayResults(response) {\n\t\tconsole.log(response);\n\t\tif (response.length === 0) {\n\t\t\t// Search validation\n\t\t\tinputValidator();\n\t\t} else {\n\t\t\tresultScnTitle.textContent = response[0].CommonName;\n\t\t\tvar keys = [\n\t\t\t\t'Order',\n\t\t\t\t'Suborder',\n\t\t\t\t'Infraorder',\n\t\t\t\t'Superfamily',\n\t\t\t\t'Family',\n\t\t\t\t'Subfamily',\n\t\t\t\t'Tribe',\n\t\t\t\t'Genus',\n\t\t\t\t'Subgenus',\n\t\t\t\t'Species',\n\t\t\t\t'Subspecies'\n\t\t\t];\n\t\t\tkeys.forEach(function(key) {\n\t\t\t\tvar text = response[0][key];\n\t\t\t\tif (text) {\n\t\t\t\t\tvar resItem = document.createElement('li');\n\t\t\t\t\tresItem.classList.add('result__item');\n\t\t\t\t\t\n\t\t\t\t\tvar resKey = document.createElement('span');\n\t\t\t\t\tresKey.classList.add('result__key')\n\t\t\t\t\tresKey.textContent = key + ': ';\n\t\t\t\t\tresItem.appendChild(resKey);\n\n\t\t\t\t\tvar resValue = document.createElement('span');\n\t\t\t\t\tresValue.classList.add('result__value')\n\t\t\t\t\tresValue.textContent = response[0][key];\n\t\t\t\t\tresItem.appendChild(resValue);\n\t\t\t\t\t\n\t\t\t\t\tresultScnList.appendChild(resItem);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function displayUserResults() {\n state.userResults.forEach(function (item) {\n let htmlItem = $('.js-userResult.templ').clone();\n htmlItem.find('.js-name-title').append(`${item.firstName} ${item.lastName}`);\n htmlItem.find('.js-name').attr('uid', item._id);\n htmlItem.find('.js-name').attr('firstName', item.firstName);\n htmlItem.find('.js-username').append(`(${item.username})`);\n if (item.watchlist.length === 1) {\n htmlItem.find('.js-listCount').append(`${item.watchlist.length} item in their Watchlist.`);\n } else {\n htmlItem.find('.js-listCount').append(`${item.watchlist.length} items in their Watchlist.`);\n }\n htmlItem.removeClass('templ');\n $('.js-userResults-list').append(htmlItem);\n $('.js-userResults').removeClass('hidden');\n $('.js-userResults').show();\n });\n $('.js-noUsers').addClass('hidden');\n $('.js-watchlist').hide();\n $('.js-watchlist-results').html('');\n $('.results').hide();\n $('.js-results-container').html('');\n $('.js-returnButton').removeClass('hidden');\n $('.js-welcome').addClass('hidden');\n}", "function appShowAllResults(){\n\tcreateMap();\n\tdestroyMarkers();\n\tdestroyInfo();\n\tclearItinerary();\n\tdrawCenterMarker();\n\tdrawAllMarkers();\n\tzoomToFit();\n}", "function DisplayResults(response, queryContents) { \n if (response != null) {\n // let's us know which nodes to show\n MasterViewModel.noteListViewModel.paginatedMerging(response, queryContents);\n LimitTextAreaMaxLength();\n }\n}", "function showSubresults(results){\n\t_checkedTerms = [];\n\tif(results.length==0){\n\t\t$(displayText).text(\"No Results\");\n\t\t$(\"#loader\").hide();\n\t\treturn;\n\t}\n\tif (_withSubterms){\n\t\t$(\"#show-subterms\").show();\n\t}\n\tSEARCH_TYPE = \"path-subresults\";\n\tmakeTables(results,tableLimit,0);\n\n\t$(loader).hide();\n\t$(\"#results\").show();\n\t$(\"#path-subresults\").show();\n\t$(\"#downloadform\").hide();\n\t$(\"#selections\").text(\"Choose the Intermediary Terms you want to search with\");\n\tsetFinishSearchHandler();\t\n}", "function DisplayResult(){\n\tanswers = answers.filter(function(e){return e});\n\t$(\"#content\").html('');\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Analysis\"]+\"</h1></div>\");\n\t$(\"#content\").append(\"<ul id='answerpanel'></ul>\");\n\tvar noAnswersGiven = 0;\n\tfor (var i = 0; i < answers.length;i++){\n\t\tvar text = \"\";\n\t\tif (answers[i].SelectedAnswer == null){\n\t\t\ttext =\"<b>\"+Language[\"NoAnswer\"]+\"</b>\";\n\t\t\tnoAnswersGiven++;\n\t\t}else\n\t\t\ttext = answers[i].SelectedAnswer.Text;\n\t\t$(\"#answerpanel\").append(\"<li>\"+answers[i].Question+\": \" + text+ \"</li>\");\n\t}\t\n\t\n\tif (noAnswersGiven == answers.length){\n\t\t$(\"#content\").append(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\"+Language[\"NoAnswersWarning\"]+\"</div\");\n\t}\n\t$(\"#content\").append(\"<a id =\\\"backToLastQuestion\\\" class='btn btn-primary btn-lg' role='button'>Zurück</a>\");\n\t$(\"#backToLastQuestion\").click(function(){\n\t\t$(\"#answerpanel\").fadeOut(function(){\n\t\t\t\t$(\"#answerpanel\").remove();\n\t\t\t\t$(\"#content\").append(\"<div id='answerpanel'></div>\"); \t\t\t\t\n\t\t\t\tLoadQuestion(--lastAnsweredQuestion.Id);\t\n \t\t});\n\t});\n\tif (noAnswersGiven != answers.length)\n\t$(\"#content\").append(\"<a id='showDistros' class='btn btn-success btn-lg' role='button'>\"+Language[\"ShowResults\"]+\"</a>\");\n\t$(\"#showDistros\").click(function(){\n\t\tLoadDistributionByAnswer();\n\t});\n}", "function updateResultsListing() {\n\n var listingText,\n allItems = yearDimension.top(Infinity),\n makeSceneLink = function (scene) {\n if (scene !== '[Non-panorama history]')\n return '<a target=\"_blank\" href=\"' + \n SCENE_URL_BASE + scene + '\">' + scene + \n '</a>';\n else return scene;\n };\n\n // Update results count\n\n $('#active').text(allItems.length);\n\n // List entries in results box\n\n $('#resource-list').empty();\n\n yearDimension.top(INIT_LISTING_COUNT).forEach(function (item) {\n listingText = '<p>' +\n '<strong>' +\n '<a href=\"' + RESOURCE_URL_BASE + item.URLID + '\" target=\"_BLANK\">' + \n item.short_title + '</a>' +\n '</strong>' +\n ' (' + item.year.getFullYear() + ')<br />' +\n (item.author ? item.author + '<br />' : '') +\n 'Scenes: ' + item.scene.map(makeSceneLink).join(', ') +\n '</p>';\n $('#resource-list').append(listingText); \n }); \n }", "function renderResults(){\n resultsContent.innerHTML = '';\n viewResultsButton.innerHTML = '';\n for(let i =0; i < allItems.length; i++){\n let p = document.createElement('p');\n p.textContent = `${allItems[i].name} : ${allItems[i].clicked} / ${allItems[i].viewed}`;\n viewResultsButton.appendChild(p);\n }\n}", "renderResults(searchResults){\n if(searchResults){\n if(searchResults.results){\n return this.renderMovieLists(searchResults.results);\n }\n if(searchResults.err){\n return (<div>{searchResults.err}</div>);\n }\n }\n }", "function showResults(results) {\n\n \n map.graphics.clear();\n var items = [];\n var symbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255, 0, 0,.55]));\n\n for (var i = 0, il = results.features.length; i < il; i++) {\n items.push(results.features[i].attributes);\n \n var graphic = results.features[i];\n graphic.setSymbol(symbol);\n map.graphics.add(graphic);\n graphicAttributes = graphic.attributes;\n \n }\n\n\n var serviceExtent = graphic.geometry;\n map.setLevel(18);\n map.centerAt(serviceExtent);\n \n var infoTemplate = new esri.InfoTemplate();\n\n infoTemplate.setTitle(\"<b>Service ID: ${GEODB_Fathom_ElCajon.SDE.WasteWaterServiceLocation.FacilityID}</b>\");\n infoTemplate.setContent(\"<b>${consumption}</b>\");\n graphic.setInfoTemplate(infoTemplate);\n map.infoWindow.resize(245, 105);\n map.infoWindow.setTitle(graphic.getTitle());\n map.infoWindow.setContent(graphic.getContent());\n map.infoWindow.show(serviceExtent);\n \n }", "function showResultPage(){\n if(resultParties.length == 0){\n resultParties = parties;\n }\n document.getElementById('importantContainer').style.display = 'none';\n document.getElementById('resultContainer').style.display = 'block';\n\n //De top 3 partijen worden laten zien\n document.getElementById('1stPlace').innerHTML += resultParties[0].name;\n document.getElementById('2ndPlace').innerHTML += resultParties[1].name;\n document.getElementById('3rdPlace').innerHTML += resultParties[2].name;\n}", "function showResultsFromApi(result) {\n\n //create an empty variable to store one LI for each one the results\n let buildTheHtmlOutput = \"\";\n\n $.each(result, function (resultKey, resultValue) {\n //create and populate one LI for each of the results ( \"+=\" means concatenate to the previous one)\n buildTheHtmlOutput += '<article role=\"listbox\" class=\"one-half\">';\n buildTheHtmlOutput += '<h3>' + resultValue.show.name + '</h3>';\n\n if (resultValue.show.rating.average == null) {\n buildTheHtmlOutput += '<h4>' + 'Ratings not found' + '</h4>';\n } else {\n buildTheHtmlOutput += '<h4>' + 'Rating ' + resultValue.show.rating.average + '</h4>';\n }\n\n if (resultValue.show.image == null) {\n buildTheHtmlOutput += '<img src=\"no-img.png\" alt=\"Television show poster\">';\n } else {\n buildTheHtmlOutput += '<img src=\"' + resultValue.show.image.original + '\" alt=\"Television show poster\">';\n }\n\n buildTheHtmlOutput += '<p>' + resultValue.show.summary + '</p>';\n buildTheHtmlOutput += '</article>';\n });\n //use the HTML output to show it in the index.html\n $(\".result-section\").html(buildTheHtmlOutput);\n $('.result-section').show();\n}", "function displaySearchResults(data) {\n const list = data.data.results;\n\n if (list.length === 0) {\n $('.unknown-section').html(`\n <div class='unknown'>\n <h2>No character found by that name.</h2>\n </div>\n `);\n\n $('.main-unknown-section').prop('hidden', false);\n $('.search-results-section').prop('hidden', true);\n\n return;\n }\n\n $('.main-unknown-section').prop('hidden', true);\n $('.search-results-section').prop('hidden', false);\n\n for (let i = 0; i < list.length; i++) {\n $('.search-results').append(`\n <div class=\"search-result\">\n <a href=\"#\" class=\"result-name\">${list[i].name}</a>\n </div>\n `);\n }\n}", "function results () {\n \n stop();\n\n $(\"#time\").empty();\n $(\"#correctAnswers\").text(\"Correct Answers: \" + correctAnswers);\n $(\"#incorrectAnswers\").text(\"Incorrect Answers: \" + incorrectAnswers);\n $(\"#unansweredQuestions\").text(\"Unanswered Questions: \" + unansweredQuestions);\n $(\"#results\").show();\n \n }", "function displayResults() {\n \n $(\"#finalScore\").html(finalScore);\n $(\"#random\").html(randomNum);\n $(\"#wins\").html(wins);\n $(\"#losses\").html(losses);\n}", "function displayMatches() {\n hide(infoElement);\n hide(matchesList);\n matchesList.textContent = '';\n hide(queryInfoElement);\n hide(textDiv);\n const filteredMatches = getFilteredMatches();\n if (filteredMatches.length > 0) {\n const query = queryInput.value;\n history.pushState({type: 'results', query}, null,\n `${window.location.origin}#${query}`);\n document.title = `Shakespeare: ${query}`;\n show(infoElement);\n show(matchesList);\n show(queryInfoElement);\n // const exactPhrase = new RegExp(`\\b${query}\\b`, 'i');\n // keep exact matches only\n // matches = matches.filter(function(match) {\n // return exactPhrase.test(match.doc.t);\n // });\n //\n for (const match of filteredMatches) {\n addMatch(match.doc);\n }\n } else {\n displayInfo('No matches :^\\\\');\n queryInfoElement.textContent = '';\n }\n}", "function renderResultsPage(results) {\r\n console.log(results);\r\n\t\r\n var resultsContainer = $('#container');\r\n\tvar did_you_mean = '';\r\n\t\r\n\tif(results.did_you_mean != null)\r\n\t{\r\n\t\tif(results.did_you_mean.length > 0)\r\n\t\t{\t\r\n\t\t\tfor(i=0;i<results.did_you_mean.length;i++) {\r\n\t\t\t if (i != 0) {\r\n\t\t\t did_you_mean += ', ';\r\n }\r\n\r\n\t\t\t did_you_mean += '<a href=\"#brm-search?request_type=search&search_type=keyword&q=' + results.did_you_mean[i] + '&l=' + results.did_you_mean[i] + '\">' + results.did_you_mean[i] + '</a>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n // remove previous results\r\n $('#filter_category').html('');\r\n $('#filter_brand').html('');\r\n $('#product_list').html('');\r\n $('#filter_size').html('');\r\n $('#filter_price').html('');\r\n $('#filter_colorGroup').html('');\r\n $('#filter_current').html('');\r\n $('#pagination_top').html('');\r\n $('#pagination_bottom').html('');\r\n $('#sort_options').html('');\r\n\t$('#m_recommendation').html('');\r\n\t\r\n\t/* did you mean */\r\n\tif (did_you_mean != '') {\r\n\t renderRecommendation(did_you_mean);\r\n\t $('#m_recommendation').css('display', 'block');\r\n\t}\r\n\telse {\r\n\t $('#m_recommendation').css('display', 'none');\r\n\t}\r\n\t\r\n if (results.numResults == 0) {\r\n $('#contents_left').css('display', 'none');\r\n $('#contents_right').css('display', 'none');\r\n $('#contents_center').css('display', 'none');\r\n\r\n var typedText = '';\r\n typedText = window.location.hash.match(/&q=([^&]+)/)[1].replace(/%20/g, \" \");\r\n //alert(BR.mobile.getJfyUrl(\"jfy,dynamic_categories\"));\r\n location.href = 'NoResult.aspx?searchTerm=' + typedText + BR.mobile.getJfyUrl(\"jfy,dynamic_categories\");\r\n //location.href = 'NoResult.aspx?searchTerm=' + typedText + '#brm-search?request_type=jfy';\r\n }\r\n else {\r\n $('#contents_left').css('display', 'block');\r\n $('#contents_right').css('display', 'block');\r\n $('#contents_center').css('display', 'none');\r\n\r\n /* Filters */\r\n var filtersContainer = $('#filter_category');\r\n\r\n renderFilters(results.availableFilters, results.currentFilters, filtersContainer);\r\n\r\n setPagination(results.numResults, results.startIndex);\r\n // console.log(filtersContainer);\r\n\t\t\r\n /* Sorting */\r\n renderSort(results.availableSorts, results.currentSort);\r\n\r\n /* Products */\r\n var contents_rightContainer = $('#product_list');\r\n var productGrid = $('<div></div>', { class: 'productgridpage' });\r\n contents_rightContainer.append($('<div></div>', { class: 'productgrid mw-three-up' }).append(productGrid));\r\n renderProducts(results.products, productGrid, results.brTrkData);\r\n\r\n brmSearchContainer.trigger('brm-rendered');\r\n }\r\n\r\n}", "function displayResults(response){\n $('.searched').show();\n console.log(response.data[1].fullName);\n response.data.forEach(function(found){\n \n $('.searched').append(`\n <div class=\"result\">\n <h2>${found.fullName}</h2>\n <p>${found.description}</p>\n <a href=\"${found.url}\" target=\"_blank\">Checkout the park!</a>\n </div>\n `);\n\n });\n \n}", "function showResults() {\n var results = document.getElementById(\"results\");\n document.getElementById(\"Q5\").style.display = \"none\";\n results.style.display = \"block\";\n results.innerHTML = '<h2>And your spirit guide is...</h2> <p>'+myImg.about+'</p> <img width=\"50%\" src=\"'+myImg.image+'\">';\n}" ]
[ "0.83796424", "0.8032661", "0.79927695", "0.7973715", "0.7820019", "0.78063816", "0.7768171", "0.7695292", "0.76834977", "0.76825", "0.76168966", "0.7601364", "0.75971085", "0.75827533", "0.75353664", "0.7469749", "0.7440658", "0.74109024", "0.7407934", "0.7361401", "0.7355251", "0.7347507", "0.73095626", "0.73038775", "0.72925776", "0.72665334", "0.7250607", "0.721751", "0.72119653", "0.7162454", "0.71324354", "0.7116202", "0.7068422", "0.70674497", "0.7050585", "0.7041105", "0.70361537", "0.70357126", "0.7019256", "0.70126", "0.7003904", "0.7003535", "0.6987153", "0.6986753", "0.69658804", "0.6956236", "0.6954017", "0.69336015", "0.6931986", "0.6919287", "0.6906192", "0.6887642", "0.6887339", "0.68747634", "0.68734556", "0.6871186", "0.68656313", "0.68634623", "0.68607706", "0.6856649", "0.68428993", "0.6826435", "0.68187946", "0.6815213", "0.6814976", "0.6810137", "0.67988575", "0.67984855", "0.6797515", "0.6792409", "0.67814445", "0.677558", "0.6774752", "0.677132", "0.6755117", "0.6747613", "0.6735537", "0.6735372", "0.67300165", "0.6727599", "0.67178893", "0.67151517", "0.67122275", "0.67118573", "0.67066896", "0.67032146", "0.6703076", "0.6699907", "0.668895", "0.6682129", "0.66723883", "0.6659839", "0.6659498", "0.66560644", "0.66390747", "0.66387945", "0.66364884", "0.6623915", "0.6622683", "0.6619147", "0.66108936" ]
0.0
-1
This starts the timer on pressing "Start Quiz" button
function startTimer(){ interval = setInterval(function() { totalSeconds--; timer.textContent = "Time : " +totalSeconds; if(totalSeconds<0){ stopTimer(); alert("Time Up!!!"); showResults(); timer.textContent = "Time : 0"; } }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startQuiz(){\n timerCount = 30;\n startQuizButton.disabled = true;\n\n //First queston display\n displayQuiz();\n\n //Timer starts to count down\n startTimer();\n \n }", "function startQuiz() {\n handleAnswerClick();\n displayInterface();\n \n timer();\n}", "function startQuiz() {\n questionCounter = 0;\n hideMenu();\n showQuestions();\n startTimer();\n}", "function startQuiz() {\n showQuestion();\n startTimer();\n}", "function startQuiz() {\n //console.log('Started')\n\n startBtn.classList.add(\"hide\");\n\n timerId = setInterval(timer, 1000);\n\n // generateQueztion()\n generateQuestions();\n }", "function startQuiz() {\n startTimer();\n showQuizItem(0);\n \n}", "function startTimer() {\n var startTimer = setInterval(() => {\n if (timer > 0) {\n timerEl.textContent = \"Time: \" + timer;\n timer--;\n } else if (timer === 0) {\n clearInterval(startTimer);\n endQuiz();\n } else if (timer < 0) {\n clearInterval(startTimer);\n timer = 0;\n timerEl.textContent = \"Time: \" + timer;\n endQuiz();\n }\n }, 1000);\n runQuestions();\n}", "function startTheQuiz() {\n quizFinished = false;\n timeLeft = 60;\n startButton.disabled = true;\n startTheTimer()\n showQuizQuestion()\n}", "function startQuiz() {\n // Hide start screen elements and unhide question contatiner\n startButton.classList.add(\"hide\");\n startTextEl.classList.add(\"hide\");\n questionContainerEl.classList.remove(\"hide\");\n // Initialize countdown timer\n timerId = setInterval(clock, 1000);\n timeEl.textContent = time;\n //Populate first question\n showQuestion();\n}", "function startQuiz(answer) {\n hideWelcome();\n questionDisplay(answer);\n timer();\n}", "function startQuiz() {\n timerCount = 60;\n startButton.disabled = true;\n startTimer();\n askQuestion();\n placeHolder1.textContent = \"\";\n placeHolder2.textContent = \"\";\n}", "function startQuiz(){\n startButton.classList.add('hide');\n qBox.classList.remove('hide');\n nextQuestion = 0; //Resets question index for beginning of gameplay\n timer = 30; //Setting timer to start at 30 seconds\n score = 0; //Clearing score for either initial gameplay or reset\n setNextQuestion(); //Serve user first question\n timerTick(); //Start timer\n}", "function quizStart() {\n /* hide the welcome UI */\n welcomeEL.setAttribute(\"class\",\"hidden\");\n \n /* unhide the question UI */\n questionEl.setAttribute(\"class\",\"\");\n \n /* Starts timer. Calls the time remaining function every 1 second */\n timeRemain = setInterval(function(){\n timeRemaining(); \n }, 1000);\n \n /* Display initial time */\n timerEL.textContent = time;\n renderQuestion();\n}", "function startQuiz() {\n //Removes the initial screen and displays the quiz questions; begins the quiz for the user\n showHide(getQuiz, introEl);\n\n //Start timer\n setTime();\n\n //Show the question based on index that increase by increments\n showQuestion();\n\n}", "function startQuiz(quiz){\n //initilize the timer\n clearPage();\n var timer = setCountdown(quiz);\n count(timer);\n\n //if this isn't the first quiz in a session, it will show timer and line again\n $(\".feedback-line\").show();\n $(\".timer\").show();\n \n //print the current question to the screen\n printQuestion(quiz[currentQuestion], quiz);\n}", "function startQuiz() {\n\n // hide start screen\n var startScreenEl = document.getElementById(\"start-screen\");\n startScreenEl.setAttribute(\"class\", \"hide\");\n\n // un-hide questions container\n questionsEl.removeAttribute(\"class\");\n\n // start timer\n timerId = setInterval(clockTick, 1000);\n\n // show starting time\n timerEl.textContent = time;\n\n // call the function that gets the next question \n getQuestion();\n\n}", "function start() {\n startPageEl.style.display = \"none\";\n questionsPgEl.style.display = \"block\";\n \n\n //time\n timeInterval = setInterval(function () {\n timer--;\n\n timerEl.textContent = \"Timer\" + \" \" + timer;\n\n if (timer === 0) {\n clearInterval(timeInterval);\n quizEnd();\n }\n }, 1000);\n}", "function startQuiz() {\n $(\"#trivia-questions\").show(500);\n $(\"#start-trivia\").hide(1000);\n // calls the render function to populate page with html quiz structure\n renderQuiz(questions);\n // calls function to start timer\n jQuery(function($) {\n const tMinutes = 60 * 2,\n display = $(\"#main-timer\");\n startTimer(tMinutes, display);\n });\n}", "function startQuiz() {\n // hide the title screen,\n titleScreen.setAttribute(\"class\", \"hide\");\n // then show quiz questions, choices\n quizScreen.setAttribute(\"class\", \"show\");\n //starting timer at the end, instead of the beginning to be fair.\n setTime();\n}", "function startQuiz() {\n console.log(\"start\"); \n buildQuestionCard();\n startTimer();\n}", "function startQuiz() {\n\n startScreenEl.setAttribute(\"class\", \"hide\");\n questionsEl.removeAttribute(\"class\");\n timerId = setInterval(clockTick, 1000);\n timerEl.textContent = time;\n getQuestion();\n\n}", "function startQuiz() {\n\tquizCover.style.display = \"none\";\n\ttimer.textContent = \"Time: 50\";\n\tstartBtn.style.display = \"none\";\n\tcountdown();\n}", "function startQuiz() {\n hide(\"start-button\");\n show(\"quiz\");\n timerSetting();\n currentQuestion = 0;\n getQuestion(0);\n questionClick();\n\n}", "function startQuiz() {\n \n \n startScreen.style.display = \"none\";\n quiz.style.display = \"block\";\n renderQuestions();\n timer = setInterval(countdown, 1000);\n counter.textContent = count;\n \n}", "function startTimer() {\n var timerInterval = setInterval(function() {\n quizTimer--;\n timerArea.textContent = quizTimer;\n\n \n\n if(quizTimer === 0) {\n \n clearInterval(timerInterval);\n \n submitScore();\n }\n\n if(questionIndex === 4) {\n clearTimeout(timerInterval);\n }\n \n\n }, 1000);\n}", "function startQuiz() {\n //Start game bit to prevent game from being reset\n isStarted = true;\n //Show Answer buttons A-D\n answerA.style.display = \"block\";\n answerB.style.display = \"block\";\n answerC.style.display = \"block\";\n answerD.style.display = \"block\";\n\n //hide start button\n startButton.style.display = \"none\";\n //Start timer\n countdown();\n //Generate question/answer pair and display in window\n getQuestion();\n getAnswers();\n}", "function start() {\n //hide start screen\n var startScreenEl = document.querySelector(\"start-screen\");\n startScreenEl.setAttribute(\"class\", \"hide\");\n\n //unhide questions section\n questionsEl.removeAttribute(\"class\");\n\n //start timer\n timerEl.textContent = time;\n intervalId = setInterval(function () {\n time--;\n timerEl.textContent = time + 1;\n if (time <= 0) {\n finishQuiz();\n }\n }, 1000);\n\n buildQuiz();\n}", "function StartQuiz(){\n \n ConvertQuizTime()\n\n\n console.log('Starting Quiz')\n document.getElementById('timer').style.display = \"none\"\n document.getElementById(\"quizbox\").style.display = \"flex\" // Show the flashcard quiz \n\n // Start the quiz countdown \n StartQuizCountDown()\n }", "function quizStart()\n\t\t\t{\n\t\t\t\t$(\".instruction\").hide();\n\t\t\t\t$(\".middle\").show();\n\t\t\t\tdocument.getElementById(\"score_right\").value = correct;\n\t\t\t\tdocument.getElementById(\"score_wrong\").value = wrong;\n\t\t\t\t\n\t\t\t\twindow.milisec = 15 * 60 * 1000;\n\t\t\t\t\n\t\t\t\t//Timer functionality\n\t\t\t\tvar timer = setInterval(function()\n\t\t\t\t{\t\n\t\t\t\t\tmilisec -= 1000;\n\t\t\t\t\tvar min = Math.floor( milisec / (60 * 1000) );\n\t\t\t\t\tvar sec = Math.floor(( milisec - (60 * 1000 * min)) / 1000 );\n\t\t\t\t\tif(milisec <= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\t\tendQuiz();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(min<10)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin = \"0\"+min;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(sec<10)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsec = \"0\"+sec;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar result = \"00:\"+min+\":\"+sec;\n\t\t\t\t\t\tdocument.getElementById(\"timer\").innerHTML = result;\n\t\t\t\t\t}\n\t\t\t\t},1000);\n\t\t\t\t\n\t\t\t\tnextQuestion();\n\t\t\t}", "function start() {\n var homepageEl = document.getElementById('homepage');\n questionEl.removeAttribute(\"class\"); // removes the main screen display once the button was clicked \n\n timerId = setInterval(timer, 5000); // sets a timer\n\n time.textContent = timeRemaining; // displays timer\n\n pullQuestion(); // once the quiz starts, the function pulls out a question.\n}", "function startQuiz() {\n //hide start screen and high score screen\n titleScreen.setAttribute(\"class\", \"hide\");\n highscoreScreen.setAttribute(\"class\", \"hide\");\n scoreDisplay.setAttribute(\"class\", \"hide\");\n\n //unhide questions section \n quizScreen.setAttribute(\"class\", \"show\");\n\n // start timer \n timer = setInterval(countdown, 1000);\n\n // show starting time\n var time = 75;\n timerCountdown.textContent = time;\n\n getQuestion();\n}", "function startQuiz() {\n //hide start screen \n var startQuizEl = document.getElementById(\"start-quiz-screen\");\n startQuizEl.setAttribute(\"class\", \"hide-page\");\n\n //show questions\n questionsEl.removeAttribute(\"class\");\n\n //start timer\n timerId = setInterval(myTimer, 1000);\n\n //show start time\n timerEl.textContent = time;\n\n getQuestion();\n}", "function startQuestions() {\n // starts timer when this function runs\n counter =15;\n timer = setInterval(countDown, 1000);\n\n\n const question = quizQuestions[currentQuestions].question;\n\n const choices = quizQuestions[currentQuestions].choices;\n\n\n // this allows T/Q/C/A show up on page\n $('#time').html('Timer: ' + counter);\n $('#game').html(`\n <h4>${question}<h4>\n ${showChoices(choices)}\n `);\n\n}", "function startQuiz() {\n remainingTime = timer;\n $questionTimerText.textContent = remainingTime;\n\n displayQuiz();\n\n quizTimer = setInterval(() => {\n $questionTimerText.textContent = --remainingTime;\n if (remainingTime < 0) {\n endQuiz(true);\n }\n }, 1000);\n}", "function startQuiz() {\n duringQuiz = true;\n timeLeft = timeTotal;\n quizInterval = setInterval(function() {\n timeLeft--;\n timeLeftEl.textContent = \"Time left: \" + timeLeft + \"s\";\n }, 1000 * 1);\n setTimer(timeLeft);\n currentQuestionIndex = 0;\n createQuestionContainer();\n loadQuestion(questions[currentQuestionIndex]);\n}", "function startTimerForQA() {\n renderQuestionForUI();\n renderTimerForUI();\n renderQuestionListNavigationForUI();\n switchModeOfTimerControlButton(START);\n}", "function startQuiz() {\n $(\"#garbage\").empty();\n $(\"#stopwatch-title\").text(\"Seconds Left\");\n $(\"#stopwatch-time\").text(secondsLeft);\n startStopwatch();\n $(\"#start-btn\").hide();\n console.log(\"quiz started\");\n promptQuestion(questionList);\n}", "function startQuiz() {\n timeLeft = 75;\n theTimer();\n questions();\n}", "function startQuiz() {\n displayCurrentQuestion();\n $(\"#nextButton\").show();\n $(\"#startButton\").hide();\n $(\".row\").show();\n startTimer();\n}", "function timingQuestion() {\n \n displayQuestionAndListenForInput();\n\n\n if (count == questionArr.length + 1) {\n clearInterval(intervalid);\n clearInterval(timeIntervalID);\n $(\"#timer-id\").empty();\n $(\"main\").empty();\n\n \n $(\"main\").append(\"<p class='ending-stats'>Correct Answers: \" + correctAnswer + \"</p>\");\n $(\"main\").append(\"<p class='ending-stats'>Wrong Answers: \" + wrongAnswer + \"</p>\");\n $(\"main\").append(\"<p class='ending-stats'>Missed Answers: \" + missedAnswer + \"</p>\");\n\n time = 30;\n clicked = false;\n count =0;\n correctAnswer = 0;\n wrongAnswer = 0;\n missedAnswer = 0;\n\n $(\"main\").append(\"<button id='start-button'>RESTART!</button>\");\n $(\"#start-button\").on(\"click\", timingQuestion);\n }\n }", "function startQuiz() {\n //css style\n hideDiv.style.visibility = 'hidden';\n nextButton.style.display = 'block';\n scoreContainer.style.display = 'block';\n\n // timer\n let duration = 30 * questions.length;\n // let duration = 30 * 1;\n startTimer(duration, timerContainer);\n\n // displaying question function\n return displayQuestion();\n}", "function startTimer() {\n totalSeconds = quizObj.length * 10;\n clearInterval(interval); \n setTime();\n}", "function startQuiz() {\n $landing.remove()\n $content.prepend($question)\n startTimer()\n nextQuestion()\n }", "function startQuiz() {\n $(\"#start\").hide();\n $(\"#question1\").show();\n startTimer();\n }", "function quizStart() {\n timer = setInterval(function () {\n secondsLeft--;\n timeEl.textContent = \"Your Time: \" + secondsLeft;\n\n if (secondsLeft <= 0) {\n clearInterval(timer);\n quizEnd();\n }\n }, 1000);\n\n nextQuestion();\n}", "function onStartClick() {\n resetTimer();\n interval = setInterval(function () {\n updateTimer(-1);\n //Stop the time loop when counter reaches 0\n if (counter < 1) {\n clearInterval(interval);\n }\n }, 1000); //1000 ms = 1 seconds which is the interval between the function execution\n \n hideDetails();\n startQuiz();\n}", "function beginquiz() {\n console.log(\"beginquiz()\");\n // Hides the instructions and the start button //\n instructionsEl.classList.add(\"hide\");\n startbuttonEl.classList.add(\"hide\");\n // Starts timer located in timer.js//\n countdown();\n // Begins the quiz //\n quizquestions();\n }", "function startQuiz(){\r\n start.style.display = \"none\";\r\n showQuestion();\r\n quiz.style.display = \"block\";\r\n Progress();\r\n renderCounter();\r\n timer = setInterval(renderCounter,1000); // 1000ms = 1s\r\n}", "function startQuiz() {\n // Add/Remove classes\n startQuizBtn.classList.add('hide');\n questionArea.classList.remove('hide');\n var instructions = document.querySelector('.instructions');\n instructions.classList.add('hide');\n\n // Start Timer\n startTimer();\n\n // Get Question\n getQuestion();\n}", "function startQuiz() {\n // Hide title screen and scores button\n instructionsEl.classList.add(\"hide\");\n viewtopScores.classList.add(\"hide\");\n // show question container\n questionContainerEl.classList.remove(\"hide\");\n // Set timer\n startTimer();\n // Show first question\n getQuestion();\n}", "function startQuiz() {\n welcomeSection.style.display = \"none\";\n questionSection.style.display = \"block\";\n currentQuestion = 0;\n startTimer();\n askQuestions();\n}", "function startQuiz() {\n startSound.play();\n landingPage.style.display = \"none\";\n quizPage.style.display = \"block\";\n isCorrect = null;\n renderQuestion();\n timeCountDown = setInterval(timeCount, 1000);\n}", "function start() {\n showIt(\".question\");\n showIt(\"#submit\");\n hideIt(\"#start\");\n hideIt(\"#restart\");\n hideIt(\".answers\");\n number = 31;\n counter = setInterval(timer, 1000);\n timer();\n }", "function startSurvey(element){\r\n //Starts timer\r\n setInterval(startTimer, 1000);\r\n //Hides the button you clicked to start the survey\r\n hideStart(element);\r\n //Starts the survey, showing the first question\r\n startQuiz();\r\n}", "function startquiz(){\n startquizEl = document.getElementById(\"startscreen\");\n\n startBtn.setAttribute (\"class\",\"hide\");\n questionEL2.removeAttribute(\"class\");\n timerId = setInterval(clockTick, 1000);\n timerId.textContent = time;\n getQuestion();\n\n}", "function startQuiz() {\n updateTime(0); //sets initial time\n startScreenEl.setAttribute(\"class\", \"hide\"); \n questionsEl.removeAttribute(\"class\");\n questionCounter = 0;\n getQuestions(); \n quizTimer = setInterval(updateTime, 1000);\n}", "function startQuiz(){\r\n\ttitle.style.display = \"none\";\r\n start.style.display = \"none\";\r\n renderQuestion();\r\n quiz.style.display = \"block\";\r\n renderCounter();\r\n renderLives();\r\n renderScore();\r\n TIMER = setInterval(renderCounter,1000); // 1000ms = 1s\r\n}", "function play() {\n startGame(); // start timer\n var answer = showQuiz(quizIndex);\n}", "function startTimer() {\n quizPage.hidden = false;\n homePage.hidden = true;\n setTimer();\n renderQuestions();\n}", "function startTimer() {\n // Sets timer\n timer = setInterval(function() {\n timerCount--;\n timerElement.textContent = timerCount;\n if (timerCount === 0) {\n // Clears interval\n clearInterval(timer);\n nextQuestion();\n }\n }, 1000);\n }", "function start() {\n\n setTime(); //set timer\n\n //next question function\n next();\n}", "function startQuiz(){\n start.style.display = \"none\";\n renderQuestion();\n quiz.style.display = \"block\";\n renderProgress();\n renderCounter();\n TIMER = setInterval(renderCounter,1000); // 1000ms = 1s\n}", "function startQuiz(){\r\n startEl.style.display = \"none\";\r\n quizEl.style.display = \"block\";\r\n timer = setInterval(renderCounter,1000); \r\n askQuestion(); \r\n}", "function startQuiz() {\n //Clear out the quiz introduction text\n quizText.textContent = \"\";\n //Create a timer for the quiz\n quizInterval = setInterval(function () {\n //Display the current time left for the quiz \n timer.textContent = \"Timer: \" + quizCountdown;\n //If the previous question's result is still being displayed, clear it.\n if (questResultDisplayed) {\n questResult.textContent = \"\";\n questResultDisplayed = false;\n }\n //If User ran out of time, display end screen and clear counter.\n if (quizCountdown <= 0) {\n endQuiz();\n }\n quizCountdown--;\n\n\n }, 1000);\n\n //Display questions\n showQuestions();\n}", "function startQuiz()\n{\n resetQuestions(); // Reset list of questions since they get spliced out when generating quiz\n div_starter.style.display = \"none\"; // Hide starter div\n div_quizzer.style.display = \"flex\"; // Show quizzer div which had default of flex\n questionNum = 1;\n quiz = getQuiz(5);\n timer = 60.00;\n startTimer();\n txt_timer.innerHTML = timer.toFixed(2);\n txt_output.innerHTML = \"\";\n quizUser();\n}", "function triviaStart() {\n $(\"#button-holder\").addClass(\"hide\");\n var timer = setInterval (countdownChanger, 1000);\n function countdownChanger () { \n timeLeft--;\n $(\"#countdown\").html(\"Time Remaining: \" + parseInt(timeLeft));\n if (timeLeft <= 0) {\n alert (\"TIME'S UP!\");\n clearInterval(timer);\n quizGrader();\n $(\"#countdown\").html(\"You got \"+ score + \" correct!\");\n }\n }\n }", "function startQuiz() {\n // hides land page\n var startScreen = document.getElementById(\"landingPage\")\n startScreen.setAttribute(\"class\", \"hide\")\n\n // un-hide question section\n questionEl.removeAttribute(\"class\");\n\n // start timer\n timerId = setInterval(clock, 1000);\n\n // show starting time\n timerEl.textContent = time;\n\n // run getQuestion function\n getQuestion();\n}", "function startQuiz() {\n // Hide all displays except for Questions Display\n openingScreen.setAttribute('class', 'hide');\n quizFinished.setAttribute(\"class\", \"hide\");\n highScores.setAttribute(\"class\", \"hide\");\n questionsDisplay.setAttribute('class', 'show');\n\n // Start the timer\n timer=setInterval(quizTimer, 1000);\n timeCountdown.textContent=timeLeft;\n\n //run the nextQuestion function\n nextQuestion()\n}", "function startQuiz() {\n startButton.classList.add(\"hide\");\n questionContainerEl.classList.remove(\"hide\");\n //Start CLock\n timerInterval = setInterval(myTimer, 1000);\n //Display the next Question\n setNextQuestion();\n}", "function startQuiz(){ \n if(seconds > 0){\n interval = setInterval(function(){\n seconds--;\n timerEl.textContent = seconds\n if(seconds === 0){\n clearInterval(interval)\n }\n }, 1000)\n showQuiz()\n }\n}", "function startQuiz(){\n start.style.display = \"none\";\n quiz.style.display = \"block\";\n timerContainer.style.display = \"block\";\n scoreContainer.style.display = \"block\";\n showQuestion();\n setTime();\n setScore();\n}", "function startQuiz(){\n\n start.style.display = \"none\";\n quiz.style.display = \"block\";\n \n timeStart();\n renderQuestions();\n}", "function startQuiz(){\n firstPage.style.display = \"none\";\n quizEl.style.display = \"flex\";\n secondsRemaining = 75;\n console.log (currentQuestion)\n startClock();\n displayQuestions();\n}", "function startQuiz() {\n // This function will need to start the countdown clock\n countdownId = setInterval(remainingTime, 1000);\n countdownClockEl.textContent = quizTime;\n\n // this function will need to hide the starting screen elements\n startMenuEl.setAttribute(\"class\", \"hidden\");\n\n // this function will need to show the first question\n quizQuestionsEl.removeAttribute(\"class\");\n\n // We need to call a function to loop through the quiz questions\n\n getQuestions();\n\n}", "function started() {\n getQuestion();\n timed = setInterval(function () {\n timer--;\n timerEl.textContent = \"Time: \" + timer;\n if (timer === 0) {\n clearInterval(timed);\n showStats();\n }\n },\n 1000);\n}", "function StartQuizCountDown(){\n\n // Initiate clock at 5 seconds \n let start = 5\n \n let startID = setInterval(function(){ \n \n \n start = start - 1\n setStartCountDown(start)\n\n if(start == 0){\n clearInterval(startID)\n console.log('Timer Ended')\n\n\n // Begin the flashcard quiz \n // Set Up the material for the quiz \n StartTimer()\n PresentCards()\n }\n\n }, 1000);\n\n\n\n\n }", "function startQuiz() {\n start.style.display = \"none\";\n displayQuestion();\n quiz.style.display = \"block\";\n console.log(countdown)\n countdown();\n}", "function startTimer() {\n questionTime--;\n questionCounter.innerHTML = questionTime;\n // When time is running low, change the style\n if(questionTime <= 5) {\n addLowTimeClass();\n }\n // When timer runs out either go to the next question or show results\n if(questionTime < 0) {\n userAnswers.push('*Timer ran out*');\n clearInterval(questionTimer);\n if(questionIndex < questionList.length - 1) {\n questionIndex++;\n displayNewQuestion(questionIndex);\n } else {\n showResults();\n }\n }\n}", "function quizStart() {\n timer = setInterval(function(){\n secondsLeft--;\n timeEl.textContent = \"time left: \" + secondsLeft;\n\n if (secondsLeft <= 0) {\n clearInterval(timer);\n quizEnd();\n }\n }, 1000);\n \n question.removeAttribute(\"class\");\n nextQuestion();\n}", "function startQuiz(){\n console.log('started!')\n\n //hide start page\n var startingPage = document.getElementById('startPage');\n startingPage.setAttribute(\"hidden\", \" \");\n\n //hide scorePage\n scorePage.setAttribute('hidden',\" \")\n\n //show questions\n showQuestions.removeAttribute(\"hidden\");\n\n //show timer\n countdown.removeAttribute(\"hidden\")\n \n questionNum = 0;\n i = 0;\n timeleft = 75;\n getQuestions()\n timer()\n \n}", "function startQuiz() {\n\ttimerInterval = setInterval(function () {\n\t\ttimerNav.innerHTML = secondsLeft;\n\t\tsecondsLeft = secondsLeft - 1;\n\t\ttimerNav.innerHTML = secondsLeft;\n\n\t\tif (secondsLeft === 0) {\n\t\t\ttimerNav.innerHTML = secondsLeft;\n\t\t\tclearInterval(timerInterval);\n\t\t}\n\t}, 1000);\n\n\tintroDiv.classList.toggle(\"collapse\");\n\tquizcontentDiv.classList.toggle(\"collapse\");\n\tactiveDiv = quizcontentDiv;\n\tloadQuestion(i);\n}", "function startQuiz() {\n startBtn.style.display = \"none\";\n renderQuestion();\n quiz.style.display = \"flex\";\n TIMER = setInterval(renderCounter, 1000);\n \n}", "function startQuiz() {\n console.log('Started')\n startButton.classList.add('hide')\n shuffledQuestions = questions.sort(() => Math.random() - .5)\n currentQuestionIndex = 0\n score = 0\n questionSection.classList.remove('hide')\n nextButton.classList.remove('hide')\n restartBtn.classList.remove('hide')\n introSection.classList.add('hide')\n countdown(1);\n setNextQuestion()\n}", "function startQuestion() {\n timer.start();\n Qnext(); \n $(\".button\").on(\"click\", function () {\n if (!qAnsered && canPressButton) {\n timer.stop();\n timer.reset();\n if ($(this).attr(\"id\") == qList[qIndex].answer.toString()) {\n Qover(1);\n }\n else {\n Qover(0);\n }\n qAnsered = true;\n }\n });\n}", "function startQuiz() {\ndisplayQuestions();\nquizCountdown();\n\n}", "function beginQuiz() {\n // Set the countdown\n countdown = 60;\n // Shuffle the questions array\n shuffledQuizArr = quizArr.sort(() => Math.random() - 0.5); // Credit: https://flaviocopes.com/how-to-shuffle-array-javascript/\n // Disable buttons while quiz is active\n beginBtn.disabled = true;\n highscoreBtn.disabled = true;\n restartBtn.disabled = true;\n // Start countdown\n countdownTimer();\n // Show the question and list of answers\n showQuiz();\n}", "function startTrivia() {\n $('.start-page').css('display', 'none');\n $('.questions-page').css('visibility', 'visible');\n $('.timer').html('<p>Time remaining: <span class=\"time\">10</span></p>');\n \n $('.question').html(questions[counter].question);\n var displayAnswers =\n '<p class=\"answer first-answer\">' +\n questions[counter].answers[0].answer +\n '</p><p class=\"answer\">' +\n questions[counter].answers[1].answer +\n '</p><p class=\"answer\">' +\n questions[counter].answers[2].answer +\n '</p><p class=\"answer\">' +\n questions[counter].answers[3].answer +\n '</p>';\n \n $('.answers').html(displayAnswers);\n \n timeHolder();\n }", "function startTimer() {\n countdown = 10;\n $(\"#timer\").text(countdown + \" seconds left to answer\"); \n timerHandle = setInterval(function () {\n countdown--;\n if (countdown > 0) {\n $(\"#timer\").text(countdown + \" seconds left to answer\");\n }\n else if (countdown === 0) {\n clearInterval(timerHandle);\n index++;\n printQuestion();\n\n }\n }, 1000);\n }", "function startQuiz() {\n setTimer();\n intro.classList.add(\"hide\");\n timer.classList.remove(\"hide\");\n questionContainer.classList.remove(\"hide\");\n setCurrentQuestion(0);\n}", "function start() {\n $(this).hide();\n count = 30;\n $(\"#timer\").html(\"Time remaining: \" + count + \" secs\");\n timeRemain = setInterval(timer, 1000);\n questions(number);\n }", "function startQuiz() {\n intervalId = setInterval(countdown, 1000);\n sectionWelcome.classList.add(\"display-none\");\n sectionQuestion.classList.remove(\"display-none\");\n\n //Show Question\n showQuestion();\n}", "function startTheQuiz(event) {\n\n // Console registers the button click\n console.log(\"button-click\");\n\n // Sets the 'hide' attribute to the instructionPage to render it invisible \n instructionsPageEl.setAttribute(\"class\", \"hide\");\n\n // Removes the 'hide' attribute to the quiz questions to make them visible\n revealQuiz.removeAttribute(\"class\");\n\n // Sets the css styling to the questions\n revealQuiz.setAttribute(\"class\", \"question-container \");\n\n // Display questions\n displayQuestions();\n\n // Begin the countdown on the timer\n timerInterval = setInterval(beginCountDown, 1000)\n}", "function runQuestions() {\n startTimer();\n welcome.classList.add('invisible');\n getQuestions();\n quizContent.classList.remove('invisible');\n shouldSubmit = true;\n}", "function startTimer(duration, display) {\n var timer = duration, minutes, seconds;\n var myTimer = setInterval(timerF, 1000);\n\n //stop the game\n if (data[qNum] == undefined) {\n document.getElementById(\"qu\").innerText = \"GAME OVER\";\n clearInterval(myTimer);\n }\n \n //timer\n function timerF() {\n minutes = parseInt(timer / 60, 10);\n seconds = parseInt(timer % 60, 10);\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n display.innerHTML = \"<span style='color:#fff; font-width:bold; font-size: 28px;'>Time to answer: \" + minutes + \":\" + seconds + \"</span>\";\n if (seconds < 11 && minutes == 0) {\n display.innerHTML = \"<span style='color:#f00; font-width:bold; font-size: 28px;'>Time to answer: \" + minutes + \":\" + seconds + \"</span>\";\n }\n if (timer-- == 0) {\n alert(\"Timeout! Next Question\");\n newQ();\n clearInterval(myTimer);\n }\n }\n\n //build new question\n function newQ() {\n document.getElementById(\"an\").innerHTML = \"\";\n qNum++;\n createQ();\n clearInterval(myTimer);\n timerStarter();\n }\n\n // create button\n if (data[qNum]){\n for (j = 0; j < 4; j++) {\n document.getElementById(\"an\" + j).addEventListener(\"click\", testAn);\n }\n }\n\n //test answer and count\n function testAn() {\n j = this.id.substring(2);\n if (document.getElementById(\"an\" + j).innerText == aArr[j] + \" \" + data[qNum][\"a\"][j][\"aText\"] && data[qNum][\"a\"][j][\"isTrue\"] == true) {\n alert(\"right\");\n rightAn++;\n result();\n newQ();\n } else {\n alert(\"wrong\");\n newQ();\n }\n }\n }", "function startTimer() {\n timerInterval = setInterval(function() {\n timeRemaining--\n $timer.text(timeRemaining)\n if (timeRemaining === 0) {\n endQuiz()\n }\n }, 1000)\n }", "function startQuiz(){\n start.style.display = \"none\";\n renderQuestion();\n quiz.style.display =\"block\";\n renderProgress();\n renderCounter();\n TIMER = setInterval(renderCounter,1000);\n\n}", "function startTimer() {\n questionCounter = 0;\n\n renderQuestion(questionCounter); // start the questions\n interval = setInterval(function() {\n // if times up: cleanup and show scoresection with score\n if (time <= 0) {\n timerSpan.textContent = 0;\n renderScore();\n return;\n }\n\n time--;\n timerSpan.textContent = time;\n }, 1000); // every second;\n} //end timer", "function startQuiz() {\n event.preventDefault();\n event.stopPropagation();\n hideEndQuizBlock(); //Calls the hideEndQuizBlock function if that is already displayed\n startQuizBlock.style.display = \"none\";\n viewScoresButton.style.display = \"none\";\n userScore = 0; //Resets the userScore\n questionProgress = 0; //Resets the questionProgress value\n timeLeft = timerLimit;\n questionItem.textContent = \"\";\n startButton.style.display = \"none\"; //Hides the startButton\n myTimer = setInterval(startTimer, 1000); //Calls the startTimer function; counts down by 1 second.\n pickRandomQuestion(); //Calls the pickRandomQuestion function\n}", "function startQuiz () {}", "startQuestionTime() {\n this.quizScreen[\"quiz-question-interval\"] = setInterval(() => {\n const timeLeftBar = this.quizScreen[\"quiz-question-time-left-bar\"]\n\n timeLeftBar.value -= 0.25\n\n if (timeLeftBar.value === 0) {\n this.submitQuestion()\n this.quizScreen[\"quiz-time-ran-out\"].classList.remove(\"hidden\")\n clearInterval(this.quizScreen[\"quiz-question-interval\"])\n }\n }, 25)\n }", "function startTimer() {\n $(\"#timer\").text(\"Time Remaining: \" + timeRemaining);\n // count down by 1 second\n time = setInterval(countDown, 100);\n // hides the start button so start can't be pressed again\n $(\"#start-screen\").empty();\n // calls function to display trivia\n displayQuestions();\n }" ]
[ "0.84979266", "0.8377631", "0.83421713", "0.82279676", "0.81773514", "0.8157394", "0.8102212", "0.8091078", "0.8082269", "0.80552167", "0.8002226", "0.7994655", "0.79870164", "0.7952219", "0.79392457", "0.79217166", "0.7904673", "0.7898548", "0.78870714", "0.7885742", "0.7884737", "0.78718585", "0.7864256", "0.7851556", "0.7834964", "0.78154045", "0.78132206", "0.780349", "0.77813655", "0.7775901", "0.7755422", "0.7747029", "0.7742548", "0.77307516", "0.7730007", "0.7729453", "0.77136767", "0.77073467", "0.77001333", "0.7690323", "0.7687297", "0.76850736", "0.765985", "0.7656916", "0.76513684", "0.76506203", "0.7646492", "0.7640277", "0.76371676", "0.761985", "0.7602085", "0.7602067", "0.75862837", "0.7585977", "0.75856644", "0.7565518", "0.7561246", "0.7554951", "0.75504875", "0.75242877", "0.75241613", "0.75196147", "0.7515456", "0.7511716", "0.75088614", "0.7499351", "0.7484757", "0.7484361", "0.74838245", "0.74818784", "0.7480471", "0.7479892", "0.74780923", "0.7476589", "0.7473344", "0.7471905", "0.74698216", "0.74651396", "0.7460236", "0.74532163", "0.7450522", "0.74474764", "0.74069005", "0.7406146", "0.7398333", "0.73771614", "0.73698914", "0.7368418", "0.7357609", "0.73413914", "0.734003", "0.73397404", "0.73379743", "0.7334537", "0.73231417", "0.73083764", "0.7306998", "0.72857744", "0.7277175", "0.727041", "0.7268254" ]
0.0
-1
This function first stores the value to localStorage and then displays the value
function displayHighscores(initials, score){ var userInitials; var userScore; content.textContent = ""; highscoreTitle.textContent = "Highscores"; var title = document.createElement("p"); highscoreTitle.append(title); highscoreTitle.setAttribute("style","font-size:28px; font-style:bold; padding:25px; !important"); if(localStorage.getItem("userInitials") && localStorage.getItem("userScore")){ userInitials = JSON.parse(localStorage.getItem("userInitials")); userScore = JSON.parse(localStorage.getItem("userScore")); }else{ userInitials = []; userScore = []; } if((initials!=null && score!=null) && (initials!="" || score!="")){ userInitials.push(initials); userScore.push(score); localStorage.setItem("userInitials", JSON.stringify(userInitials)); localStorage.setItem("userScore", JSON.stringify(userScore)); } var finalInitials = JSON.parse(localStorage.getItem("userInitials")); var finalScore = JSON.parse(localStorage.getItem("userScore")); if(finalInitials!=null){ for(var values= 0; values<finalInitials.length; values++){ var highscoreValue1 = document.createElement("p"); highscoreValue1.setAttribute("style","margin:16px 0; font-size:18px;"); highscoreValue1. textContent = finalInitials[values]+ " - " +finalScore[values]; highscoreDisplay.prepend(highscoreValue1); } highscoreTitle.append(highscoreDisplay); }else{ var title2 = document.createElement("p"); title2.textContent = "No Highscores to display. Please take test!!!" title2.setAttribute("style","margin:16px 0; font-size:18px;"); highscoreTitle.append(title2); } var button1 = document.createElement("button"); button1.setAttribute("id", "goBack"); button1.setAttribute("class", "btn btn-primary mr-5"); button1.textContent = "Go Back"; var button2 = document.createElement("button"); button2.setAttribute("id", "clearHighscores"); button2.setAttribute("class", "btn btn-primary"); button2.textContent = "Clear Highscores"; highscoreTitle.append(button1); highscoreTitle.append(button2); // Onpressing the "goBack" button displays the homePage button1.addEventListener("click", function(event){ event.preventDefault(); window.location.reload(); }); // Onpressing the "ClearHighscores" clears the highscores from localStorage too button2.addEventListener("click", function(event) { event.preventDefault(); if(event.target.id === 'clearHighscores'){ localStorage.removeItem('userInitials'); localStorage.removeItem('userScore'); highscoreDisplay.textContent=""; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showStoreValue() {\n\tvar item = localStorage.getItem(localStorageKey);\n\t\n\tif (item == null) {\n\t\titem = 'Nothing in store';\n\t} else if (item.length === 0) {\n\t\titem = 'Store contains empty value'; \n\t}\n\t\n\t$('.storeItem').text(item);\n}", "function displayScores() {\n document.getElementById(\"highscore\").textContent = localStorage.getItem(\"score\");\n console.log(localStorage.getItem(\"score\"));\n console.log(\"something \");\n}", "function getValue(){\r\n document.getElementById(\"calc\").value=localStorage.getItem(\"M+ Values\");\r\n}", "function nine(){\n var nineAM=localStorage.getItem(\"9AM\");\n //(nineAM);\n if(nineAM != null){\n document.getElementById('9').textContent=nineAM\n }\n \n}", "function show_name()\n{\n let showname = localStorage.getItem('username');\n if (!localStorage.getItem('username'))\n document.getElementById(\"displaynm\").innerHTML = \"Type in Your Display Name.\";\n else\n document.getElementById(\"displaynm\").innerHTML = \"Welcome, \" + showname;\n\n}", "function displayTask(time) {\n $(\"#\" + time).val(localStorage.getItem(time)); \n }", "function givevalue(){\r\n document.getElementById(\"qty_field\").value=\"1\";\r\n document.getElementById(\"pname\").innerText=localStorage.getItem(\"name\");\r\n document.getElementById(\"pprice\").innerText=localStorage.getItem(\"price\");\r\n document.getElementById(\"totalp\").innerText=localStorage.getItem(\"price\");\r\n }", "function saveLocalStorage() {\n const userInput9 = localStorage.getItem('9');\n $('#9')\n .children('.description')\n .text(userInput9);\n\n const userInput10 = localStorage.getItem('10');\n $('#10')\n .children('.description')\n .text(userInput10);\n\n const userInput11 = localStorage.getItem('11');\n $('#11')\n .children('.description')\n .text(userInput11);\n\n const userInput12 = localStorage.getItem('12');\n $('#12')\n .children('.description')\n .text(userInput12);\n\n const userInput1 = localStorage.getItem('13');\n $('#13')\n .children('.description')\n .text(userInput1);\n\n const userInput2 = localStorage.getItem('14');\n $('#14')\n .children('.description')\n .text(userInput2);\n\n const userInput3 = localStorage.getItem('15');\n $('#15')\n .children('.description')\n .text(userInput3);\n\n const userInput4 = localStorage.getItem('16');\n $('#16')\n .children('.description')\n .text(userInput4);\n\n const userInput5 = localStorage.getItem('17');\n $('#17')\n .children('.description')\n .text(userInput5);\n }", "function display(){\n\tvar rightbox = document.getElementById(\"rightbox\");\n\trightbox.innerHTML = \"\";\n\tfor(var x = 0; x<localStorage.length; x++){\n\t\tvar a = localStorage.key(x);\n\t\tvar b = localStorage.getItem(a);\n\t\trightbox.innerHTML += \"key: \" + a + \" | value is: \" + b + \"<br/>\" + \"<hr/>\";\n\t}\n}", "function display_saved_note() {\n if(check_web_storage_support() == true) {\n result = localStorage.getItem('note');\n }\n if(result === null) {\n result = \"\";\n }\n\n document.getElementById('area').value = result;\n}", "function showjumlah() {\n document.getElementById('jumlah1').innerHTML = localStorage.getItem('jumlah1');\n document.getElementById('jumlah2').innerHTML = localStorage.getItem('jumlah1');\n}", "function display_name()\n{\n // localStorage.clear();\n let username=document.getElementById(\"username\").value;\n // alert(username)\n localStorage.setItem('username', username);\n}", "function Cargar(nombre){\n var valor = localStorage.getItem(nombre);\n document.getElementById(nombre).value = valor;\n return valor;\n}", "function getChosenItem(){\n $(\"#spinlabel\").html(localStorage.getItem(\"chosenItem\"));\n}", "function displayUserName() {\n\tshowname = document.getElementById('displayName');\n\tshowname.innerHTML=localStorage.getItem('user'); \n}", "function actualizaCantidad()\n{\n if(localStorage.getItem('cantidad'))\n {\n numero.innerHTML = localStorage.getItem('cantidad');\n }\n}", "function getName() {\r\n var firstname = localStorage.getItem(\"memfirstname\");\r\n document.getElementById(\"user\").innerHTML = \" Hello \"+firstname;\r\n}", "function work(){\r\n var storedValue = localStorage.getItem('wname');\r\n var storedValue = localStorage.getItem('wdescription');\r\n var storedValue = localStorage.getItem('wdateline');\r\n }", "function displayCheckout(){\n\n let productNumb = localStorage.getItem('cartNumbers');\n let totalCartCost = localStorage.getItem('totalCost');\n\n $('.basket-total-cost').html(\"Basket Total (\"+ productNumb +\" items): $\"+totalCartCost + \",00\");\n\n}", "function nineAM() {\n var inputNineEl = document.getElementById(\"9am-text\");\n var outputNineEl = document.getElementById(\"9am-text\");\n var buttonNineEl = document.getElementById(\"9am-button\");\n\n buttonNineEl.addEventListener(\"click\", updateOutputNine);\n\n outputNineEl.textContent = localStorage.getItem(\"content9AM\");\n inputNineEl.value = localStorage.getItem(\"content9AM\");\n\n function updateOutputNine() {\n localStorage.setItem(\"content9AM\", inputNineEl.value);\n outputNineEl.textContent = inputNineEl.value;\n }\n}", "function getName() {\r\n if(localStorage.getItem('name') === null){\r\n name.textContent = '[Enter Name]';\r\n } else {\r\n name.textContent = localStorage.getItem('name');\r\n }\r\n}", "function setScore(){\r\n var userIni = document.getElementById(\"initials\").value;\r\n let storeInfo = totalScore + \" points - \" + userIni\r\n document.getElementById(\"high\").textContent = storeInfo;\r\n localStorage.setItem(\"highestInfo\", storeInfo);\r\n localStorage.setItem(\"highestScore\", totalScore);\r\n document.getElementById(\"setHighScore\").style.display = \"none\";\r\n document.getElementById(\"initials\").style.display = \"none\";\r\n document.getElementById(\"userScore\").textContent = \"Thank You For Playing\" ;\r\n}", "function setLocalValue( key, value ) {\n\twindow.localStorage.setItem( key, value );\n\t/*console.log(\"key: \" + key + \", value: \" + value);\n\tconsole.log( getLocalValue( key ) );*/\n\twindow.location.href = \"paquetes_detalle.html\";\n}", "function gravarLS(key,valor){\n localStorage.setItem(key, valor)\n}", "function FunctionDisplay()\r\n\t\r\n {\r\n\t \r\n\tvar x = document.forms[\"myForm\"][\"txt_notepad_title\"].value;\r\n \r\n if (x == \"\")\r\n \r\n {\r\n \r\n alert(\"Please Choose Notepad Title From Table Below To Display\");\r\n \r\n }\r\n \r\n else\r\n \r\n { \r\n\t \r\n\t\r\ndocument.getElementById('display2').innerHTML =\r\ndocument.getElementById(\"txt_area\").value;\r\n\r\n\r\n// Retrieve\r\ndocument.getElementById(\"display2\").innerHTML = localStorage.getItem(document.getElementById(\"txt_notepad_title\").value);\r\ndocument.getElementById(\"txt_area\").value = document.getElementById('display2').innerHTML;\r\n\r\n\t \r\n }\r\n }", "function asignarUsuario(){\n usuarioActual = localStorage.getItem('nombre');\n document.getElementById(\"nombreUsuario\").value = usuarioActual;\n}", "function displayResult() {\n finishDiv.style.visibility = \"visible\";\n timeElement.textContent = \"Time:\" + \" \" + timer;\n var HighScores = timer;\n localStorage.getItem(HighScores)\n finalScore.textContent = \"Your finally score is: \" + HighScores;\n localStorage.setItem(\"HighScores\", HighScores)\n \n }", "function loadLocalStorage() {\n$(\"#hour9 .description\").text(localStorage.getItem(\"hour9\"));\n$(\"#hour10 .description\").text(localStorage.getItem(\"hour10\"));\n$(\"#hour11 .description\").text(localStorage.getItem(\"hour11\"));\n$(\"#hour12 .description\").text(localStorage.getItem(\"hour12\"));\n$(\"#hour1 .description\").text(localStorage.getItem(\"hour1\"));\n$(\"#hour2 .description\").text(localStorage.getItem(\"hour2\"));\n$(\"#hour3 .description\").text(localStorage.getItem(\"hour3\"));\n$(\"#hour4 .description\").text(localStorage.getItem(\"hour4\"));\n$(\"#hour5 .description\").text(localStorage.getItem(\"hour5\"));\n}", "function set_value_in_local_storage(key,value)\n{\n\tif(key == null || value == null)\n\t{\n\t\treturn false;\n\t}\n\t\n\ttry\n\t{\n\t\tif ($(\"#\"+value).val() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).val();\n\t\t\t\n\t\t}\n\t\telse if($(\"#\"+value).html() != null)\n\t\t{\n\t\t\tvalue = $(\"#\"+value).html();\n\t\t\t\n\t\t}\n\t\t// save value in localStorage Object\n\t\tlocalStorage.setItem(key,value);\n\t\t\n\t\t// update current page cache of var your_name\n\t\tyour_name = get_value_from_local_storage(\"name\");\n\t\tupdate_message('Name Saved as ('+your_name+')','form_ok');\n\t\t\n\t\treturn true;\n\t} catch(e)\n\t{\n\t\treturn false;\n\t\tupdate_message('Failed to Save your name','form_error');\n\t}\n}", "function salvar(valor){\n aceitouSalvar = valor\n localStorage.setItem('aceitouSalvar', valor)\n}", "function userFromlocalStorge(s) {\n s.textContent = localStorage.getItem(\"user\");\n}", "function displayLocalStorage() {\n if (userInput == \"You let Kanye decide.\") {\n recentSearch.text(\"You let Kanye decide.\")\n recentSearch.on(\"click\", function () {\n\n let queryString = \"./kanye-decide.html\";\n location.assign(queryString);\n })\n }\n else {\n recentSearch.text(userInput.name)\n recentSearch.on(\"click\", function () {\n let queryString = `./user-form.html?q=${userInput.val}`;\n location.assign(queryString);\n })\n }\n }", "function showluas() {\n document.getElementById('luas1').innerHTML = localStorage.getItem('luas1');\n document.getElementById('luas2').innerHTML = localStorage.getItem('luas1');\n}", "function showAccessTime() {\n var tempTime = localStorage.time;\n document.getElementById('accessTime').innerHTML = tempTime.toString().convertTime();\n}", "function getData() {\n\n let scoreLocal = localStorage.getItem('score');\n\n if (scoreLocal > 0) {\n\n document.getElementById('bestScore').innerHTML = ` Meilleur score : ${scoreLocal}`;\n\n }\n\n}", "function nombreIngresado(e){ \n e.preventDefault();\n\n let nombreUsuario = document.getElementById(\"usuarioInput\").value;\n\n document.getElementById(\"inputIngresado\").innerHTML = nombreUsuario;\n\n localStorage.setItem(\"nombreUsuario\", nombreUsuario); //local storage set item\n\n localStorage.getItem(\"nombreUsuario\"); //local storage get item\n }", "function renderLastItem() {\n var yourScore = localStorage.getItem(\"HighScores\");\n var yourInitial = localStorage.getItem(\"Initial\");\n if (yourScore && yourInitial === \"\") {\n return\n }\n finishDiv.textContent = \"\";\n var finaPageEl = document.querySelector(\".final-page\");\n finaPageEl.style.visibility = \"visible\";\n var initialAndScore = document.querySelector(\"#staticEmail\");\n initialAndScore.value = yourInitial + \":\" + \" \" + yourScore;\n\n}", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n alert('Please use a modern browser to properly view this template!');\n }\n }", "function budgetClicked() {\n var budget = document.getElementById(\"valueUp\").innerHTML\n localStorage.setItem(\"budget\", budget);\n window.location.href = 'weather.html';\n}", "function updateUI() {\n uiTotal.innerHTML = localStorage.getItem(\"price\")\n uiCount.innerHTML = localStorage.getItem(\"count\")\n}", "function fetchStorage() {\n txtFName.value = localStorage.getItem(\"input-name\");\n txtLName.value = localStorage.getItem(\"input-lastname\");\n txtPhone.value = localStorage.getItem(\"input-phone\");\n txtEmail.value = localStorage.getItem(\"input-email\");\n }", "function exibir(){\n var qtd = document.getElementById('qtd');\n qtd.value=localStorage.qtd;\n var comp = document.getElementById('comp');\n comp.value=localStorage.comp;\n var larg = document.getElementById('larg');\n larg.value=localStorage.larg;\n var desc = document.getElementById('desc');\n desc.value=localStorage.desc;\n}", "function storage() {\n var el = document.getElementById(event.target.id);\n localStorage.setItem(el.id, el.value);\n}", "function getName() {\r\n if (localStorage.getItem('name') === null) {\r\n name.textContent = '[enter name]';\r\n }\r\n else {\r\n name.textContent = localStorage.getItem('name');\r\n }\r\n}", "function storeScore(){\n if (localStorage.getItem(\"xscore\")){\n $(\"#xscore\").html(localStorage.getItem(\"xscore\"));\n $(\"#oscore\").html(localStorage.getItem(\"oscore\"));\n\n } else {\n localStorage.setItem(\"xscore\", \"0\");\n localStorage.setItem(\"oscore\", \"0\");\n $(\"#xscore\").html(localStorage.getItem(\"xscore\"));\n $(\"#oscore\").html(localStorage.getItem(\"oscore\"));\n }\n}", "function getSavedValue(v) {\n if (typeof(Storage) !== \"undefined\") {\n if (!localStorage.getItem(v)) {\n return \"\";// You can change this to your defualt value.\n }\n return localStorage.getItem(v);\n }\n else {\n console.log(\"Sorry, your browser does not support web storage...\");\n }\n}", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\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}", "function showResults(){\n\n var storedResult = localStorage.getItem(\"result\");\n var mylang = localStorage.getObject('mylang');\n\n if(storedResult){\n document.getElementById('gs-results').innerHTML = storedResult;\n }else{\n if(mylang == \"fr\" ) {\n document.getElementById('gs-results').innerHTML = \"Aucun résultat disponible à l’heure actuelle.\";\n }else if(mylang == \"es\" ) {\n document.getElementById('gs-results').innerHTML = \"No hay resultados disponibles en el momento.\";\n }else if(mylang == \"pt\" ) {\n document.getElementById('gs-results').innerHTML = \"Nenhum resultado disponível ainda.\";\n }else{\n document.getElementById('gs-results').innerHTML = \"No Results Available Yet.\";\n } \n }\n}", "function setnewvalue(value, class_name) {\n window.localStorage.setItem(class_name, value);\n $('.' + class_name).html(value);\n $('#save_changes').css({ \"visibility\": \"visible\" });\n}", "function HighScore() {\n document.querySelector(\"#user\").innerHTML = localStorage.getItem(\"user\") + \"/\" + localStorage.getItem(\"score\");\n console.log(userEl);\n}", "function getSucDetalle(){\n\n localStorage.setItem(\"gen-suc\", genSucActual);\n $(\"#opcion-principal\").text(genSucActual); \n $(\"#opcion-principal\").append(\"<span class='caret'></span>\");\n\n if (genSucActual == \"Villa Olímpica\" ){\n $(\"#opcion1\").text(\"Miramontes\");\n $(\"#opcion2\").text(\"Datos Generales\");\n cambiaEstilosRojos();\n }\n else if (genSucActual == \"Miramontes\" ){\n $(\"#opcion1\").text(\"Villa Olímpica\");\n $(\"#opcion2\").text(\"Datos Generales\");\n cambiaEstilosRojos();\n }\n else if (genSucActual == \"Datos Generales\"){\n $(\"#opcion1\").text(\"Villa Olímpica\");\n $(\"#opcion2\").text(\"Miramontes\");\n cambiaEstilosVerdes();\n }\n}", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(name, val);\n } else {\n window.alert('Please use a modern browser to properly view this template!');\n }\n }", "function displayPlan() {\n for (var i = 0; i < timeBlocks.length; i++) {\n let value = localStorage.getItem(timeBlocks[i].querySelector('.time').innerHTML);\n if (value != null) {\n timeBlocks[i].querySelector(\".input\").value = value;\n } else {\n timeBlocks[i].querySelector(\".input\").value = '';\n }\n }\n}", "function displayCartInHTML() {\n var quantity = displayItemsInCart();\n // returning variable named quantity from displayItemsInCart(), which is the displayValue\n if (quantity > 0){\n //if quantity is more than 0, i want to update it\n var x = document.getElementById(\"amtInCart\");\n // console.log(x,\"x\");\n // changing the html doc x to quantity\n var storeCart = localStorage.setItem(\"amount\",quantity);\n //storing my stuff so i can refresh and keep my content\n var quantity2 = localStorage.getItem(\"amount\");\n //retreiving my content to be assigned as quantity2\n quantity = quantity2;\n // referring to my html doc and naming the default 0 as x\n x.innerHTML = quantity;\n //assigning quantity to quantity2\n // console.log(quantity2, \"quantity2\");\n return quantity2;\n }\n}", "function store(name, val) {\r\n if (typeof Storage !== \"undefined\") {\r\n localStorage.setItem(name, val);\r\n } else {\r\n window.alert(\r\n \"Please use a modern browser to properly view this template!\"\r\n );\r\n }\r\n }", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n window.alert('Please use a modern browser to properly view this template!')\n }\n }", "function showResult(){\n var scoreBoard = document.getElementById('scoreboard');\n var quizName = localStorage.getItem('resultQuizName');\n var quizTitle = document.getElementById('quiz-title');\n quizTitle.innerText = quizName;\n // if(JSON.parse(localStorage.getItem('questions')).length <= 0){\n // var score = localStorage.getItem('score');\n // scoreBoard.innerText = `Your score: ${score}`;\n // }else{\n // scoreBoard.innerText = 'Quiz is not completed yet';\n // }\n if(localStorage.getItem('score')){\n var score = localStorage.getItem('score');\n scoreBoard.innerText = `Your score: ${score}`;\n }else{\n scoreBoard.innerText = 'Quiz is not completed yet'; \n }\n}", "function renderLastRegistered() {\n var savedInitials = localStorage.getItem(\"initials\");\n userInitials.textContent = savedInitials;\n\n var savedScore = localStorage.getItem(\"score\");\n userScore.textContent = savedScore;\n}", "function storeItem() {\n\n localStorage.setItem(initialsInput.value, finalScore);\n\n}", "function getStored() {\n var citySaved = window.localStorage;\n console.log(citySaved.length)\n for (i=0; i < citySaved.length; i+=1) {\n $(travelOptions[i]).html(window.localStorage.key(i));\n $(travelOptions[i]).css(\"display\", \"block\");\n };\n}", "function data(origin){\n switch (origin) {\n case 0://// saving \"key\" and it \"value\" in localStorage\n var input = document.getElementById(\"textMe\");\n localStorage.setItem(\"text\", input.value);\n var storedValue = localStorage.getItem(\"text\");\n document.getElementById('outputMe').innerHTML = storedValue = \"NOW YOU'R SAVED\";\n break;\n\n\n case 1:/// clears typing area, but keeps data in localStorage\n input = document.getElementById(\"textMe\");\n input.value = \"\";\n document.getElementById('outputMe').innerHTML = \"CAN TYPE AGAIN\";\n break;\n\n\n case 2:/// gets data from localStorage and displays at typing area\n var lastText = localStorage.getItem(\"text\");\n console.log(\"last text =\" + lastText);\n document.getElementById('textMe').value = lastText;\n document.getElementById('outputMe').innerHTML = \"LOOK I REMEMBER YOU\";\n break;\n\n\n case 3:/// clears all data from localStorage\n input = document.getElementById(\"textMe\");\n input.value = \"\";\n localStorage.clear();\n document.getElementById('outputMe').innerHTML = \"NOW IT IS EMTY\";\n break;\n\n default:\n\n break;\n }\n\n }", "function subValue()\r\n{\r\nvar sub=localStorage.getItem(\"M+ Values\");\r\nvar b=parseInt(document.getElementById(\"calc\").value);\r\nsub=sub-b;\r\nlocalStorage.setItem(\"M+ Values\",sub); \r\n//console.log(\"sub \",sub); \r\n}", "function savedData() {\n var i1 = localStorage.getItem('inputText1');\n inOutText1.text(i1);\n var i2 = localStorage.getItem('inputText2');\n inOutText2.text(i2);\n var i3 = localStorage.getItem('inputText3');\n inOutText3.text(i3);\n var i4 = localStorage.getItem('inputText4');\n inOutText4.text(i4);\n var i5 = localStorage.getItem('inputText5');\n inOutText5.text(i5);\n var i6 = localStorage.getItem('inputText6');\n inOutText6.text(i6);\n var i7 = localStorage.getItem('inputText7');\n inOutText7.text(i7);\n var i8 = localStorage.getItem('inputText8');\n inOutText8.text(i8);\n var i9 = localStorage.getItem('inputText9');\n inOutText9.text(i9);\n $('#clear').on(\"click\", function () {\n localStorage.clear();\n });\n\n }", "function updateOutput9() {\n localStorage.setItem('info9', input_textarea9.value)\n}", "function localStorageEntry() {\n localStorage.setItem(\"eventOne\", timeBlock1.text());\n localStorage.setItem(\"eventTwo\", timeBlock2.text());\n localStorage.setItem(\"eventThree\", timeBlock3.text());\n localStorage.setItem(\"eventFour\", timeBlock4.text());\n localStorage.setItem(\"eventFive\", timeBlock5.text());\n localStorage.setItem(\"eventSix\", timeBlock6.text());\n localStorage.setItem(\"eventSeven\", timeBlock7.text());\n localStorage.setItem(\"eventEight\", timeBlock8.text());\n localStorage.setItem(\"eventNine\", timeBlock9.text());\n localStorage.setItem(\"eventTen\", timeBlock10.text());\n localStorage.setItem(\"eventEleven\", timeBlock11.text());\n}", "function showprice() {\n document.getElementById('harga1').innerHTML = parseInt(localStorage.getItem('harga1')) + parseInt(localStorage.getItem('komisi1'));\n document.getElementById('harga2').innerHTML = parseInt(localStorage.getItem('harga2')) + parseInt(localStorage.getItem('komisi1'));\n}", "function store(name, val) {\n\tif (typeof (Storage) !== \"undefined\") {\n\t\tlocalStorage.setItem(name, val);\n\t} else {\n\t\twindow.alert('Please use a modern browser to properly view this template!');\n\t}\n}", "function addValue(){\r\n var sum = parseInt( localStorage.getItem(\"M+ Values\"));\r\n var a = parseInt(document.getElementById(\"calc\").value); \r\n sum = sum + a;\r\n localStorage.setItem(\"M+ Values\",sum);\r\n // console.log(\"sum : \" + sum);\r\n}", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n console.warn('LocalStorage not available for your browser. Layout customization will not work.')\n }\n }", "function displayScores(){\n\n \n var arr2 = JSON.parse(localStorage.getItem('playerScore'));\n \n if(arr2.length>5){\n for(var i =0; i<3;i++){\n scoreReport=scoreReport + (\"\\n\" + arr2[i].name + \"\\t\" + arr2[i].high);\n };\n }\n else{\n scoreReport=JSON.stringify(arr2);\n } \n \n //document.getElementById(\"highScoreList\").textContent(scoreReport);\n\n document.getElementById(\"highScoreList\").innerText =scoreReport;\n\n //this works too-->document.getElementById(\"highScoreList\").innerText = localStorage.getItem('playerScore');\n \n var restart = document.createElement(\"BUTTON\");\n restart.innerText=\"RESTART\";\n document.getElementById(\"main\").appendChild(restart);\n\n restart.addEventListener(\"click\", function() {\n location.reload();\n });\n \n\n\n}", "function educationData() {\r\n var select = document.getElementById(\"education\");\r\n localStorage.setItem(\"save\", select.value);\r\n \r\n console.log(select.value)\r\n \r\n }", "function Load(){\n monstercount=localStorage.getItem(\"monsterrawrs\");\n monstercount=parseInt(monstercount);\n document.getElementById('text').value=monstercount; \n}", "function updateOutput1() {\n localStorage.setItem('info1', input_textarea1.value)\n}", "function store(name, val) {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(name, val)\n } else {\n console.warn('LocalStorage not available for your browser. Layout customization will not work.')\n }\n}", "function updateOutput4() {\n localStorage.setItem('info4', input_textarea4.value)\n}", "function storeScore() {\n localStorage.setItem(\"highscore\", score);\n\n localStorage.setItem(\"highscoreName\", document.getElementById(\"name\").value);\n\n getScore();\n}", "function createAccountDiv(){\n \n $(\"#accountDaten\").html(\n \"<h3>Accountdaten</h3>\"+ \n localStorage.getItem('accVorname')+\",\"+localStorage.getItem('accNachname')+\"</br>\"+\n localStorage.getItem('accStraße')+\" \"+\"</br>\"+\n localStorage.getItem('accPlz')+\" \"+localStorage.getItem('accOrt')\n );\n \n}", "function setScore() {\nlocalStorage.setItem(\"highscore\", score);\nlocalStorage.setItem(\"highscoreName\", document.getElementById('name').value);\ngetScore();\n}", "function saveButton(num) { //Passing a number we're going to use to determine the time\n //console.log(this.siblings)\n let timestring = parseTime(num)\n var input = document.getElementById(\"TextField\" + timestring).value;\n localStorage.setItem(timestring, input);\n document.getElementById(\"TextField\" + timestring).value = localStorage.getItem(timestring);\n var testStorage = localStorage.getItem(timestring);\n console.log(\"input: \", input)\n console.log(\"testStorage: \", testStorage)\n\n }", "function storeContent17() {\n var savedContent17 = content17.val(); \n localStorage.setItem(\"5:00pm\", savedContent17);\n}", "function showUrlIfSaved() {\n chrome.storage.sync.get('tpUrl', function(items) {\n if (items.tpUrl) {\n\n // Update URL value\n $('#aad-tp-url').val(items.tpUrl); \n\n // Store\n tpUrl = items.tpUrl;\n }\n });\n }", "function showScore() {\n quizEl.style.display = \"none\";\n questionStat.style.display = \"none\";\n userStats.style.display = \"block\";\n tryAgainEl.style.display = \"block\";\n userStats.innerHTML = \"\";\n var h2 = document.createElement(h2);\n h2.textContent = \"You Scored \" + correctAnswer + \" out of \" + questionLength;\n userStats.appendChild(h2);\n\n // CONSOLE LOG USER SCORE AND TRY TO STORE THEM IN LOCAL STORAGE (Still an issue but it logs something, just not what I want)\n console.log(h2.textContent);\n document.querySelector(\"h2\", userStats);\n localStorage.setItem(\"h2\", userStats);\n localStorage.getItem(\"h2\", userStats);\n \n // COMMENTED OUT BECAUSE THESE ARE NOT CORRECT\n // localStorage.setItem(\"highScore\", \"userStats\");\n // document.getElementById(\"highScore\").innerHTML = localStorage.getItem(\"userStats\");\n}", "function valueToLStorage(pobj){ //pobj debe ser un elemento o id de elemento válido\n\tif (typeof(Storage)!== 'undefined'){\n\t\tvar aux=selectObjId(pobj);\n\t\tif ((aux!==null) && (aux.value!==undefined)){\n\t\t\tlocalStorage.setItem(aux.id, aux.value);\n\t\t}\n\t\telse {\n\t\t\tconsole.log('ERROR: Objeto o propiedad value inexistente');\n\t\t}\n\t}\telse {\n\t\talert('Su navegador no soporta HTML5 API Storage');}\n}", "function updateOutput3() {\n localStorage.setItem('info3', input_textarea3.value)\n}", "setFurnitureValue() {\n if(this.state.value!== null) {\n localStorage.setItem('furniture_value', JSON.stringify(this.state.value));\n } \n if(this.state.value===0) {\n localStorage.setItem('furniture_image', JSON.stringify(\"I'm designing the whole room\"));\n } else if (this.state.value===1) {\n localStorage.setItem('furniture_image', JSON.stringify(\"I'm designing around a few pieces I already own\"))\n } else {\n localStorage.setItem('furniture_image', JSON.stringify(\"I want to put the finishing touches on my room\"))\n }\n }", "function updateUI(){\n\tfor(var i in list_keys){\n\t\tvar key = list_keys[i];\n\t\tvar link = localStorage.getItem(key);\n\t\tif(typeof link == \"string\"){\n\t\t\tdocument.getElementById(key).value = link;\n\t\t}\n\t\telse{\n\t\t\tdocument.getElementById(key).value = \"\";\n\t\t}\n\t}\n}", "function storeInLocalStorage(key, value) {\n localStorage.setItem(key, value);\n}", "function displayTime() {\n display = document.querySelector('#time');\n localStorage.setItem(\"display\", display);\n\n var myMinutes = localStorage.getItem(\"myMinutes\");\n var mySeconds = localStorage.getItem(\"mySeconds\");\n var duration = (60 * Number(myMinutes)) + Number(mySeconds);\n\n localStorage.setItem(\"duration\", duration);\n\n var timer = duration,\n minutes, seconds;\n\n minutes = parseInt(timer / 60, 10)\n seconds = parseInt(timer % 60, 10);\n\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n\n display.textContent = minutes + \":\" + seconds;\n startTimer(duration, display);\n}", "function saveData(key, value) {\n var localstorage = JSON.parse(localStorage.getItem(key));\n localStorage.setItem(key, JSON.stringify(value));\n\n /// Clear value\n $('#input').val(\"\");\n\n /// Stop interval\n clearInterval(inputInterval);\n\n /// Some info\n changeInput(\"Successfully saved \" + key + \" on the internal storage, refresing in 3 seconds!\", \"rgba(0,255,0,0.5)\");\n\n /// Refresh\n setTimeout(() => {\n window.location.reload(false);\n }, 3000);\n}", "function storageDirection(direccion)\n{\n localStorage.setItem('direccion',direccion);\n var direccion=localStorage.getItem('direccion');\n $('#direccion').text(direccion);\n}", "function current_user_name() {\n document.getElementById(\"current_user_name\").innerHTML = \"Current User: \" + localStorage.getItem(\"currentUser\");\n document.getElementById(\"footer_paragraph\").innerHTML = \"\";\n \n}", "function GetDataFromLocalStorage(){\n /*if (storageObject.getItem(\"username\") != null) {\n $(\".usernameval\").val(storageObject.username);\n }\n if (storageObject.getItem(\"password\") != null) {\n $(\".passwordval\").val(storageObject.password);\n }*/\n}", "function save() {\n if (document.getElementById('workSettings').value < 1) {\n alert(usePositiveNumberText[localStorage.getItem('language')]);\n return;\n } else if (document.getElementById('shortBreakSettings').value < 1) {\n alert(usePositiveNumberText[localStorage.getItem('language')]);\n return;\n } else if (document.getElementById('longBreakSettings').value < 1) {\n alert(usePositiveNumberText[localStorage.getItem('language')]);\n return;\n }\n\n valueWork = document.getElementById('workSettings').value;\n valueShort = document.getElementById('shortBreakSettings').value;\n valueLong = document.getElementById('longBreakSettings').value;\n valueSound = document.getElementById('volume-slider').value;\n document.getElementById('clock').innerHTML = `${valueWork}:00`;\n\n localStorage.setItem('workSettings', `${valueWork}`);\n localStorage.setItem('shortBreakSettings', `${valueShort}`);\n localStorage.setItem('longBreakSettings', `${valueLong}`);\n localStorage.setItem('volume-slider', `${valueSound}`);\n}", "function showResults() {\n document.getElementById('performance').innerHTML = \"With \" + localStorage['moves'] +\n \" moves and \" + localStorage['stars'] + \" stars. Time: \" + localStorage['time'];\n}", "function loadValue()\n{\n document.getElementById('nameInput').value = localStorage.getItem('nameInput');\n document.getElementById('emailInput').value = localStorage.getItem('emailInput');\n document.getElementById('msgInput').value = localStorage.getItem('msgInput');\n if (localStorage.getItem('privacyInput') == \"checked\")\n document.getElementById('privacyInput').checked = true;\n else if (localStorage.getItem('privacyInput') == \"unchecked\") document.getElementById('privacyInput').checked = false;\n}", "function renderMessege() { \n var userInput = localStorage.getItem(\"inputField\")\n userTextInput.textContent = userInput;\n }" ]
[ "0.79007894", "0.7499455", "0.7394474", "0.72622263", "0.7226946", "0.7147585", "0.71225077", "0.7114784", "0.7097173", "0.70767146", "0.7061297", "0.70601517", "0.70083827", "0.69997674", "0.6984179", "0.6961659", "0.6947761", "0.69032186", "0.6901314", "0.6886904", "0.687236", "0.686784", "0.6862603", "0.68613565", "0.6853036", "0.68473977", "0.68416476", "0.68297184", "0.68295765", "0.6825408", "0.6815639", "0.6778949", "0.677834", "0.677764", "0.677457", "0.6773919", "0.6757235", "0.67532986", "0.6742085", "0.67215216", "0.670921", "0.67081684", "0.66871524", "0.66812295", "0.6675897", "0.66547525", "0.66543174", "0.6650421", "0.6649355", "0.66405904", "0.66373134", "0.6635021", "0.6628605", "0.66243184", "0.66243184", "0.66243184", "0.6624303", "0.66194504", "0.661124", "0.66072166", "0.66072166", "0.6602552", "0.659556", "0.6588176", "0.65879476", "0.65843177", "0.65794384", "0.65677625", "0.6552336", "0.6550583", "0.65418524", "0.65406823", "0.65393275", "0.6537536", "0.65342176", "0.65241235", "0.6523964", "0.6522869", "0.6518402", "0.65138584", "0.65124196", "0.65122235", "0.65085894", "0.6507962", "0.6500121", "0.64966977", "0.6489557", "0.64885545", "0.64822036", "0.64745444", "0.6464727", "0.64632595", "0.6460847", "0.6448017", "0.64456683", "0.64451945", "0.64442664", "0.6442961", "0.64384484", "0.6435294", "0.64318633" ]
0.0
-1
check that all members agree that the wallet is fully approved now
function checkAndFinalizeWallet(wallet, onDone) { db.query("SELECT member_ready_date FROM wallets LEFT JOIN extended_pubkeys USING(wallet) WHERE wallets.wallet=?", [wallet], function (rows) { if (rows.length === 0) { // wallet not created yet or already deleted // throw Error("no wallet in checkAndFinalizeWallet"); console.log("no wallet in checkAndFinalizeWallet"); return onDone ? onDone() : null; } if (rows.some(function (row) { return !row.member_ready_date; })) return onDone ? onDone() : null; db.query("UPDATE wallets SET ready_date=" + db.getNow() + " WHERE wallet=? AND ready_date IS NULL", [wallet], function () { if (onDone) onDone(); eventBus.emit('wallet_completed', wallet); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkReadyForSubmit(){\n if(this.checkAnswersReady() && this.checkAddressReady() && this.checkMembership()){\n return true;\n }\n else{\n return false;\n }\n }", "function performChecks() {\n if (atLeastOneAdmin()) {\n let demoteSelf = false;\n if (document.getElementById(\"membership-\" + currentUserMembershipID + \"-select\").value.toString() ===\n \"Member\") {\n $('#demote-self-modal').modal('show');\n $('#demote-self-modal-button').click(function () {\n demoteSelf = true;\n updateMemberships(demoteSelf);\n })\n } else {\n updateMemberships(demoteSelf);\n }\n } else {\n updateFailure(\"The Group needs at least one Admin.\");\n }\n}", "function checkTotals() {\n\t/* See if a new breeder can be unlocked.\n\t As prices are in acending order, we know we cannot buy any after */\n\twhile (state.nextBreederUnlock < state.breeders.length\n\t\t\t&& state.larvae >= state.breeders[state.nextBreederUnlock].unlock) {\n\t\taddBreeder(state.nextBreederUnlock);\n\t\tstate.nextBreederUnlock++;\n\t}\n\t/* Check which breeders can be bought */\n\tfor (var i = 0; i < state.nextBreederUnlock; i++) {\n\t\tsetBreederLock(i, state.breeders[i].cost <= state.larvae);\n\t}\n\t/* Check if a new upgrade can be unlocked */\n\tfor (var i = state.nextUpgradeUnlock; i < state.upgrades.length; i++) {\n\t\t/* As prices are in acending order, we know we cannot buy any after */\n\t\tif (state.upgrades[i].canUnlock(state)) {\n\t\t\taddPurchaseUpgrade(i);\n\t\t\tstate.nextUpgradeUnlock++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\t/* Check if the currently selected upgrade can be bought */\n\tif (screen1.currentUpgrade >= 0) {\n\t\tsetUpgradeLock(state.upgrades[screen1.currentUpgrade].cost <= state.larvae);\n\t}\n}", "checkPermissionsModify(result, contracts, currentWallet, appName) {\n const { sellNum } = this.props;\n const { nightElf } = this.state;\n const wallet = {\n address: currentWallet.address\n };\n contractChange(nightElf, result, currentWallet, appName).then(result => {\n if (sellNum && !result) {\n nightElf.chain.contractAt(\n contracts.multiToken,\n wallet,\n (err, contract) => {\n if (contract) {\n this.getApprove(contract);\n }\n }\n );\n } else {\n message.info('Contract renewal completed...', 3);\n this.setState({\n sellBtnLoading: false\n });\n }\n });\n }", "_approveLoan(val) {\n return true;\n }", "isValid () {\n return this.validHasGamblingDebt() &&\n this.validGamblingDebt()\n }", "function CheckPaid(){\n if (store.state.generalData){\n // redirect to account page if the user has not paid, and they are not super\n if (store.state.superUser != true && store.state.paidMember == false && store.state.currentPage != 'account'){\n store.commit('updatePage', 'account')\n app.$toast.error(\"Please submit payment.\", {icon: 'warning'});\n return redirect('/account')\n }\n }\n }", "function checkAllBalances() {\n linkgearPOS.checkAllBalances();\n}", "async approveTokensForTransfer() {\n const { setProtocol } = this.state;\n const tokenAddresses = this.state.tokensToApprove;\n\n tokenAddresses.forEach(async function(address) {\n console.log(\"approving..\", address);\n const txhash = await setProtocol.setUnlimitedTransferProxyAllowanceAsync(\n address,\n {\n gas: 300000,\n gasPrice: 6000000000\n }\n );\n console.log(\"mining..\", txhash);\n const mined = await setProtocol.awaitTransactionMinedAsync(txhash);\n if (mined) console.log(\"mined! tx hash:\", txhash);\n });\n }", "function checkWallet(currentBalanceP1,currentBalanceP2,arbPaidFee,arbFeePayorName,person1,person2,arbAccount,feeAccount) {\r\n\r\n var expectedBalance = Number(currentBalanceP1) + Number(currentBalanceP2); \r\n callback = (err, res) => {err ? finalReturn(\"31\") : validateBalance(res)}\r\n eos.getCurrencyBalance(code,accountName,token,callback)\r\n\r\n function validateBalance(res) { \r\n var tokenBalance = [];\r\n if (res) {\r\n var resString = res.toString();\r\n var finalBalance = -1;\r\n\r\n if (resString.length > 3) {\r\n // parse the number from token symbol\r\n tokenBalance = resString.split(\" \"); \r\n }\r\n\r\n // get the final balance\r\n if (tokenBalance.length == 2) {\r\n finalBalance = tokenBalance[0]; \r\n finalBalance = parseFloat(finalBalance);\r\n }\r\n\r\n // check if balance equals expected\r\n if (finalBalance.toFixed(4) == expectedBalance.toFixed(4)) { \r\n // calculate releases\r\n calculateRelease(currentBalanceP1,currentBalanceP2,arbPaidFee,arbFeePayorName,person1,person2,arbAccount,feeAccount);\r\n } else {\r\n // balance error\r\n finalReturn(\"error32\");\r\n }\r\n\r\n } else {\r\n // balance not found\r\n finalReturn(\"error33\");\r\n } \r\n }\r\n}", "function checkMissionApprovalVotes(){\n var mission = clientGame.missions[clientGame.missionNumber]; \n \n if(mission.acceptMissionVotes.length == clientGame.users.length){\n if(mission.acceptVotes > mission.rejectVotes){\n //send results to users\n //socket.emit(\"emitToSpecificUsers\", \"triggerMissionVote\", mission.selectedUsers);\n mission.approved = true;\n socket.emit('syncMasterGamestate', clientGame);\n generateView();\n console.log(\"MISSION ACCEPTED\");\n } else {\n clientGame.numMissionRejects++;\n\n clientGame.leaderIndex++;\n\n if(clientGame.leaderIndex >= clientGame.users.length){\n clientGame.leaderIndex = 0;\n }\n\n mission.leader = clientGame.users[clientGame.leaderIndex];\n mission.acceptVotes = 0;\n mission.rejectVotes = 0;\n mission.selectedUsers = [];\n\n mission.approved = false;\n socket.emit('syncMasterGamestate', clientGame);\n generateView();\n console.log(\"MISSION REJECTED\");\n }\n }\n\n console.log(mission.acceptMissionVotes);\n console.log(\"Accept votes \" + mission.acceptVotes);\n console.log(\"Fail votes \" + mission.rejectVotes);\n}", "function approveCustomer() {\n // loginOwner()\n let tokenID = document.getElementById(\"approveTokenID\").value;\n let senderPrvtKey = document.getElementById(\"approveSenderPrvtKey\").value;\n let spenderAddress = document.getElementById(\"approveSpenderAddress\").value;\n let value = document.getElementById(\"approveValue\").value;\n\n if (tokenID == \"\" || senderPrvtKey == \"\" || spenderAddress == \"\" || value == \"\") {\n alert(\"You did not complete all the fields\");\n return;\n }\n \n approve(web3.eth.getTransactionCount(getAddress(senderPrvtKey)),tokenID, senderPrvtKey, spenderAddress, value, (err, success) => {\n if (err || success == false) {\n alert(\"Faild\");\n return;\n }\n alert(\"Success\");\n });\n}", "function setEligible() {\n var tempaddr;\n\n if(addressChosen) {\n\n var lastchar = document.getElementById('addresses').value.trim().slice(-1);\n var toSplit;\n\n // Make sure the user has not ended the list with ','\n if(lastchar == ',') {\n var len = document.getElementById('addresses').value.length;\n toSplit = document.getElementById('addresses').value.substring(0,len-1);\n\n } else {\n toSplit = document.getElementById('addresses').value;\n }\n\n var split = toSplit.split(\",\");\n\n // TODO: Sanity check the list ... verify they are all valid Ethereum addresses\n var addresses = new Array();\n\n // TODO: Check with Ethereum how many addresses have ALREADY been accepted.\n // It will only hold UP to 40. No point sending 40 if Ethereum already has 25. (We should send 15 in that case).\n var uptolimit;\n\n if(split.length > 40) {\n if(!confirm(\"We can only use the first 40 addresses... Is this ok?\")) {\n return;\n }\n uptolimit = 40;\n } else {\n uptolimit = split.length;\n }\n\n // No point re-submiting an address if it is already eligible\n for(var i=0; i<uptolimit; i++) {\n if(!anonymousvotingAddr.eligible(split[i])) {\n addresses.push(split[i]);\n }\n }\n\n // Do we have any addresses that are not yet eligible?\n if(addresses.length > 0) {\n web3.personal.unlockAccount(addr,password)\n var res = anonymousvotingAddr.setEligible.sendTransaction(addresses, {from:web3.eth.accounts[accountindex], gas: 4200000})\n\n txlist(\"Set Eligible: \" + res);\n\n alert(\"Sent \" + addresses.length + \" addresses to Ethereum whitelist\");\n } else {\n alert(\"All addresses are already eligible!\");\n }\n\n } else {\n alert(\"You need to select the admin address first!\");\n }\n}", "async ensureAllFriends(params) {\n return await asyncForEach(params.friendsToAdd, async (friendId) => {\n const isFriend = await FS.isConfirmedFriend(params.user, friendId);\n if (!isFriend) {\n return Promise.reject(`User ${friendId} is not friends with you!`);\n }\n });\n }", "function hasLoan(){\n return bankLoan !== 0\n}", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n }\n }", "isValid(utxos=this.utxos) {\n // The genesis block is automatically valid.\n if (this.isGenesisBlock()) return true;\n\n // Calculating total inputs.\n let totalIn = COINBASE_AMT_ALLOWED;\n this.transactions.forEach((tx) => {\n tx.inputs.forEach((input, txID) => {\n let txUXTOs = utxos[txID];\n if (txUXTOs[input.outputIndex]) {\n totalIn += txUXTOs[input.outputIndex].amount;\n }\n });\n });\n\n // Calculating total outputs.\n let totalOut = 0;\n this.transactions.forEach((tx) => {\n totalOut += tx.totalOutput();\n });\n\n return totalIn === totalOut;\n }", "validateAwardAccount() {\n let result = false;\n let account = this.awards.accountID;\n let state = this.awards.accountState;\n let accountExist = this.bank.players.some(p => p.id === account);\n\n if (accountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "hasValidTransactions() {\r\n for (const tx of this.transactions) { //iterating over all the transactions over the block\r\n if (!tx.isValid()) { //make sure that every transaction is valid \r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "_checkDone() {\n\n // it's only for SIGHASH_ALL, if implement other - change it!\n if (this._data.claimProofs.length) throw new Error('Tx is already signed, you can\\'t modify it');\n }", "validateTaxPayer() {\n let result = false;\n let taxPayerId = this.taxesView.accountID;\n let state = this.taxesView.accountState;\n let taxPayerExist = this.bank.players.some(p => p.id === taxPayerId);\n\n if (taxPayerExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "async verifyAddressRequest(walletAddress) {\n if (Object.keys(this.validMemPoolEntries) != 0) {\n const validEntry = await this.validMemPoolEntries[walletAddress];\n\n if (validEntry) {\n return true;\n }\n return false;\n }\n }", "async checkFreeAccountRequestsLimit() {\n const from = +this.userTokens.property('сounting_requests_from');\n const counter = +this.userTokens.property('request_counter');\n if (this.now >= (from + 3600000)) { // Обновим метку отсчета (запросов в час)\n await this.extendRequestCounting();\n }\n else if (counter >= config.requests_per_hour_for_free_account) { // Превышено\n this.exceededRequestsLimit();\n return false;\n }\n else { // Накрутить счетчик запросов\n await this.increaseRequestsCount(counter + 1);\n }\n return true;\n }", "function isInFinalState(membershipRequest){\r\n debug(membershipRequest);\r\n\t\tvar returnValue = false;\r\n\t\tif(membershipRequest && ((membershipRequest.status === 'approved') || (membershipRequest.status === 'rejected'))){\r\n\t\t\treturnValue = true;\r\n\t\t}\r\n\t\treturn returnValue;\r\n\t}", "validateSaleBuyAcount() {\n let result = false;\n let acountID = this.saleAndBuy.acountID;\n let state = this.saleAndBuy.acountState;\n\n //Primero verifico que es una cuenta exsitente\n let acountExist = this.bank.players.some(p => p.id === acountID);\n\n if (acountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "approveMember() {\n MemberActions.approveUser(this.props.memberID);\n this.props.unselect();\n }", "function canComplete() {\n return state.accounts.data.email && state.accounts.data.personId;\n }", "checkWithdrawal(amount){\n if ((this.balance - amount) >= 0) {\n return true;\n }else {\n return false;\n }\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 }", "get meetsRequirements() {\n let reqs = this.getTotalRequirements()\n let rews = this.getTotalRewards()\n\n for (let x in reqs) {\n if (rews[x] < reqs[x])\n return false\n }\n\n return true\n }", "async function checkMinDeposit() {\n try {\n const tokenBal = await getTokenBalan(metaMaskState.selectedAddress);\n console.log('tokenBal', tokenBal);\n if (tokenBal < inputs.initialDeposit) {\n throw new Error('Kindly fund your account');\n }\n return true;\n } catch (error) {\n console.log('error', error);\n toast.error(`😠 ${error} `, {\n position: \"bottom-right\",\n autoClose: 2000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n progress: 1,\n });\n }\n }", "checkBalance() {\n return this.balance >= 1;\n }", "function increaseCustomerApproval() {\n // loginOwner()\n let tokenID = document.getElementById(\"increaseApprovalTokenID\").value;\n let senderPrvtKey = document.getElementById(\"increaseApprovalSenderPrvtKey\").value;\n let spenderAddress = document.getElementById(\"increaseApprovalSpenderAddress\").value;\n let addedValue = document.getElementById(\"increaseApprovalValue\").value;\n\n if (tokenID == \"\" || senderPrvtKey == \"\" || spenderAddress == \"\" || addedValue == \"\") {\n alert(\"You did not complete all the fields\");\n return;\n }\n\n increaseApproval(web3.eth.getTransactionCount(getAddress(senderPrvtKey)),tokenID, senderPrvtKey, spenderAddress, addedValue, (err, success) => {\n if (err || success == false) {\n alert(\"Faild\");\n return;\n }\n alert(\"Success\");\n });\n}", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n return true\n } else {\n return false\n }\n }", "function checkloanin() {\n\tvar sos = document.getElementById('sourceCombo').value\n\n\tvar invoiceAmount = document.getElementById('invoiceAmount').value.trim()\n\tvar grnValue = document.getElementById('grnValue').value.trim()\n\n\tif (sos == \"l\" | sos == \"x\") {\n\t\tif (invoiceAmount != grnValue) {\n\t\t\tif (confirm(\"Invoice Amount and GRN Valued Is not Equal.Enter Correct Invoice Amount.\"))\n\t\t\t\treturn false;\n\t\t\t// return true;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}\n\treturn true;\n}", "checkUser() {\n let doesExit = false\n this.state.admin.forEach(x => {\n if(x.email === this.state.email) {\n doesExit = true;\n }\n });\n return doesExit;\n }", "function giveAllowance(owner, spender, amount) {\n return new Promise(async (resolve, reject) => {\n let fromAccount = web3APIs.isContract(owner)?karmaMainAccount:owner\n try {\n if(web3APIs.isContract(owner)) {\n if (owner === escrowInstance.address) {\n await unlockAccount(karmaMainAccount, 'password', 30)\n await unlockAccount(fromAccount)\n await isMined.checkMining(await escrowInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(fromAccount)\n await lockAccount(karmaMainAccount)\n } else {\n await unlockAccount(karmaMainAccount, 'password', 30)\n await unlockAccount(fromAccount)\n //Get borrower instance as per params.debtor and not the predefined borrowerInstance\n let borrowerInstance = getBorrowerInstance(owner)\n await isMined.checkMining(await borrowerInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(fromAccount)\n await lockAccount(karmaMainAccount)\n }\n } else {\n if (fromAccount !== karmaMainAccount) {\n await unlockAccount(karmaMainAccount, 'password', 30)\n await unlockAccount(fromAccount)\n await isMined.checkMining(await erc20TokenInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(fromAccount)\n await lockAccount(karmaMainAccount)\n } else {\n console.log('fromAccount and karmaMainAccount both are the same: ')\n await unlockAccount(karmaMainAccount, 'password', 30)\n await isMined.checkMining(await erc20TokenInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(karmaMainAccount)\n }\n }\n resolve('Allowance granted')\n } catch(error) {\n console.log('error in giveAllowance baseLogic: ', error)\n reject(error.message)\n }\n })\n}", "async function checkState(_tokens, _stateChanges, _accounts) {\n let numTokens = _tokens.length\n assert.equal(numTokens, _stateChanges.length)\n for (let i = 0; i < numTokens; i++) {\n let token = _tokens[i]\n let stateChanges = _stateChanges[i]\n let name = await token.contractName.call()\n let _expectedState = await expectedState(token, stateChanges, _accounts, name)\n let _actualState = await actualState(token, _expectedState, _accounts, name)\n assertDiff.deepEqual(_actualState, _expectedState,\n \"difference between expected and actual state\")\n if (name != 'BearCrowdsale') {\n await checkBalancesSumToTotalSupply(token, _accounts, name)\n }\n }\n}", "readyCheck(vcList) {\n const botUsers = vcList.filter(vcUser => vcUser.user.bot === true); \n const isEveryoneReady = (vcList.size <= this.readyCollection.size + this.skipCollection.size + botUsers.size);\n return isEveryoneReady;\n }", "#approveLoan(val) {\n return true;\n }", "function verify() {\r\n\tif(nameCheck())\r\n\t{\r\n\t\tconsole.log(\"Name Check Verified!\");\r\n\t\tif(emailCheck())\r\n\t\t{\r\n\t\t\tconsole.log(\"Email Check Verified!\");\r\n\t\t\tif(radioCheck())\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"Radio Check Verified!\");\r\n\t\t\t\tconsole.log(\"All Data Verified Successfully!\");\r\n\t\t\t\talert(\"Data Verified and Submitted!\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"Please Re-enter proper data again!\");\r\n\treturn false;\r\n}", "function verifyOwnCourse() {\n UserCoursesService.listUserCourses($scope.user.id).then(function (data) {\n userCoursesTable = data;\n $scope.ownCourse = false;\n for (var i = 0; i < userCoursesTable.length; i++) {\n userCourseIds[i] = userCoursesTable[i].id_curso;\n if ($stateParams.courseId == userCourseIds[i]) {\n // If the user is registered in the selected course, $scope.ownCourse\n // is set to true. We use this in the view for validate if the button\n // for registration to the course appers or the button for the view of\n // course contents\n $scope.ownCourse = true;\n }\n }\n });\n }", "function checkComplete() {\n if (listQuestion.length === Object.keys(listResult).length) {\n return true\n } else {\n return false\n }\n}", "async function verifyRequirement(verifyingAddress,leafNodes) {\nconst buf2hex = x => '0x'+x.toString('hex')\nconst leaf = keccak256('0x00000a86986129038908a9808098-toto-18-99123456-France')\n\nconst leafInfo = buf2hex(leaf);\n\nconst hexproof = tree.getProof(leaf).map(x => buf2hex(x.data));\n\nconst positions = tree.getProof(leaf).map(x => x.position === 'right' ? 1 : 0)\n\n\n\n//TODO: fetch the \nconst SBTCertification = await web3.eth.Contract();\n\nconst verifiedOnchain = await SBTCertification.ifVerified(verifyingAddress, leafNodes);\n\nassert.equal(MerkleTree.verify(proof,leaf,root), verifiedOnchain);\n\n}", "function checkAttend(client) {\n if (client.mesa) return true\n return false\n }", "control(user) {\n return this.tx.every((tx) => {\n if (! user.isInvolvedIn(tx)) {\n return true;\n }\n return user.transactions().includes(tx);\n });\n }", "checkForAllComplete() {\n if (this.state.personCount === this.state.meals.length && (this.state.personCount !== 0 && this.state.meals.length !== 0)) {\n return (\n <button className=\"button\" onClick={() => this.toggleModal(true)}>Confirm Reservation</button>\n );\n }\n }", "function renew_amc_submit_check()\n{\n reset_fields();\n var checking_status = true;\n renew_date_check($(\"customer_contract_date\")) ? \"\" : checking_status = false;\n check_name(\"customer_name\") ? \"\" : checking_status = false;\n check_address() ? \"\" : checking_status = false;\n (!contact_numbers(\"customer_mobile_number\") || !contact_numbers(\"customer_phone_number\")) ? checking_status = false : \"\";\n check_paid_amount(\"customer_contract_amount\") ? \"\" : checking_status = false;\n check_name(\"customer_model_name\") ? \"\" : checking_status = false;\n checking_status ? \"\" : error_message();\n return checking_status;\n}", "function membersHaveChanged(org, members) {\n return org.members.length !== members.length;\n}", "hasValidTransaction(){\n for(const tx of this.transactions){\n if(!tx.isValid()){\n return false;\n }\n }\n\n return true;\n }", "function checkBalance(amt){\nif (account_blacalce - amt >= 0 ) {\n return true;\n}else {\n console.log('INSUFICIENT FUNDS')\n return false;\n }\n}", "function isEligible(no_of_miles_away, is_a_member) {\n if(typeof no_of_miles_away !== \"number\") {\n throw new Error(\"Please provide a number for customer's location in miles away\");\n }\n \n let eligibility = false;\n if(no_of_miles_away > 1 && no_of_miles_away <= 5) {\n eligibility = true;\n } else if(no_of_miles_away <= 10 && is_a_member) {\n eligibility = true\n }\n console.log(eligibility \n ? \"Congratulations! You qualify for free delivery\"\n : \"Sorry, free delievery is not availbale in your location!\");\n return eligibility;\n}", "validateLootAccount() {\n let result = false;\n let account = this.lootView.accountID;\n let state = this.lootView.accountState;\n let accountExist = this.bank.players.some(p => p.id === account);\n\n if (accountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "function verifyForm()\n{\n valid = true;\n validFields.forEach(function(element) { valid &= element });\n changeFormState(valid);\n}", "approve(result) { }", "shouldQuarantine() {\n const healthy = this.passengers.some(traveler => traveler.isHealthy === false)\n return healthy\n }", "hasValidTransactions() {\n for (const tx of this.transactions) {\n if (!tx.isValid()) {\n return false;\n }\n }\n\n return true;\n }", "validGamblingDebt () {\n if (this.validHasGamblingDebt() && this.hasGamblingDebt === 'No') {\n return true\n }\n\n if (!this.list || !this.list.length) {\n return false\n }\n\n if (this.listBranch !== 'No') {\n return false\n }\n\n for (const item of this.list) {\n if (!item.Losses || parseInt(item.Losses.value) < 1) {\n return false\n }\n\n if (!item.Description || !item.Description.value) {\n return false\n }\n\n if (!item.Actions || !item.Actions.value) {\n return false\n }\n\n if (!new DateRangeValidator(item.Dates, null).isValid()) {\n return false\n }\n }\n\n return true\n }", "async function approveAndDeposit(\n user,\n values\n ) {\n // aprove an amounts to mvptt\n const total = values.reduce((acc, el) => acc.add(el), new BN('0'))\n\n const approveTx = await signTransaction(\n web3,\n addresses.dollarCoin,\n u.hex2buf(\n dollarCoin.methods\n .approve(u.buf2hex(addresses.mvppt), total.toString())\n .encodeABI()\n ),\n 5000000,\n u.hex2buf(user.account.privateKey)\n )\n await sendSignedTransaction(web3, approveTx)\n\n for (let i = 0; i < values.length; i++) {\n const v = values[i]\n\n const data = await user.k0.prepareDeposit(\n user.platformState,\n user.secretStore.getAddress(),\n v\n )\n\n const waitForDeposit = testUtil.awaitEvent(user.emitter, 'depositProcessed')\n const depositTx = await user.k0Eth.deposit(\n u.hex2buf(user.account.privateKey),\n v,\n data.k,\n data.cm,\n data.ciphertext,\n data.nextRoot,\n data.commitmentProofAffine,\n data.additionProofAffine\n )\n\n await sendSignedTransaction(web3, depositTx)\n\n await waitForDeposit\n }\n }", "function approveWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, arrOtherCosigners, onDone) {\n\tvar arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate);\n\tdevice.addIndirectCorrespondents(arrOtherCosigners, function () {\n\t\taddWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () {\n\t\t\tarrDeviceAddresses.forEach(function (device_address) {\n\t\t\t\tif (device_address !== device.getMyDeviceAddress())\n\t\t\t\t\tsendMyXPubKey(device_address, wallet, xPubKey);\n\t\t\t});\n\t\t\tif (onDone)\n\t\t\t\tonDone();\n\t\t});\n\t});\n}", "async function checkBalances () {\n try {\n const state = tlUtil.readState()\n const effTokenBal = lib.getEffectiveTokenBalance(state.bchBalance)\n const realTokenBal = await slp2.getTokenBalance()\n\n wlogger.info(\n `usdPerBCH: ${state.usdPerBCH}, ` +\n `BCH balance: ${state.bchBalance}, ` +\n `Actual token balance: ${realTokenBal}, ` +\n `Effective token balance: ${effTokenBal}`\n )\n } catch (err) {\n wlogger.error('Error in checkBalances(): ', err)\n }\n}", "function employerCheck(){\n //for studentA\n if(people[4]==people[2])\n\t{\n\t\tif(people[1]!=people[4])\n\t\t{\n\t\t\talert(\"Employer enforce student to work\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t//for studentB\n\tif(people[4]==people[3])\n\t{\n\t\tif(people[1]!=people[4])\n\t\t{\n\t\t\talert(\"Employer enforce student to work\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function decreaseCustomerApproval() {\n // loginOwner()\n let tokenID = document.getElementById(\"decreaseApprovalTokenID\").value;\n let senderPrvtKey = document.getElementById(\"decreaseApprovalSenderPrvtKey\").value;\n let spenderAddress = document.getElementById(\"decreaseApprovalSpenderAddress\").value;\n let subtractedValue = document.getElementById(\"decreaseApprovalValue\").value;\n\n if (tokenID == \"\" || senderPrvtKey == \"\" || spenderAddress == \"\" || subtractedValue == \"\") {\n alert(\"You did not complete all the fields\");\n return;\n }\n\n decreaseApproval(web3.eth.getTransactionCount(getAddress(senderPrvtKey)),tokenID, senderPrvtKey, spenderAddress, subtractedValue, (err, success) => {\n if (err || success == false) {\n alert(\"Faild\");\n return;\n }\n alert(\"Success\");\n });\n}", "static isValid(creep) {\n //Should be in home room\n if (creep.memory.home) {\n if (creep.room.name == creep.memory.home) {\n //Wait until rest of the squad members have spawned\n var squad = this.roleCall(creep);\n if (squad.attacker && squad.healer) {\n if (creep.memory.role == 'RoleRanger') {\n console.log(1);\n creep.memory.attacker = null;\n creep.memory.healer = squad.healer.id;\n }\n else {\n creep.memory.healer = null;\n creep.memory.attacker = squad.attacker.id;\n }\n return false;\n }\n else {\n return true;\n }\n }\n }\n\n return false;\n }", "async function approveThenTransferFunds(from, to, amount) {\n // In the 'from' account, approve 'to' to be able to take funds.\n result.set(await CpuCoin.methods.approve(to, amount).send({from: from}));\n result.checkTransactionOk('approveThenTransferFunds(): approve failed');\n // Transfer approved funds 'from' -> 'to'.\n result.set(await CpuCoin.methods.transferFrom(from, to, amount).send({from: to}));\n result.checkTransactionOk('approveThenTransferFunds(): transferFrom failed');\n }", "shouldQuarantine() {\r\n if (this.passengers.map(passenger => (passenger.isHealthy)).includes(false)) {\r\n return true\r\n } else {\r\n return false\r\n }\r\n\r\n }", "function finishRegistration() {\n if(!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n if(state != 1) {\n alert(\"Please wait until Registration Phase\");\n return;\n }\n\n if(anonymousvotingAddr.totalregistered() < 3) {\n alert(\"Election cannot begin until there is 3 or more registered voters\");\n return;\n }\n\n var time = new Date();\n var finishReg = anonymousvotingAddr.finishSignupPhase() * 1000;\n \n var reg = anonymousvotingAddr.totalregistered();\n var eligible = anonymousvotingAddr.totaleligible();\n \n if(time.getTime() < finishReg && !reg.equals(eligible)) {\n alert(\"Please wait until \" + clockformat(new Date(finishReg)) + \" before finishing registration or that all eligible voters have vote.\");\n return;\n }\n \n\n web3.personal.unlockAccount(addr,password);\n\n res = anonymousvotingAddr.finishRegistrationPhase.sendTransaction({from:web3.eth.accounts[accountindex], gas: 4200000});\n document.getElementById(\"finishRegistration\").innerHTML = \"Waiting for Ethereum to confirm that Registration has finished\";\n\n txlist(\"Finish Registration Phase: \" + res);\n}", "function checkRequiredUsers(member, command) {\n return command.requiredUsers.includes(member.id);\n}", "isPurchaseStatusOk() {\n const purchaseStatus = this.getPurchaseStatus();\n return purchaseStatus === PURCHASE_STATUS.OK;\n }", "function verificationCheck(data) {\n\n if(data.token == \"89IiMTHtU8N9WrJn4aE9MZCp\" && data.team_id == \"T2XBT4Q6Q\"){\n return true;\n }\n\n return false;\n}", "containsAllDevelopers(allDeveloperIds) {\n //whether the passed in dev ids match the member ids perfectly\n let retVal = false;\n\n //if there are exactly the same number of developer ids in the \n //parameter that are in the members collection, otherwise they \n //can be exactly equal\n if(allDeveloperIds.length === this.memberIds.length) {\n //find the dev ids who are in the member ids \n const presentDevIds = allDeveloperIds.filter(candidateDevId => {\n return this.memberIds.includes(candidateDevId);\n });\n //if the number present is the same as the number of members\n retVal = presentDevIds.length === allDeveloperIds.length;\n }\n\n return retVal;\n }", "async isAllowance(account, amountBN = this.getAmountDecimals(1)) {\n //validate not crbtc\n if (this.isCRBTC) return true\n // check allowance\n const allowance = await this.token.instance.allowance(account, this.instanceAddress)\n // validate if enough\n return !allowance.lt(amountBN)\n }", "async CheckNewLobeOwner(ctx) {\n let members = await ctx.stub.getState('members');\n members = JSON.parse(members);\n console.log('*********1' + members[0].Domain);\n for (const member of members) {\n console.log('*********2' + member.Domain.toString());\n let domain = await ctx.stub.getState(member.Domain);\n domain = JSON.parse(domain);\n console.log('*********3' + domain.LobeOwner);\n if (member.Tokens > domain.Tokens) {\n let oldLO = await ctx.stub.getState(domain.LobeOwner);\n oldLO = JSON.parse(oldLO);\n oldLO.Role = 'Expert';\n await ctx.stub.putState(oldLO.ID, Buffer.from(JSON.stringify(oldLO)));\n console.log('*********4' + oldLO.ID);\n domain.LobeOwner = member.ID;\n domain.Tokens = member.Tokens;\n await ctx.stub.putState(member.Domain, Buffer.from(JSON.stringify(domain)));\n let newMember = await ctx.stub.getState(member.ID);\n newMember.Role = 'Lobe_Owner';\n await ctx.stub.putState((member.ID).toString(), Buffer.from(JSON.stringify(newMember)));\n }\n }\n return ('accomplish checking new Lobe Owner');\n }", "function applyLoan() {\n\n // Check Whether User Has Loan\n if (hasActiveLoan === false) {\n\n // How Much Loan Do User Want\n const amountUserWant = prompt(\"What is your name?\");\n console.log(amountUserWant)\n\n // Reject if Asked Amount is more then Double Current Bank Account Balance with Prompt\n if (amountUserWant > currentBalance.innerText * 2) {\n alert(\"Asked Amout Is More Than Current Balance Times 2\")\n } else { \n \n // Grant Loan and Make Owned Amount and RePay button Visable to User\n loanAmount.innerText = amountUserWant;\n loanDownPayment.style.display = 'flex';\n downPaymentButton.style.display = 'unset';\n currentBalance.innerText = Number(currentBalance.innerText) + Number(amountUserWant);\n hasActiveLoan = true;\n }\n } else {\n alert(\"You can not have more than one active loans!\")\n }\n}", "function runOnComplete() {\n\t\tif (valid == 0) {\n\t\t\t/*\n\t\t\t * checks for privacy-policy\n\t\t\t */\n\t\t\tif ($(\"#privacy-policy\").prop('checked') != true) {\n\t\t\t\t$(\"#privacyValidation\").text(\n\t\t\t\t\t\t\"you must accept the privacy policy to continue\");\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$(\"#privacyValidation\").text(\"\");\n\t\t\t\t$(\".step\").hide(\"fast\");\n\t\t\t\t$(\"#soicalMediaAccountsForm\").show(\"slow\");\n\t\t\t}\n\t\t}\n\t}", "function checkAchievements(vals) {\n for (let k in vals.challenges) {\n switch (vals.challenges[k].required_type) {\n\n case \"click_m\":\n for (let i in vals.challenges[k]) {\n if (vals.challenges[k][i] != vals.challenges[k].required_type) {\n var has_unlocked = false;\n if( vals.challenges[k][i].type === \"total\") {if( vals.stats.miracle_click_energy >= vals.challenges[k][i].val_req ) has_unlocked = true; }\n else {if( vals.stats.miracle_clicks >= vals.challenges[k][i].click_req) has_unlocked = true; }\n //we don't want achievment messages to show unless the user actually unlocks them => not on startup every time.\n if (has_unlocked) {\n if (!vals.challenges[k][i].unlocked && ($('#save_title').text() != \"Nothing saved yet.\" || last_saved > 2))\n $.toaster( {message: vals.challenges[k][i].label, title:\"Achievement Unlocked\" } );\n vals.challenges[k][i].unlocked = true;\n }\n fix_names(vals);\n }\n }\n break;\n case \"click_a\":\n for (let i in vals.challenges[k]) {\n if( vals.challenges[k][i] != vals.challenges[k].required_type) {\n var has_unlocked = false;\n if( vals.challenges[k][i].type === \"total\") {if( vals.stats.ascension_click_energy >= vals.challenges[k][i].val_req ) has_unlocked = true; }\n else {if( vals.stats.ascension_clicks >= vals.challenges[k][i].click_req) has_unlocked = true; }\n \n if(has_unlocked) {\n if( !vals.challenges[k][i].unlocked && ($('#save_title').text() != \"Nothing saved yet.\" || last_saved >= 1) )\n $.toaster( {message: vals.challenges[k][i].label, title:\"Achievement Unlocked\" } );\n vals.challenges[k][i].unlocked = true;\n }\n fix_names(vals);\n }\n }\n break;\n case \"conv\":\n for (let i in vals.challenges[k]) {\n if( vals.challenges[k][i] != vals.challenges[k].required_type) {\n if( vals.miracle['purchase' + vals.challenges[k][i].req_tier].amount >= vals.challenges[k][i].req_num ) {\n if( !vals.challenges[k][i].unlocked && ($('#save_title').text() != \"Nothing saved yet.\" || last_saved >= 1) )\n $.toaster( {message: vals.challenges[k][i].label, title:\"Achievement Unlocked\" } );\n vals.challenges[k][i].unlocked = true;\n fix_names(vals);\n }\n }\n }\n break;\n case \"asc\":\n for (let i in vals.challenges[k]) {\n if( vals.challenges[k][i] != vals.challenges[k].required_type) {\n if( vals.ascend['ascend' + vals.challenges[k][i].req_tier].amount >= vals.challenges[k][i].req_num ) {\n if( !vals.challenges[k][i].unlocked && ($('#save_title').text() != \"Nothing saved yet.\" || last_saved >= 1) )\n $.toaster( {message: vals.challenges[k][i].label, title:\"Achievement Unlocked\" } );\n vals.challenges[k][i].unlocked = true;\n fix_names(vals);\n }\n }\n }\n break;\n case \"sac\":\n for (let i in vals.challenges[k]) {\n if( vals.challenges[k][i] != vals.challenges[k].required_type) {\n if( vals.corruption >= vals.challenges[k][i].req_corrupt ) {\n if( !vals.challenges[k][i].unlocked && ($('#save_title').text() != \"Nothing saved yet.\" || last_saved >= 1) )\n $.toaster( {message: vals.challenges[k][i].label, title:\"Achievement Unlocked\" } );\n vals.challenges[k][i].unlocked = true;\n fix_names(vals);\n }\n }\n }\n break;\n case \"panth\":\n for (let i in vals.challenges[k]) {\n if( vals.challenges[k][i] != vals.challenges[k].required_type) {\n if( vals.pantheon.stage == vals.challenges[k][i].req_stage && vals.pantheon.unlocked ) {\n if( !vals.challenges[k][i].unlocked && ($('#save_title').text() != \"Nothing saved yet.\" || last_saved >= 1)) {\n $.toaster( {message: vals.challenges[k][i].label, title:\"Achievement Unlocked\" } );\n if( i === '1') {\n vals.pantheon.damage *= (vals.click / parseFloat(vals.start_click)); \n }\n }\n vals.challenges[k][i].unlocked = true;\n fix_names(vals);\n }\n }\n }\n break;\n }\n }\n set_achievement_multiplier(vals);\n}", "function verifyBalance(balance, userId) {\n con.query(\"SELECT balance from account where map_id=?\", [userId], function (err, result, fields) {\n if (err) throw err;\n\n var balance = result[0];\n con.query(\"SELECT * from permissions where map_id=?\", [userId], function (err, result, fields) {\n if (err) throw err;\n if (balance < result[0].lower_limit || balance > result[0].upper_limit) {\n return res.status(500).send(makeResObj(\"Current balance is not valid\"));\n }\n });\n });\n}", "checkNewCritterTargets (donations) { //confusing b/c critter.donations and donation message are objects with \"target\" \"amount\" \"total\"\n let targetA = donations[0].target;\n let targetB = donations[1].target;\n let newOrgA = true;\n let newOrgB = true;\n for (let org of this.donations) {\n if (org[\"target\"] == targetA) {\n newOrgA = false;\n }\n if (org[\"target\"] == targetB) {\n newOrgB = false;\n }\n }\n //new donation target\n if (newOrgA) {\n this.donations.push({\n target: targetA,\n funds: 0,\n link: null\n }) \n }\n if (newOrgB) {\n this.donations.push({\n target: targetB,\n funds: 0,\n link: null\n }) \n } \n if (newOrgA || newOrgB) {\n this.sortTargets();\n return true; //so ecosystem can emit fundsUpdate\n } else {\n return false;\n }\n }", "function checkIfCanUpgrade(upgrade, bypassMoney = false){\n var check = 0;\n for (i in upgrades[upgrade]['cost']){\n if (upgrades[upgrade]['cost'][i] <= currency[i]['amount']){\n check++;\n }\n }\n if ((check == Object.keys(upgrades[upgrade]['cost']).length || bypassMoney == true) && ((upgrades[upgrade]['onetime'] == 0 && upgrades[upgrade]['amount'] == 0) || upgrades[upgrade]['onetime'] == 1)){\n var neededUpgrades = 0;\n for (i = 0; i < upgrades[upgrade]['prerequisites'].length; i++){\n if (upgradesHave.indexOf(upgrades[upgrade]['prerequisites'][i]) > -1){\n neededUpgrades++;\n }\n }\n if (neededUpgrades >= upgrades[upgrade]['prerequisites'].length){\n return true;\n }\n }\n else {\n return false;\n }\n}", "static async checkIsRegistered (selectedAddress) {\n if (registrations === undefined) {\n return\n }\n\n for (const x of registrations) {\n const { txid } = x\n const account = await this.getPendingIdentity(txid)\n if (account === undefined) {\n return false\n }\n\n const bchRegistration = account.information.payment[0].address\n if (bchRegistration === selectedAddress) {\n return true\n } else {\n return false\n }\n }\n }", "shouldQuarantine () {\n for (let index = 0; index < this.passengerList.length; index += 1) {\n let passengersHealth = this.passengerList [index];\n if (passengersHealth.isHealthy === false) {\n return true;\n }\n }\n return false;\n }", "function checkVotes(members, groupID, movieSection, movieCenterTitle, resetBtn) {\n groupRef.doc(groupID).get()\n .then(function (doc) {\n if (doc.data().totalVotes >= members) {\n\n getWinningMovie(groupID, movieSection, movieCenterTitle, resetBtn);\n }\n })\n}", "function verifyAccount() {\n\treturn (dispatch) => {\n\t\tdispatch(removeAmountOnAccount(0.30));\n\n // Simulate asynchronous treatment\n\t\tsetTimeout(() => {\n\t\t\tdispatch(addAmountOnAccount(0.30));\n\t\t}, 1000);\n\t}\n}", "function isAllValid(){\n return (\n BILL_REGEX.test(billInput.value) && \n (NUM_REGEX.test(customPercent.value) || \n document.querySelector('input[name=\"tip-amount\"]:checked')) && \n NUM_REGEX.test(numPeople.value)\n )\n}", "async callAndUpdatePlayerBalance() {\n let collectionPath = \"room/\" + this.props.room.id + \"/members\";\n let newBalance = this.props.members.balance - this.props.room.currentBettingAmount;\n if (newBalance <= 0) {\n newBalance = 0\n }\n await this.updatePlayer.updatePlayerBalance(collectionPath, this.props.currentUser.uid, newBalance, this.props.room.currentBettingAmount);\n }", "isApproved() {\n let modulesTypeGAreApproved = true\n\n const moduleTypeG = Object.values(this.modules).filter((module) => module.module_type === 'g')\n\n for (let i = 0; i < moduleTypeG.length; i++) {\n const guidelines = StatisticsHelpers.getGuidelinesArray(\n this.guidelines,\n moduleTypeG[i].guideline_pks\n )\n\n const answersComplete = StatisticsHelpers.generateAnswers(\n this.answers,\n moduleTypeG[i].guideline_pks\n )\n\n const moduleItem = new Module(moduleTypeG[i], guidelines, answersComplete, this.isAudit)\n\n if (!moduleItem.isApproved()) {\n modulesTypeGAreApproved = false\n break\n }\n }\n\n return modulesTypeGAreApproved\n }", "hashValidTransactions(){\n for(const tx of this.transactions){\n if(!tx.isValid()){\n return false;\n }\n }\n return true;\n }", "validateAcknowledger() {\n var acknowledger = this.state.acknowledger;\n if (acknowledger === \"\") {\n return null;\n }\n if (document.getElementById(\"acknowledger\")) {\n if (\n !this.state.users.some(function(user) {\n return user.fullName === acknowledger;\n })\n ) {\n return \"error\";\n }\n }\n return \"success\";\n }", "function checkIfAffordable(card) {\n\n if (card.type === 'expedition') {\n\n // Set up variables\n missingItems = 0;\n let hasAllItems = false;\n let requirements = countOccurrences(card.requirements);\n\n // See if player has enough of each item needed\n for (let property in requirements) {\n\n if (requirements[property] > players[actingPlayer].getCards(property)) {\n hasAllItems = false;\n missingItems += requirements[property] - players[actingPlayer].getCards(property);\n // console.log(`hasAllItems:>> ${hasAllItems} missingItems:>> ${missingItems}`);\n } else {\n hasAllItems = true;\n }\n }\n\n // See if player has enough Jack of all Trades to make up the difference\n if (missingItems <= players[actingPlayer].getCards('Jack of all Trades')) {\n hasAllItems = true;\n }\n\n return (hasAllItems && (missingItems <= players[actingPlayer].getCards('Jack of all Trades')));\n\n }\n\n if (playerMoves == 0) {\n return;\n }\n\n // Taxes cannot be bought\n if (card.type === 'tax') {\n return false;\n }\n\n // Ships are always 'purchaseable'\n if (card.type === 'ship') {\n if (actingPlayer !== turnOf || !isDeckDisabled) {\n return true;\n }\n\n // For all 'person' cards, calculate affordability (incl discounts)\n } else {\n if (card.coins - madamoiselleDiscount(card) + turnFee() <= players[actingPlayer].coins.length) {\n return true;\n }\n return false;\n }\n}", "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "function check_vip_applied() {\n\tvar email = jQuery.trim(jQuery(\"#email\").val());\n\tjQuery.post(\"./sales_rep_order_vip.htm\", \"check_vip_applied=1&email=\"\n\t\t\t+ email, function(data) {\n\t\tif (data.result == \"1\") {\n\t\t\talert(\"该客户正在申请过VIP,请不要重复申请!\");\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t});\n\t\n}", "function validateAvailability() {\n if (!volunteerRegObject.availability.mon && !volunteerRegObject.availability.tue && !volunteerRegObject.availability.wed && !volunteerRegObject.availability.thu && !volunteerRegObject.availability.fri && !volunteerRegObject.availability.sat && !volunteerRegObject.availability.sun) {\n kony.ui.Alert({\n \"alertType\": constants.ALERT_TYPE_ERROR,\n \"alertTitle\": \"Action Required\",\n \"yesLabel\": \"OK\",\n \"message\": \"At least one day of the week must be selected.\",\n \"alertHandler\": null\n }, {\n \"iconPosition\": constants.ALERT_ICON_POSITION_LEFT\n });\n return false;\n }\n return true;\n}", "function checkUsersValid(goodUsers) {\n return function allUsersValid(submittedUsers) {\n return submittedUsers.every(function (checkedId) {\n return goodUsers.some(function (goodUser) {\n return goodUser.id === checkedId.id;\n })\n })\n };\n}", "function checkIsValidForm(data) {\n\t\n\tvar stat = true;\n\t\n\tif(data == undefined)\n\t\tstat = false;\n\n//checks if any data is empty\n\tif(\tdata.name != undefined && \n\t\tdata.game != undefined && \n\t\tdata.requirements != undefined)\n\t{\n\t\tif(data.members.length == 0)\n\t\t\tstat = false;\n\t\t\n\t\tdata.members.forEach( function(element) {\n\t\t\tif(!global.allUsers.some(e => e.id == element)) {\n\t\t\t\tstat = false;\n\t\t\t}\n\t\t});\n\t}\n\treturn stat;\n}", "function checkForPendingConfirmations() {\n if (parent && parent.ApplinksUtils && parent.ApplinksUtils.pendingConfirmations) {\n var myFrame = getCurrentIframe();\n if (myFrame) {\n if (myFrame.id in parent.ApplinksUtils.pendingConfirmations) {\n var pendingConfirmations = parent.ApplinksUtils.pendingConfirmations[myFrame.id];\n delete parent.ApplinksUtils.pendingConfirmations[myFrame.id];\n for (var i = 0, n = pendingConfirmations.length; i < n; i++) {\n showAuthConfirmationBanner(pendingConfirmations[i]);\n }\n }\n }\n }\n }", "isComplete() {\n try {\n if (!validator.isPositiveNumber(this.cap)) {\n return false;\n } else if (!validator.isPositiveNumber(this.tokenPrice)) {\n return false;\n }\n return true;\n } catch (error) {\n return false;\n }\n }", "function acceptLoanRequest(res, req) {\n borrower.acceptRequest(res.query.borrower_uid, res.query.request_uid)\n req.send(JSON.stringify({\n \"status\": \"success\",\n \"error\": null\n }))\n}", "function approveFrom(params) {\n return new Promise((resolve, reject) => {\n var response;\n var fromAddress = params.from;\n var upgrade = params.upgrade;\n var approve = params.approve;\n multichain.approveFrom({\n \"from\": from,\n \"upgrade\": upgrade,\n \"approve\": approve\n },\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n response: res,\n message: \"Blockchain Information\"\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n\n })\n}", "ready(){\n this.crew.forEach(function(member) { \n if((member.job == \"Pilot\" && member.vehicle.type == \"Plane\") ||\n (member.job == \"Captain\" && member.vehicle.type == \"Boat\"))\n {\n console.log(`The ${member.vehicle.type} is ready to depart!`)\n } else {\n return false\n }\n })\n }", "checkValidity() {\n this.validState = this.currentDataState.name && \n +this.currentDataState.amount && +this.currentDataState.maximumRides;\n }" ]
[ "0.6465505", "0.61762244", "0.6079832", "0.60730726", "0.601335", "0.5954323", "0.5920635", "0.5887216", "0.58646625", "0.58586264", "0.5834388", "0.58060724", "0.5749621", "0.5729037", "0.5722815", "0.5711033", "0.5704529", "0.56971294", "0.5690364", "0.5686234", "0.5676086", "0.5654737", "0.5650647", "0.56396544", "0.5627686", "0.5598132", "0.5584557", "0.5577978", "0.55666643", "0.555341", "0.55408424", "0.5534912", "0.5530906", "0.5517745", "0.5516239", "0.55113465", "0.5510531", "0.54974115", "0.54890496", "0.5476153", "0.5467932", "0.5450003", "0.5448308", "0.54259247", "0.54251295", "0.54246396", "0.54236656", "0.5419539", "0.5418011", "0.5417612", "0.5415722", "0.5407453", "0.5406308", "0.5406023", "0.54038197", "0.5400157", "0.53980154", "0.53965664", "0.5395057", "0.5386646", "0.5384796", "0.5381827", "0.5374121", "0.5373355", "0.5373256", "0.53613436", "0.53599274", "0.5356738", "0.53562856", "0.53513813", "0.5351319", "0.5348777", "0.53486705", "0.5346393", "0.5340691", "0.53363985", "0.5330999", "0.53309554", "0.5323131", "0.53206515", "0.5317763", "0.5315147", "0.5310299", "0.53016484", "0.52985215", "0.5298281", "0.5288899", "0.5288436", "0.52855265", "0.52847964", "0.5270229", "0.526868", "0.5268507", "0.52670574", "0.52587247", "0.52557546", "0.52495706", "0.52474207", "0.52438354", "0.5239072" ]
0.60021394
5
initiator of the new wallet creates records about itself and sends requests to other devices
function createWallet(xPubKey, account, arrWalletDefinitionTemplate, walletName, isSingleAddress, handleWallet) { var wallet = crypto.createHash("sha256").update(xPubKey, "utf8").digest("base64"); console.log('will create wallet ' + wallet); var arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate); setTimeout(function () { addWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () { handleWallet(wallet); if (arrDeviceAddresses.length === 1) // single sig return; console.log("will send offers"); // this continues in parallel while the callback handleWallet was already called // We need arrOtherCosigners to make sure all cosigners know the pubkeys of all other cosigners, even when they were not paired. // For example, there are 3 cosigners: A (me), B, and C. A is paired with B, A is paired with C, but B is not paired with C. device.readCorrespondentsByDeviceAddresses(arrDeviceAddresses, function (arrOtherCosigners) { if (arrOtherCosigners.length !== arrDeviceAddresses.length - 1) throw Error("incorrect length of other cosigners"); arrDeviceAddresses.forEach(function (device_address) { if (device_address === device.getMyDeviceAddress()) return; console.log("sending offer to " + device_address); sendOfferToCreateNewWallet(device_address, wallet, arrWalletDefinitionTemplate, walletName, arrOtherCosigners, isSingleAddress, null); sendMyXPubKey(device_address, wallet, xPubKey); }); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addWallet() {}", "async createNewWallet(walletId, mnemonic, restoreHeight) {\n const pathName = mnemonic ? mnemonicHasher(mnemonic) : createRandomHash(8);\n\n const walletConfig = {\n path: pathjs.join(WALLETS_PATH, pathName),\n password: createRandomHash(),\n networkType: MoneroNetworkType.MAINNET,\n serverUri: DAEMON_URL,\n mnemonic: mnemonic || undefined,\n restoreHeight: +restoreHeight || undefined,\n };\n\n let newWallet = await monerojs.createWalletWasm(walletConfig);\n\n\n newWallet.isSyncing = true;\n const clientId = this.clientId;\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:0},\n clientId\n })\n await newWallet.sync(new class extends monerojs.MoneroWalletListener {\n // newWallet.addListener(new class extends monerojs.MoneroWalletListener {\n onSyncProgress(height, startHeight, endHeight, percentDone, message) {\n\n // parentPort.postMessage(returnWrapper(percentDone*100, 'syncProgress'));\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:percentDone*100},\n clientId\n })\n if (height % 10000 === 0) {\n writeToLog(`Create Progress: ${height} | ${percentDone * 100}% | ${message}`);\n }\n if (percentDone === 1) {\n writeToLog(`Wallet Synced: ${height} | ${percentDone * 100}% | ${message}`);\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: false, progress:percentDone*100},\n clientId\n })\n newWallet.save();\n }\n }\n });\n await newWallet.startSyncing();\n let walletMnemonic = await newWallet.getMnemonic();\n const address = await newWallet.getAddress(0, 0);\n const balance = (await newWallet.getBalance(0, 0));\n this.updateOpenedWallets({...this.openedWallets, [pathName]: newWallet})\n // this.openedWallets[walletMnemonic] = newWallet\n const walletInfo = {\n walletHash: mnemonicHasher(walletMnemonic),\n mnemonic,\n address,\n balance: balance.toString(),\n transactions: [],\n creationDate: Date.now(),\n ...walletConfig,\n };\n\n //The wallets are not synced in this method to improve the UI/UX\n if (!this.syncedWallets[walletInfo.walletHash]) {\n this.syncedWallets[walletInfo.walletHash] = newWallet;\n }\n\n this.updateClientWallets([\n ...this.clientWallets,\n {\n ...walletInfo,\n wallet_id: walletId,\n },\n ]);\n\n this.updateWalletsJson([\n ...this.localWallets,\n walletInfo,\n ]);\n }", "async addWallet() {\n // Validate and format address\n let newAddress = this.validateAddress();\n // Deactivate addressInput button\n this.addressInput.changeToDeactive();\n // Check if wallet already exists in list of wallets\n if (wallets.findWallet(this.name, newAddress) !== undefined) {\n communication.message('Address already included in database for this blockchain. Please try again.');\n } else {\n // Get financial data to check existence of account\n let walletFinancialData = await this.getWalletsFinancialData(this.name, [newAddress]);\n // Invalid address for blockchain\n if (walletFinancialData[newAddress].valid === false) {\n communication.message(\"Not a valid address on \" + this.name + \" blockchain. Please try again.\");\n // Valid address\n } else {\n communication.message('Verified.<br> Generating new wallet info for ' + this.name + ' blockchain.');\n // Generate a new Wallet instance based on the new address\n // - saves in wallets and also stores the summaryRange in the database\n await wallets.generateNewWallet(this, newAddress, true);\n // Set current wallet to new wallet\n wallets.processWalletSelection(this.name, newAddress);\n // Update wallets table\n wallets.updateWalletsTable();\n wallets.scrollToBottomOfTable();\n communication.message('Verified.<br> Click on LOAD DATA to obtain transactions from ' + this.name + ' blockchain.');\n }\n }\n }", "static generateWallet() {\n const wallet = EthereumJsWallet.generate();\n\n AnalyticsUtils.trackEvent('Generate wallet', {\n walletAddress: wallet.getAddressString(),\n });\n\n this.storeWallet(wallet);\n }", "async function initTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender); \n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"; // Zebec program id\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: false,\n isWritable: true,\n },\n {\n // master pda to store fund\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n // pda to store data //sender and recepient\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n const explorerhash = {\n transactionhash: signature,\n };\n return explorerhash;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "function sendTransaction(generateAccount, algodClient, kmdClient) {\n let note = '';\n let amount = 0;\n const from = { addr: '', sk: '' };\n let to = ''; // 'KI6TMKHUQOGJ7EDZLOWFOGHBBWBIMBMKONMS565X7NSOFMAM6S2EK4GBHQ';\n let walletName = '';\n let walletPassword = '';\n let walletId = null;\n let walletHandle = null;\n let txId = '';\n\n (async () => {\n if (generateAccount) {\n // Create an account\n const account = algosdk.generateAccount();\n console.log(`Address: ${account.addr}`);\n\n // Get backup phrase for account\n const mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n console.log(`Mnemonic: ${mnemonic}`);\n\n // Recover the account\n const recoveredAccount = algosdk.mnemonicToSecretKey(mnemonic);\n // console.log(recoveredAccount.addr);\n\n // Check to see if account is valid\n const isValid = algosdk.isValidAddress(recoveredAccount.addr);\n if (isValid) {\n from.addr = recoveredAccount.addr;\n from.sk = recoveredAccount.sk;\n }\n } else {\n const wallets = await kmdClient.listWallets();\n const walletsLength = wallets.wallets.length;\n if (typeof walletsLength === 'undefined' || walletsLength <= 0) {\n console.log(\"No wallets could be found in `kmd'.\");\n process.exit(1);\n }\n\n console.log('\\nGot wallets list:'); // + JSON.stringify(wallets));\n for (let i = 0; i < walletsLength; i++) {\n console.log(`[${i + 1}] ${wallets.wallets[i].name}`);\n }\n\n if (!walletName) {\n const walletIndex = readlineSync.keyIn(\n `Pick the wallet to use [1${walletsLength > 1 ? `-${walletsLength}` : ''}]: `,\n // eslint-disable-next-line comma-dangle\n { limit: `$<1-${walletsLength}>` }\n );\n walletName = wallets.wallets[walletIndex - 1].name;\n walletId = wallets.wallets[walletIndex - 1].id;\n }\n\n if (!walletPassword) {\n walletPassword = readlineSync.question(`\\nType the '${walletName}' wallet's password: `, {\n hideEchoBack: true,\n mask: '',\n });\n }\n\n walletHandle = (await kmdClient.initWalletHandle(walletId, walletPassword)).wallet_handle_token;\n\n const keys = await kmdClient.listKeys(walletHandle);\n const keysLength = keys.addresses.length;\n if (typeof keysLength === 'undefined' || keysLength <= 0) {\n console.log(`No keys could be found in \\`kmd' for '${walletName}'.`);\n process.exit(1);\n }\n console.log('\\nGot keys list:'); // + keys);\n for (let i = 0; i < keysLength; i++) {\n console.log(`[${i + 1}] ${keys.addresses[i]}`);\n }\n\n const keyIndex = readlineSync.keyIn(\n `Pick the account address to send from [1${keysLength > 1 ? `-${keysLength}` : ''}]: `,\n { limit: `$<1-${keysLength}>` },\n );\n from.addr = keys.addresses[keyIndex - 1];\n from.sk = (await kmdClient.exportKey(walletHandle, walletPassword, from.addr)).private_key;\n // console.log('sk', from.sk);\n }\n\n if (!to) {\n to = readlineSync.question('\\nSpecify the account address to send to: ');\n }\n\n if (!amount) {\n amount = readlineSync.questionInt('\\nSpecify the amount to be transferred: ');\n }\n\n if (!note) {\n note = readlineSync.question('\\nSpecify some note text (optional): ');\n }\n\n // Get the relevant params from the algod\n const params = await algodClient.getTransactionParams();\n const endRound = params.lastRound + parseInt(1000, 10);\n\n // Create a transaction\n const txn = {\n from: from.addr,\n to, // 'NJY27OQ2ZXK6OWBN44LE4K43TA2AV3DPILPYTHAJAMKIVZDWTEJKZJKO4A',\n fee: params.fee,\n amount,\n firstRound: params.lastRound,\n lastRound: endRound,\n genesisID: params.genesisID,\n note: note ? algosdk.encodeObj(note) : new Uint8Array(0),\n };\n\n // Sign the transaction\n console.log('\\nSigning transaction: \\n', txn);\n const signedTxn = algosdk.signTransaction(txn, from.sk);\n\n // Submit the transaction\n console.log('\\nSubmitting transaction...');\n const tx = await algodClient.sendRawTransaction(signedTxn.blob);\n txId = tx.txId; // eslint-disable-line prefer-destructuring\n console.log(`Transaction: tx-${txId}`);\n })().catch((e) => {\n console.log(e.error.text);\n process.exit(1);\n });\n}", "createAccount(){\n\n console.log('ACCOUNT CREATED')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n var web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n\n let newAccount = web3js.eth.accounts.create();\n let newAccount_public = newAccount.address\n let newAccount_private = newAccount.privateKey\n\n\n //JSON that is supporting all chains. \n let newJSON = {\n eth : [\n {\n privateKey : newAccount_private,\n publicKey : newAccount_public, \n }\n ],\n eos : [] \n }\n // 0xf65edc67222a17bdb9979e9560f75ac34fae6dc30e6d2145458295bf11739390\n\n //Turn array to string to store in keychain. \n let stored_string = JSON.stringify(newJSON);\n\n\n //Store array with keys in keychain. \n (async function() {\n\n // Store the credentials\n await Keychain.setGenericPassword('null', stored_string);\n \n })();\n\n this.props.navigator.push({\n id : 'AccountCreated',\n passProps : {\n privateKey : newAccount_private,\n publicKey : newAccount_public\n }\n })\n \n }", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', 'sherlocked123@gmail.com', 'sherlocked123@gmail.com', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', 'a12@gmail.com', 'a12@gmail.com', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', 'a@gmail.com', 'a@gmail.com', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, 'a@gmail.com','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', 'b012@gmail.com', 'b012@gmail.com', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', 'b123@gmail.com', 'b012@gmail.com', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', 'b012@gmail.com', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', 'a1234@gmail.com', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "init() { \n // Form is a transfer transaction object, pre-set recipient if any from state parameter\n this.formData = nem.model.objects.create(\"transferTransaction\")(undefined !== this._$state.params.address ? this._$state.params.address : '');\n // Mosaics are null by default\n this.formData.mosaics = null;\n // Set first multisig account if any\n this.formData.multisigAccount = this._DataStore.account.metaData.meta.cosignatoryOf.length == 0 ? '' : this._DataStore.account.metaData.meta.cosignatoryOf[0];\n // Switch between mosaic transfer and normal transfers\n this.isMosaicTransfer = false;\n this.formData.messageType = 1; \n this.formData.message = '';\n this.formData.amount = 0;\n this.formData.recipient ='';\n this.formData.recipientPublicKey = '';\n\n // Pointer add for view\n this.formData.pointerAdd = '';\n \n // Prevent user to click twice on send when already processing\n this.okPressed = false;\n // Is namespace selected\n this.nameSpaceSelected = true;\n // Object to contain our password & private key data.\n this.common = nem.model.objects.get(\"common\");\n // Default namespaces owned\n this.namespaceOwned = this._DataStore.namespace.ownedBy[this._Wallet.currentAccount.address];\n //alert(JSON.stringify(this.namespaceOwned, null, 4));\n \n // Store the prepared transaction\n this.preparedTransaction = {};\n\n // Store transactions\n this.transactions = [];\n this.noMoreTxes = false;\n\n //DNS info holder\n this.ip1 = '';\n this.organization = '';\n this.country = '';\n this.address = '';\n this.phone = '';\n this.email = '';\n this.other = '';\n this.transMessage= '';\n // Character counter\n this.charactersLeft = 1024;\n }", "handler(app, req, res) {\n wallet.addNewAddress(wallet.getDefaultActiveWallet())\n .then(address => {\n res.send(address);\n })\n .catch(e => res.send({\n api_status : 'fail',\n api_message: `unexpected generic api error: (${e})`\n }));\n }", "addWalletTransaction(payload) {\n return this.request.post('transaction', payload);\n }", "async createRequest() {\n try {\n const result = await this.rn.requestEthereumService.createRequestAsPayee(\n this.payerAddress,\n this.amountRequired,\n `{\"reason\": \"${ this.reason }\"}`,\n '',\n [],\n { from: this.payeeAddress }\n ).on('broadcasted', (data) => {\n console.log(data.transaction.hash);\n this.txHash = data.transaction.hash;\n });\n } catch (error) {\n console.error(error);\n }\n }", "function createWallet(walletRPC, walletName, chain) {\n\twalletRPC.create_wallet(walletName, '')\n\t\t.then(new_wallet => {\n\t\t\tconsole.log(\"createWallet \" + walletName + \".key success\");\n\t\t\tchain(walletRPC, walletName)\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "static newTransaction(sendersWallet, recipientAddress, amount){\n //check balance\n if(amount > sendersWallet){\n console.log(`The amount ${amountToSend} is exceeding the current balance`);\n return;\n }\n //creating the two outputs of the transaction\n\n //Every time the user sends the whole amount he has\n //pushing two objects\n return Transaction.transactionWithOutputs(sendersWallet,[ //first object output has the amount that must be left to the sender wwallet\n {amount : sendersWallet.balance - amount, address: sendersWallet.publicKey},\n {amount, address: recipientAddress}]);\n\n return transaction;\n }", "async function createWallet(){\r\n try{\r\n let account;\r\n account = web3.eth.accounts.create(web3.utils.randomHex(32));\r\n\r\n sendETH(account.address);//send eth to new address\r\n\r\n return({\"address\":account.address,\"key\":account.privateKey});\r\n }catch{\r\n return({\"address\" : \"ERROR\",\"key\" : \"error\"});\r\n }\r\n}", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "constructor(data, wallet) {\n this.id = ChainUtil.id();\n this.from = wallet.publicKey;\n console.log('>>>>>>Transaction Entry @>>>>>>', new Date)\n this.input = { data: data, timestamp: new Date };\n console.log('>>>>>>>> input', this.input)\n this.hash = ChainUtil.hash(this.input);\n this.signature = wallet.sign(this.hash);\n }", "function newDepartment() {\n console.log(\"Create new department\");\n\nvar account = web3.personal.newAccount(\"BE1010be\");\n //web3.personal.newAccount(\"BE1010be\").then(function(account){\n\nif(account != null && account != ''){\n //var account = acc1.result;\n web3.personal.unlockAccount(accounts[0], \"BE1010be\");\n web3.eth.sendTransaction({from:accounts[0], to:account, value:20000000000000000000}, function(error, result){\n if(error){\n alert(\"Issue creating the account, please try after sometime\");\n }\n\n var transaction = web3.eth.getTransaction(result);\n\n\n while(transaction.blockNumber == null || transaction.blockNumber <= 0){\n transaction = web3.eth.getTransaction(result);\n console.log(\"waiting for transaction to mined...\");\n }\n Department.setProvider(web3.currentProvider);\n web3.personal.unlockAccount(account, \"BE1010be\");\n \tDepartment.new({from: account, gas: 4712386}).then(\n \tfunction(department) {\n \t\tconsole.log(department);\n \t\tmyDepartmentInstance = department;\n console.log(\"Department contract address....\" + myDepartmentInstance.address);\n console.log(\"Department account address....\" + account);\n\n $(\"#contractAddress\").val(myDepartmentInstance.address);\n $(\"#accountAddress\").val(account);\n $(\"#departmentName\").val(\"\");\n\n addToDepartments(account, myDepartmentInstance.address);\n\n\n \t\t//$(\"#patientContractAddress\").html(myPatientInstance.address);\n\n \t});\n });\n }else{\n alert(\"Issue creating the account, please try after sometime\");\n }\n //});\n\n\n}", "function createFirstBlankTransaction(self) {\n\t\tlet transParams = self.generateTransParams(self.wallet.publicKey, 0, 'The blank transaction to register address!');\n\t\tself.iota.api.sendTransfer(self.wallet.publicKey, 3, 9, transParams, (error, response) => {\n\t if (error) {\n\t \tconsole.log(error);\n\t } else {\n\t \tconsole.log('Register address transaction details:');\n\t console.log(response);\n\t }\n\t\t});\n\t}", "initiate_key_exchange(recipients, offchain=0, peer=null) {\n\n let recipient = \"\";\n let parties_to_exchange = 2;\n\n if (Array.isArray(recipients)) {\n if (recipients.length > 0) {\n recipients.sort();\n recipient = recipients[0];\n parties_to_exchange = recipients.length;\n }\n else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n } else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n\nconsole.log(\"recipient is: \" + recipient);\n if (recipient == \"\") { return; }\n\n let tx = this.app.wallet.createUnsignedTransactionWithDefaultFee(recipient, (parties_to_exchange * this.app.wallet.wallet.default_fee));\n\n //\n // we had an issue creating the transaction, try zero-fee\n //\n if (!tx) {\nconsole.log(\"zero fee tx creating...\");\n tx = this.app.wallet.createUnsignedTransaction(recipient, 0.0, 0.0);\n }\n\n tx.msg.module = this.name;\n tx.msg.request = \"key exchange request\";\n tx.msg.alice_publickey = this.app.keys.initializeKeyExchange(recipient);\n\n //\n // does not currently support n > 2\n //\n if (parties_to_exchange > 2) {\n for (let i = 1; i < parties_to_exchange; i++) {\n tx.transaction.to.push(new saito.slip(recipients[i], 0.0));\n }\n }\n\n tx = this.app.wallet.signTransaction(tx);\n\n if (offchain == 0) {\n this.app.network.propagateTransaction(tx);\n } else {\n let data = {};\n data.module = \"Encrypt\";\n\t data.tx = tx;\nconsole.log(\"sending request on network\");\n this.app.network.sendPeerRequest(\"diffie hellman key exchange\", data, peer);\n }\n this.saveEncrypt();\n\n }", "async function main () {\n\n /**\n * Fetch your personal wallet's balance\n */\n //let myBalanceWei = web3.eth.getBalance(web3.eth.defaultAccount).toNumber()\n let myBalanceWei = await web3.eth.getBalance(web3.eth.defaultAccount)\n\n let myBalance = fromWei(myBalanceWei)\n \n log(`Your wallet wei balance is currently ${myBalanceWei} ETH`.green)\n\n log(`Your wallet balance is currently ${myBalance} ETH`.green)\n\n\n /**\n * With every new transaction you send using a specific wallet address,\n * you need to increase a nonce which is tied to the sender wallet.\n */\n let nonce = await web3.eth.getTransactionCount(web3.eth.defaultAccount)\n log(`The outgoing transaction count for your wallet address is: ${nonce}`.magenta)\n\n\n /**\n * Fetch the current transaction gas prices from https://ethgasstation.info/\n */\n let gasPrices = await getCurrentGasPrices()\n\n log('wallet: ' + process.env.WALLET_ADDRESS)\n log('testnet: ' + testnet)\n log('chain id: ' + process.env.CHAIN_ID)\n log('chain_name: ' + process.env.CHAIN_NAME)\n log('chain_hardfork: ' + process.env.CHAIN_HARDFORK)\n\n /**\n * Build a new transaction object and sign it locally.\n */\n let details = {\n \"to\": process.env.DESTINATION_WALLET_ADDRESS,\n \"value\": web3.utils.numberToHex( toWei(amountToSend) ),\n \"gas\": 21000,\n \"gasPrice\": gasPrices.low * 1000000000, // converts the gwei price to wei\n \"nonce\": nonce,\n \"chainId\": process.env.CHAIN_ID // EIP 155 chainId - mainnet: 1, rinkeby: 4\n }\n\n const transaction = new EthereumTx(details, {chain:process.env.CHAIN_NAME, hardfork: process.env.CHAIN_HARDFORK})\n\n /**\n * This is where the transaction is authorized on your behalf.\n * The private key is what unlocks your wallet.\n */\n transaction.sign( Buffer.from(process.env.WALLET_PRIVATE_KEY, 'hex') )\n\n\n /**\n * Now, we'll compress the transaction info down into a transportable object.\n */\n const serializedTransaction = transaction.serialize()\n\n /**\n * Note that the Web3 library is able to automatically determine the \"from\" address based on your private key.\n */\n\n const addr = transaction.from.toString('hex')\n log(`Based on your private key, your wallet address is ${addr}`.yellow)\n\n /**\n * We're ready! Submit the raw transaction details to the provider configured above.\n */\n await web3.eth.sendSignedTransaction('0x' + serializedTransaction.toString('hex') )\n .catch( error => { console.log (error) } )\n\n /*\n let transactionReceipt = await web3.eth.getTransactionReceipt() \n console.log (\"recibo\"+ transactionReceipt)\n let transactionId = transactionReceipt.transactionHash\n console.log (\"transactionId\"+ transactionId)\n */\n\n /**\n * We now know the transaction ID, so let's build the public Etherscan url where\n * the transaction details can be viewed.\n */\n //const url = `https://rinkeby.etherscan.io/tx/${transactionId}`\n //log(url.cyan)\n\n let contract_abi = [ { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isWaitingValidationAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isReservedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setTokenAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getBlockchainAccount\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"enableChangeAccount\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"isChangeAccountEnabled\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"string\", \"name\": \"str\", \"type\": \"string\" } ], \"name\": \"isValidHash\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"pure\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"renounceOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isRedemptionAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getRedemptionAddress\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"changeAccountLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"validateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByValidatorAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getIdLegalFinancialAgreement\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForRegistryValidation\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"owner\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForDisbursement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getAccountState\", \"outputs\": [ { \"internalType\": \"int256\", \"name\": \"\", \"type\": \"int256\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getLegalEntityInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isAvailableAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getLegalEntityInfoByCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"novoCampo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"invalidateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForSettlement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isTokenAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setRedemptionAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"registryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"transferOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountRegistration\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"oldAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountChange\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountValidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountInvalidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"previousOwner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"OwnershipTransferred\", \"type\": \"event\" } ]\n\n var myContract = new web3.eth.Contract(contract_abi, process.env.CONTRACT_ADDRESS, {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n});\n\n\n\n// using the callback\n await myContract.methods.getResponsibleForDisbursement().call({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log ('The disbursement responsible is : ' + result);\n });\n\n let outraABI = [ { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"decrease\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"increase\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"triple\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"double\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]\n\n var counterContract = new web3.eth.Contract(outraABI, \"0xB87b994174CA4af8FD7E9e7DED2036564Ba53829\", {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n });\n\n// using the callback\n// Infura has not activated the method eth_sendTransaction because this method needs unlocked accounts on the ethereum node. \n await counterContract.methods.increase(1).send({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log (result);\n })\n\n log(`Note: please allow for 30 seconds before transaction appears on Etherscan`.magenta)\n\n process.exit()\n}", "function Backend() {\n var prefix = '';\n\n // let address = keys.public_addr;\n // let view_key = keys.view.sec;\n // let spend_key = keys.spend.sec;\n\n this.get_monero_price = function () {\n return request('/api/get_monero_price', {});\n };\n\n this.login = function () {\n return request('/api/login', { 'address': address, 'view_key': view_key });\n };\n\n this.get_height = function () {\n return request('/api/get_height', {}, 'GET');\n };\n\n this.create_wallet = function (address, spend, view) {\n return request('/api/create_wallet', {\n 'address': address,\n 'spend': spend,\n 'view': view\n });\n };\n\n this.import_from_height = function (address, spend, view) {\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n return request('/api/import_wallet_from_height', {\n 'address': address,\n 'spend': spend,\n 'view': view,\n 'height': height\n });\n };\n\n this.get_balance = function () {\n return request('/api/get_balance', {\n 'walletName': walletName\n });\n };\n\n this.get_transfers = function () {\n return request('/api/get_transfers', {\n 'walletName': walletName\n });\n };\n\n this.get_transactions_info = function (transactions) {\n return request('/api/get_transactions_info', {\n 'walletName': walletName,\n 'transactions': transactions\n });\n };\n\n this.make_transaction = function (address, amount, payment_id) {\n return request('/api/make_transaction', {\n 'walletName': walletName,\n 'address': address,\n 'amount': amount,\n 'payment_id': payment_id\n });\n };\n\n this.rescan_blockchain = function () {\n return request('/api/rescan', {\n 'walletName': walletName\n });\n };\n\n this.question = function (name, email, message) {\n return request('/api/rescan', {\n 'name': name,\n 'email': email,\n 'message': message\n });\n };\n\n // this.updateWalletName = function(newName){\n // walletName = newName;\n // }\n\n function request(url, params) {\n var method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'POST';\n\n return new Promise(function (resolve, reject) {\n var jqxhr = $.ajax({\n url: prefix + url,\n data: JSON.stringify(params),\n dataType: 'json',\n method: method,\n contentType: 'application/json'\n });\n\n jqxhr.done(function (data) {\n console.log('ajax successes:!');\n resolve(data);\n });\n\n jqxhr.fail(function (error) {\n console.log('ajax error: ' + error);\n reject(error);\n });\n\n jqxhr.always(function () {\n console.log('ajax end');\n });\n });\n }\n}", "async function createTransaction() {\n // Get a fee estimate from Smart Fee:\n const smartFeeResponse = await request({\n url: `https://api.smartfee.live/latest`,\n headers: {\n 'X-API-KEY': smartFeeApiKey\n }\n })\n const smartFeeResponseObject = JSON.parse(smartFeeResponse)\n // Use the 2-block target.\n const twoBlockFeeRateSatsPerKb = smartFeeResponseObject.feeByBlockTarget[\"2\"]\n\n\n // Send a BitGo transaction with a custom fee rate:\n const wallet = await bitgo.coin('tbtc').wallets().get({ id: WALLET_ID })\n const sendParams = {\n feeRate: twoBlockFeeRateSatsPerKb,\n // TODO: replace below with your transaction info:\n /*\n recipients: [{\n amount: 0.01 * 1e8,\n address: '2NFfxvXpAWjKng7enFougtvtxxCJ2hQEMo4',\n }, {\n amount: 0.01 * 1e8,\n address: '2MsMFw75RKRiMb548q6W4jrJ63jwvvDdR2w',\n }],\n walletPassphrase: 'secretpassphrase1a5df8380e0e30'\n */\n }\n const result = await wallet.sendMany(sendParams)\n console.dir(result)\n}", "_updateWallet(transaction = this.transaction_update()) {\n let wallet = this.state.wallet;\n\n if (!wallet) {\n reject(\"missing wallet\");\n return;\n } //DEBUG console.log('... wallet',wallet)\n\n\n let wallet_clone = (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_17__[\"default\"])(wallet);\n\n wallet_clone.last_modified = new Date();\n (0,_tcomb_structs__WEBPACK_IMPORTED_MODULE_6__.WalletTcomb)(wallet_clone); // validate\n\n let wallet_store = transaction.objectStore(\"wallet\");\n let p = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_request_end(wallet_store.put(wallet_clone));\n let p2 = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_transaction_end(transaction).then(() => {\n this.state.wallet = wallet_clone;\n this.setState({\n wallet: wallet_clone\n });\n });\n return Promise.all([p, p2]);\n }", "function initWallet() {\n // do not override existing private keys\n if (fs.existsSync(privateKeyFile)) { return; }\n\n const newPrivateKey = generatePrivateKey();\n\n // mkdir, if necessary\n if (!fs.existsSync(\"wallet/\")) {\n fs.mkdirSync(\"wallet/\");\n }\n if (!fs.existsSync(privateKeyLocation)) {\n fs.mkdirSync(privateKeyLocation);\n }\n\n // write file\n fs.writeFileSync(privateKeyFile, newPrivateKey);\n\n console.log(\"New wallet with private key created to: %s\", privateKeyFile);\n}", "async initLedger(ctx) {\n // const dev_map = new Map();\n\t const device = [\n ];\n\n for (let i = 0; i < device.length; i++) {\n device[i].docType = 'swarm_device';\n await ctx.stub.putState('MODEL' + i, Buffer.from(JSON.stringify(device[i])));\n console.info('Added <--> ', device[i]);\n }\n console.info('============= END : Initialize Ledger ===========');\n }", "ConfigureWithRecord (wallet) {\n const self = this\n if (typeof self.wallet !== 'undefined') {\n self.PrepareForReuse()\n }\n self.wallet = wallet\n self._configureUIWithWallet()\n self.startObserving_wallet()\n }", "function addTransaction(tx) {\n if (!$scope.account.Balance) {\n // if account is unfunded, then there is no need to ask user for a key\n // Add transaction to the queue.\n // (Will be submitted as soon as account gets funding)\n var item = {\n tx_json: tx.tx_json,\n type: tx.tx_json.TransactionType\n };\n\n // Additional details depending on a transaction type\n if ('TrustSet' === item.type) {\n item.details = tx.tx_json.LimitAmount;\n }\n\n var saveTx = function(e1, r1) {\n if (e1) {\n console.warn(e1);\n return;\n }\n $scope.userBlob.unshift('/clients/rippletradecom/txQueue', item);\n };\n\n if ($scope.userBlob.data && !$scope.userBlob.data.clients) {\n // there is bug in RippleLib with unshift operation - if \n // there is empty nodes in the path, it tries to create array node,\n // and nothing gets created under it, so create '/clients' explicitly\n $scope.userBlob.set('/clients', { rippletradecom: {} }, saveTx);\n } else if ($scope.userBlob.data && $scope.userBlob.data.clients && _.isArray($scope.userBlob.data.clients)) {\n // if '/clients' already set to array, clear it\n $scope.userBlob.unset('/clients', function(e, r) {\n if (e) return;\n $scope.userBlob.set('/clients', { rippletradecom: {} }, saveTx);\n });\n } else {\n saveTx();\n }\n } else {\n // Get user's secret key\n keychain.requestSecret(id.account, id.username, function(err, secret) {\n if (err) {\n console.log('client: txQueue: error while unlocking wallet: ', err);\n return;\n }\n\n var transaction = ripple.Transaction.from_json(tx.tx_json);\n\n transaction.remote = network.remote;\n transaction.secret(secret);\n\n api.getUserAccess().then(function(res) {\n // If account is funded submit the transaction right away\n transaction.submit();\n }, function(err2) {\n // err\n });\n\n });\n }\n }", "function prepareTransaction() {\r\n let amountInt=0;\r\n if (amount.value == \"\") {\r\n amount.focus();\r\n return false;\r\n }\r\n amountInt = parseInt(amount.value);\r\n \r\n if (recipient == \"\") {\r\n recipient.focus();\r\n return false;\r\n }\r\n let recipientAdr = recipient.value;\r\n\r\n let pubkey = publickey.value;\r\n if (pubkey == \"\") {\r\n publickey.focus();\r\n return false;\r\n }\r\n let prvkey = privatekey.value;\r\n if (prvkey == \"\") {\r\n privatekey.focus();\r\n return false;\r\n }\r\n\r\n let ts = _getTimestamp();\r\n let due = network.value === 'T' ? 60 : 24 * 60;\r\n let deadline = ts + due * 60;\r\n const payload = \"4e454d20415049204578616d706c657320666f72206c6561726e696e67\"; //NEM API Examples for learning \r\n const fee = 500000;\r\n const typeTx = 257;\r\n let data = {\r\n \"transaction\": {\r\n \"timeStamp\": _getTimestamp(),\r\n \"amount\": amountInt,\r\n \"fee\": fee,\r\n \"recipient\": recipientAdr,\r\n \"type\": typeTx,\r\n \"deadline\": deadline,\r\n \"message\": {\r\n \"payload\": payload,\r\n \"type\": 1\r\n },\r\n \"version\": _getVersion(1),\r\n \"signer\": pubkey,\r\n \"mosaics\": []\r\n },\r\n \"privateKey\": prvkey\r\n };\r\n\r\n _doPost('/transaction/prepare-announce', data);\r\n }", "async createAccount(caller, amount = 0) {\n const iTx = invokeScript({\n dApp: address(this.dapp_account),\n call: {\n function: \"createAccount\",\n },\n payment: [{ assetId: this.asset_id, amount: amount }]\n }, caller);\n\n await broadcast(iTx)\n await waitForTx(iTx.id);\n this.dd('Account ' + caller + ' (' + address(caller) + ') has been created in dApp (' + address(this.dapp_account) + ') | tx_id: ' + iTx.id)\n }", "async function run() {\n const { AccountManager, StorageType, SignerType } = require('iota-wallet')\n const manager = new AccountManager({\n storagePath: './test-database',\n storageType: StorageType.Sqlite\n })\n \n const mnemonic = process.env.IOTA_WALLET_MNEMONIC\n \n const account = await manager.createAccount({\n mnemonic,\n alias: 'Test',\n clientOptions: { node: process.env.NODE_URL, localPow: false },\n signerType: SignerType.EnvMnemonic\n })\n\n console.log('alias', account.alias())\n console.log('balance', account.availableBalance())\n \n console.log('syncing account now')\n\n const synced = await account.sync()\n\n console.log('synced', synced)\n console.log('acc messages', account.listMessages())\n console.log('acc spent addresses', account.listAddresses(false))\n console.log('acc unspent addresses', account.listAddresses(true))\n}", "async beforeTransaction(ctx) {\n\t\t// Allow only the manufacturer peers to initiate any transaction on this contract\n\t}", "function newTransaction() {\n inquirer.prompt([{\n type: 'confirm',\n name: 'choice',\n message: 'Would you like to perform another transaction?'\n }]).then(function (answer) {\n if (answer.choice) {\n start();\n }\n else {\n console.log(chalk.redBright(\"===============================================\"));\n console.log(chalk.greenBright(\"Thank You So Much! \") + chalk.yellowBright(\"Wishing You \") + chalk.blueBright(\"A Wonderful Day!\"));\n console.log(chalk.magentaBright(\"===============================================\"));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n connection.end();\n }\n });\n }", "async function CreateNewMerchantRecord(data, id) {\n // NOTIFY PROGESS\n console.log(\"Creating a new merchant record\");\n\n if(id != undefined) {\n return await _set(\"Merchants/\" + id, data);\n } else {\n return await _push('Merchants', data);\n }\n \n}", "async createWalletFromKeys(name, password, address, viewKey, spendKey, daemonConnection, restoreHeight, language, saveCurrent) {\n if (restoreHeight === undefined) restoreHeight = 0;\n if (language === undefined) language = MoneroWallet.DEFAULT_LANGUAGE;\n await this.config.rpc.sendJsonRequest(\"generate_from_keys\", {\n filename: name,\n password: password,\n address: address,\n viewkey: viewKey,\n spendkey: spendKey,\n restore_height: restoreHeight,\n autosave_current: saveCurrent\n });\n this._clear();\n this.path = name;\n }", "function sendRequest() {\n console.log('sending request to establish peer connection');\n var message = 'request';\n console.log('Check - '+vm.setId+' - '+vm.peerId);\n //dont request yourself!\n if (vm.peerId !== vm.setId) {\n signalingService.sendRequest(vm.setId, vm.peerId, message);\n } else {\n console.log('You requested yourself');\n modalOptions.headerText = 'Alert: Connection with yourself';\n modalOptions.bodyText = 'Please choose another peer Id.';\n modalService.showModal({}, modalOptions);\n }\n }", "createTable() {\n logger.verbose(`createTable()`);\n\n const appAccount = process.env.APP_ACCOUNT;\n const appAccountAddress = process.env.APP_ACCOUNT_ADDRESS;\n const appPublickKey = process.env.APP_PUBLIC_KEY;\n const eventEmitter = new events.EventEmitter();\n const self = this;\n // let valid_table = true;\n let tableList = [];\n // let app;\n let tableName;\n let address;\n let passphrase;\n // let current_tables;\n let record;\n let tableListRecord;\n // let table_created = true;\n\n return new Promise((resolve, reject) => {\n eventEmitter.on('insufficient_balance', () => {\n reject(\"Please send JUP to your app's address and retry command\");\n });\n\n eventEmitter.on('table_created', () => {\n // This code will send Jupiter to the recently created table address so that it is\n // able to record information\n self.sendMoney(address)\n .then((response) => {\n logger.info(`Table ${tableName} funded with JUP.`);\n resolve({\n success: true,\n message: `Table ${tableName} pushed to the blockchain and funded.`,\n data: response.data,\n jupiter_response: response.data,\n tables: tableList,\n others: self.tables,\n });\n })\n .catch((err) => {\n logger.error(err);\n reject({ success: false, message: 'Unable to send Jupiter to new table address' });\n });\n });\n\n eventEmitter.on('address_retrieved', () => {\n const encryptedData = self.encrypt(JSON.stringify(record));\n const encryptedTableData = self.encrypt(JSON.stringify(tableListRecord));\n\n const callUrl = `${self.jupiter_data.server}/nxt?requestType=sendMessage&secretPhrase=${appAccount}&recipient=${appAccountAddress}&messageToEncrypt=${encryptedData}&feeNQT=${self.jupiter_data.feeNQT}&deadline=${self.jupiter_data.deadline}&recipientPublicKey=${appPublickKey}&compressMessageToEncrypt=true`;\n\n\n axios.post(callUrl)\n .then((response) => {\n if (response.data.broadcasted && response.data.broadcasted === true) {\n logger.info(`Table ${tableName} pushed to the blockchain and linked to your account.....`);\n eventEmitter.emit('table_created');\n } else if (response.data.errorDescription != null) {\n logger.info('There was an Error');\n logger.info(response);\n logger.info(response.data);\n logger.error(`Error: ${response.data.errorDescription}`);\n reject({\n success: false,\n message: response.data.errorDescription,\n jupiter_response: response.data,\n });\n } else {\n logger.error('Unable to save data in the blockchain');\n logger.error(response.data);\n reject({ success: false, message: 'Unable to save data in the blockchain', jupiter_response: response.data });\n }\n })\n .catch((error) => {\n logger.error(error);\n reject({ success: false, message: 'There was an error', error: error.response });\n });\n\n const tableListUpdateUrl = `${self.jupiter_data.server}/nxt?requestType=sendMessage&secretPhrase=${appAccount}&recipient=${appAccountAddress}&messageToEncrypt=${encryptedTableData}&feeNQT=${(self.jupiter_data.feeNQT / 2)}&deadline=${self.jupiter_data.deadline}&recipientPublicKey=${appPublickKey}&compressMessageToEncrypt=true`;\n\n axios.post(tableListUpdateUrl)\n .then((response) => {\n if (response.data.broadcasted && response.data.broadcasted === true) {\n } else if (response.data.errorDescription != null) {\n logger.info('There was an Error');\n logger.info(response.data);\n logger.error(`Error:${response.data.errorDescription}`);\n logger.error(response.data);\n } else {\n logger.info(response.data);\n logger.info(encryptedTableData);\n }\n })\n .catch((error) => {\n logger.info('There was an error in updating table list');\n logger.error(error);\n logger.info(encryptedTableData);\n });\n });\n\n eventEmitter.on('tableName_obtained', () => {\n if (self.tables.indexOf(tableName) >= 0 || tableList.indexOf(tableName) >= 0) {\n reject(`Error: Unable to save table. ${tableName} is already in the database`);\n } else {\n passphrase = self.generate_passphrase();\n\n self.createNewJupiterAccount(passphrase)\n .then((response) => {\n if (response.success === true && response.address && response.address.length > 0) {\n ({ address } = response);\n record = {\n [tableName]: {\n address,\n passphrase,\n public_key: response.publicKey\n },\n };\n tableList.push(tableName);\n tableListRecord = {\n tables: tableList,\n date: Date.now(),\n };\n\n eventEmitter.emit('address_retrieved');\n } else {\n logger.error(response);\n reject('There was an error');\n }\n })\n .catch((error) => {\n logger.error(error);\n reject('Error creating Jupiter address for your table.');\n });\n }\n });\n\n eventEmitter.on('verified_balance', () => {\n if (appAccount === undefined || appAccount === '' || appAccount == null) {\n reject('Error: The .env file does not contain APP_ACCOUNT. Please provide one.');\n } else {\n logger.debug('-- ---- -- --- -- --- $$$$$ -- ---- -- --- -- --- 8')\n self.loadUserAndAppData()\n .then(async (response) => {\n if (response.tables === undefined\n || response.tables == null\n || response.tables.length === 0) {\n tableList = [];\n } else {\n tableList = response.tables;\n }\n\n logger.info('You are about to create a new database table for your Gravity app.');\n logger.info('The following tables are already linked to your database:');\n logger.info(tableList);\n try {\n const answer = await self.makeQuestion('What will be the name of your new table?\\n');\n tableName = answer;\n if (tableName === 'undefined' || tableName === undefined) {\n reject('Table name cannot be undefined');\n } else {\n eventEmitter.emit('tableName_obtained');\n }\n } catch (e) {\n reject(e);\n }\n })\n .catch((error) => {\n logger.error(error);\n reject('Error in creating table');\n });\n }\n });\n\n self.getBalance()\n .then((response) => {\n if (response.minimumAppBalance === true) {\n eventEmitter.emit('verified_balance');\n } else {\n logger.error('Error in creating new table: insufficient app balance.');\n logger.error(`A minimum of ${parseFloat((self.jupiter_data.minimumAppBalance) / (10 ** self.jupiter_data.moneyDecimals))} JUP is required to create a table with Gravity.`);\n eventEmitter.emit('insufficient_balance');\n }\n })\n .catch((error) => {\n logger.error('There was an error trying to create a new table in Jupiter.');\n logger.error(error);\n eventEmitter.emit('insufficient_balance');\n });\n });\n }", "function newHDWallets() {\r\n var walletObj = new Object();\r\n walletObj.mainnet = new Object();\r\n walletObj.testnet = new Object();\r\n walletObj.mainnet.mnemonic = bip39.generateMnemonic();\r\n walletObj.testnet.mnemonic = bip39.generateMnemonic();\r\n var seedBuffer = bip39.mnemonicToSeed(walletObj.mainnet.mnemonic);\r\n walletObj.mainnet.wallet = bip32.fromSeed(seedBuffer);\r\n walletObj.testnet.wallet = bip32.fromSeed(seedBuffer, bitcoin.networks.testnet);\r\n walletObj.mainnet.pubKey = walletObj.mainnet.wallet.neutered().toBase58();\r\n walletObj.mainnet.pubKeyHex = walletObj.mainnet.wallet.neutered().publicKey.toString(\"hex\");\r\n walletObj.mainnet.privKey = walletObj.mainnet.wallet.toBase58();\r\n walletObj.mainnet.privKeyHex = walletObj.mainnet.wallet.privateKey.toString(\"hex\");\r\n walletObj.mainnet.wif = walletObj.mainnet.wallet.toWIF();\r\n walletObj.testnet.pubKey = walletObj.testnet.wallet.neutered().toBase58();\r\n walletObj.testnet.pubKeyHex = walletObj.testnet.wallet.neutered().publicKey.toString(\"hex\");\r\n walletObj.testnet.privKey = walletObj.testnet.wallet.toBase58();\r\n walletObj.testnet.privKeyHex = walletObj.testnet.wallet.privateKey.toString(\"hex\");\r\n walletObj.testnet.wif = walletObj.testnet.wallet.toWIF();\r\n //remove these for a nicer display:\r\n delete walletObj.mainnet.wallet;\r\n delete walletObj.testnet.wallet;\r\n return (walletObj);\r\n}", "startObserving_wallet () {\n const self = this\n if (!self.wallet) {\n return\n }\n if (typeof self.wallet === 'undefined' || self.wallet === null) {\n throw Error('wallet undefined in start observing')\n }\n // here, we're going to store a bunch of functions as instance properties\n // because if we need to stopObserving we need to have access to the listener fns\n //\n // login success/fail\n self.wallet_EventName_booted_listenerFunction = function () {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_booted(),\n self.wallet_EventName_booted_listenerFunction\n )\n //\n self.wallet_EventName_errorWhileBooting_listenerFunction = function (err) {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_errorWhileBooting(),\n self.wallet_EventName_errorWhileBooting_listenerFunction\n )\n //\n // wallet label\n self.wallet_EventName_walletLabelChanged_listenerFunction = function () {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_walletLabelChanged(),\n self.wallet_EventName_walletLabelChanged_listenerFunction\n )\n // wallet swatch\n self.wallet_EventName_walletSwatchChanged_listenerFunction = function () {\n self._configureUIWithWallet__color()\n }\n self.wallet.on(\n self.wallet.EventName_walletSwatchChanged(),\n self.wallet_EventName_walletSwatchChanged_listenerFunction\n )\n // balance\n self.wallet_EventName_balanceChanged_listenerFunction = function () {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_balanceChanged(),\n self.wallet_EventName_balanceChanged_listenerFunction\n )\n {\n const emitter = self.context.CcyConversionRates_Controller_shared\n self._CcyConversionRates_didUpdateAvailabilityOfRates_fn = function () {\n self._configureUIWithWallet__labels()\n }\n emitter.on(\n emitter.eventName_didUpdateAvailabilityOfRates(),\n self._CcyConversionRates_didUpdateAvailabilityOfRates_fn\n )\n }\n {\n const emitter = self.context.settingsController\n self._settingsController__EventName_settingsChanged_displayCcySymbol__fn = function () {\n self._configureUIWithWallet__labels()\n }\n emitter.on(\n emitter.EventName_settingsChanged_displayCcySymbol(),\n self._settingsController__EventName_settingsChanged_displayCcySymbol__fn\n )\n }\n }", "async function initiateTransaction(req) {\n let bookingId = req.body.bookingId;\n let amount = req.body.amount;\n let conventionalCharges = req.body.conventionalCharges;\n let auth = req.body.auth;\n let book = await bookingBl.getBookingById(bookingId, req);\n let booking = book.records[0];\n\n let hdfcCredentials = await PaymentSetting.findOne({\n divId: booking.divId,\n platform: config.HDFC_SETTINGS,\n paymentProvider: \"hdfc\"\n });\n\n let postUrl = hdfcCredentials.url;\n\n let data = {};\n data.mode = \"Online\",\n data.amount = amount,\n data.conventionalCharges = conventionalCharges,\n data.transactionId = \"\",\n data.bookingId = bookingId,\n data.providerResponse = {},\n data.status = \"Initiated\".toUpperCase(),\n data.bankRef = \"\",\n data.refNo = \"\",\n data.paymentPartner = \"Hdfc\";\n\n let response = await paymentBl.createNewPayment(data, req);\n let paymentId = response._id;\n\n let hashUrl = `merchant_id=${hdfcCredentials.merchantId}&order_id=${paymentId}&currency=INR&amount=${amount}&redirect_url=${hdfcCredentials.responseUrl}&cancel_url=${hdfcCredentials.responseUrl}&language=EN&billing_te=${booking.customerDetails.phoneNo}&billing_email=${booking.customerDetails.email}&merchant_param1=${bookingId}&merchant_param2=${paymentId}&merchant_param3=${auth}`;\n\n let body = '',\n workingKey = hdfcCredentials.workingKey,\n accessCode = hdfcCredentials.accessCode,\n encRequest = '',\n formbody = '';\n body += hashUrl.toString();\n encRequest = await encrypt(body, workingKey);\n\n formbody = '<form id=\"nonseamless\" method=\"post\" name=\"redirect\" action=\"'+postUrl+'\"/> <input type=\"hidden\" id=\"encRequest\" name=\"encRequest\" value=\"' + encRequest + '\"><input type=\"hidden\" name=\"access_code\" id=\"access_code\" value=\"' + accessCode + '\"><script language=\"javascript\">document.redirect.submit();</script></form>';\n\n\n return formbody;\n}", "async storeNewSubmittedTransferData(txHash, addressTo, balancePaymentId, tokenAmount)\n {\n\n var blockNumber = await this.getEthBlockNumber();\n\n\n var balanceTransferData = {\n addressTo: addressTo,\n balancePaymentId: balancePaymentId,\n tokenAmount: tokenAmount,\n txHash: txHash,\n block:blockNumber,\n confirmed: false\n }\n\n console.log('Storing new submitted transfer data',('balance_transfers:'+addressTo.toString()),balanceTransferData)\n\n //helps audit payouts\n //this guy never gets updated and so should not be used\n await this.redisInterface.pushToRedisList(('balance_transfers:'+addressTo.toString()), JSON.stringify(balanceTransferData) )\n\n\n await this.redisInterface.storeRedisHashData('balance_transfer',balancePaymentId, JSON.stringify(balanceTransferData) )\n\n }", "function Wallet () {\n this.hdWallet = null\n this.numberOfFctAddresses = 0\n this.addresses = []\n this.mnemonic = ''\n}", "function create_transaction(){\n\n var data_sent = {\n input_address: bitcoin_address,\n output_address:$(\"[name='recipient-bitcoin-address']\").val(),\n value: parseInt($(\"[name='amount']\").val())\n };\n\n unsigned_transaction={}\n ajaxPost('/blockcypher/create_transaction',JSON.stringify(data_sent), function(response){\n unsigned_transaction = response;\n $(\"#tosign-data\").text(unsigned_transaction.tosign[0]);\n $(\"#step-2\").removeAttr('hidden');\n\n\n },function(error){\n showError(error);\n });\n}", "async transferFunds({request,response,auth}){\n const data = request.only(['email','amount','pin']) \n \n const validation = await validateAll(data, {\n email :'required|email',\n amount :'required',\n pin:'required',\n })\n\n if(validation.fails()){\n return response.status(400).json({\n messag:validation.messages()\n })\n }\n\n var {email,amount:amount_to_send_from_client,pin} = data\n\n //get id of the client from email\n const {id:user_id_client} = await User.findBy('email',email)\n \n // get the pin from client\n var {pin:pin_from_db,balance:client_balance_from_db} = await Client.findBy('user_id',user_id_client)\n\n // if client has no pin set\n if(pin_from_db == null){\n return response.status(200).json({message: \"Invalid Transaction\"})\n }\n //if pin is invalid\n if(pin != pin_from_db ){\n return response.status(200).json({message: \"Invalid pin\"})\n }\n\n //if balance is insufficient\n if( parseFloat(amount_to_send_from_client) > parseFloat(client_balance_from_db) ){\n return response.status(200).json({message: \"Insufficient fund\"})\n }\n\n // check for if client is sending to Client \n \n // Debit Client\n const new_client_balance = parseFloat(client_balance_from_db) - parseFloat(amount_to_send_from_client)\n\n await Client.query().where('user_id',user_id_client).update({balance:parseFloat(new_client_balance)})\n \n \n // Credit Merchant\n const user = await auth.getUser() \n\n const {balance:merchant_balance_from_db,user_id:user_id_merchant} = await user.merchant().fetch()\n\n const new_merchant_balance = parseFloat(merchant_balance_from_db) + parseFloat(amount_to_send_from_client)\n\n await Merchant.query().where('user_id',user_id_merchant).update({balance:parseFloat(new_merchant_balance)})\n\n //add record in Transfer Table\n var timestamp = new Date().getTime()\n var amount = amount_to_send_from_client\n var sender_id = user_id_client\n var reciever_id = user_id_merchant\n const transfer_details ={amount,sender_id,reciever_id,timestamp}\n await Transfer.create({...transfer_details})\n\n\n\n return response.status(200).json({message:\"Transaction Successfull\"})\n\n\n }", "async function main(){\n // return 0;\n accounts = await web3.eth.getAccounts();\n \n //return 0;\n web3.eth.defaultAccount = accounts[1];\n address = web3.eth.defaultAccount;\n \n tc = await new web3.eth.Contract(JSON.parse(JSON.stringify(abi)) ).deploy({ data: bytecode }).send({from:address , gas: '1000000', value: '2000000000'} );\n \n await tc.methods.setDataToDb(2 ,2 , \"Ahmad\", \"Khan\").send({from: accounts[0]}).then(transaction => {\n landModule.create({land_id: 2, age: 2, first_name: \"Ahmad\", last_name: \"Khan\"}, (err, resp) => {\n if(err) {\n console.log(error);\n }\n else {\n console.log('adeedeeeee');\n }\n });\n });\n await tc.methods.GetValue(2).call().then( function( value ) { console.log( \"Current Value: \", value ); } );\n}", "function create_account(sender_worker, username, password) {\n var new_guid = generate_random_id();\n var wr = { \n\t'guid': new_guid, \n\t'username': CryptoJS.SHA1(username).toString(), \n\t'password' : CryptoJS.SHA1(password).toString(),\n\t'version' : pii_vault.config.current_version \n }\n\n var r = request({\n\t url: \"http://woodland.gtnoise.net:5005/create_new_account\",\n\t content: JSON.stringify(wr),\n\t onComplete: function(response) {\n\t\tmy_log(\"Here here: Comepleted create-account response\", new Error);\n\t\tmy_log(\"Here here: Response status: \" + response.status, new Error);\n\t\tmy_log(\"Here here: Response status txt: \" + response.statusText, new Error);\n\t\tmy_log(\"Here here: Response text: \" + response.text, new Error);\n\t\tmy_log(\"Here here: Response json: \" + response.json, new Error);\n\t\tmy_log(\"Here here: Response headers: \" + response.headers, new Error);\n\n\t\tif (response.status == 200) {\n\t\t var data = response.text;\n\t\t if (data == 'Success') {\n\t\t\tsender_worker.port.emit(\"account-success\", {\n\t\t\t\ttype: \"account-success\", \n\t\t\t\t desc: \"Account was created successfully. You are now logged-in\"\n\t\t\t\t });\n\n\t\t\t//Reset pii_vault.\n\t\t\tpii_vault = { \"options\" : {}, \"config\": {}};\n\t\t\tpii_vault.guid = new_guid;\n\t\t\tmy_log(\"create_account(): Updated GUID in vault: \" + pii_vault.guid, new Error);\n\t\t\tvault_write(\"guid\", pii_vault.guid);\n\t\t\t\n\t\t\tcurrent_user = username;\n\t\t\tpii_vault.current_user = username;\n\t\t\tvault_write(\"current_user\", pii_vault.current_user);\n\t\t\t\n\t\t\tsign_in_status = 'signed-in';\n\t\t\tpii_vault.sign_in_status = 'signed-in';\n\t\t\tvault_write(\"sign_in_status\", pii_vault.sign_in_status);\n\t\t\t//GUID has changed, call init() to create new fields. Otherwise it\n\t\t\t//will not do anything.\n\t\t\tvault_init();\n\t\t\tmy_log(\"APPU DEBUG: Account creation was success\", new Error);\n\t\t\t//Just to report our status\n\t\t\tpii_check_if_stats_server_up();\n\t\t }\n\t\t else if (data.split(' ')[0] == 'Failed') {\n\t\t\tvar temp = data.split(' ');\n\t\t\ttemp.shift();\n\t\t\tvar reason = temp.join(' ');\n\n\t\t\tsender_worker.port.emit(\"account-failure\", {\n\t\t\t\ttype: \"account-failure\", \n\t\t\t\t desc: reason\n\t\t\t\t });\n\t\t\tmy_log(\"APPU DEBUG: Account creation was failure: \" + reason, new Error);\n\t\t }\n\t\t else {\n\t\t\tsender_worker.port.emit(\"account-failure\", {\n\t\t\t\ttype: \"account-failure\", \n\t\t\t\t desc: \"Account creation failed for unknown reasons\"\n\t\t\t\t });\n\t\t\tmy_log(\"APPU DEBUG: Account creation was failure: Unknown Reason\", new Error);\n\t\t }\n\t\t}\n\t\telse {\n\t\t //This means that HTTP response is other than 200 or OK\n\t\t print_appu_error(\"Appu Error: Account creation failed at the server: \" \n\t\t\t\t + response.toString() + \" @ \" + (new Date()));\n\n\t\t sender_worker.port.emit(\"account-failure\", {\n\t\t\t type: \"account-failure\", \n\t\t\t\tdesc: \"Account creation failed, service possibly down\"\n\t\t\t\t});\n\t\t my_log(\"APPU DEBUG: Account creation was failure: Unknown Reason\", new Error);\n\t\t}\n\t }\n\t});\n\n r.post();\n}", "async function main () {\n\n // Set up our RPC provider connections.\n const l1RpcProvider = new ethers.providers.JsonRpcProvider('https://eth-kovan.alchemyapi.io/v2/DjNrM2B5hxtPWLVfZu8ExupvxSoTigC6')\n const l2RpcProvider = new ethers.providers.JsonRpcProvider('https://kovan.optimism.io')\n\n // Set up our wallets (using a default private key with 10k ETH allocated to it).\n // Need two wallets objects, one for interacting with L1 and one for interacting with L2.\n // Both will use the same private key.\n const key = new ethers.Wallet.createRandom().privateKey\n const l1Wallet = new ethers.Wallet(key, l1RpcProvider)\n const l2Wallet = new ethers.Wallet(key, l2RpcProvider)\n\n // L1 messenger address depends on the deployment, this is default for our local deployment.\n const l1MessengerAddress = '0x48062eD9b6488EC41c4CfbF2f568D7773819d8C9'\n // L2 messenger address is always the same.\n const l2MessengerAddress = '0x4200000000000000000000000000000000000007'\n\n // Tool that helps watches and waits for messages to be relayed between L1 and L2.\n const watcher = new Watcher({\n l1: {\n provider: l1RpcProvider,\n messengerAddress: l1MessengerAddress\n },\n l2: {\n provider: l2RpcProvider,\n messengerAddress: l2MessengerAddress\n }\n })\n\n // Deploy an ERC20 token on L1.\n console.log('Deploying L1 ERC20...')\n const L1_ERC20 = await factory__L1_ERC20.connect(l1Wallet).deploy(\n 1234, //initialSupply\n 'L1 ERC20', //name\n { gasPrice: 0 }\n )\n await L1_ERC20.deployTransaction.wait()\n\n // Deploy the paired ERC20 token to L2.\n console.log('Deploying L2 ERC20...')\n const L2_ERC20 = await factory__L2_ERC20.connect(l2Wallet).deploy(\n l2MessengerAddress,\n 'L2 ERC20', //name\n { gasPrice: 0 }\n )\n await L2_ERC20.deployTransaction.wait()\n\n // Create a gateway that connects the two contracts.\n console.log('Deploying L1 ERC20 Gateway...')\n const L1_ERC20Gateway = await factory__L1_ERC20Gateway.connect(l1Wallet).deploy(\n L1_ERC20.address,\n L2_ERC20.address,\n l1MessengerAddress,\n { gasPrice: 0 }\n )\n await L1_ERC20Gateway.deployTransaction.wait()\n\n // Make the L2 ERC20 aware of the gateway contract.\n console.log('Initializing L2 ERC20...')\n const tx0 = await L2_ERC20.init(\n L1_ERC20Gateway.address,\n { gasPrice: 0 }\n )\n await tx0.wait()\n\n console.log(\"All contracts deployed!\")\n console.log(\"L1 ERC20 Address: \" + L1_ERC20.address)\n console.log(\"L2 ERC20 Address: \" + L2_ERC20.address)\n console.log(\"L1 ERC20 Gateway Address: \" + L1_ERC20Gateway.address)\n\n\n}", "postNewBlock() {\n this.app.post(\"/block\", (request, response) => {\n let contentType = request.headers['content-type'];\n if (!contentType || contentType.indexOf('application/json') !== 0) {\n response.status(403).json(this.constructError(\"Denied: Invalid contentType. use application/json.\"))\n }\n \n let blockData = request.body;\n console.log(\"Request body:\" + JSON.stringify(blockData));\n if(JSON.stringify(blockData) === JSON.stringify({})) {\n return response.status(500).json(this.constructError(\"ERROR:Invalid/Empty request body.\"));\n }\n\n // Check if wallet address is present\n if(blockData.address == undefined) {\n return response.status(500).json(this.constructError('ERROR: Invalid/Empty Wallet address.' ));\n }\n\n // check if star data is given in the request.\n if(blockData.star == undefined) {\n return response.status(500).json(this.constructError('ERROR: Invalid/Empty Star data.' ));\n }\n\n let walletAddress = blockData.address;\n let starData = blockData.star;\n\n console.log(walletAddress + \":Star:\"+ starData)\n\n // Now check if the validation is present for the wallet address.\n if(!this.mempoolController.hasValidation(walletAddress)) {\n return response.status(500).json(this.constructError('ERROR: Validation doesnt exist in mempool.' ));\n }\n\n // Here we can assume the data is present in the request and the validation exists in mempool.\n // Time to add the star data.\n if(starData.ra == undefined || starData.dec == undefined || starData.story == undefined) {\n return response.status(500).json(this.constructError('ERROR: Invalid/Incomplete star data.' ));\n } \n\n let star_obj = new star.star(starData);\n star_obj.encodeStory()\n blockData.star = star_obj\n\n this.mempoolController.removeValidationRequest(walletAddress);\n console.log(\"adding new block with text:\" + blockData);\n this.blockchain.addBlock(new privateChain.Block(blockData)).then((result) => {\n response.status(200).json(JSON.parse(result));\n })\n .catch((err) => {\n response.status(500).json(this.constructError('ERROR: Error while adding a new block'));\n }) \n });\n }", "function test() {\r\n\r\n\r\n var seed = Wallet.generateMnemonic();\r\n\r\n // seed = 'dragon accuse transfer cash help couch olive idea rotate unveil divert odor'\r\n seed = 'copper siren differ use like egg sight where spoon learn swamp swarm'\r\n\r\n var coinNames = ['bitcoin', 'litecoin', 'dogecoin', 'dashcoin', 'ethereum'];\r\n var pwd = '1';\r\n\r\n // Wallet.createInstance(seed, pwd, coinNames, function (wallet) {\r\n // console.log('Create Wallet instance ok')\r\n // });\r\n\r\n\r\n Wallet.createInstance(seed, 'password', coinNames, function(wallet) {\r\n console.log('Test create Wallet instance ok');\r\n\r\n // for (var i = 0; i < coinNames.length; i++) {\r\n // var address = wallet.getAddress(coinNames[i], 0);\r\n // var privKey = wallet.exportPrivateKey(coinNames[i], address);\r\n // console.log('%s: %s', address, privKey)\r\n // }\r\n\r\n // Test serialize and deserialize\r\n var json = wallet.serialize();\r\n var wallet2 = new Wallet();\r\n wallet2.deserialize(json);\r\n\r\n var json2 = wallet2.serialize();\r\n\r\n // Compare 2 serialization\r\n console.log('Test serialize and deserialize: ' + (json2.toString() == json.toString()))\r\n\r\n var address = wallet2.getAddress(coinNames[0], 0);\r\n var privKey = wallet2.exportPrivateKey(coinNames[0], address);\r\n\r\n // Test encrypt and decrypt\r\n var msg = '123123';\r\n Wallet.encryptString(msg, 'password', function(data) {\r\n Wallet.decryptString(data, 'password2', function(data) {\r\n console.log('Test encrypt and decrypt(wrong password): ' + (data != msg))\r\n })\r\n Wallet.decryptString(data, 'password', function(data) {\r\n console.log('Test encrypt and decrypt(right password): ' + (data == msg))\r\n })\r\n })\r\n\r\n //Test change password\r\n var newPassword = '123';\r\n wallet.changePassword('password', newPassword, newPassword, function(newWallet) {\r\n var address2 = wallet2.getAddress(coinNames[0], 0);\r\n var privKey2 = wallet2.exportPrivateKey(coinNames[0], address);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var oldPrivateKey = Encrypt.decryptString(privKey, derivedKey);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var newPrivateKey = Encrypt.decryptString(privKey2, derivedKey);\r\n\r\n console.log('Test change password: ' + (oldPrivateKey == newPrivateKey));\r\n });\r\n })\r\n });\r\n\r\n });\r\n\r\n}", "postNewBlock() {\n let self = this;\n self.app.post(\"/block\", (req, res) => {\n let address = req.body.address;\n\n if (!address || address.trim().length == 0) {\n res.status(400).send({ 'error': \"Invalid adress\" });\n return;\n }\n\n let validAddress = self.mempool.searchValidAdressByWallet(address);\n if (!validAddress || !validAddress.status.messageSignature) {\n res.status(400).send({ 'error': \"Invalid message signature\" });\n return;\n }\n\n let RA = req.body.star.ra;\n let DEC = req.body.star.dec;\n let MAG = req.body.star.mag;\n let CEN = req.body.star.cen;\n\n if (!RA || !DEC) {\n res.status(400).send({ 'error': \"Required RA and DEC\" });\n return;\n }\n\n let body = {\n address: req.body.address,\n star: {\n ra: RA,\n dec: DEC,\n mag: MAG,\n cen: CEN,\n story: Buffer.from(req.body.star.story, \"ascii\").toString('hex')\n }\n };\n let newBlock = new Block(body);\n\n self.blockchain.addBlock(newBlock).then((result) => {\n let block = JSON.parse(result);\n \n res.status(201).send(block);\n }).catch((err) => {\n console.error(err.stack);\n res.status(500).send({ 'error': 'Unexpected error occurred' });\n });\n });\n }", "onSetWallet({wallet_name = \"default\", create_wallet_password, brnkey, resolve}) {\n\n let p = new Promise(resolve => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\")\n throw new Error(\"Invalid wallet name\")\n\n if (this.state.current_wallet === wallet_name) {\n resolve()\n return\n }\n\n let add\n if (!this.state.wallet_names.has(wallet_name)) {\n let wallet_names = this.state.wallet_names.add(wallet_name)\n add = iDB.root.setProperty(\"wallet_names\", wallet_names)\n this.setState({wallet_names})\n }\n\n let current = iDB.root.setProperty(\"current_wallet\", wallet_name)\n\n resolve(Promise.all([add, current]).then(() => {\n // 在当前应用程序代码可以初始化其新状态之前,必须首先关闭并重新打开数据库。\n iDB.close()\n ChainStore.clearCache()\n BalanceClaimActiveStore.reset()\n // 当调用loadDbData时,Store可能会重置\n return iDB.init_instance().init_promise.then(() => {\n // 在调用CachedPropertyStore.reset()时确保数据库准备就绪\n CachedPropertyStore.reset()\n return Promise.all([\n WalletDb.loadDbData().then(() => AccountStore.loadDbData()),\n PrivateKeyActions.loadDbData().then(() => AccountRefsStore.loadDbData())\n ]).then(() => {\n // 在这里再次更新状态,以确保侦听器重新渲染\n\n if (!create_wallet_password) {\n this.setState({current_wallet: wallet_name})\n return\n }\n\n return WalletDb.onCreateWallet(\n create_wallet_password,\n brnkey, //brainkey,\n true, //unlock\n wallet_name\n ).then(() => this.setState({current_wallet: wallet_name}))\n })\n })\n }))\n }).catch(error => {\n console.error(error)\n return Promise.reject(error)\n })\n if (resolve) resolve(p)\n }", "async function createAccount() {\n // now there are 2 ways to generate account\n // 1. input private key and added to wallet\n // 2. input seedphrase and added to wallet\n\n // for better end-user experience, like meta-mask does, the working flow like this:\n // 1. give account a name, it should be done by app as shown to user, not sdk.\n // perhaps store it in localstorage or some front-end database\n\n const accountName = 'My First Account'\n\n // 2. ask user to input password and confirm again\n // if we pass the 2-times-validator\n // we then use the password later\n\n let password\n\n const passwordFirst = 'MyVeryStrongPassword'\n logOutPut('input password first time', passwordFirst)\n\n const passwordConfirmed = 'MyVeryStrongPassword'\n logOutPut('input password second time', passwordConfirmed)\n\n if (passwordFirst !== passwordConfirmed) {\n throw new Error('password is not correct')\n }\n\n password = passwordConfirmed\n\n logOutPut('Your password is', password)\n\n // 3. generate seed phrase, according to BIP-44, and ask user to write it down\n const seed = Wallet.generateMnemonic()\n\n // see log here:\n logOutPut('seed phrase created', seed)\n\n // 2. then add the seed phrase to wallet, each phrase can generate multiple accounts using index.\n // that actually create different private keys, however user don't want to remember them all.\n // we use 0 to use the first index according to BIP-39\n // please note that same seed and same index, generate same privateKey, which is constant.\n // just for example , we add one account each time.\n // note that the first account will be the signer of wallet\n\n const signer = harmony.wallet.addByMnemonic(seed, 0)\n\n // 3. now the account is created, but it is not encrypted yet, we use the password that user confirmed earlier.\n // how ever the encrypt process is async, because it may cause your app runs encryption.\n // we use `Wallet.encryptAccont(address:string, password:string)` to encrypt the account\n\n await harmony.wallet.encryptAccount(signer.address, password)\n\n // 4. now the private key is encrypted to keystore format.\n\n logOutPut('your private key is encrypted to KeyStore', signer.privateKey)\n\n logOutPut(\n 'Account.encrypted also show encryption state is:',\n signer.encrypted\n )\n\n // 5. you can print out Account address.\n\n logOutPut('Account address is:', signer.address)\n\n // 6. but to user, you had better show them checksumAddress\n\n logOutPut('Account checksumAddress is:', signer.checksumAddress)\n\n // 7. now you can save account name, account address to local storage.\n // note: NEVER store privatekey to local storage\n\n const accountInfo = {\n accountName,\n address: signer.checksumAddress\n }\n\n logOutPut('Account is to be saved:', accountInfo)\n\n // now if you want to get account instance from wallet\n // use Wallet.getAccount(address:string)\n // we just use accountInfo object above as query\n\n const foundAccount = harmony.wallet.getAccount(accountInfo.address)\n\n logOutPut('Account is found:', foundAccount)\n\n // whenever you want to encrypt an acount\n // use Wallet.decryptAccount(address:string,password:string)\n\n logOutPut('Signer is to encrypted:', harmony.wallet.signer.privateKey)\n\n await harmony.wallet.decryptAccount(\n harmony.wallet.signer.address,\n 'MyVeryStrongPassword'\n )\n\n logOutPut(\n 'Account is now decrypted, you got the private key:',\n harmony.wallet.signer.privateKey\n )\n\n // you can remove account from Wallet\n // but remember to delete localstorage as well\n // use Wallet.removeAccount(address:string)\n\n harmony.wallet.removeAccount(harmony.wallet.signer.address)\n\n logOutPut('wallet is cleaned up', harmony.wallet.accounts)\n}", "async function withdrawTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender);\n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: true,\n isWritable: true,\n },\n {\n // master pda\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n {\n // data storage pda\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeWithdrawInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "async createPO(ctx, buyerCRN, sellerCRN, drugName, quantity) {\n let errorMessage;\n let verifyBuyerOrRetailer = ctx.clientIdentity.getMSPID();\n //Verify if the function is called by either Buyer or Retailer.\n if (verifyBuyerOrRetailer === 'distributorMSP' || verifyBuyerOrRetailer === 'retailerMSP') {\n //Retrieving the buyer and seller details in an Array.\n let buyerDetails = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.company', buyerCRN);\n let sellerDetails = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.company', sellerCRN);\n let drugDetails = await this.getPartialKeyArray(ctx, 'org.pharma-network.pharmanet.lists.drug', drugName);\n //verifying if the Buyer and Seller and Drug are registered on the network\n if (buyerDetails.length !== 0 && sellerDetails.length !== 0 && drugDetails.length !== 0) {\n //converting the arrays into Json objects\n let buyerJsonObject = JSON.parse(buyerDetails[0]);\n let buyerName = buyerJsonObject.name;\n let sellerJsonObject = JSON.parse(sellerDetails[0]);\n let sellerName = sellerJsonObject.name;\n let buyerRole = buyerJsonObject.organisationRole;\n let sellerRole = sellerJsonObject.organisationRole;\n //Verifying the hirerachy of the Organisation\n if ((buyerRole === 'distributor' && sellerRole === 'manufacturer') || (buyerRole === 'retailer' && sellerRole === 'distributor')) {\n //Create a Request object to add the details of the PO on the blockchain\n let requestObject = {\n poId: {\n buyerCRN: buyerCRN,\n drugName: drugName\n },\n drugName: drugName,\n quantity: quantity,\n buyer: {\n buyerCRN: buyerCRN,\n buyerName: buyerName\n },\n seller: {\n sellerCRN: sellerCRN,\n sellerName: sellerName\n }\n };\n //Create the instance of the model class to save it to blockchain\n let poObj = PO.createInstance(requestObject);\n await ctx.poList.addPO(poObj);\n //returns the Jason object\n return poObj;\n } else {\n errorMessage = {\n message: 'Hierarchy of the organisation is not satisfied'\n }\n return errorMessage;\n }\n } else {\n errorMessage = {\n message: 'Please enter valid buyer and seller details'\n }\n return errorMessage;\n }\n } else {\n errorMessage = {\n message: 'Only Retailer or Distributor can create a Purchase Order'\n }\n return errorMessage;\n }\n }", "static transactionWithOutputs(senderWallet, outputs){\n const transaction = new this();\n transaction.outputs.push(...outputs);\n //creating the input object and creating a signature for it. The signature is generated from the public key in wallet\n Transaction.signTransaction(transaction, senderWallet);\n return transaction;\n }", "function addTransaction(tx) {\n\n\t // Get user's secret key\n\t keychain.requestSecret(id.account, id.username, function (err, secret) {\n\t if (err) {\n\t console.log(\"client: txQueue: error while unlocking wallet: \", err);\n\n\t return;\n\t }\n\n\t var transaction = ripple.Transaction.from_json(tx.tx_json);\n\n\t transaction.remote = network.remote;\n\t transaction.secret(secret);\n\n\t // If account is funded submit the transaction right away\n\t if ($scope.account.Balance) {\n\t transaction.submit();\n\t }\n\n\t // If not, add it to the queue.\n\t // (Will be submitted as soon as account gets funding)\n\t else {\n\t var item = {\n\t tx_json: tx.tx_json,\n\t type: tx.tx_json.TransactionType\n\t };\n\n\t // Additional details depending on a transaction type\n\t if ('TrustSet' === item.type) {\n\t item.details = tx.tx_json.LimitAmount;\n\t }\n\n\t $scope.userBlob.unshift(\"/txQueue\", item);\n\t }\n\t });\n\t }", "function saveEntireAmtState2() {\r\n console.log('Fetching all Intel AMT state, this may take a few minutes...');\r\n var transport = require('amt-wsman-duk');\r\n var wsman = require('amt-wsman');\r\n var amt = require('amt');\r\n wsstack = new wsman(transport, settings.hostname, settings.tls ? 16993 : 16992, settings.username, settings.password, settings.tls);\r\n amtstack = new amt(wsstack);\r\n amtstack.onProcessChanged = onWsmanProcessChanged;\r\n //var AllWsman = \"AMT_GeneralSystemDefenseCapabilities\".split(',');\r\n var AllWsman = \"AMT_8021xCredentialContext,AMT_8021XProfile,AMT_ActiveFilterStatistics,AMT_AgentPresenceCapabilities,AMT_AgentPresenceInterfacePolicy,AMT_AgentPresenceService,AMT_AgentPresenceWatchdog,AMT_AgentPresenceWatchdogAction,AMT_AlarmClockService,IPS_AlarmClockOccurrence,AMT_AssetTable,AMT_AssetTableService,AMT_AuditLog,AMT_AuditPolicyRule,AMT_AuthorizationService,AMT_BootCapabilities,AMT_BootSettingData,AMT_ComplexFilterEntryBase,AMT_CRL,AMT_CryptographicCapabilities,AMT_EACCredentialContext,AMT_EndpointAccessControlService,AMT_EnvironmentDetectionInterfacePolicy,AMT_EnvironmentDetectionSettingData,AMT_EthernetPortSettings,AMT_EventLogEntry,AMT_EventManagerService,AMT_EventSubscriber,AMT_FilterEntryBase,AMT_FilterInSystemDefensePolicy,AMT_GeneralSettings,AMT_GeneralSystemDefenseCapabilities,AMT_Hdr8021Filter,AMT_HeuristicPacketFilterInterfacePolicy,AMT_HeuristicPacketFilterSettings,AMT_HeuristicPacketFilterStatistics,AMT_InterfacePolicy,AMT_IPHeadersFilter,AMT_KerberosSettingData,AMT_ManagementPresenceRemoteSAP,AMT_MessageLog,AMT_MPSUsernamePassword,AMT_NetworkFilter,AMT_NetworkPortDefaultSystemDefensePolicy,AMT_NetworkPortSystemDefenseCapabilities,AMT_NetworkPortSystemDefensePolicy,AMT_PCIDevice,AMT_PETCapabilities,AMT_PETFilterForTarget,AMT_PETFilterSetting,AMT_ProvisioningCertificateHash,AMT_PublicKeyCertificate,AMT_PublicKeyManagementCapabilities,AMT_PublicKeyManagementService,AMT_PublicPrivateKeyPair,AMT_RedirectionService,AMT_RemoteAccessCapabilities,AMT_RemoteAccessCredentialContext,AMT_RemoteAccessPolicyAppliesToMPS,AMT_RemoteAccessPolicyRule,AMT_RemoteAccessService,AMT_SetupAndConfigurationService,AMT_SNMPEventSubscriber,AMT_StateTransitionCondition,AMT_SystemDefensePolicy,AMT_SystemDefensePolicyInService,AMT_SystemDefenseService,AMT_SystemPowerScheme,AMT_ThirdPartyDataStorageAdministrationService,AMT_ThirdPartyDataStorageService,AMT_TimeSynchronizationService,AMT_TLSCredentialContext,AMT_TLSProtocolEndpoint,AMT_TLSProtocolEndpointCollection,AMT_TLSSettingData,AMT_TrapTargetForService,AMT_UserInitiatedConnectionService,AMT_WebUIService,AMT_WiFiPortConfigurationService,CIM_AbstractIndicationSubscription,CIM_Account,CIM_AccountManagementCapabilities,CIM_AccountManagementService,CIM_AccountOnSystem,CIM_AdminDomain,CIM_AlertIndication,CIM_AssignedIdentity,CIM_AssociatedPowerManagementService,CIM_AuthenticationService,CIM_AuthorizationService,CIM_BIOSElement,CIM_BIOSFeature,CIM_BIOSFeatureBIOSElements,CIM_BootConfigSetting,CIM_BootService,CIM_BootSettingData,CIM_BootSourceSetting,CIM_Capabilities,CIM_Card,CIM_Chassis,CIM_Chip,CIM_Collection,CIM_Component,CIM_ComputerSystem,CIM_ComputerSystemPackage,CIM_ConcreteComponent,CIM_ConcreteDependency,CIM_Controller,CIM_CoolingDevice,CIM_Credential,CIM_CredentialContext,CIM_CredentialManagementService,CIM_Dependency,CIM_DeviceSAPImplementation,CIM_ElementCapabilities,CIM_ElementConformsToProfile,CIM_ElementLocation,CIM_ElementSettingData,CIM_ElementSoftwareIdentity,CIM_ElementStatisticalData,CIM_EnabledLogicalElement,CIM_EnabledLogicalElementCapabilities,CIM_EthernetPort,CIM_Fan,CIM_FilterCollection,CIM_FilterCollectionSubscription,CIM_HostedAccessPoint,CIM_HostedDependency,CIM_HostedService,CIM_Identity,CIM_IEEE8021xCapabilities,CIM_IEEE8021xSettings,CIM_Indication,CIM_IndicationService,CIM_InstalledSoftwareIdentity,CIM_KVMRedirectionSAP,CIM_LANEndpoint,CIM_ListenerDestination,CIM_ListenerDestinationWSManagement,CIM_Location,CIM_Log,CIM_LogEntry,CIM_LogicalDevice,CIM_LogicalElement,CIM_LogicalPort,CIM_LogicalPortCapabilities,CIM_LogManagesRecord,CIM_ManagedCredential,CIM_ManagedElement,CIM_ManagedSystemElement,CIM_MediaAccessDevice,CIM_MemberOfCollection,CIM_Memory,CIM_MessageLog,CIM_NetworkPort,CIM_NetworkPortCapabilities,CIM_NetworkPortConfigurationService,CIM_OrderedComponent,CIM_OwningCollectionElement,CIM_OwningJobElement,CIM_PCIController,CIM_PhysicalComponent,CIM_PhysicalElement,CIM_PhysicalElementLocation,CIM_PhysicalFrame,CIM_PhysicalMemory,CIM_PhysicalPackage,CIM_Policy,CIM_PolicyAction,CIM_PolicyCondition,CIM_PolicyInSystem,CIM_PolicyRule,CIM_PolicyRuleInSystem,CIM_PolicySet,CIM_PolicySetAppliesToElement,CIM_PolicySetInSystem,CIM_PowerManagementCapabilities,CIM_PowerManagementService,CIM_PowerSupply,CIM_Privilege,CIM_PrivilegeManagementCapabilities,CIM_PrivilegeManagementService,CIM_ProcessIndication,CIM_Processor,CIM_ProtocolEndpoint,CIM_ProvidesServiceToElement,CIM_Realizes,CIM_RecordForLog,CIM_RecordLog,CIM_RedirectionService,CIM_ReferencedProfile,CIM_RegisteredProfile,CIM_RemoteAccessAvailableToElement,CIM_RemoteIdentity,CIM_RemotePort,CIM_RemoteServiceAccessPoint,CIM_Role,CIM_RoleBasedAuthorizationService,CIM_RoleBasedManagementCapabilities,CIM_RoleLimitedToTarget,CIM_SAPAvailableForElement,CIM_SecurityService,CIM_Sensor,CIM_Service,CIM_ServiceAccessBySAP,CIM_ServiceAccessPoint,CIM_ServiceAffectsElement,CIM_ServiceAvailableToElement,CIM_ServiceSAPDependency,CIM_ServiceServiceDependency,CIM_SettingData,CIM_SharedCredential,CIM_SoftwareElement,CIM_SoftwareFeature,CIM_SoftwareFeatureSoftwareElements,CIM_SoftwareIdentity,CIM_StatisticalData,CIM_StorageExtent,CIM_System,CIM_SystemBIOS,CIM_SystemComponent,CIM_SystemDevice,CIM_SystemPackaging,CIM_UseOfLog,CIM_Watchdog,CIM_WiFiEndpoint,CIM_WiFiEndpointCapabilities,CIM_WiFiEndpointSettings,CIM_WiFiPort,CIM_WiFiPortCapabilities,IPS_AdminProvisioningRecord,IPS_ClientProvisioningRecord,IPS_HostBasedSetupService,IPS_HostIPSettings,IPS_IderSessionUsingPort,IPS_IPv6PortSettings,IPS_KVMRedirectionSettingData,IPS_KvmSessionUsingPort,IPS_ManualProvisioningRecord,IPS_OptInService,IPS_ProvisioningAuditRecord,IPS_ProvisioningRecordLog,IPS_RasSessionUsingPort,IPS_ScreenSettingData,IPS_SecIOService,IPS_SessionUsingPort,IPS_SolSessionUsingPort,IPS_TLSProvisioningRecord\".split(',');\r\n IntelAmtEntireStateProgress = 101;\r\n IntelAmtEntireStateCalls = 3;\r\n IntelAmtEntireState = { 'localtime': Date(), 'utctime': new Date().toUTCString(), 'isotime': new Date().toISOString() };\r\n amtstack.BatchEnum(null, AllWsman, saveEntireAmtStateOk2, null, true);\r\n amtstack.GetAuditLog(saveEntireAmtStateOk3);\r\n amtstack.GetMessageLog(saveEntireAmtStateOk4);\r\n\r\n}", "async prepareBaseTransaction(wallet) {\n const classicAddress = xrp_utils_1.default.decodeXAddress(wallet.getAddress());\n if (!classicAddress) {\n throw xrp_error_1.default.xAddressRequired;\n }\n const fee = await this.getMinimumFee();\n const accountData = await this.getAccountData(classicAddress.address);\n const openLedgerSequence = await this.getOpenLedgerSequence();\n const senderAccountAddress = new account_pb_1.AccountAddress();\n senderAccountAddress.setAddress(wallet.getAddress());\n const account = new common_pb_1.Account();\n account.setValue(senderAccountAddress);\n const lastLedgerSequence = new common_pb_1.LastLedgerSequence();\n lastLedgerSequence.setValue(openLedgerSequence + maxLedgerVersionOffset);\n const signingPublicKeyBytes = xpring_common_js_1.Utils.toBytes(wallet.publicKey);\n const signingPublicKey = new common_pb_1.SigningPublicKey();\n signingPublicKey.setValue(signingPublicKeyBytes);\n const transaction = new transaction_pb_1.Transaction();\n transaction.setAccount(account);\n transaction.setFee(fee);\n transaction.setSequence(accountData.getSequence());\n transaction.setLastLedgerSequence(lastLedgerSequence);\n transaction.setSigningPublicKey(signingPublicKey);\n return transaction;\n }", "addTransaction (params){\r\n return Api().post('/savetransaction', params)\r\n }", "function init_keys() {\n // funding_key = new bitcore.PrivateKey('75d79298ce12ea86863794f0080a14b424d9169f7e325fad52f60753eb072afc', network_name);\n set_funding_key(new bitcore.PrivateKey(network_name));\n client_key = new bitcore.PrivateKey(network_name);\n console.log(\"Funding address: \" + funding_address.toString());\n}", "function init() {\n self = {};\n fBalance = 0;\n if ( fAddress === undefined && fCryptPrivateKey === undefined ) {\n createNewAddress();\n }\n }", "async function connect() {\n try {\n // load the network configuration\n let ccp = JSON.parse(fs.readFileSync(config.conexionPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd()+'/esc_core/wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get(config.identityName);\n if (!identity) {\n console.log(`An identity for the user \"${config.identityName}\" does not exist in the wallet`);\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: config.identityName, discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork(config.channelName);\n\n // Get the contract from the network.\n contract = network.getContract(config.chaincodeName);\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "async function sendTx() {\n console.log('sending transaction...')\n txResponse = await wallet.sendTransaction(txData)\n const txReceipt = await txResponse.wait()\n console.log('\\nView Tx with Block Explorer:\\n', '\\nhttps://alfajores-blockscout.celo-testnet.org/search?q='+txReceipt.transactionHash+'\\n')\n}", "create (req, res) {\n const { btc_quantity, offer_price } = req.body\n const offer = new Offer({\n id: uuidv4(),\n client_id: config.get('app.name'),\n btc_quantity,\n offer_price,\n sequence: 1,\n availability: true\n })\n\n const keys = ed.createKeyPair(ed.createSeed())\n const opts = { keys }\n\n putMutable({ seq: offer.sequence, v: JSON.stringify(offer) }, opts, (error, hash) => {\n if (error) {\n return Responder.operationFailed(res, 'Error in Broadcasting the Offer')\n }\n const offerKey = new OfferKey({ offer_id: offer.id, keys, hash })\n\n OffersKeyList.addKey(offerKey)\n\n logger.info('An Order has been added to DHT!')\n logger.info(`Order Id: ${offer.id}, DHT Hash: ${hash}`)\n logger.info('Announcing in Network about new Order')\n\n announce(`ADD_OFFER:${hash}`, () => { })\n\n Responder.success(res, offer)\n })\n }", "async initLedger(ctx) {\n console.info('============= START : Initialize Ledger ===========');\n const supplyRequests = [\n {\n state: undefined,\n paid: false,\n itemId: 'ITEM1',\n amount: 0,\n isInBudget: true,\n },\n ];\n\n for (let i = 0; i < supplyRequests.length; i++) {\n supplyRequests[i].docType = 'request';\n await ctx.stub.putState('REQ' + i, Buffer.from(JSON.stringify(supplyRequests[i])));\n console.info('Added <--> ', supplyRequests[i]);\n }\n console.info('============= END : Initialize Ledger ===========');\n\n console.info('============= START : Initialize Ledger ===========');\n const items = [\n {\n type: 'chair',\n stock: 5,\n },\n {\n type: 'tables',\n stock: 3,\n },\n ];\n\n for (let i = 0; i < items.length; i++) {\n items[i].docType = 'item';\n await ctx.stub.putState('ITEM' + i, Buffer.from(JSON.stringify(items[i])));\n console.info('Added <--> ', items[i]);\n }\n console.info('============= END : Initialize Ledger ===========');\n }", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\nhdPrivateKey.network = bitcore.Networks.get(\"openchain\");\nvar derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\nconsole.log(\"Passphrase is: \" + code.toString() + \"\\nWalletID: \" + derivedKey.privateKey.toAddress().toString());\n\n}", "registerAccount(traderName, traderEmail, traderPassword) {\n var registration = new Registration(traderName, traderEmail, traderPassword);\n\n // Validate Credentials\n let obj = registration.validateCredentials(traderEmail, traderName, traderPassword);\n if (obj.Bool == false)\n return obj;\n\n // Complete Registration\n const words = Buffer.from(Registration.generateWords(), 'utf8').toString('hex'); // Store this, fuck aughttt\n let walletID = registration.createWalletID(words, traderPassword); // get the first hash (secret)\n console.log(\"Please keep this walletID secret \" + walletID + ' ' + words + ' ' + traderPassword);\n registration.storeCredentials(registration, words);\n const reg = (registration.createIdentity(traderName, \"50000\", walletID)) ? true : false;\n if (reg == true)\n return {\n Bool: true,\n Message: \"Registration Successful\"\n };\n\n return {\n Bool: false,\n Message: \"Registratiion Failed\"\n };\n }", "function newWithdrawal(uid, wallet, amount, immed, password) {\n const { isNumeric } = validator;\n\n var validate = WAValidator.validate(wallet, 'bitcoin');\n\n if (!validate) {\n return sendToClient('Please enter valid wallet address.');\n }\n\n if(!isNumeric(amount)){\n return sendToClient('Please check your inputs.');\n }\n\n if(amount == 0 || amount < 10){\n return sendToClient('Please check your inputs.');\n }\n\n //Validate password\n\n User.getPasswordFromId(uid, (hash) => {\n // Compare the password entered to the hash from the database\n authentication.comparePassword(password, hash, (match) => {\n\n if(!match){\n return sendToClient('Your password not match with your account!');\n }\n\n // Get the user bits\n User.getUserBits(uid, (result) => {\n\n // Set User Bits\n var setNumber = numeral();\n setNumber.set(result);\n const cash = setNumber._value;\n\n // Set Amount\n var setAmount = numeral();\n setAmount.set(amount);\n const amountRequested = setAmount._value;\n\n // Plus immediately with requested amount\n var setImmed = numeral(immed);\n var addImmed = setImmed.add(amountRequested);\n\n // Get The full amount want to withdrawl\n const fullAmount = addImmed._value;\n\n //if user not have enough cash\n if (cash === 0 || amount > cash) {\n return sendToClient('Your cash is not enough.');\n }\n\n var newCash = cash - fullAmount;\n var finalAmount = fullAmount;\n\n finalAmount = convertToBits(finalAmount);\n\n bc.sendToAddress(wallet, finalAmount, uid, function (err, res) {\n if (!err) {\n //Save Withdrawl\n console.log('res is: ', res)\n Withdrawl.create(uid, fullAmount, wallet, res, Date.date, () => {\n User.reduceUserCash(uid, newCash, (result) => {\n if(result){\n return sendToClient('Your Withdrawl Request was sended.');\n }\n });\n });\n\n }\n else {\n return sendToClient('Please Try again later.');\n }\n });\n\n });\n\n\n })\n })\n }", "function Account() {\n var backend = void 0,\n localstorage = APP.localstorage,\n tooltip = void 0,\n transaction = void 0,\n monero_price = 0,\n balance = 0,\n unlocked_balance = 0,\n base = 10000000000,\n walletName = void 0,\n blockchainheight = 0,\n wallet_address = '',\n keys = void 0;\n\n var j_current_balance = $('.current_balance');\n var j_current_usd = $('#current_usd');\n var j_wallet_address = $('.wallet-address');\n var import_btn = $('#import-transactions');\n var rescan_btn = $('#rescan');\n var height_input = $('#import-height');\n var table = $('#transactions-table');\n var import_progress = $('#import-progress');\n var clear_cache = $('#clear-cache');\n\n //send\n var send_btn = $('#try-send-transaction');\n var send_address = $('#send-address');\n var send_amount = $('#send-amount');\n var send_payment_id = $('#send-payment-id');\n\n //tootlip\n var tt_id = $('#tx-id');\n var tt_fee = $('#tx-fee');\n var tt_confirmations = $('#tx-confirmations');\n var tt_mixin = $('#tx-mixin');\n\n function onInit() {\n\n keys = localstorage.get('keys');\n transaction = new _transaction.Transaction();\n\n // walletName = localstorage.get('walletName');\n\n backend = new _backend.Backend();\n\n wallet_address = JSON.parse(localstorage.get('keys')).public_addr;\n\n // changelly.getCurrencies().then((data) => {\n // console.log(data);\n // updateCurrencyList(data.result);\n // });\n\n backend.get_monero_price().then(function (data) {\n monero_price = data[0].price_usd;\n updateView();\n });\n\n j_wallet_address.val(wallet_address);\n\n getTransactionsData();\n\n new _tabs.Tabs('.account', { 'wallet': 0, 'transactions': 1, 'send': 2, 'exchange': 3 });\n // new Copy('#copy-exchange-address','#exchange-address');\n new _copy.Copy('#copy-wallet-address', '#wallet-address');\n new _qrcode.QR('#qrcode', '#exchange-address');\n new _qrcode.ToggleQR('#toggle-qr', '#wallet-address');\n var exchange = new _exchange.Exchange(wallet_address);\n new _loading.Loading('#transaction-load', function () {\n console.log('transactions loaded!');\n showMockTransactions();\n });\n\n new _validator.Validator('#try-send-transaction', '#send-transaction');\n // new Validator('#to-exchange','.exchange-data', ()=>{\n // exchange.go();\n // });\n\n tooltip = new _tooltip.Tooltip('[data-transaction-id]', 'data-transaction-id', getTransactionDetail, function (hash, data) {\n var txs = JSON.parse(localstorage.get('txs'));\n var tx = txs.find(function (el) {\n return el.txid === hash;\n });\n console.log(txs);\n var mixin = data.rctsig_prunable.MGs[0].ss.length - 1;\n var confirmations = blockchainheight - tx.height;\n var split_hash = hash.substr(0, 32) + '<br>' + hash.substr(32);\n\n tt_id.html(split_hash);\n tt_fee.text(tx.fee / 1000000000000 + ' XMR');\n tt_mixin.text(mixin);\n tt_confirmations.text(confirmations);\n });\n\n import_btn.on('click', function () {\n importWalletFromHeight();\n });\n\n send_btn.on('click', function () {\n makeTransaction();\n });\n\n var rescan_interval = setInterval(function () {\n rescanBlockchain();\n }, 10000);\n\n setInterval(function () {\n backend.get_height().then(function (data) {\n blockchainheight = data.result.count;\n console.log('curr blockchain height:', blockchainheight);\n });\n }, 45000);\n backend.get_height().then(function (data) {\n blockchainheight = data.result.count;\n console.log('curr blockchain height:', blockchainheight);\n });\n\n rescan_btn.on('click', rescanBlockchain);\n\n clear_cache.on('click', function () {\n localstorage.clear();\n window.location.href = '/';\n });\n\n updateView();\n }\n\n function getBalance() {\n\n var txs = JSON.parse(localstorage.get('txs'));\n console.log(txs);\n\n var _balance = txs.reduce(function (res, el) {\n switch (el.type) {\n case 'in':\n res += el.amount;\n break;\n case 'out':\n res -= el.amount + el.fee;\n break;\n }\n return res;\n }, 0);\n balance = Math.round(_balance / base) / 100;\n updateView();\n // backend.get_balance().then((data)=>{\n // balance = Math.round(data.result.balance/base)/100;\n // unlocked_balance = Math.round(data.result.unlocked_balance/base)/100;\n // if(balance > 0 && unlocked_balance === 0){\n // alert('All your balance locked! Wait ~15 minutes');\n // }\n // updateView();\n // getTransactionsData(); //TODO: to debug, remove later\n // });\n }\n\n function importWalletFromHeight() {\n\n var height = height_input.val();\n height = height == '' ? 1 : parseInt(height);\n var keys = JSON.parse(localstorage.get('keys'));\n //mock keys for test: //TODO: remove on production\n keys.public_addr = '9w7UYUD35ZS82ZsiHus5HeJQCJhzJiMRZTLTsCYCGfUoahk5PJpfKpPMvsBjteE3EW3Xm63t4ibk1ihBdjYjZn6KAjH2oSt';\n keys.view.sec = 'c53e9456ca998abc13cfc9a4c868bbe142ef0298fcf6b569bdf7986b9d525305';\n keys.spend.sec = '0da41a4648265e69701418753b610566ae04f0bbee8b815e3e4b99a69a5bd80d';\n import_btn.text('Importing...');\n var progress = '';\n var update_interval = void 0;\n\n setTimeout(function () {\n var socket = io('http://localhost:3335/');\n\n update_interval = setInterval(function () {\n import_progress.text(progress);\n }, 1000);\n socket.on('progress', function (data) {\n // console.log(data);\n // import_progress.text(data.progress);\n progress = data.progress;\n });\n socket.on('imported', function (data) {\n clearInterval(update_interval);\n localstorage.set('walletStatus', 'imported');\n console.log('from imported event', data.walletName);\n // getTransactionsData();\n // import_btn.text('Imported!');\n // socket.close();\n import_progress.text('');\n getTransactionsData();\n import_btn.text('Imported!');\n\n socket.close();\n });\n // socket.on('disconnect',()=>{\n // console.log('from disconnected event');\n // getTransactionsData();\n // import_btn.text('Imported!');\n // socket.close();\n // });\n }, 2000);\n\n backend.import_from_height(keys.public_addr, keys.spend.sec, keys.view.sec, height).then(function (data) {\n walletName = data.data;\n localstorage.set('walletName', data.data);\n backend.updateWalletName(data.data);\n\n // getTransactionsData();\n }).catch(function (e) {\n console.log('Cannot import wallet!', e);\n });\n }\n\n function rescanBlockchain() {\n backend.rescan_blockchain().then(function (data) {\n console.log('on rescan', data);\n updateTransactionTable(data);\n });\n }\n\n function getTransactionsData() {\n backend.get_transfers().then(function (data) {\n console.log(data);\n return data;\n }).then(updateTransactionTable);\n }\n\n function updateTransactionTable(txs_data) {\n $('.tr-generated').remove();\n var rows = txsDataToTableRows(txs_data);\n table.append(rows);\n tooltip.reinit();\n }\n\n function txsDataToTableRows(data) {\n var all = [];\n var restore_height = 0;\n var _in = data.result.in ? data.result.in : [];\n var _out = data.result.out ? data.result.out : [];\n var _pool = data.result.pool ? data.result.pool : [];\n var _pending = data.result.pending ? data.result.pending : [];\n var _failed = data.result.failed ? data.result.failed : [];\n var _all = _in.concat(_out, _pool, _pending, _failed);\n\n //eval restore height:\n if (_out.length > 0) {\n console.log('restore h out: ', _out);\n } else if (_in.length > 0) {\n console.log('restore h in: ', _in);\n } else {\n restore_height = blockchainheight;ll;\n }\n var local = [];\n\n if (localstorage.get('walletStatus') === 'imported') {\n var _local = JSON.parse(localstorage.get('txs'));\n local = _local.filter(function (el) {\n return _all.findIndex(function (tx) {\n return transaction.compare(tx, el);\n }) === -1;\n });\n }\n\n all = local.concat(_all);\n localstorage.set('txs', JSON.stringify(all));\n var rows = all.sort(function (a, b) {\n return -a.timestamp + b.timestamp;\n }).map(function (tx) {\n return transaction.generateTableRow(tx, monero_price);\n });\n getBalance();\n return rows;\n }\n\n function getTransactionDetail(tx) {\n return backend.get_transactions_info([tx]);\n // .then((data)=>{\n //\n // let txs = data.txs_as_json.map(JSON.parse);\n // console.log(txs);\n // });\n }\n\n function makeTransaction() {\n send_btn.attr('disabled', 'disabled');\n send_btn.text('Sending...');\n var address = send_address.val();\n var amount = parseFloat(send_amount.val()) * 1000000000000;\n var payment_id = send_payment_id.val();\n backend.make_transaction(address, amount, payment_id).then(function (data) {\n console.log(data);\n if (data.error) {\n send_btn.text(backend.translateWalletError(data.error));\n return;\n }\n send_btn.text('Success!');\n var tx_hash = data.result.tx_hash;\n // getTransactionDetail(tx_hash);\n }, function (error) {\n console.log(error);\n });\n }\n\n function updateView() {\n j_current_balance.text(balance);\n j_current_usd.text(Math.round(monero_price * balance));\n }\n\n //mockTransactions\n function showMockTransactions() {\n $('tr.hidden').removeClass('hidden');\n }\n\n onInit();\n}", "async handleFormEvent(event) {\n // stop default behaviour\n event.preventDefault();\n\n // collect form data\n let desired_link = event.target.desired_link.value;\n let bounty = event.target.bounty.value;\n let price_per = event.target.price_per.value;\n let private_key = \"5J8GwbXpAfgj89gSUH4j63uknX9vdsQBVXctjW2tDuuxgGfNvi2\";\n\n // prepare variables for the switch below to send transactions\n let actionName = \"\";\n let actionData = {};\n\n // define actionName and action according to event type\n switch (event.type) {\n case \"submit\":\n actionName = \"bidscreate\";\n actionData = {\n bidder: \"acmesuper\",\n desired_link: desired_link,\n bounty: bounty,\n price_per: price_per\n };\n break;\n default:\n return;\n }\n\n // eosjs function call: connect to the blockchain\n const eos = Eos({keyProvider: private_key, httpEndpoint: 'http://www.cookie-store.my.to:8888'});\n const result = await eos.transaction({\n actions: [{\n account: \"cookie.store\",\n name: actionName,\n authorization: [{\n actor: \"acmesuper\",\n permission: \"active\",\n }],\n data: actionData,\n }],\n });\n\n console.log(result);\n\n let payment_memo = result.transaction.transaction.actions[0].account + \" \" + result.transaction.transaction.actions[0].name;\n console.log(payment_memo);\n let payment_data = {from: \"acmesuper\", to: \"cookie.store\", quantity: bounty, memo: payment_memo};\n console.log(payment_data)\n\n const payment_result = await eos.transaction({\n actions: [{\n account: \"eosio.token\",\n name: \"transfer\",\n authorization: [{\n actor: \"acmesuper\",\n permission: \"active\",\n }],\n data: payment_data,\n }],\n });\n\n console.log(payment_result);\n\n this.getCookiesTable();\n }", "async function main() {\n const [deployer] = await ethers.getSigners();\n\n console.log(\"Deploying account:\", await deployer.getAddress());\n console.log(\n \"Deploying account balance:\",\n (await deployer.getBalance()).toString(),\n \"\\n\"\n );\n\n const NFTXV1Buyout = await ethers.getContractFactory(\"NFTXV1Buyout\");\n const v1Buyout = await upgrades.deployProxy(NFTXV1Buyout, [], {\n initializer: \"__NFTXV1Buyout_init\",\n });\n await v1Buyout.deployed();\n\n console.log(\"NFTXV1Buyout:\", v1Buyout.address);\n\n const ProxyController = await ethers.getContractFactory(\n \"ProxyControllerSimple\"\n );\n\n const proxyController = await ProxyController.deploy(v1Buyout.address);\n await proxyController.deployed();\n console.log(\"ProxyController address:\", proxyController.address);\n\n console.log(\"\\nUpdating proxy admin...\");\n\n await upgrades.admin.changeProxyAdmin(\n v1Buyout.address,\n proxyController.address\n );\n\n console.log(\"Fetching implementation addresses...\");\n\n await proxyController.fetchImplAddress({\n gasLimit: \"150000\",\n });\n\n console.log(\"Implementation address:\", await proxyController.impl());\n\n console.log(\"Transfering ownerships...\");\n await v1Buyout.transferOwnership(founderAddress);\n await proxyController.transferOwnership(founderAddress);\n\n console.log(\"\");\n}", "async function send() {\n // make sure `data` starts with 0x\n const contract = new caver.klay.Contract(LoonGEM.abi, '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF');\n const pebToken = caver.utils.toPeb(50000000, 'KLAY');\n const data = await contract.methods.transfer(receiverAddress, pebToken).encodeABI();\n\n const { rawTransaction: senderRawTransaction } = await caver.klay.accounts.signTransaction({\n type: 'FEE_DELEGATED_SMART_CONTRACT_EXECUTION',\n from: sender.address,\n to: '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF',\n data: data,\n gas: '3000000',\n value: 0,\n }, sender.privateKey);\n\n // signed raw transaction\n console.log(\"Raw TX:\\n\", senderRawTransaction);\n \n // send fee delegated transaction with fee payer information\n caver.klay.sendTransaction({\n senderRawTransaction: senderRawTransaction,\n feePayer: payer.address\n })\n .on('transactionHash', function (hash) {\n console.log(\">>> tx_hash for deploy =\", hash);\n })\n .on('receipt', function (receipt) {\n console.log(\">>> receipt arrived: \", receipt);\n })\n .on('error', function (err) {\n console.error(\">>> error: \", err);\n });\n}", "minePendingTransactions (miningRewardAddress) {\n \n //newBlock.previousHash = this.getLatestBlock().hash;\n let block = new Block(Date.now(), this.pendingTransactions);\n block.previousHash = this.getLatestBlock().hash;\n block.mineBlock(this.difficulty);\n \n console.log(\"Transaction block successfully mined.\");\n this.chain.push(block);\n \n this.pendingTransactions = [\n new Transaction(null, miningRewardAddress,this.miningReward )\n ]\n }", "mineTransactions() {\n //1. Retrieve the transaction pool's valid transaction\n const validTransactions = this.transactionPool.validTransaction();\n\n //2. Miner incentives, Miner rewards\n validTransactions.push(\n Transaction.rewardTransaction({ minerWallet: this.wallet })\n );\n\n //3. Add a block consisting of these transactions to the blockchain \n this.blockchain.addBlock({ transactions: validTransactions });\n\n //4. Broadcast the new updated blockchain\n this.pubsub.broadcastChain();\n\n //5. Clear the transaction pool\n this.transactionPool.clear();\n }", "_web3_send_funds(to, amount, pass){\r\n var core = this;\r\n\t\ttry{\r\n\t var abiArray = core._contract_abi;\r\n\t\t\tvar contractAddress = core._contract_address;\r\n\t\t\tlet privateKey = ethereumjs.Buffer.Buffer(ethereumjs.Util.toBuffer(\"0x\" + pass), 'hex');\r\n\r\n\t var count = core._web3.eth.getTransactionCount(core._wallet_address);\r\n\t var contract = core._web3.eth.contract(abiArray).at(contractAddress);\r\n\r\n\t\t \tlet gasData = JSON.parse(core._app_ret_buffer._gas_estimated_cost);\r\n\t let txParams = {\r\n\t\t\t\tdata: contract.transfer.getData(to, (amount * 100000000)),\r\n\t nonce: core._web3.toHex(count),\r\n\t gasPrice: core._web3.toHex(((parseInt(gasData.average) / 10) * core._wallet_txs_gas_multiplier) * 1000000000), // Multiple of 1000000000 produces Gwei level value\r\n\t gasLimit: core._web3.toHex(parseInt(gasData.average) * 10000),\r\n\t value: '0x0',\r\n\t to: contractAddress\r\n\t }\r\n\t let tx = new ethereumjs.Tx(txParams);\r\n\t tx.sign(privateKey);\r\n\t let serializedTx = tx.serialize().toString('hex');\r\n\r\n\t\t\tif(core._app_verbose) console.log(txParams);\r\n\r\n\t core._web3.eth.sendRawTransaction('0x' + serializedTx, function(err, hash) {\r\n\t if(!err){\r\n\t core._transaction_current_hash = hash;\r\n\r\n\t\t\t\t\t\t// Add TX record to tx_queue (app_conf) - this allows the app to track all pending tx\r\n\t\t\t\t\t\tcore._web3_create_pending_tx(amount, hash, -1, core._wallet_address, to, \"...\", (((parseInt(gasData.average) / 10) * core._wallet_txs_gas_multiplier) * 1000000000), 0);\r\n\r\n\t } else {\r\n\t\t\t\t\t\tconsole.log(\"An error has occured while processing transaction: \" + err);\r\n\t\t\t core._ui_event_portals(\"send_funds_failed\");\r\n\t }\r\n\t });\r\n\r\n\t\t\t// !important, gas cost must be nulled after the transaction\r\n\t\t\t// gas cost is checked for tx confirmation process\r\n\t\t\tcore._app_ret_buffer._gas_estimated_cost = null;\r\n\r\n\t\t} catch(err){\r\n\t\t\tconsole.log(\"An error has occured while processing transaction: \" + err);\r\n\t\t\tcore._ui_event_portals(\"send_funds_failed\");\r\n\t\t\tcore._app_ret_buffer._gas_estimated_cost = null;\r\n\t\t}\r\n\r\n }", "addBlock(){\r\n this.server.route({\r\n method: 'POST',\r\n path: '/block',\r\n handler: async (request, h) => {\r\n //Validates payload\r\n if(!request.payload){\r\n throw Boom.badRequest(\"You should provide a valid JSON request\");\r\n }\r\n //Checks address and star properties\r\n let address = request.payload.address;\r\n let star = request.payload.star;\r\n if(!address || address.length==0 || !star){\r\n throw Boom.badRequest(\"You should provide a valid address and star properties in the JSON request\");\r\n }\r\n let util = new Util();\r\n\r\n //validates star data\r\n let startValidation = util.validateStar(star);\r\n\r\n //if start validation is correctly passed the continues with the process\r\n if(startValidation==\"ok\"){\r\n //verifies that a valid request already exists in the mempool\r\n if(this.mempoolService.verifyAddressRequest(address)){\r\n\r\n //creates star object\r\n let starData = {address: address, star : new Star(star)};\r\n //creates a block\r\n let newBlock = new Block.Block(starData);\r\n //adds the block and saves it in the blockData variable\r\n let blockData = await BlockAPI.blockChain.addBlock(newBlock);\r\n blockData = JSON.parse(blockData);\r\n //decode the story data to return it to the user\r\n blockData.body.star.storyDecoded = hextoascii(blockData.body.star.story);\r\n\r\n //removes validation request\r\n this.mempoolService.removeValidRequest();\r\n\r\n //returns the response\r\n return h.response(blockData).code(201);\r\n }else{\r\n throw Boom.forbidden(\"A previous valid request wasn't found, please call /message-signature/validate with valid signature before saving a star.\");\r\n }\r\n }else{\r\n throw Boom.badRequest(startValidation);\r\n }\r\n }\r\n });\r\n }", "function saveUserAddress(device, wallet) {\n db.query(`INSERT INTO xwf_obyfit_user_challenge (device, wallet)\n VALUES (?,?)`, [device, wallet]);\n device.sendMessageToDevice(device, 'text', 'Your address is saved');\n device.sendMessageToDevice(device, 'text', \"Please send me your google id\");\n //toPlay.stackGame(device_address, wallet_address); // ask user to play\n}", "function contract_create(request, response, next) {\n console.log('Contract create');\n}", "function startOffer(data) {\n console.log('Sending offer to peer');\n vm.partnerId = data.receiver;\n pc.createOffer(localAndSendPvtMsg, handleCreateOfferError);\n }", "startNewGame() {\n if (this.lobyCorrect) {\n let bankerName = this.loby.bankerName;\n let password = this.loby.password;\n let process = this.bank.createTheBanker(bankerName, password);\n\n //Si el proceso de creacion fue sactifactorio se actualizan los datos\n if (process.result) {\n this.loby.bankerName = '';\n this.loby.password = '';\n this.loby.visibility = false;\n this.showView(this.views.dashboard.name)\n }\n\n this.saveBank();\n }//Fin de if\n }", "postNewBlock() {\n //Set Default response \n let response = {\n success: \"false\",\n message: \"Address and star are required\"\n };\n let registerFlag = false;\n let id = 0;\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: async(request, h) => {\n if(!(request.payload === null)){\n //Check to see if necessary data specified in payload.\n if(request.payload.address && request.payload.star) {\n if(this.mempoolValid.length > 0){\n //check if address is present in the mempoolvalid array\n let i = 0;\n this.mempoolValid.forEach(element => {\n if((element.status.address == request.payload.address) && !registerFlag){\n registerFlag = true;\n //get index of element to remove from mempoolValid after block is added.\n id = i;\n }\n i++;\n }); \n //If Address is verified\n if(registerFlag){\n let bc = this.blockchain;\n let star = request.payload.star;\n //Encode the star story\n star.story = Buffer.from(star.story).toString('hex');\n //Create the body of the block\n let body = {\n address: request.payload.address,\n star: {\n ra: star.ra,\n dec: star.dec,\n story: star.story\n }\n };\n //Add new block\n let block = new BlockClass.Block(body);\n await bc.addBlock(block).then((result) => {\n //check if block successfully added\n if(result){\n //return block\n response = block;\n\n //Remove from mempoolValid \n this.mempoolValid.splice(id, 1);\n }else{\n response = {\n success: \"false\",\n message: \"Error adding block to the blockchain\"\n };\n }\n }).catch(err => {\n response = {\n success: \"false\",\n message: \"Error adding block to the blockchain\"\n };\n });\n }else{\n //Address could not be verified\n response = {\n success: \"false\",\n message: \"Your address cannot be verified.\"\n };\n }\n } else {\n //if mempoolValid is empty\n response = {\n success: \"false\",\n message: \"No validations available.\"\n };\n } \n }\n }\n return response;\n }\n });\n }", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) {\n return this.okPressed = false;\n }\n\n if(!confirm(this._$filter(\"translate\")(\"EXCHANGE_WARNING\"))) {\n this.okPressed = false;\n return;\n }\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n });\n });\n\n var parameter = JSON.stringify({ip_address:this.externalIP,nem_address:this.address, btc_address:this.btc_sender, eth_address:this.eth_sender});\n this._$http.post(this.url + \"/api/sphinks\", parameter).then((res) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init(res);\n return;\n });\n }, (err) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "secondPass(ledger) {}", "function create(req,res) {\n\tlet cointype = req.params.cointype;\n\twalletService.create(cointype).then(function(new_address) {\n\t\tif (new_address.pk != null && new_address.addr != null) {\n\t\t\tres.send({status: true, data: new_address});\n\t\t} else {\n\t\t\tres.send({status: false, message: 'Sorry, Error while creating new ' + cointype.toUpperCase() + ' address.'});\n\t\t}\n\t}).catch(function(err) {\n\t\tres.send({status: false, message: 'Error in creation of the ' + cointype.toUpperCase() + ' address: ' + err});\n\t});\n\t\n}", "createPendingBlocks(privKey, address, balance, previous, subType, callback, accountCallback) {\n this.privKey = privKey\n this.previous = previous\n this.subType = subType\n this.pendingCallback = callback\n // check for pending first\n var command = {}\n command.action = 'pending'\n command.account = address\n command.count = this.state.maxPending\n command.source = 'true'\n command.sorting = 'true' //largest amount first\n command.include_only_confirmed = 'true'\n if (this.state.raw !== '') {\n command.threshold = this.state.raw\n }\n\n // retrive from RPC\n helpers.postDataTimeout(command,helpers.constants.RPC_SWEEP_SERVER)\n .then(function(data) {\n // if there are any pending, process them\n if (data.blocks) {\n // sum all raw amounts\n var raw = '0'\n Object.keys(data.blocks).forEach(function(key) {\n raw = helpers.bigAdd(raw,data.blocks[key].amount)\n })\n let nanoAmount = helpers.rawToMnano(raw)\n let pending = {count: Object.keys(data.blocks).length, raw: raw, NANO: nanoAmount, blocks: data.blocks}\n let row = \"Found \" + pending.count + \" pending containing total \" + pending.NANO + \" NANO\"\n this.inputToast = toast(row, helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.appendLog(row)\n\n // create receive blocks for all pending\n var keys = []\n // create an array with all keys to be used recurively\n Object.keys(pending.blocks).forEach(function(key) {\n keys.push(key)\n })\n\n this.processPending(pending.blocks, keys, 0)\n }\n // no pending, create final block directly\n else {\n if (parseInt(this.adjustedBalance) > 0) {\n this.processSend(this.privKey, this.previous, () => {\n accountCallback() // tell that we are ok to continue with next step\n })\n }\n else {\n accountCallback() // tell that we are ok to continue with next step\n }\n }\n }.bind(this))\n .catch(function(error) {\n this.handleRPCError(error)\n }.bind(this))\n }", "onSetWallet({\n wallet_name = \"default\",\n create_wallet_password,\n brnkey,\n resolve\n }) {\n var p = new Promise(res => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\") throw new Error(\"Invalid wallet name\");\n\n if (this.state.current_wallet === wallet_name) {\n res();\n return;\n }\n\n var add;\n\n if (!this.state.wallet_names.has(wallet_name)) {\n var wallet_names = this.state.wallet_names.add(wallet_name);\n add = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"wallet_names\", wallet_names);\n this.setState({\n wallet_names\n });\n }\n\n var current = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"current_wallet\", wallet_name);\n res(Promise.all([add, current]).then(() => {\n // The database must be closed and re-opened first before the current\n // application code can initialize its new state.\n idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].close();\n bitsharesjs__WEBPACK_IMPORTED_MODULE_8__.ChainStore.clearCache();\n stores_BalanceClaimActiveStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reset(); // Stores may reset when loadDbData is called\n\n return idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].init_instance().init_promise.then(() => {\n // Make sure the database is ready when calling CachedPropertyStore.reset()\n stores_CachedPropertyStore__WEBPACK_IMPORTED_MODULE_5__[\"default\"].reset();\n return Promise.all([stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadDbData().then(() => stores_AccountStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].loadDbData()), actions_PrivateKeyActions__WEBPACK_IMPORTED_MODULE_6__[\"default\"].loadDbData().then(() => stores_AccountRefsStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadDbData())]).then(() => {\n // Update state here again to make sure listeners re-render\n if (!create_wallet_password) {\n this.setState({\n current_wallet: wallet_name\n });\n return;\n }\n\n return stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].onCreateWallet(create_wallet_password, brnkey, //brainkey,\n true, //unlock\n wallet_name).then(() => this.setState({\n current_wallet: wallet_name\n }));\n });\n });\n }));\n }).catch(error => {\n console.error(error);\n return Promise.reject(error);\n });\n if (resolve) resolve(p);\n }", "function factory(options){\n\n options || (options = {});\n options.name || (options.name = 'reception_back_client');\n\n var department = options.department;\n var dns = options.dns;\n var switchboard = options.switchboard;\n var backclient = Device('core.box', {\n name:options.name\n })\n\n var warehouse = Warehouse();\n warehouse.switchboard = switchboard;\n warehouse.department = department;\n\n function handle(routingpacket, payload, callback){\n /*\n \n trigger the supply chain handler here\n \n */\n var req = Contract.request(payload);\n var res = Contract.response(function(){\n callback(res.toJSON());\n })\n\n process.nextTick(function(){\n warehouse(req, res, function(){\n res.send404();\n }) \n })\n \n }\n\n var backclient = Device('core.box', {\n name:options.name,\n department:department\n })\n\n backclient.switchboard = switchboard;\n backclient.warehouse = warehouse;\n\n backclient.plugin = function(done){\n\n /*\n \n the current back socket connections to the Receptions\n \n */\n var pool = {};\n var intervalids = {};\n\n /*\n \n the current routing status that we broadcast to the reception\n servers every second\n \n */\n var routing_table = {};\n\n function addconnection(message){\n var receptionsocketid = message.wireids.back;\n var socketaddress = message.back;\n\n var backsocket = Device('core.wire', {\n type:'router',\n direction:'connect',\n manual:true,\n address:socketaddress\n })\n\n var thissocketid = backsocket.identity;\n warehouse._socketid = thissocketid;\n\n setTimeout(function(){\n intervalids[message.id] = setInterval(function(){\n var routes = JSON.stringify({\n timestamp:new Date().getTime(),\n department:department,\n routes:warehouse.get_mounts(thissocketid)\n })\n process.nextTick(function(){\n backsocket.send([receptionsocketid, 'routing_table', routes]);\n });\n }, 1000); \n }, 500 + Math.round(Math.random()*500))\n\n backsocket.on('message', function(){\n var socketid = arguments[0];\n var request_id = arguments[1].toString();\n var routing_packet = arguments[2];\n var payload_packet = JSON.parse(arguments[3].toString());\n function respond(answer){\n backsocket.send([socketid, request_id, routing_packet, JSON.stringify(answer)]);\n }\n handle(routing_packet, payload_packet, respond);\n })\n\n process.nextTick(function(){\n backsocket.plugin();\n })\n }\n\n function removeconnection(message){\n var backsocket = pool[message.id];\n backsocket && backsocket.close();\n clearInterval(intervalids[message.id]);\n delete(intervalids[message.id]);\n delete(pool[message.id]);\n }\n\n /*\n \n listen for any reception servers arriving and going\n\n treat them as a common pool\n\n wrap the callbacks from the rpc servers with the actual socket\n to write back down\n \n */\n dns.listen('reception', addconnection, removeconnection);\n\n done();\n\n }\n\n backclient.mount = _.bind(warehouse.mount, warehouse);\n\n return backclient;\n}", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n $('#confirmation').modal({\n show: 'true'\n }); \n }", "fromMnemonic() {\n\n\t\tlet keystoreFromMnemonic = async ( _mnemonic, _passwd, _index = 0, _hdpath = \"m/44'/60'/0'/0/\") => {\n\t\t\n\t\t\tlet hdwallet = Wallet.hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_mnemonic));\n\n\t\t\tlet hdpath = _hdpath;\n\n\t\t\tlet wallet = hdwallet.derivePath(_hdpath + _index).getWallet();\n\n\t\t\tconst address = wallet.getAddressString();\n\n\t\t\t/*\n\t\t\t\tWe need the async block because of this function\n\t\t\t*/\n\t\t\tconst keystore = await wallet.toV3String(_passwd)\n\t\t\t\n\t\t\tfs.writeFile( this.path + address + \".json\" , keystore, (err) => {\n\t\t\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tconsole.log( \"OK: \" + address )\n\t\t\t})\n\t\t}\t\n\n\t\tlet hexstoreFromMnemonic = async ( _mnemonic, _passwd, _index = 0, _hdpath = \"m/44'/60'/0'/0/\") => {\n\t\t\t\n\t\t\tlet hdwallet = Wallet.hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_mnemonic));\n\n\t\t\tlet hdpath = _hdpath;\n\n\t\t\tlet wallet = hdwallet.derivePath(_hdpath + _index).getWallet();\n\n\t\t\tconst address = wallet.getAddressString();\n\n\t\t\tconst hexstore = Buffer.from(JSON.stringify({\n\n\t\t\t\t\"secret\" : wallet.getPrivateKeyString()\n\t\t\t}));\n\n\n\t\t\tfs.writeFile( this.path + address + \"-hex.json\" , hexstore, (err) => {\n\t\t\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tconsole.log( \"OK: \" + address )\n\t\t\t})\n\t\t}\n\n\t\t/*\n\t\t\tCreate a schema for user entry \n\t\t*/\n\t\tvar schema = {\n\t\t\t\n\t\t\tproperties: {\n\t\t\t\n\t\t\t\toutput \t: { description : 'Select output format \\n\\t (1) v3-keystore \\n\\t (2) hexadecimal', required: true },\n\n\t\t\t\tmnemonic : { description : 'PASTE your mnemonic', hidden : true, required: true },\n\n\t\t\t\tindex \t: { description : 'ENTER wallet index', hidden : false, required: true },\n\n\t\t\t\thdpath \t: { description : 'ENTER wallet hdpath \\n\\t default m/44\\'/60\\'/0\\'/0/', hidden : false, required : false },\n\t\t\n\t\t\t\t// only ask for password if we are building a v3-keystore\n\t\t\t\tpasswd \t: { \n\n\t\t\t\t\tdescription : 'ENTER your password', \n\n\t\t\t\t\thidden: true, \n\n\t\t\t\t\trequired: true,\n\t\t\t\t\t\n\t\t\t\t\task: function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn prompt.history('output').value == \"1\";\n\n\t\t\t\t\t}\n\t\t\t\t},\n\n\n\t\t\t\tverify \t: { \n\n\t\t\t\t\tdescription : 'RE-ENTER your password', \n\n\t\t\t\t\thidden: true, \n\n\t\t\t\t\trequired: true,\n\t\t\t\t\t\n\t\t\t\t\t// only ask for password if we are building a v3\n\t\t\t\t\task: function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn prompt.history('output').value == \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/*\n\t\t\tStart prompt. The user inputs desired private key, followed by password\n\t\t*/\n\t\tprompt.start();\n\n\t\tprompt.get(schema, function (err, result) {\n\n\t\t\tif (err) { return onErr(err); }\n\n\n\t\t\t/*\n\t\t\t\tv3 from mnemonic mode\n\t\t\t*/\n\t\t\tif ( result.output == \"1\") {\n\n\t\t\t\tif ( result.passwd == result.verify ){\n\n\t\t\t\t\tconsole.log( \"OK: generating keystore\")\n\n\t\t\t\t\tif ( result.hdpath == \"\" ) {\n\n\t\t\t\t\t\tconsole.log( \"OK: hdpath default \\\"m/44\\'/60\\'/0\\'/0/\\\" \")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tkeystoreFromMnemonic ( result.mnemonic, result.passwd, result.index );\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tconsole.log( \"OK: hdpath \\\"\" + result.hdpath + \"\\\"\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tkeystoreFromMnemonic ( result.mnemonic, result.passwd, result.index, result.hdpath );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\n\t\t\t\t\tconsole.log( \"ERROR: passwords do not match ... exiting.\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\thexadecimal from mnemonic mode\n\t\t\t*/\n\t\t\tif ( result.output == \"2\") {\n\n\t\t\t\tif ( result.hdpath == \"\" ) {\n\n\t\t\t\t\tconsole.log( \"OK: hdpath default \\\"m/44\\'/60\\'/0\\'/0/\\\" \")\n\t\t\t\t\t\n\t\t\t\t\thexstoreFromMnemonic ( result.mnemonic, result.passwd, result.index );\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t\t\t\n\t\t\t\t\thexstoreFromMnemonic ( result.mnemonic, result.passwd, result.index, result.hdpath );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tClear mnemonic from clipboard\n\t\t\t*/\n\t\t\tclipboardy.writeSync(\"\");\n\n\t\t});\n\n\t\tfunction onErr(err) {\n\t\t\tconsole.log(err);\n\t\t\treturn 1;\n\t\t}\n\t}", "processSend(privKey, previous, sendCallback) {\n let pubKey = nano_old.derivePublicKey(privKey)\n let address = nano.deriveAddress(pubKey, {useNanoPrefix: true})\n\n // make an extra check on valid destination\n if (this.state.validAddress && nano.checkAddress(this.state.address)) {\n this.inputToast = toast(\"Started transferring funds...\", helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.appendLog(\"Transfer started: \" + address)\n this.generateWork(previous, this.defaultSendPow, function(work) {\n // create the block with the work found\n let block = nano.createBlock(privKey, {balance:'0', representative:this.representative,\n work:work, link:this.state.address, previous:previous})\n // replace xrb with nano (old library)\n block.block.account = block.block.account.replace('xrb', 'nano')\n block.block.link_as_account = block.block.link_as_account.replace('xrb', 'nano')\n\n // publish block for each iteration\n let jsonBlock = {action: \"process\", json_block: \"true\", subtype:\"send\", watch_work:\"false\", block: block.block}\n helpers.postDataTimeout(jsonBlock,helpers.constants.RPC_SWEEP_SERVER)\n .then(function(data) {\n if (data.hash) {\n this.inputToast = toast(\"Funds transferred!\", helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.appendLog(\"Funds transferred: \"+data.hash)\n console.log(this.adjustedBalance + \" raw transferred to \" + this.state.address)\n }\n else {\n this.inputToast = toast(\"Failed processing block.\", helpers.getToast(helpers.toastType.ERROR_AUTO))\n this.appendLog(\"Failed processing block: \"+data.error)\n }\n sendCallback()\n }.bind(this))\n .catch(function(error) {\n this.handleRPCError(error)\n sendCallback()\n }.bind(this))}.bind(this)\n )\n }\n else {\n if (this.state.address !== '') {\n this.inputToast = toast(\"The destination address is not valid\", helpers.getToast(helpers.toastType.ERROR))\n }\n sendCallback()\n }\n }", "async initLedger(ctx){\n await ctx.stub.putState(\"Init\", \"Fasten Network Project\");\n return \"success\";\n }", "function tranferToMany(records, coin_type){\n return new Promise((resolve, reject)=>{\n var temp = {};\n var obj = null;\n for(var i=0; i < records.length; i++) {\n obj=records[i];\n if(!temp[obj.to_address]) {\n temp[obj.to_address] = obj;\n } else {\n temp[obj.to_address].value += obj.value;\n }\n }\n var result = [];\n for (var prop in temp)\n result.push(temp[prop]);\n var temp1 ={}\n var pars = [\"\"]\n result.forEach(element => {\n temp1[element.to_address] = parseFloat(element.value.toFixed(8));\n });\n pars.push(temp1)\n rpc.requestNode('walletpassphrase', [config.WALLET_PASSWORD, 15]); \n setTimeout(async function(){\n //send transaction\n var txn_id = await rpc.requestNode('sendmany', pars);\n if(txn_id){\n resolve(txn_id);\n }else{\n resolve(null)\n }\n },200)\n })\n}", "async makeDeposit({response,request,auth}){\n\n const { reference } = request.all() \n \n const validation = await validateAll( {reference},{reference:'required'});\n \n if (validation.fails()){\n return response.status(400).json({message:validation.messages()})\n }\n \n const paymentVerification = await Paystack.transaction.verify({reference})\n \n var {status,amount,gatewayresponse} = paymentVerification.data\n \n amount = parseFloat(amount)/100\n \n const user = await auth.getUser();\n \n const {id:user_id} = user \n \n const client_deposit = {user_id,amount,reference}\n \n if(status == \"success\"){\n // regiter Deposit in Deposit table\n const newDeposit = await Deposit.create({...client_deposit})\n \n const client_details = await user.client().fetch(); \n \n var {balance:amount_from_db} = client_details\n \n amount_from_db += amount\n \n //update the client amount\n await Client\n .query()\n .where ('user_id',user_id)\n .update({balance:parseFloat(amount_from_db)})\n \n \n return response.status(200).json({message:\"Top Up Successful\"})\n }\n else {\n return response.status(200).json({message:gatewayresponse})\n }\n \n }", "async function init () {\n // get info for ganache or hardhat testnet\n const provider = await new ethers.providers.JsonRpcProvider();\n //console.log(\"\\n\\nprovider\\n\\n\", provider);\n\n // the following 2 lines are used if contract is on rinkeby instead of ganache or hardhat testnet\n //let provider;\n //window.ethereum.enable().then(provider = new ethers.providers.Web3Provider(window.ethereum));\n\n const signer = await provider.getSigner()\n //console.log(\"\\n\\nsigner\\n\\n\", signer);\n const userAddress = await signer.getAddress();\n //console.log(\"\\n\\nuser address\\n\\n\", userAddress);\n\n // initialize shadow contract\n\n let AppInstance = null;\n // get the contract address from deployment to test network. Make sure it is the applicaton contract, not the oracle.\n const abi = AppContractJSON.abi;\n\n // Make sure you set this correctly after deployment or nothing will work!!!\n AppInstance = new ethers.Contract('0x5FbDB2315678afecb367f032d93F642f64180aa3', abi, signer);\n\n // listen for events\n filterEvents(AppInstance);\n\n return { AppInstance, signer }\n}", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "async function resumeTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(data.sender);\n const recepientaddress = new PublicKey(data.receiver);\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys:[\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeResumeInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "async createDevice(caller, deviceAddress = \"TEST_DEVICE_ADDRESS\", amount = 0) {\n const iTx = invokeScript({\n dApp: address(this.dapp_account),\n call: {\n function: \"createDevice\",\n args: [{ type: 'string', value: deviceAddress }, { type: 'integer', value: amount }]\n }\n }, caller);\n\n await broadcast(iTx)\n await waitForTx(iTx.id);\n this.dd('Device ' + deviceAddress + ' has been created in dApp | tx_id: ' + iTx.id)\n }", "function createTransactionObjectJson(){\n var transObject = {};\n // get the from and to account\n transObject.from = document.getElementById('send_from_account').value;\n transObject.to = document.getElementById('send_to_account_value').value;\n // Get the value in ether and convert to wie\n var valueInEther = document.getElementById('send_value_in_ether').value\n var valueInWei = web3.toWei(valueInEther,'ether');\n transObject.value = valueInWei;\n // set the gas and gasPrice\n if(document.getElementById('send_gas').value !== 'default')\n transObject.gas = document.getElementById('send_gas').value;\n if(document.getElementById('send_gas_price').value !== 'default')\n transObject.gasPrice = document.getElementById('send_gas_price').value;\n // set the data\n if(document.getElementById('send_data').value !== 'default'){\n // convert the ascii to hex\n var data = document.getElementById('send_data').value;\n transObject.data = web3.toHex(data);\n }\n // set the nonce\n if(document.getElementById('send_nonce').value !== 'default')\n transObject.nonce = document.getElementById('send_nonce').value;\n\n return transObject;\n}", "function claimButtonClicked() { \n console.log(\"ejecución 1\")\n web3.eth.getAccounts(function(error, accounts) { \n if (error) { \n console.log(error)\n return\n }\n //console.log(\"ejecución 2\")\n var account = web3.eth.defaultAccount;\n\n var starName = document.getElementById(\"star-name-input\").value;\n var starStory = document.getElementById(\"star-story-input\").value;\n var star_dec = document.getElementById(\"star-dec-input\").value;\n var star_mag = document.getElementById(\"star-mag-input\").value;\n var star_cent = document.getElementById(\"star-cent-input\").value;\n var star_token = document.getElementById(\"star-token-input\").value;\n\n\n\n starNotary.createStar(starName, starStory, star_dec, star_mag, star_cent, star_token, {from: account, gasLimit:\"5000000\"}, function (error, result) {\n if (!error) {\n document.getElementById(\"result\").innerHTML = \"Transaction: <a href='https://rinkeby.etherscan.io/tx/\"+result+\"' target='_blank'>\"+result+\"</a>\";\n document.getElementById(\"star-tx-input\").value = star_token = document.getElementById(\"star-token-input\").value;\n } else { \n console.log(error);\n console.log(\"errorrrr\");\n }\n });\n \n });\n \n}" ]
[ "0.6795212", "0.67434233", "0.66491395", "0.6545587", "0.6383956", "0.6288529", "0.62812907", "0.6272693", "0.6252663", "0.6245656", "0.6152518", "0.6132928", "0.6112114", "0.60959184", "0.6085097", "0.60662955", "0.60092795", "0.59285754", "0.59209657", "0.5903874", "0.5855193", "0.5804994", "0.57954973", "0.57855207", "0.57758635", "0.5770847", "0.57567674", "0.5731954", "0.57304966", "0.5725149", "0.5723472", "0.5690081", "0.56725323", "0.56675094", "0.5663292", "0.5629884", "0.562241", "0.5606312", "0.56037104", "0.5595295", "0.5594051", "0.55857444", "0.55828285", "0.5579772", "0.5577102", "0.55767107", "0.5573812", "0.5552849", "0.5552439", "0.5542784", "0.55321664", "0.55265456", "0.5520717", "0.5497603", "0.5486539", "0.5475567", "0.54695576", "0.54614526", "0.54606", "0.54497343", "0.5445607", "0.5444804", "0.54340345", "0.54316676", "0.543055", "0.54286593", "0.5423035", "0.54196155", "0.5413953", "0.5405976", "0.53987765", "0.5393094", "0.5388387", "0.5376498", "0.53637695", "0.53606796", "0.5360031", "0.5356995", "0.5356696", "0.5355918", "0.5355083", "0.53536206", "0.5349114", "0.53489983", "0.53481364", "0.53437483", "0.5341532", "0.533654", "0.5334561", "0.53336406", "0.53335106", "0.5333485", "0.5328034", "0.5327008", "0.5326546", "0.5326544", "0.53257704", "0.5320677", "0.5316453", "0.53136915" ]
0.64236265
4
walletName will not be used
function createSinglesigWallet(xPubKey, account, walletName, handleWallet) { var arrDefinitionTemplate = ["sig", { pubkey: '$pubkey@' + device.getMyDeviceAddress() }]; createWallet(xPubKey, account, arrDefinitionTemplate, walletName, null, handleWallet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addWallet() {}", "static generateWallet() {\n const wallet = EthereumJsWallet.generate();\n\n AnalyticsUtils.trackEvent('Generate wallet', {\n walletAddress: wallet.getAddressString(),\n });\n\n this.storeWallet(wallet);\n }", "setWalletName(store, { name }) {}", "removeWallet() {}", "function Wallet () {\n this.hdWallet = null\n this.numberOfFctAddresses = 0\n this.addresses = []\n this.mnemonic = ''\n}", "getWallet() {\r\n return this.wallet;\r\n }", "async addWallet() {\n // Validate and format address\n let newAddress = this.validateAddress();\n // Deactivate addressInput button\n this.addressInput.changeToDeactive();\n // Check if wallet already exists in list of wallets\n if (wallets.findWallet(this.name, newAddress) !== undefined) {\n communication.message('Address already included in database for this blockchain. Please try again.');\n } else {\n // Get financial data to check existence of account\n let walletFinancialData = await this.getWalletsFinancialData(this.name, [newAddress]);\n // Invalid address for blockchain\n if (walletFinancialData[newAddress].valid === false) {\n communication.message(\"Not a valid address on \" + this.name + \" blockchain. Please try again.\");\n // Valid address\n } else {\n communication.message('Verified.<br> Generating new wallet info for ' + this.name + ' blockchain.');\n // Generate a new Wallet instance based on the new address\n // - saves in wallets and also stores the summaryRange in the database\n await wallets.generateNewWallet(this, newAddress, true);\n // Set current wallet to new wallet\n wallets.processWalletSelection(this.name, newAddress);\n // Update wallets table\n wallets.updateWalletsTable();\n wallets.scrollToBottomOfTable();\n communication.message('Verified.<br> Click on LOAD DATA to obtain transactions from ' + this.name + ' blockchain.');\n }\n }\n }", "async onRegistrationBadWallet (walletAddressGiven) {\n return `${walletAddressGiven} is not a valid Public Key / wallet address`\n }", "constructor() {\r\n this.wallet = {\r\n bitcoin: {},\r\n ethereum: {}\r\n };\r\n this.crypto = '';\r\n }", "function createWallet(walletRPC, walletName, chain) {\n\twalletRPC.create_wallet(walletName, '')\n\t\t.then(new_wallet => {\n\t\t\tconsole.log(\"createWallet \" + walletName + \".key success\");\n\t\t\tchain(walletRPC, walletName)\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "getUserWallet() {\n return Api.get(\"/client/user-wallet\");\n }", "setActiveWallet(activeWallet){\n if (this.confirmMethodsArePresent(activeWallet)) {\n this.walletProvider = activeWallet\n } else if (Reflect.has(activeWallet, 'signPersonalMessage')) {\n this.walletProvider = activeWallet\n this.walletProvider.signMessage = activeWallet.signPersonalMessage\n }\n }", "getAddress() {\n return this.wallet.address;\n }", "getAddress() {\n return this.wallet.legacyAddress;\n }", "function inMyWallet() {\n console.log(currentWallet);\n walletValue.textContent = \"$\"+ parseInt(currentWallet.amount);\n}", "static getWallet() {\n const { privateKey } = store.getState();\n\n return EthereumJsWallet.fromPrivateKey(Buffer.from(privateKey, 'hex'));\n }", "function makeWallet(name) {\n const directory = `wallets/${name}`;\n makeDir(directory);\n pubcrypto.genkeys(name, directory);\n}", "@observable progressInfo: ProgressInfo;\n @observable derivationIndex: number = HARD_DERIVATION_START + 0; // assume single account\n error: ?LocalizableError;\n hwDeviceInfo: ?HWDeviceInfo;\n ledgerConnect: ?LedgerConnect;\n\n get defaultWalletName(): string {\n // Ledger doesn’t provide any device name so using hard-coded name\n return Config.wallets.hardwareWallet.ledgerNano.DEFAULT_WALLET_NAME;\n }", "function displayWallet() {\n if (localStorage.getItem('reddcoinWallet')) {\n $('#walletSwapInteract').trigger('click');\n }\n else {\n $('#createWalletSetup').trigger('click');\n }\n\n if (localStorage.getItem('reddcoinWallet') || localStorage.getItem('user')) {\n Reddcoin.popup.updateBalance();\n Reddcoin.popup.updateHistory();\n\n // TODO: SEARCH\n Reddcoin.popup.updateSend();\n Reddcoin.popup.updateAccount();\n Reddcoin.popup.updateReceive();\n }\n}", "restore(wallet_name = \"default\", wallet_object) {\n wallet_name = wallet_name.toLowerCase();\n return {\n wallet_name,\n wallet_object\n };\n }", "checkForWalletWithPriorLoadedData(wallet) {\n if (this.name === 'steem') {\n if (wallet.summaryRange.pairs.hasOwnProperty('hive')) {\n return wallets.findWallet('hive', wallet.address);\n }\n }\n return false;\n }", "function openWallet(wallet){\n\t// decrypted?\n\tif (wallet.substr(0,1) === '*'){\n\t\tif (!$('#watchKey').val()){\n\t\t\talert('Error: This wallet is encrypted, password required');\n\t\t\tloading(false);\n\t\t\treturn false;\n\t\t}\n\t\t// decrypt now\n\t\ttry {\n\t\t\tmasPubKey = CryptoJS.AES.decrypt(wallet.substr(1), $('#watchKey').val()).toString(CryptoJS.enc.Utf8);\n\t\t\tif(!masPubKey){\n\t\t\t\talert('Error: Incorrect password');\n\t\t\t\tloading(false);\n\t\t\t\treturn false;\n\t\t\t}\t\t\n\t\t} catch(e) {\n\t\t\talert('Error: Incorrect password');\n\t\t\tloading(false);\n\t\t\treturn false;\n\t\t}\n\t\tloadWallet(masPubKey);\t\n\t} else{\n\t\tloadWallet(wallet);\n\t}\n}", "function generateWallet() {\n var account = algosdk.generateAccount();\n var mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n return { account, mnemonic }\n}", "if (wallets.hasActiveWallet) {\n runInAction(() => {\n this.disableTransferFunds = false;\n });\n }", "async stop() {\n this._clear();\n await this.config.rpc.sendJsonRequest(\"stop_wallet\");\n }", "async function createWallet(){\r\n try{\r\n let account;\r\n account = web3.eth.accounts.create(web3.utils.randomHex(32));\r\n\r\n sendETH(account.address);//send eth to new address\r\n\r\n return({\"address\":account.address,\"key\":account.privateKey});\r\n }catch{\r\n return({\"address\" : \"ERROR\",\"key\" : \"error\"});\r\n }\r\n}", "setNewWallet(new_wallet) {\n this.setState({\n new_wallet\n });\n }", "addAccountFromMnemonic() {\n const existingAddresses = this.props.wallet.accounts.map(a => a.address)\n // Use a loop to try the next account in the derivation path\n for (let i = 0; i < 10; i++) {\n // This is the default path but explicitly stated here for clarity\n const derivePath = `m/44'/60'/0'/0/${i}`\n // Web3js doesn't support wallet creation from a mnemonic, so somewhat\n // redundantly we have to include ethersjs. Perhaps migrate everything\n // away from web3js to ethersjs or the functionality will be added to web3js\n // sometime in the future, see:\n // https://github.com/ethereum/web3.js/issues/1594\n let wallet\n try {\n wallet = ethers.Wallet.fromMnemonic(this.state.value.trim(), derivePath)\n } catch (error) {\n let errorMessage = error.message\n if (errorMessage === 'invalid mnemonic') {\n errorMessage = fbt(\n 'That does not look like a valid recovery phrase.',\n 'ImportScreen.invalidRecoveryPhraseError'\n )\n }\n this.setState({ error: String(errorMessage) })\n return false\n }\n if (!existingAddresses.includes(wallet.address)) {\n // Got an account we don't have, use that\n return wallet\n }\n }\n this.setState({\n error: 'Maximum addresses reached'\n })\n return false\n }", "exportAccount (address) {\n return null // disabled\n // const wallet = this._getWalletForAccount(address)\n // return Promise.resolve(wallet.getPrivateKey().toString('hex'))\n }", "function generateRandomHDWallet() {\n return ethers.Wallet.createRandom();\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = \"web3js_wallet\";\n}", "function saveWallet() {\n localStorage.setItem(\"currentWallet\", JSON.stringify(currentWallet));\n}", "async getWalletInfo() {\n return new Promise(async resolve => {\n const myWalletInfo = await this.wallet.getWalletInfo();\n resolve(myWalletInfo);\n });\n }", "function loadWallet() {\n if (!localStorage.getItem(\"currentWallet\")) {\n return;\n }\n currentWallet = JSON.parse(localStorage.getItem(\"currentWallet\"));\n}", "onSetWallet({wallet_name = \"default\", create_wallet_password, brnkey, resolve}) {\n\n let p = new Promise(resolve => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\")\n throw new Error(\"Invalid wallet name\")\n\n if (this.state.current_wallet === wallet_name) {\n resolve()\n return\n }\n\n let add\n if (!this.state.wallet_names.has(wallet_name)) {\n let wallet_names = this.state.wallet_names.add(wallet_name)\n add = iDB.root.setProperty(\"wallet_names\", wallet_names)\n this.setState({wallet_names})\n }\n\n let current = iDB.root.setProperty(\"current_wallet\", wallet_name)\n\n resolve(Promise.all([add, current]).then(() => {\n // 在当前应用程序代码可以初始化其新状态之前,必须首先关闭并重新打开数据库。\n iDB.close()\n ChainStore.clearCache()\n BalanceClaimActiveStore.reset()\n // 当调用loadDbData时,Store可能会重置\n return iDB.init_instance().init_promise.then(() => {\n // 在调用CachedPropertyStore.reset()时确保数据库准备就绪\n CachedPropertyStore.reset()\n return Promise.all([\n WalletDb.loadDbData().then(() => AccountStore.loadDbData()),\n PrivateKeyActions.loadDbData().then(() => AccountRefsStore.loadDbData())\n ]).then(() => {\n // 在这里再次更新状态,以确保侦听器重新渲染\n\n if (!create_wallet_password) {\n this.setState({current_wallet: wallet_name})\n return\n }\n\n return WalletDb.onCreateWallet(\n create_wallet_password,\n brnkey, //brainkey,\n true, //unlock\n wallet_name\n ).then(() => this.setState({current_wallet: wallet_name}))\n })\n })\n }))\n }).catch(error => {\n console.error(error)\n return Promise.reject(error)\n })\n if (resolve) resolve(p)\n }", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = 'web3js_wallet';\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = 'web3js_wallet';\n}", "function Wallet(accounts) {\n this._accounts = accounts;\n this.length = 0;\n this.defaultKeyName = 'web3js_wallet';\n}", "getApplePayMerchantName() {\n return this.getStorage('applePayMerchantName') || 'Digital Roadmap';\n }", "function MultisigWallet (account) {\n this.account = account\n this.unspents = []\n}", "function _updateWallet() {\r\n if (!_isEmpty(output)) {\r\n address.value = output.address;\r\n publickey.value = output.publicKey;\r\n privatekey.value = output.privateKey;\r\n }\r\n }", "constructor(params){\n\tthis.name = params || 'test';\n this.balance = INITIAL_BALANCE;\n this.keyPair = ChainUtil.genKeyPair();\n\t //usually the address\n this.publicKey = this.keyPair.getPublic().encode('hex');\n }", "function updatewallets() {\n //seclect the wallet from wallets array and update it\n var walletsArray = JSON.parse(localStorage.getItem(\"walletsArray\"));\n for (var i = 0; i < walletsArray.length; i++) {\n if (walletsArray[i].name == currentWallet.name) {\n walletsArray[i].amount = currentWallet.amount;\n }\n }\n // }\n localStorage.setItem(\"walletsArray\", JSON.stringify(walletsArray));\n}", "function test() {\r\n\r\n\r\n var seed = Wallet.generateMnemonic();\r\n\r\n // seed = 'dragon accuse transfer cash help couch olive idea rotate unveil divert odor'\r\n seed = 'copper siren differ use like egg sight where spoon learn swamp swarm'\r\n\r\n var coinNames = ['bitcoin', 'litecoin', 'dogecoin', 'dashcoin', 'ethereum'];\r\n var pwd = '1';\r\n\r\n // Wallet.createInstance(seed, pwd, coinNames, function (wallet) {\r\n // console.log('Create Wallet instance ok')\r\n // });\r\n\r\n\r\n Wallet.createInstance(seed, 'password', coinNames, function(wallet) {\r\n console.log('Test create Wallet instance ok');\r\n\r\n // for (var i = 0; i < coinNames.length; i++) {\r\n // var address = wallet.getAddress(coinNames[i], 0);\r\n // var privKey = wallet.exportPrivateKey(coinNames[i], address);\r\n // console.log('%s: %s', address, privKey)\r\n // }\r\n\r\n // Test serialize and deserialize\r\n var json = wallet.serialize();\r\n var wallet2 = new Wallet();\r\n wallet2.deserialize(json);\r\n\r\n var json2 = wallet2.serialize();\r\n\r\n // Compare 2 serialization\r\n console.log('Test serialize and deserialize: ' + (json2.toString() == json.toString()))\r\n\r\n var address = wallet2.getAddress(coinNames[0], 0);\r\n var privKey = wallet2.exportPrivateKey(coinNames[0], address);\r\n\r\n // Test encrypt and decrypt\r\n var msg = '123123';\r\n Wallet.encryptString(msg, 'password', function(data) {\r\n Wallet.decryptString(data, 'password2', function(data) {\r\n console.log('Test encrypt and decrypt(wrong password): ' + (data != msg))\r\n })\r\n Wallet.decryptString(data, 'password', function(data) {\r\n console.log('Test encrypt and decrypt(right password): ' + (data == msg))\r\n })\r\n })\r\n\r\n //Test change password\r\n var newPassword = '123';\r\n wallet.changePassword('password', newPassword, newPassword, function(newWallet) {\r\n var address2 = wallet2.getAddress(coinNames[0], 0);\r\n var privKey2 = wallet2.exportPrivateKey(coinNames[0], address);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var oldPrivateKey = Encrypt.decryptString(privKey, derivedKey);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var newPrivateKey = Encrypt.decryptString(privKey2, derivedKey);\r\n\r\n console.log('Test change password: ' + (oldPrivateKey == newPrivateKey));\r\n });\r\n })\r\n });\r\n\r\n });\r\n\r\n}", "onSetWallet({\n wallet_name = \"default\",\n create_wallet_password,\n brnkey,\n resolve\n }) {\n var p = new Promise(res => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\") throw new Error(\"Invalid wallet name\");\n\n if (this.state.current_wallet === wallet_name) {\n res();\n return;\n }\n\n var add;\n\n if (!this.state.wallet_names.has(wallet_name)) {\n var wallet_names = this.state.wallet_names.add(wallet_name);\n add = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"wallet_names\", wallet_names);\n this.setState({\n wallet_names\n });\n }\n\n var current = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"current_wallet\", wallet_name);\n res(Promise.all([add, current]).then(() => {\n // The database must be closed and re-opened first before the current\n // application code can initialize its new state.\n idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].close();\n bitsharesjs__WEBPACK_IMPORTED_MODULE_8__.ChainStore.clearCache();\n stores_BalanceClaimActiveStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reset(); // Stores may reset when loadDbData is called\n\n return idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].init_instance().init_promise.then(() => {\n // Make sure the database is ready when calling CachedPropertyStore.reset()\n stores_CachedPropertyStore__WEBPACK_IMPORTED_MODULE_5__[\"default\"].reset();\n return Promise.all([stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadDbData().then(() => stores_AccountStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].loadDbData()), actions_PrivateKeyActions__WEBPACK_IMPORTED_MODULE_6__[\"default\"].loadDbData().then(() => stores_AccountRefsStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadDbData())]).then(() => {\n // Update state here again to make sure listeners re-render\n if (!create_wallet_password) {\n this.setState({\n current_wallet: wallet_name\n });\n return;\n }\n\n return stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].onCreateWallet(create_wallet_password, brnkey, //brainkey,\n true, //unlock\n wallet_name).then(() => this.setState({\n current_wallet: wallet_name\n }));\n });\n });\n }));\n }).catch(error => {\n console.error(error);\n return Promise.reject(error);\n });\n if (resolve) resolve(p);\n }", "addAccountFromPrivateKey() {\n let wallet\n try {\n let privateKey = this.state.value\n if (!privateKey.startsWith('0x') && /^[0-9a-fA-F]+$/.test(privateKey)) {\n privateKey = '0x' + privateKey\n }\n wallet = new ethers.Wallet(privateKey)\n } catch (error) {\n let errorMessage = error.message\n if (error.code === 'INVALID_ARGUMENT') {\n errorMessage = fbt(\n 'That is not a valid private key.',\n 'ImportScreen.invalidPrivateKeyError'\n )\n }\n this.setState({ error: String(errorMessage) })\n return false\n }\n return wallet\n }", "function delInputWallet() {\r\n address.value = \"\";\r\n publickey.value = \"\";\r\n privatekey.value = \"\";\r\n }", "setWallet(wallet_name, create_wallet_password, brnkey) {\n actions_WalletUnlockActions__WEBPACK_IMPORTED_MODULE_1__[\"default\"].lock();\n if (!wallet_name) wallet_name = \"default\";\n return dispatch => {\n return new Promise(resolve => {\n dispatch({\n wallet_name,\n create_wallet_password,\n brnkey,\n resolve\n });\n });\n };\n }", "_updateWallet(transaction = this.transaction_update()) {\n let wallet = this.state.wallet;\n\n if (!wallet) {\n reject(\"missing wallet\");\n return;\n } //DEBUG console.log('... wallet',wallet)\n\n\n let wallet_clone = (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_17__[\"default\"])(wallet);\n\n wallet_clone.last_modified = new Date();\n (0,_tcomb_structs__WEBPACK_IMPORTED_MODULE_6__.WalletTcomb)(wallet_clone); // validate\n\n let wallet_store = transaction.objectStore(\"wallet\");\n let p = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_request_end(wallet_store.put(wallet_clone));\n let p2 = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_transaction_end(transaction).then(() => {\n this.state.wallet = wallet_clone;\n this.setState({\n wallet: wallet_clone\n });\n });\n return Promise.all([p, p2]);\n }", "getWallets() {\n var _a, _b;\n const items = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.ganacheOptions.accounts) !== null && _b !== void 0 ? _b : ethereum_waffle_1.defaultAccounts;\n return items.map((x) => new ethers_1.Wallet(x.secretKey, this));\n }", "getUserWallet(uid) {\n return Request.get({\n url: `${URLS.WALLET_USER}/${uid}`,\n });\n }", "function newHDWallets() {\r\n var walletObj = new Object();\r\n walletObj.mainnet = new Object();\r\n walletObj.testnet = new Object();\r\n walletObj.mainnet.mnemonic = bip39.generateMnemonic();\r\n walletObj.testnet.mnemonic = bip39.generateMnemonic();\r\n var seedBuffer = bip39.mnemonicToSeed(walletObj.mainnet.mnemonic);\r\n walletObj.mainnet.wallet = bip32.fromSeed(seedBuffer);\r\n walletObj.testnet.wallet = bip32.fromSeed(seedBuffer, bitcoin.networks.testnet);\r\n walletObj.mainnet.pubKey = walletObj.mainnet.wallet.neutered().toBase58();\r\n walletObj.mainnet.pubKeyHex = walletObj.mainnet.wallet.neutered().publicKey.toString(\"hex\");\r\n walletObj.mainnet.privKey = walletObj.mainnet.wallet.toBase58();\r\n walletObj.mainnet.privKeyHex = walletObj.mainnet.wallet.privateKey.toString(\"hex\");\r\n walletObj.mainnet.wif = walletObj.mainnet.wallet.toWIF();\r\n walletObj.testnet.pubKey = walletObj.testnet.wallet.neutered().toBase58();\r\n walletObj.testnet.pubKeyHex = walletObj.testnet.wallet.neutered().publicKey.toString(\"hex\");\r\n walletObj.testnet.privKey = walletObj.testnet.wallet.toBase58();\r\n walletObj.testnet.privKeyHex = walletObj.testnet.wallet.privateKey.toString(\"hex\");\r\n walletObj.testnet.wif = walletObj.testnet.wallet.toWIF();\r\n //remove these for a nicer display:\r\n delete walletObj.mainnet.wallet;\r\n delete walletObj.testnet.wallet;\r\n return (walletObj);\r\n}", "setNewWallet(new_wallet) {\n this.setState({new_wallet})\n }", "static getInstance(){\n if(!Wallet._instance){\n Wallet._instance = new Wallet();\n return Wallet._instance;\n }\n else{\n throw 'App was already created';\n }\n }", "async deleteWallet () {\n return indy.deleteWallet(this.walletHandle, this.walletConfig, this.walletCredentials)\n }", "function WalletHeader() {\n const [provider, loadWeb3Modal, logoutOfWeb3Modal] = useWeb3Modal();\n const [address, setAddress] = useState('no address');\n const [addressString, setAddressString] = useState('Connect');\n const [balance, setBalance] = useState('no balance');\n const [balanceString, setBalanceString] = useState('no balance');\n const [network, setNetwork] = useState();\n\n useEffect(() => {\n if (provider) {\n getWalletInfo();\n }\n }, [provider]);\n\n const getWalletInfo = async () => {\n if (provider) {\n // get address\n let s = provider.getSigner();\n let a = await s.getAddress()\n setAddress(a);\n let as = a.toString();\n setAddressString(as.slice(0, 6) + '...' + as.slice(-4));\n let b = await s.getBalance();\n const network = await provider.getNetwork();\n setNetwork(network);\n // console.log(network);\n let balanceCurrency = CurrencyAmount.fromRawAmount(Ether.onChain(network.chainId), b);\n setBalance(balanceCurrency);\n setBalanceString(`${balanceCurrency.toSignificant(4)} Ξ`);\n }\n else {\n console.log('no provider')\n }\n };\n\n return (\n <div>\n <Button>{network?.name}</Button>\n <Button>{balanceString}</Button>\n <Button\n onClick={() => {\n if (!provider) {\n loadWeb3Modal();\n } else {\n logoutOfWeb3Modal();\n }\n }}\n >\n {!provider ? \"Connect Wallet\" : addressString}\n </Button>\n </div>\n );\n}", "deleteWallet() {\n localStorage.clear();\n return;\n }", "async getAccountWallet(params) {\n let {data} = await xhr.get(`${this.apiUrl}/api/account/wallet`,{params});\n return data;\n }", "async createWalletFromKeys(name, password, address, viewKey, spendKey, daemonConnection, restoreHeight, language, saveCurrent) {\n if (restoreHeight === undefined) restoreHeight = 0;\n if (language === undefined) language = MoneroWallet.DEFAULT_LANGUAGE;\n await this.config.rpc.sendJsonRequest(\"generate_from_keys\", {\n filename: name,\n password: password,\n address: address,\n viewkey: viewKey,\n spendkey: spendKey,\n restore_height: restoreHeight,\n autosave_current: saveCurrent\n });\n this._clear();\n this.path = name;\n }", "function EncryptWallet(passphrase) {\n return { method: 'encryptwallet', params: [passphrase] };\n}", "walletSetup(seed) {\n const root = Hdkey.fromMasterSeed(seed);\n const masterPrivateKey = root.privateKey.toString('hex');\n\n const addrNode = root.derive(\"m/44'/60'/0'/0/0\"); // line 1\n const pubKey = EthUtil.privateToPublic(addrNode._privateKey); //eslint-disable-line\n const addr = EthUtil.publicToAddress(pubKey).toString('hex');\n const address = EthUtil.toChecksumAddress(addr);\n const hexPrivateKey = EthUtil.bufferToHex(addrNode._privateKey); //eslint-disable-line\n this.props.setKeys(masterPrivateKey, address, hexPrivateKey);\n\n const { onUnlockAccount, password } = this.props;\n if (onUnlockAccount) {\n onUnlockAccount(true, hexPrivateKey, password, address);\n }\n }", "upgradeWallet() {\n // Lock button\n this.okPressed = true;\n // Upgrade\n return this._Wallet.upgrade(this.common, this.selectedWallet).then(()=> {\n this._$timeout(() => {\n // Unlock button\n this.okPressed = false;\n // Clean common object\n this.common = nem.model.objects.get(\"common\");\n // Prepare wallet download link\n this._Wallet.prepareDownload(this.selectedWallet);\n // Store base64 format for safety protocol\n this.rawWallet = this._Wallet.base64Encode(this.selectedWallet);\n //\n this.needsUpgrade = false;\n this.showSafetyMeasure = true;\n });\n },\n (err) => {\n this._$timeout(() => {\n // Unlock button\n this.okPressed = false;\n // Clean common object\n this.common = nem.model.objects.get(\"common\");\n });\n })\n }", "static async saveAccount(encryptedWalletJSON)\n {\n /* var password = acct.password;\n var dk = acct.dk;\n var name = 'eth_acct_'+acct.address;\n var options = {};\n\n var keyObject = keythereum.dump(password, new Buffer(dk.privateKey), new Buffer(dk.salt), new Buffer(dk.iv), {options});\n*/\n console.log('saving acct ', encryptedWalletJSON)\n\n var encryptedWallet = JSON.parse(encryptedWalletJSON);\n\n\n var address = encryptedWallet.address;\n\n if(!address.startsWith('0x')){\n address = '0x' + encryptedWallet.address;\n }\n\n var name = 'eth_acct_'+address;\n\n\n var storage = await StorageHelper.storeFile(name,encryptedWallet);\n\n\n return {success:true}\n }", "onWalletUpdate(wallet) {\n const mapped = wallet.map(item => item.toJS()).filter(item => item.type === 'funding');\n mapped.forEach((item) => {\n this.state.wallet = this.state.wallet.filter(w => w.currency !== item.currency);\n this.state.wallet.push(item);\n });\n }", "registerAccount(traderName, traderEmail, traderPassword) {\n var registration = new Registration(traderName, traderEmail, traderPassword);\n\n // Validate Credentials\n let obj = registration.validateCredentials(traderEmail, traderName, traderPassword);\n if (obj.Bool == false)\n return obj;\n\n // Complete Registration\n const words = Buffer.from(Registration.generateWords(), 'utf8').toString('hex'); // Store this, fuck aughttt\n let walletID = registration.createWalletID(words, traderPassword); // get the first hash (secret)\n console.log(\"Please keep this walletID secret \" + walletID + ' ' + words + ' ' + traderPassword);\n registration.storeCredentials(registration, words);\n const reg = (registration.createIdentity(traderName, \"50000\", walletID)) ? true : false;\n if (reg == true)\n return {\n Bool: true,\n Message: \"Registration Successful\"\n };\n\n return {\n Bool: false,\n Message: \"Registratiion Failed\"\n };\n }", "static async getWalletKeys() {\n if (this.walletKeys === undefined) {\n \n // import keys-only wallet module\n const MoneroWalletKeys = await require(\"../../../src/main/js/wallet/MoneroWalletKeys\")();\n \n // create wallet from mnemonic\n this.walletKeys = MoneroWalletKeys.createWalletFromMnemonic(TestUtils.NETWORK_TYPE, TestUtils.MNEMONIC);\n }\n return this.walletKeys;\n }", "function register(bytes32 mySystemID) {\n if(keysWallet[mySystemID].mySystemID == 0 && mySystemID != \"\"){\n keysWallet[mySystemID].ethereum = msg.sender;\n }\n }", "checkBalance(walletAddress){\r\n var balance = 0;\r\n for(var i = 0; i < this.bc.length; i++){\r\n for(var j = 0; j < this.bc[i].data.length; j++){\r\n if(this.bc[i].data[j].reciever == walletAddress){\r\n balance += this.bc[i].data[j].amount;\r\n } else if (this.bc[i].data[j].sender == walletAddress) {\r\n balance -= this.bc[i].data[j].amount;\r\n }\r\n }\r\n\r\n }\r\n return balance;\r\n }", "function sendTransaction(generateAccount, algodClient, kmdClient) {\n let note = '';\n let amount = 0;\n const from = { addr: '', sk: '' };\n let to = ''; // 'KI6TMKHUQOGJ7EDZLOWFOGHBBWBIMBMKONMS565X7NSOFMAM6S2EK4GBHQ';\n let walletName = '';\n let walletPassword = '';\n let walletId = null;\n let walletHandle = null;\n let txId = '';\n\n (async () => {\n if (generateAccount) {\n // Create an account\n const account = algosdk.generateAccount();\n console.log(`Address: ${account.addr}`);\n\n // Get backup phrase for account\n const mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n console.log(`Mnemonic: ${mnemonic}`);\n\n // Recover the account\n const recoveredAccount = algosdk.mnemonicToSecretKey(mnemonic);\n // console.log(recoveredAccount.addr);\n\n // Check to see if account is valid\n const isValid = algosdk.isValidAddress(recoveredAccount.addr);\n if (isValid) {\n from.addr = recoveredAccount.addr;\n from.sk = recoveredAccount.sk;\n }\n } else {\n const wallets = await kmdClient.listWallets();\n const walletsLength = wallets.wallets.length;\n if (typeof walletsLength === 'undefined' || walletsLength <= 0) {\n console.log(\"No wallets could be found in `kmd'.\");\n process.exit(1);\n }\n\n console.log('\\nGot wallets list:'); // + JSON.stringify(wallets));\n for (let i = 0; i < walletsLength; i++) {\n console.log(`[${i + 1}] ${wallets.wallets[i].name}`);\n }\n\n if (!walletName) {\n const walletIndex = readlineSync.keyIn(\n `Pick the wallet to use [1${walletsLength > 1 ? `-${walletsLength}` : ''}]: `,\n // eslint-disable-next-line comma-dangle\n { limit: `$<1-${walletsLength}>` }\n );\n walletName = wallets.wallets[walletIndex - 1].name;\n walletId = wallets.wallets[walletIndex - 1].id;\n }\n\n if (!walletPassword) {\n walletPassword = readlineSync.question(`\\nType the '${walletName}' wallet's password: `, {\n hideEchoBack: true,\n mask: '',\n });\n }\n\n walletHandle = (await kmdClient.initWalletHandle(walletId, walletPassword)).wallet_handle_token;\n\n const keys = await kmdClient.listKeys(walletHandle);\n const keysLength = keys.addresses.length;\n if (typeof keysLength === 'undefined' || keysLength <= 0) {\n console.log(`No keys could be found in \\`kmd' for '${walletName}'.`);\n process.exit(1);\n }\n console.log('\\nGot keys list:'); // + keys);\n for (let i = 0; i < keysLength; i++) {\n console.log(`[${i + 1}] ${keys.addresses[i]}`);\n }\n\n const keyIndex = readlineSync.keyIn(\n `Pick the account address to send from [1${keysLength > 1 ? `-${keysLength}` : ''}]: `,\n { limit: `$<1-${keysLength}>` },\n );\n from.addr = keys.addresses[keyIndex - 1];\n from.sk = (await kmdClient.exportKey(walletHandle, walletPassword, from.addr)).private_key;\n // console.log('sk', from.sk);\n }\n\n if (!to) {\n to = readlineSync.question('\\nSpecify the account address to send to: ');\n }\n\n if (!amount) {\n amount = readlineSync.questionInt('\\nSpecify the amount to be transferred: ');\n }\n\n if (!note) {\n note = readlineSync.question('\\nSpecify some note text (optional): ');\n }\n\n // Get the relevant params from the algod\n const params = await algodClient.getTransactionParams();\n const endRound = params.lastRound + parseInt(1000, 10);\n\n // Create a transaction\n const txn = {\n from: from.addr,\n to, // 'NJY27OQ2ZXK6OWBN44LE4K43TA2AV3DPILPYTHAJAMKIVZDWTEJKZJKO4A',\n fee: params.fee,\n amount,\n firstRound: params.lastRound,\n lastRound: endRound,\n genesisID: params.genesisID,\n note: note ? algosdk.encodeObj(note) : new Uint8Array(0),\n };\n\n // Sign the transaction\n console.log('\\nSigning transaction: \\n', txn);\n const signedTxn = algosdk.signTransaction(txn, from.sk);\n\n // Submit the transaction\n console.log('\\nSubmitting transaction...');\n const tx = await algodClient.sendRawTransaction(signedTxn.blob);\n txId = tx.txId; // eslint-disable-line prefer-destructuring\n console.log(`Transaction: tx-${txId}`);\n })().catch((e) => {\n console.log(e.error.text);\n process.exit(1);\n });\n}", "constructor(data, wallet) {\n this.id = ChainUtil.id();\n this.from = wallet.publicKey;\n console.log('>>>>>>Transaction Entry @>>>>>>', new Date)\n this.input = { data: data, timestamp: new Date };\n console.log('>>>>>>>> input', this.input)\n this.hash = ChainUtil.hash(this.input);\n this.signature = wallet.sign(this.hash);\n }", "async function fetchAccountData() {\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n\n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\n\n // Get a handl\n const template = document.querySelector(\"#template-balance\");\n const accountContainer = document.querySelector(\"#accounts\");\n\n const contractAddress = \"0x0456c33f24038bf277a1F1CA27C1999a416BbA0d\";\n var Erush = new web3.eth.Contract([{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"checkmemopurchases\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getmemotextcountforaddr\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_memo\",\"type\":\"string\"}],\"name\":\"sendtokenwithmemo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"0x0456c33f24038bf277a1F1CA27C1999a416BbA0d\");\n\n\n\n\n // Purge UI elements any previously loaded accounts\n accountContainer.innerHTML = '';\n\n // Go through all accounts and get their ETH balance\n const rowResolvers = accounts.map(async (address) => {\n const balance = await web3.eth.getBalance(address);\n const ebl = await Erush.methods.balanceOf(address).call();\n console.log(\"eblllll\", ebl);\n // ethBalance is a BigNumber instance\n // https://github.com/indutny/bn.js/\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\n const eerBalance = web3.utils.fromWei(ebl, \"ether\");\n\n\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\n const humanFriendlyeerBalance = parseFloat(eerBalance).toFixed(4);\n // Fill in the templated row and put in the document\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance;\n clone.querySelector(\".eerbalance\").textContent = humanFriendlyeerBalance;\n accountContainer.appendChild(clone);\n });\n\n // Because rendering account does its own RPC commucation\n // with Ethereum node, we do not want to display any results\n // until data for all accounts is loaded\n await Promise.all(rowResolvers);\n\n // Display fully loaded UI for wallet data\n document.querySelector(\"#prepare\").style.display = \"none\";\n document.querySelector(\"#connected\").style.display = \"block\";\n}", "function createWallet(xPubKey, account, arrWalletDefinitionTemplate, walletName, isSingleAddress, handleWallet) {\n\tvar wallet = crypto.createHash(\"sha256\").update(xPubKey, \"utf8\").digest(\"base64\");\n\tconsole.log('will create wallet ' + wallet);\n\tvar arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate);\n\tsetTimeout(function () {\n addWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () {\n handleWallet(wallet);\n if (arrDeviceAddresses.length === 1) // single sig\n return;\n console.log(\"will send offers\");\n // this continues in parallel while the callback handleWallet was already called\n // We need arrOtherCosigners to make sure all cosigners know the pubkeys of all other cosigners, even when they were not paired.\n // For example, there are 3 cosigners: A (me), B, and C. A is paired with B, A is paired with C, but B is not paired with C.\n device.readCorrespondentsByDeviceAddresses(arrDeviceAddresses, function (arrOtherCosigners) {\n if (arrOtherCosigners.length !== arrDeviceAddresses.length - 1)\n throw Error(\"incorrect length of other cosigners\");\n arrDeviceAddresses.forEach(function (device_address) {\n if (device_address === device.getMyDeviceAddress())\n return;\n console.log(\"sending offer to \" + device_address);\n sendOfferToCreateNewWallet(device_address, wallet, arrWalletDefinitionTemplate, walletName, arrOtherCosigners, isSingleAddress, null);\n sendMyXPubKey(device_address, wallet, xPubKey);\n });\n });\n });\n });\n\n}", "async closeWallet () {\n return indy.closeWallet(this.walletHandle)\n }", "async function getWallet(mnemonic, walletPath=transactions.makeHdPath(), bip39Passphrase = \"\") {\n try {\n const [wallet, address] = await transactions.MnemonicWalletWithPassphrase(mnemonic, walletPath, bip39Passphrase, prefix);\n return {\n success: true,\n address: address,\n mnemonic: wallet.mnemonic,\n walletPath: pathToString(walletPath)\n };\n } catch (e) {\n return {\n success: false,\n error: e.message\n };\n }\n}", "async getExistingWallets() {\n this.localWallets = JSON.parse(walletFile);\n }", "async setAccount() {\n if (!this.state.privatekey) return\n if (this.state.privatekey.indexOf('0x') === -1) {\n this.setState({privatekey: \"0x\" + this.state.privatekey});\n }\n let a = web3.eth.accounts.privateKeyToAccount(\n this.state.privatekey\n );\n this.setState({account: a});\n if (a.address) {\n this.userHasFsn(a.address);\n }\n this.addOutput(`Succesfully decrypted wallet. Your address is : ${a.address}`);\n }", "addAccount() {\n let account\n if (this.state.mnemonic) {\n account = this.addAccountFromMnemonic()\n } else {\n account = this.addAccountFromPrivateKey()\n }\n if (account) {\n // Since this is an imported account disable backup prompts because it\n // is assumed the user already has their mnemonic recorded\n this.props.setBackupWarningStatus(account.address)\n DeviceEventEmitter.emit('addAccount', {\n address: account.address,\n mnemonic: account.mnemonic,\n privateKey: account.privateKey\n })\n // Reset state of component\n this.setState({\n mnemonic: true,\n value: '',\n error: '',\n loading: false\n })\n const onSuccess = this.props.navigation.getParam('navigateOnSuccess')\n if (onSuccess) {\n this.props.navigation.navigate(onSuccess)\n }\n }\n }", "function account(name, fullName, network, decimalPlaces, asset, features, prefix, suffix, isToken) {\n if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; }\n if (prefix === void 0) { prefix = ''; }\n if (suffix === void 0) { suffix = name.toUpperCase(); }\n if (isToken === void 0) { isToken = false; }\n return Object.freeze(new AccountCoin({\n name: name,\n fullName: fullName,\n network: network,\n prefix: prefix,\n suffix: suffix,\n features: features,\n decimalPlaces: decimalPlaces,\n isToken: isToken,\n asset: asset,\n }));\n}", "get privKey () {\n this.assert(this._privKey, 'This is a public key only wallet')\n return this._privKey\n }", "async createNewWallet(walletId, mnemonic, restoreHeight) {\n const pathName = mnemonic ? mnemonicHasher(mnemonic) : createRandomHash(8);\n\n const walletConfig = {\n path: pathjs.join(WALLETS_PATH, pathName),\n password: createRandomHash(),\n networkType: MoneroNetworkType.MAINNET,\n serverUri: DAEMON_URL,\n mnemonic: mnemonic || undefined,\n restoreHeight: +restoreHeight || undefined,\n };\n\n let newWallet = await monerojs.createWalletWasm(walletConfig);\n\n\n newWallet.isSyncing = true;\n const clientId = this.clientId;\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:0},\n clientId\n })\n await newWallet.sync(new class extends monerojs.MoneroWalletListener {\n // newWallet.addListener(new class extends monerojs.MoneroWalletListener {\n onSyncProgress(height, startHeight, endHeight, percentDone, message) {\n\n // parentPort.postMessage(returnWrapper(percentDone*100, 'syncProgress'));\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:percentDone*100},\n clientId\n })\n if (height % 10000 === 0) {\n writeToLog(`Create Progress: ${height} | ${percentDone * 100}% | ${message}`);\n }\n if (percentDone === 1) {\n writeToLog(`Wallet Synced: ${height} | ${percentDone * 100}% | ${message}`);\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: false, progress:percentDone*100},\n clientId\n })\n newWallet.save();\n }\n }\n });\n await newWallet.startSyncing();\n let walletMnemonic = await newWallet.getMnemonic();\n const address = await newWallet.getAddress(0, 0);\n const balance = (await newWallet.getBalance(0, 0));\n this.updateOpenedWallets({...this.openedWallets, [pathName]: newWallet})\n // this.openedWallets[walletMnemonic] = newWallet\n const walletInfo = {\n walletHash: mnemonicHasher(walletMnemonic),\n mnemonic,\n address,\n balance: balance.toString(),\n transactions: [],\n creationDate: Date.now(),\n ...walletConfig,\n };\n\n //The wallets are not synced in this method to improve the UI/UX\n if (!this.syncedWallets[walletInfo.walletHash]) {\n this.syncedWallets[walletInfo.walletHash] = newWallet;\n }\n\n this.updateClientWallets([\n ...this.clientWallets,\n {\n ...walletInfo,\n wallet_id: walletId,\n },\n ]);\n\n this.updateWalletsJson([\n ...this.localWallets,\n walletInfo,\n ]);\n }", "async createAccount(ctx, name) {\n const userId = ctx.clientIdentity.getID();\n const newAccount = {\n ID: userId,\n Name: name,\n Balance: 0,\n AuthedParties: {},\n };\n ctx.stub.putState(userId, Buffer.from(JSON.stringify(newAccount)));\n return JSON.stringify(newAccount);\n }", "_configureUIWithWallet () {\n const self = this\n self._configureUIWithWallet__labels()\n self._configureUIWithWallet__color()\n }", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function generateAddress() {\r\n _doGet('/account/generate', _updateWallet);\r\n }", "async function main () {\n\n /**\n * Fetch your personal wallet's balance\n */\n //let myBalanceWei = web3.eth.getBalance(web3.eth.defaultAccount).toNumber()\n let myBalanceWei = await web3.eth.getBalance(web3.eth.defaultAccount)\n\n let myBalance = fromWei(myBalanceWei)\n \n log(`Your wallet wei balance is currently ${myBalanceWei} ETH`.green)\n\n log(`Your wallet balance is currently ${myBalance} ETH`.green)\n\n\n /**\n * With every new transaction you send using a specific wallet address,\n * you need to increase a nonce which is tied to the sender wallet.\n */\n let nonce = await web3.eth.getTransactionCount(web3.eth.defaultAccount)\n log(`The outgoing transaction count for your wallet address is: ${nonce}`.magenta)\n\n\n /**\n * Fetch the current transaction gas prices from https://ethgasstation.info/\n */\n let gasPrices = await getCurrentGasPrices()\n\n log('wallet: ' + process.env.WALLET_ADDRESS)\n log('testnet: ' + testnet)\n log('chain id: ' + process.env.CHAIN_ID)\n log('chain_name: ' + process.env.CHAIN_NAME)\n log('chain_hardfork: ' + process.env.CHAIN_HARDFORK)\n\n /**\n * Build a new transaction object and sign it locally.\n */\n let details = {\n \"to\": process.env.DESTINATION_WALLET_ADDRESS,\n \"value\": web3.utils.numberToHex( toWei(amountToSend) ),\n \"gas\": 21000,\n \"gasPrice\": gasPrices.low * 1000000000, // converts the gwei price to wei\n \"nonce\": nonce,\n \"chainId\": process.env.CHAIN_ID // EIP 155 chainId - mainnet: 1, rinkeby: 4\n }\n\n const transaction = new EthereumTx(details, {chain:process.env.CHAIN_NAME, hardfork: process.env.CHAIN_HARDFORK})\n\n /**\n * This is where the transaction is authorized on your behalf.\n * The private key is what unlocks your wallet.\n */\n transaction.sign( Buffer.from(process.env.WALLET_PRIVATE_KEY, 'hex') )\n\n\n /**\n * Now, we'll compress the transaction info down into a transportable object.\n */\n const serializedTransaction = transaction.serialize()\n\n /**\n * Note that the Web3 library is able to automatically determine the \"from\" address based on your private key.\n */\n\n const addr = transaction.from.toString('hex')\n log(`Based on your private key, your wallet address is ${addr}`.yellow)\n\n /**\n * We're ready! Submit the raw transaction details to the provider configured above.\n */\n await web3.eth.sendSignedTransaction('0x' + serializedTransaction.toString('hex') )\n .catch( error => { console.log (error) } )\n\n /*\n let transactionReceipt = await web3.eth.getTransactionReceipt() \n console.log (\"recibo\"+ transactionReceipt)\n let transactionId = transactionReceipt.transactionHash\n console.log (\"transactionId\"+ transactionId)\n */\n\n /**\n * We now know the transaction ID, so let's build the public Etherscan url where\n * the transaction details can be viewed.\n */\n //const url = `https://rinkeby.etherscan.io/tx/${transactionId}`\n //log(url.cyan)\n\n let contract_abi = [ { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isWaitingValidationAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isReservedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setTokenAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getBlockchainAccount\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"enableChangeAccount\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"isChangeAccountEnabled\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"string\", \"name\": \"str\", \"type\": \"string\" } ], \"name\": \"isValidHash\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"pure\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"renounceOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isRedemptionAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getRedemptionAddress\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"changeAccountLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"validateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByValidatorAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getIdLegalFinancialAgreement\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForRegistryValidation\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"owner\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForDisbursement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getAccountState\", \"outputs\": [ { \"internalType\": \"int256\", \"name\": \"\", \"type\": \"int256\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getLegalEntityInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isAvailableAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getLegalEntityInfoByCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"novoCampo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"invalidateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForSettlement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isTokenAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setRedemptionAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"registryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"transferOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountRegistration\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"oldAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountChange\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountValidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountInvalidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"previousOwner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"OwnershipTransferred\", \"type\": \"event\" } ]\n\n var myContract = new web3.eth.Contract(contract_abi, process.env.CONTRACT_ADDRESS, {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n});\n\n\n\n// using the callback\n await myContract.methods.getResponsibleForDisbursement().call({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log ('The disbursement responsible is : ' + result);\n });\n\n let outraABI = [ { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"decrease\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"increase\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"triple\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"double\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]\n\n var counterContract = new web3.eth.Contract(outraABI, \"0xB87b994174CA4af8FD7E9e7DED2036564Ba53829\", {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n });\n\n// using the callback\n// Infura has not activated the method eth_sendTransaction because this method needs unlocked accounts on the ethereum node. \n await counterContract.methods.increase(1).send({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log (result);\n })\n\n log(`Note: please allow for 30 seconds before transaction appears on Etherscan`.magenta)\n\n process.exit()\n}", "getBalance(publicKey) {\n // Your code here\n\n }", "static async getWalletWasm() {\n if (this.walletWasm === undefined || await this.walletWasm.isClosed()) {\n \n // import wasm wallet module\n const MoneroWalletWasm = await require(\"../../../src/main/js/wallet/MoneroWalletWasm\")();\n \n // create wallet from mnemonic phrase if it doesn't exist\n if (!await MoneroWalletWasm.walletExists(TestUtils.WALLET_WASM_PATH_1)) {\n let daemonConnection = new MoneroRpcConnection(TestUtils.DAEMON_RPC_URI, TestUtils.DAEMON_RPC_USERNAME, TestUtils.DAEMON_RPC_PASSWORD);\n this.walletWasm = await MoneroWalletWasm.createWalletFromMnemonic(TestUtils.WALLET_WASM_PATH_1, TestUtils.WALLET_PASSWORD, TestUtils.NETWORK_TYPE, TestUtils.MNEMONIC, (await TestUtils.getDaemonRpc()).getRpcConnection(), TestUtils.FIRST_RECEIVE_HEIGHT);\n //assert.equal(await this.walletWasm.getRestoreHeight(), TestUtils.FIRST_RECEIVE_HEIGHT);\n console.log(\"Synchronizing test wallet...\");\n await this.walletWasm.sync();\n //await this.walletWasm.sync(new WalletSyncPrinter()); // TODO\n await this.walletWasm.save(); // save progress\n //await this.walletWasm.startSyncing(); // TODO\n }\n \n // otherwise open existing wallet\n else {\n this.walletWasm = await MoneroWalletWasm.openWallet(TestUtils.WALLET_WASM_PATH_1, TestUtils.WALLET_PASSWORD, TestUtils.NETWORK_TYPE, (await TestUtils.getDaemonRpc()).getRpcConnection());\n await this.walletWasm.sync();\n //await this.walletWasm.save();\n //await this.walletWasm.sync(new WalletSyncPrinter()); // TODO\n //await this.walletWasm.startSyncing(); // TODO\n }\n \n // TODO: hook to save on shutdown?\n// // Save and close the JNI wallet when the runtime is shutting down in order\n// // to preserve local wallet data (e.g. destination addresses and amounts).\n// // This is not necessary in the rpc wallet which saves automatically.\n// Runtime.getRuntime().addShutdownHook(new Thread() {\n// public void run() {\n// walletJni.close(true);\n// }\n// });\n }\n \n // return cached wasm wallet\n return this.walletWasm;\n }", "async unlockEthAccount(password)\n {\n var self = this;\n var address = transferComponent.selectedAddress;\n\n\n var data = await this.socketClient.emitToSocket('unlockAccount',{address:address,password:password});\n\n var error = null;\n\n var account;\n if(data.success)\n {\n account = data.account;\n\n\n Vue.set(transferComponent, 'selectedAccount', account )\n\n Vue.nextTick(function () {\n self.getRelayStats()\n self.getEthInfo()\n })\n\n\n }else{\n error = data.message;\n }\n\n\n Vue.set(transferComponent, 'unlockError', error )\n\n\n return account; // address and pkey\n }", "static async getWalletRpc() {\n if (this.walletRpc === undefined) {\n \n // construct wallet rpc instance with daemon connection\n this.walletRpc = new MoneroWalletRpc(TestUtils.WALLET_RPC_CONFIG);\n }\n \n // attempt to open test wallet\n try {\n await this.walletRpc.openWallet(TestUtils.WALLET_RPC_NAME_1, TestUtils.WALLET_PASSWORD);\n } catch (e) {\n if (!(e instanceof MoneroRpcError)) throw e;\n \n // -1 returned when the wallet does not exist or it's open by another application\n if (e.getCode() === -1) {\n \n // create wallet\n await this.walletRpc.createWalletFromMnemonic(TestUtils.WALLET_RPC_NAME_1, TestUtils.WALLET_PASSWORD, TestUtils.MNEMONIC, TestUtils.FIRST_RECEIVE_HEIGHT);\n } else {\n throw e;\n }\n }\n \n // ensure we're testing the right wallet\n assert.equal(await this.walletRpc.getMnemonic(), TestUtils.MNEMONIC);\n assert.equal(await this.walletRpc.getPrimaryAddress(), TestUtils.ADDRESS);\n \n // sync and save the wallet\n await this.walletRpc.sync();\n await this.walletRpc.save();\n \n // return cached wallet rpc\n return this.walletRpc;\n }", "downloadWallet() {\n if (this._Wallet.prepareDownload(this.selectedWallet)) {\n // Simulate click to trigger download\n document.getElementById(\"downloadWallet\").click();\n return;\n }\n }" ]
[ "0.71450025", "0.6903897", "0.6820971", "0.67283136", "0.6643265", "0.6560982", "0.65130633", "0.64113885", "0.63825154", "0.63022906", "0.62454325", "0.6138936", "0.6117011", "0.61133426", "0.61069167", "0.6066534", "0.59985024", "0.5996005", "0.5951974", "0.5950851", "0.5921866", "0.5892459", "0.58764315", "0.5845096", "0.5837219", "0.5832323", "0.58281535", "0.58241564", "0.5761705", "0.57370746", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.57350826", "0.5725042", "0.57113177", "0.5707829", "0.57028645", "0.5695212", "0.5695212", "0.5695212", "0.56881934", "0.5673594", "0.5668307", "0.5667515", "0.5664891", "0.56598103", "0.56577235", "0.56290174", "0.5627466", "0.56267416", "0.56217486", "0.56017864", "0.5601212", "0.55979544", "0.5593663", "0.55908906", "0.55833626", "0.55779266", "0.5569849", "0.5557572", "0.55287164", "0.5523702", "0.55199283", "0.5517667", "0.55170727", "0.54954755", "0.54878557", "0.5469821", "0.5460723", "0.5444793", "0.5441023", "0.54266316", "0.5398667", "0.5387366", "0.53812784", "0.53656036", "0.53649056", "0.53513616", "0.5346718", "0.534472", "0.5340441", "0.5336926", "0.53193927", "0.53156066", "0.5312582", "0.52993304", "0.52962124", "0.5296042", "0.5289076", "0.52824724", "0.52548665", "0.5251076" ]
0.57392174
29
called from UI after user confirms creation of wallet initiated by another device
function approveWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, arrOtherCosigners, onDone) { var arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate); device.addIndirectCorrespondents(arrOtherCosigners, function () { addWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () { arrDeviceAddresses.forEach(function (device_address) { if (device_address !== device.getMyDeviceAddress()) sendMyXPubKey(device_address, wallet, xPubKey); }); if (onDone) onDone(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createAccount(){\n\n console.log('ACCOUNT CREATED')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n var web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n\n let newAccount = web3js.eth.accounts.create();\n let newAccount_public = newAccount.address\n let newAccount_private = newAccount.privateKey\n\n\n //JSON that is supporting all chains. \n let newJSON = {\n eth : [\n {\n privateKey : newAccount_private,\n publicKey : newAccount_public, \n }\n ],\n eos : [] \n }\n // 0xf65edc67222a17bdb9979e9560f75ac34fae6dc30e6d2145458295bf11739390\n\n //Turn array to string to store in keychain. \n let stored_string = JSON.stringify(newJSON);\n\n\n //Store array with keys in keychain. \n (async function() {\n\n // Store the credentials\n await Keychain.setGenericPassword('null', stored_string);\n \n })();\n\n this.props.navigator.push({\n id : 'AccountCreated',\n passProps : {\n privateKey : newAccount_private,\n publicKey : newAccount_public\n }\n })\n \n }", "addWallet() {}", "async addWallet() {\n // Validate and format address\n let newAddress = this.validateAddress();\n // Deactivate addressInput button\n this.addressInput.changeToDeactive();\n // Check if wallet already exists in list of wallets\n if (wallets.findWallet(this.name, newAddress) !== undefined) {\n communication.message('Address already included in database for this blockchain. Please try again.');\n } else {\n // Get financial data to check existence of account\n let walletFinancialData = await this.getWalletsFinancialData(this.name, [newAddress]);\n // Invalid address for blockchain\n if (walletFinancialData[newAddress].valid === false) {\n communication.message(\"Not a valid address on \" + this.name + \" blockchain. Please try again.\");\n // Valid address\n } else {\n communication.message('Verified.<br> Generating new wallet info for ' + this.name + ' blockchain.');\n // Generate a new Wallet instance based on the new address\n // - saves in wallets and also stores the summaryRange in the database\n await wallets.generateNewWallet(this, newAddress, true);\n // Set current wallet to new wallet\n wallets.processWalletSelection(this.name, newAddress);\n // Update wallets table\n wallets.updateWalletsTable();\n wallets.scrollToBottomOfTable();\n communication.message('Verified.<br> Click on LOAD DATA to obtain transactions from ' + this.name + ' blockchain.');\n }\n }\n }", "static generateWallet() {\n const wallet = EthereumJsWallet.generate();\n\n AnalyticsUtils.trackEvent('Generate wallet', {\n walletAddress: wallet.getAddressString(),\n });\n\n this.storeWallet(wallet);\n }", "addAccount() {\n let account\n if (this.state.mnemonic) {\n account = this.addAccountFromMnemonic()\n } else {\n account = this.addAccountFromPrivateKey()\n }\n if (account) {\n // Since this is an imported account disable backup prompts because it\n // is assumed the user already has their mnemonic recorded\n this.props.setBackupWarningStatus(account.address)\n DeviceEventEmitter.emit('addAccount', {\n address: account.address,\n mnemonic: account.mnemonic,\n privateKey: account.privateKey\n })\n // Reset state of component\n this.setState({\n mnemonic: true,\n value: '',\n error: '',\n loading: false\n })\n const onSuccess = this.props.navigation.getParam('navigateOnSuccess')\n if (onSuccess) {\n this.props.navigation.navigate(onSuccess)\n }\n }\n }", "function displayWallet() {\n if (localStorage.getItem('reddcoinWallet')) {\n $('#walletSwapInteract').trigger('click');\n }\n else {\n $('#createWalletSetup').trigger('click');\n }\n\n if (localStorage.getItem('reddcoinWallet') || localStorage.getItem('user')) {\n Reddcoin.popup.updateBalance();\n Reddcoin.popup.updateHistory();\n\n // TODO: SEARCH\n Reddcoin.popup.updateSend();\n Reddcoin.popup.updateAccount();\n Reddcoin.popup.updateReceive();\n }\n}", "function createWallet(xPubKey, account, arrWalletDefinitionTemplate, walletName, isSingleAddress, handleWallet) {\n\tvar wallet = crypto.createHash(\"sha256\").update(xPubKey, \"utf8\").digest(\"base64\");\n\tconsole.log('will create wallet ' + wallet);\n\tvar arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate);\n\tsetTimeout(function () {\n addWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () {\n handleWallet(wallet);\n if (arrDeviceAddresses.length === 1) // single sig\n return;\n console.log(\"will send offers\");\n // this continues in parallel while the callback handleWallet was already called\n // We need arrOtherCosigners to make sure all cosigners know the pubkeys of all other cosigners, even when they were not paired.\n // For example, there are 3 cosigners: A (me), B, and C. A is paired with B, A is paired with C, but B is not paired with C.\n device.readCorrespondentsByDeviceAddresses(arrDeviceAddresses, function (arrOtherCosigners) {\n if (arrOtherCosigners.length !== arrDeviceAddresses.length - 1)\n throw Error(\"incorrect length of other cosigners\");\n arrDeviceAddresses.forEach(function (device_address) {\n if (device_address === device.getMyDeviceAddress())\n return;\n console.log(\"sending offer to \" + device_address);\n sendOfferToCreateNewWallet(device_address, wallet, arrWalletDefinitionTemplate, walletName, arrOtherCosigners, isSingleAddress, null);\n sendMyXPubKey(device_address, wallet, xPubKey);\n });\n });\n });\n });\n\n}", "function createWallet(walletRPC, walletName, chain) {\n\twalletRPC.create_wallet(walletName, '')\n\t\t.then(new_wallet => {\n\t\t\tconsole.log(\"createWallet \" + walletName + \".key success\");\n\t\t\tchain(walletRPC, walletName)\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "async function createWallet(){\r\n try{\r\n let account;\r\n account = web3.eth.accounts.create(web3.utils.randomHex(32));\r\n\r\n sendETH(account.address);//send eth to new address\r\n\r\n return({\"address\":account.address,\"key\":account.privateKey});\r\n }catch{\r\n return({\"address\" : \"ERROR\",\"key\" : \"error\"});\r\n }\r\n}", "async createNewWallet(walletId, mnemonic, restoreHeight) {\n const pathName = mnemonic ? mnemonicHasher(mnemonic) : createRandomHash(8);\n\n const walletConfig = {\n path: pathjs.join(WALLETS_PATH, pathName),\n password: createRandomHash(),\n networkType: MoneroNetworkType.MAINNET,\n serverUri: DAEMON_URL,\n mnemonic: mnemonic || undefined,\n restoreHeight: +restoreHeight || undefined,\n };\n\n let newWallet = await monerojs.createWalletWasm(walletConfig);\n\n\n newWallet.isSyncing = true;\n const clientId = this.clientId;\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:0},\n clientId\n })\n await newWallet.sync(new class extends monerojs.MoneroWalletListener {\n // newWallet.addListener(new class extends monerojs.MoneroWalletListener {\n onSyncProgress(height, startHeight, endHeight, percentDone, message) {\n\n // parentPort.postMessage(returnWrapper(percentDone*100, 'syncProgress'));\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:percentDone*100},\n clientId\n })\n if (height % 10000 === 0) {\n writeToLog(`Create Progress: ${height} | ${percentDone * 100}% | ${message}`);\n }\n if (percentDone === 1) {\n writeToLog(`Wallet Synced: ${height} | ${percentDone * 100}% | ${message}`);\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: false, progress:percentDone*100},\n clientId\n })\n newWallet.save();\n }\n }\n });\n await newWallet.startSyncing();\n let walletMnemonic = await newWallet.getMnemonic();\n const address = await newWallet.getAddress(0, 0);\n const balance = (await newWallet.getBalance(0, 0));\n this.updateOpenedWallets({...this.openedWallets, [pathName]: newWallet})\n // this.openedWallets[walletMnemonic] = newWallet\n const walletInfo = {\n walletHash: mnemonicHasher(walletMnemonic),\n mnemonic,\n address,\n balance: balance.toString(),\n transactions: [],\n creationDate: Date.now(),\n ...walletConfig,\n };\n\n //The wallets are not synced in this method to improve the UI/UX\n if (!this.syncedWallets[walletInfo.walletHash]) {\n this.syncedWallets[walletInfo.walletHash] = newWallet;\n }\n\n this.updateClientWallets([\n ...this.clientWallets,\n {\n ...walletInfo,\n wallet_id: walletId,\n },\n ]);\n\n this.updateWalletsJson([\n ...this.localWallets,\n walletInfo,\n ]);\n }", "function runExternalAutologin() {\n spinner.attachToView();\n LOADER_GLOBALS.loadCredentials();\n const secretArrayKey = getWalletSecretArrayKey();\n const isArrayEmpty = secretArrayKey.filter(el => el && el.trim().length !== 0).length === 0;\n\n if(isArrayEmpty) {\n return console.warn(\"Array of secrets is not loaded yet...\", secretArrayKey);\n }\n\n walletService.create(LOADER_GLOBALS.environment.domain, secretArrayKey, (err, wallet) => {\n if (err) {\n throw createOpenDSUErrorWrapper(`Failed to create wallet in domain ${LOADER_GLOBALS.environment.domain}`, err);\n }\n console.log(\"A new wallet got initialised...\", wallet.getCreationSSI(true));\n return self.openWallet();\n });\n }", "if (wallets.hasActiveWallet) {\n runInAction(() => {\n this.disableTransferFunds = false;\n });\n }", "onSetWallet({wallet_name = \"default\", create_wallet_password, brnkey, resolve}) {\n\n let p = new Promise(resolve => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\")\n throw new Error(\"Invalid wallet name\")\n\n if (this.state.current_wallet === wallet_name) {\n resolve()\n return\n }\n\n let add\n if (!this.state.wallet_names.has(wallet_name)) {\n let wallet_names = this.state.wallet_names.add(wallet_name)\n add = iDB.root.setProperty(\"wallet_names\", wallet_names)\n this.setState({wallet_names})\n }\n\n let current = iDB.root.setProperty(\"current_wallet\", wallet_name)\n\n resolve(Promise.all([add, current]).then(() => {\n // 在当前应用程序代码可以初始化其新状态之前,必须首先关闭并重新打开数据库。\n iDB.close()\n ChainStore.clearCache()\n BalanceClaimActiveStore.reset()\n // 当调用loadDbData时,Store可能会重置\n return iDB.init_instance().init_promise.then(() => {\n // 在调用CachedPropertyStore.reset()时确保数据库准备就绪\n CachedPropertyStore.reset()\n return Promise.all([\n WalletDb.loadDbData().then(() => AccountStore.loadDbData()),\n PrivateKeyActions.loadDbData().then(() => AccountRefsStore.loadDbData())\n ]).then(() => {\n // 在这里再次更新状态,以确保侦听器重新渲染\n\n if (!create_wallet_password) {\n this.setState({current_wallet: wallet_name})\n return\n }\n\n return WalletDb.onCreateWallet(\n create_wallet_password,\n brnkey, //brainkey,\n true, //unlock\n wallet_name\n ).then(() => this.setState({current_wallet: wallet_name}))\n })\n })\n }))\n }).catch(error => {\n console.error(error)\n return Promise.reject(error)\n })\n if (resolve) resolve(p)\n }", "addNewAccount() {\n this.okPressed = true;\n return this._Wallet.addAccount(this.common, this.newAccountLabel).then((res) => {\n this._$timeout(() => {\n this.okPressed = false;\n this.checkNumberOfAccounts();\n // Hide modal\n $(\"#addAccountModal\").modal('hide');\n this.reset();\n return;\n });\n }, \n (err) => {\n this._$timeout(() => {\n this.okPressed = false;\n this.reset();\n return;\n });\n });\n }", "function finishRegistration() {\n var localstorage = new _localstorage.LocalStorage(),\n slice_size = config.sliceSize;\n var backend = new _backend.Backend();\n var seed = localstorage.get('seed');\n var seed_slices = [];\n var rand_slice = void 0;\n var confirm = $('#passphrase-confirm');\n var tryLogin = $('#try-login');\n\n function onInit() {\n for (var i = 0; i < 6; i++) {\n seed_slices.push(seed.slice(slice_size * i, slice_size * (i + 1)));\n }\n rand_slice = Math.floor(Math.random() * 6);\n updateView();\n\n tryLogin.on('click', login);\n }\n\n function updateView() {\n // confirm.attr('placeholder','enter '+sliceName(rand_slice)+' word');\n }\n\n function login(e) {\n var _this = this;\n\n e.preventDefault();\n var val = confirm.val();\n if (val === seed) {\n confirm.removeClass('invalid');\n var keys = JSON.parse(localstorage.get('keys'));\n //mock keys for test: //TODO: remove on production\n keys.public_addr = '9w7UYUD35ZS82ZsiHus5HeJQCJhzJiMRZTLTsCYCGfUoahk5PJpfKpPMvsBjteE3EW3Xm63t4ibk1ihBdjYjZn6KAjH2oSt';\n keys.view.sec = 'c53e9456ca998abc13cfc9a4c868bbe142ef0298fcf6b569bdf7986b9d525305';\n keys.spend.sec = '0da41a4648265e69701418753b610566ae04f0bbee8b815e3e4b99a69a5bd80d';\n\n backend.create_wallet(keys.public_addr, keys.spend.sec, keys.view.sec).then(function (data) {\n // console.log(data);\n localstorage.set('walletName', data.data);\n localstorage.set('walletStatus', 'new');\n window.location.href = $(_this).attr('href');\n }).catch(function (error) {\n console.log(error);\n });\n } else {\n confirm.addClass('invalid');\n }\n }\n\n function sliceName(index) {\n switch (index) {\n case 0:\n return index + 1 + 'st';\n case 1:\n return index + 1 + 'nd';\n case 2:\n return index + 1 + 'rd';\n default:\n return index + 1 + 'th';\n }\n }\n\n onInit();\n}", "setActiveWallet(activeWallet){\n if (this.confirmMethodsArePresent(activeWallet)) {\n this.walletProvider = activeWallet\n } else if (Reflect.has(activeWallet, 'signPersonalMessage')) {\n this.walletProvider = activeWallet\n this.walletProvider.signMessage = activeWallet.signPersonalMessage\n }\n }", "async function createAccount() {\n // now there are 2 ways to generate account\n // 1. input private key and added to wallet\n // 2. input seedphrase and added to wallet\n\n // for better end-user experience, like meta-mask does, the working flow like this:\n // 1. give account a name, it should be done by app as shown to user, not sdk.\n // perhaps store it in localstorage or some front-end database\n\n const accountName = 'My First Account'\n\n // 2. ask user to input password and confirm again\n // if we pass the 2-times-validator\n // we then use the password later\n\n let password\n\n const passwordFirst = 'MyVeryStrongPassword'\n logOutPut('input password first time', passwordFirst)\n\n const passwordConfirmed = 'MyVeryStrongPassword'\n logOutPut('input password second time', passwordConfirmed)\n\n if (passwordFirst !== passwordConfirmed) {\n throw new Error('password is not correct')\n }\n\n password = passwordConfirmed\n\n logOutPut('Your password is', password)\n\n // 3. generate seed phrase, according to BIP-44, and ask user to write it down\n const seed = Wallet.generateMnemonic()\n\n // see log here:\n logOutPut('seed phrase created', seed)\n\n // 2. then add the seed phrase to wallet, each phrase can generate multiple accounts using index.\n // that actually create different private keys, however user don't want to remember them all.\n // we use 0 to use the first index according to BIP-39\n // please note that same seed and same index, generate same privateKey, which is constant.\n // just for example , we add one account each time.\n // note that the first account will be the signer of wallet\n\n const signer = harmony.wallet.addByMnemonic(seed, 0)\n\n // 3. now the account is created, but it is not encrypted yet, we use the password that user confirmed earlier.\n // how ever the encrypt process is async, because it may cause your app runs encryption.\n // we use `Wallet.encryptAccont(address:string, password:string)` to encrypt the account\n\n await harmony.wallet.encryptAccount(signer.address, password)\n\n // 4. now the private key is encrypted to keystore format.\n\n logOutPut('your private key is encrypted to KeyStore', signer.privateKey)\n\n logOutPut(\n 'Account.encrypted also show encryption state is:',\n signer.encrypted\n )\n\n // 5. you can print out Account address.\n\n logOutPut('Account address is:', signer.address)\n\n // 6. but to user, you had better show them checksumAddress\n\n logOutPut('Account checksumAddress is:', signer.checksumAddress)\n\n // 7. now you can save account name, account address to local storage.\n // note: NEVER store privatekey to local storage\n\n const accountInfo = {\n accountName,\n address: signer.checksumAddress\n }\n\n logOutPut('Account is to be saved:', accountInfo)\n\n // now if you want to get account instance from wallet\n // use Wallet.getAccount(address:string)\n // we just use accountInfo object above as query\n\n const foundAccount = harmony.wallet.getAccount(accountInfo.address)\n\n logOutPut('Account is found:', foundAccount)\n\n // whenever you want to encrypt an acount\n // use Wallet.decryptAccount(address:string,password:string)\n\n logOutPut('Signer is to encrypted:', harmony.wallet.signer.privateKey)\n\n await harmony.wallet.decryptAccount(\n harmony.wallet.signer.address,\n 'MyVeryStrongPassword'\n )\n\n logOutPut(\n 'Account is now decrypted, you got the private key:',\n harmony.wallet.signer.privateKey\n )\n\n // you can remove account from Wallet\n // but remember to delete localstorage as well\n // use Wallet.removeAccount(address:string)\n\n harmony.wallet.removeAccount(harmony.wallet.signer.address)\n\n logOutPut('wallet is cleaned up', harmony.wallet.accounts)\n}", "onSetWallet({\n wallet_name = \"default\",\n create_wallet_password,\n brnkey,\n resolve\n }) {\n var p = new Promise(res => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\") throw new Error(\"Invalid wallet name\");\n\n if (this.state.current_wallet === wallet_name) {\n res();\n return;\n }\n\n var add;\n\n if (!this.state.wallet_names.has(wallet_name)) {\n var wallet_names = this.state.wallet_names.add(wallet_name);\n add = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"wallet_names\", wallet_names);\n this.setState({\n wallet_names\n });\n }\n\n var current = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"current_wallet\", wallet_name);\n res(Promise.all([add, current]).then(() => {\n // The database must be closed and re-opened first before the current\n // application code can initialize its new state.\n idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].close();\n bitsharesjs__WEBPACK_IMPORTED_MODULE_8__.ChainStore.clearCache();\n stores_BalanceClaimActiveStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reset(); // Stores may reset when loadDbData is called\n\n return idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].init_instance().init_promise.then(() => {\n // Make sure the database is ready when calling CachedPropertyStore.reset()\n stores_CachedPropertyStore__WEBPACK_IMPORTED_MODULE_5__[\"default\"].reset();\n return Promise.all([stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadDbData().then(() => stores_AccountStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].loadDbData()), actions_PrivateKeyActions__WEBPACK_IMPORTED_MODULE_6__[\"default\"].loadDbData().then(() => stores_AccountRefsStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadDbData())]).then(() => {\n // Update state here again to make sure listeners re-render\n if (!create_wallet_password) {\n this.setState({\n current_wallet: wallet_name\n });\n return;\n }\n\n return stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].onCreateWallet(create_wallet_password, brnkey, //brainkey,\n true, //unlock\n wallet_name).then(() => this.setState({\n current_wallet: wallet_name\n }));\n });\n });\n }));\n }).catch(error => {\n console.error(error);\n return Promise.reject(error);\n });\n if (resolve) resolve(p);\n }", "async function onConnect() {\r\n\r\n console.log(\"Opening a dialog\", web3Modal);\r\n try {\r\n provider = await web3Modal.connect();\r\n web3 = new Web3(provider);\r\n } catch(e) {\r\n console.log(\"Could not get a wallet connection\", e);\r\n return;\r\n }\r\n\r\n // Subscribe to accounts change\r\n provider.on(\"accountsChanged\", (accounts) => {\r\n fetchAccountData();\r\n });\r\n\r\n // Subscribe to chainId change\r\n provider.on(\"chainChanged\", (chainId) => {\r\n fetchAccountData();\r\n });\r\n\r\n // Subscribe to networkId change\r\n provider.on(\"networkChanged\", (networkId) => {\r\n fetchAccountData();\r\n });\r\n\r\n await refreshAccountData();\r\n}", "upgradeWallet() {\n // Lock button\n this.okPressed = true;\n // Upgrade\n return this._Wallet.upgrade(this.common, this.selectedWallet).then(()=> {\n this._$timeout(() => {\n // Unlock button\n this.okPressed = false;\n // Clean common object\n this.common = nem.model.objects.get(\"common\");\n // Prepare wallet download link\n this._Wallet.prepareDownload(this.selectedWallet);\n // Store base64 format for safety protocol\n this.rawWallet = this._Wallet.base64Encode(this.selectedWallet);\n //\n this.needsUpgrade = false;\n this.showSafetyMeasure = true;\n });\n },\n (err) => {\n this._$timeout(() => {\n // Unlock button\n this.okPressed = false;\n // Clean common object\n this.common = nem.model.objects.get(\"common\");\n });\n })\n }", "async function onConnect() {\n console.log(\"Opening a dialog\", web3Modal);\n try {\n provider = await web3Modal.connect();\n } catch (e) {\n console.log(\"Could not get a wallet connection\", e);\n return;\n }\n\n // Subscribe to accounts change\n provider.on(\"accountsChanged\", accounts => {\n fetchAccountData();\n });\n\n // Subscribe to chainId change\n provider.on(\"chainChanged\", chainId => {\n fetchAccountData();\n });\n\n // Subscribe to networkId change\n provider.on(\"networkChanged\", networkId => {\n fetchAccountData();\n });\n\n await refreshAccountData();\n}", "function showCreateAccountDialog() {\n var createDialog = Alloy.Dialog.showCustomDialog({\n controllerPath : 'checkout/confirmation/createAccount',\n continueEvent : 'createAccount:dismiss',\n continueFunction : function() {\n logger.info('createAccount dismiss called');\n $.stopListening(createDialog);\n createDialog = null;\n }\n });\n createDialog.focusFirstField();\n\n // go ahead and create the account\n $.listenTo(createDialog, 'createAccount:create', function(customer_info, address, loginPreference) {\n var deferred = new _.Deferred();\n Alloy.Router.showActivityIndicator(deferred);\n newCustomer.register(customer_info, {\n c_employee_id : currentAssociate.getEmployeeId(),\n c_employee_passcode : currentAssociate.getPasscode(),\n c_store_id : Alloy.CFG.store_id\n }).done(function() {\n\n analytics.fireAnalyticsEvent({\n category : _L('Users'),\n action : _L('Create User'),\n label : customer_info.username\n });\n analytics.fireUserEvent({\n category : _L('Users'),\n action : _L('Create User'),\n userId : customer_info.username\n });\n\n //login customer\n if (loginPreference) {\n var promise = newCustomer.loginCustomer({\n login : customer_info.customer.login\n }, currentBasket);\n promise.done(function() {\n createDialog.dismiss();\n notify(_L('Account successfully created.'));\n }).fail(function(model, options, params) {\n createDialog.showErrorMessage( model ? model.get('fault') : null);\n }).always(function() {\n deferred.resolve();\n });\n\n } else {// do not login customer\n currentAssociate.loginAssociate({\n employee_id : currentAssociate.getEmployeeId(),\n passcode : currentAssociate.getPasscode()\n }).done(function() {\n createDialog.dismiss();\n notify(_L('Account successfully created.'));\n }).fail(function(data) {\n var failMsg = _L('Unable to create account.');\n if (data && data.faultDescription) {\n failMsg = data.faultDescription;\n } else if (data.get('httpStatus') != 200 && data.get('fault')) {\n failMsg = data.get('fault').message;\n }\n createDialog.showErrorMessage(failMsg);\n }).always(function() {\n deferred.resolve();\n });\n }\n analytics.fireAnalyticsEvent({\n category : _L('Customer'),\n action : _L('Create New User')\n });\n }).fail(function(model, options, params) {\n createDialog.showErrorMessage( model ? model.get('fault') : null);\n deferred.resolve();\n });\n });\n}", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "setNewWallet(new_wallet) {\n this.setState({\n new_wallet\n });\n }", "async function onConnect() {\n\n console.log(\"Opening a dialog\", web3Modal);\n try {\n provider = await web3Modal.connect();\n } catch (e) {\n console.log(\"Could not get a wallet connection\", e);\n return;\n }\n\n // Subscribe to accounts change\n provider.on(\"accountsChanged\", (accounts) => {\n fetchAccountData();\n });\n\n // Subscribe to chainId change\n provider.on(\"chainChanged\", (chainId) => {\n fetchAccountData();\n });\n\n // Subscribe to networkId change\n provider.on(\"networkChanged\", (networkId) => {\n fetchAccountData();\n });\n\n await refreshAccountData();\n}", "async function onConnect() {\n\n console.log(\"Opening a dialog\", web3Modal);\n try {\n provider = await web3Modal.connect();\n } catch(e) {\n console.log(\"Could not get a wallet connection\", e);\n return;\n }\n\n // Subscribe to accounts change\n provider.on(\"accountsChanged\", (accounts) => {\n fetchAccountData();\n });\n\n // Subscribe to chainId change\n provider.on(\"chainChanged\", (chainId) => {\n fetchAccountData();\n });\n\n // Subscribe to networkId change\n provider.on(\"networkChanged\", (networkId) => {\n fetchAccountData();\n });\n\n await refreshAccountData();\n}", "function initWalletChoice() {\n $(\"#create-wallet\").show();\n $(\"#enter-wallet\").hide();\n $('#generated-address').hide();\n $('#generate-address').show();\n\n if (wavesWallet) {\n $('#generated-address').show();\n $('#generate-address').hide();\n }\n\n $(\"#wallet-choice\").change(function() {\n var value = $( this ).val();\n if (value === 'yes') {\n showEnterWallet();\n } else {\n showCreateWallet();\n }\n });\n}", "async setAccount() {\n if (!this.state.privatekey) return\n if (this.state.privatekey.indexOf('0x') === -1) {\n this.setState({privatekey: \"0x\" + this.state.privatekey});\n }\n let a = web3.eth.accounts.privateKeyToAccount(\n this.state.privatekey\n );\n this.setState({account: a});\n if (a.address) {\n this.userHasFsn(a.address);\n }\n this.addOutput(`Succesfully decrypted wallet. Your address is : ${a.address}`);\n }", "async function onConnect() {\r\n try {\r\n provider = await web3Modal.connect();\r\n } catch(e) {\r\n console.log(\"Could not get a wallet connection\", e);\r\n return;\r\n }\r\n\r\n // Subscribe to accounts change\r\n provider.on(\"accountsChanged\", (accounts) => {\r\n fetchAccountData();\r\n });\r\n\r\n // Subscribe to chainId change\r\n provider.on(\"chainChanged\", (chainId) => {\r\n fetchAccountData();\r\n });\r\n\r\n // Subscribe to networkId change\r\n provider.on(\"networkChanged\", (networkId) => {\r\n fetchAccountData();\r\n });\r\n\r\n await refreshAccountData();\r\n}", "function saveWallet() {\n localStorage.setItem(\"currentWallet\", JSON.stringify(currentWallet));\n}", "function newTransaction() {\n inquirer.prompt([{\n type: 'confirm',\n name: 'choice',\n message: 'Would you like to perform another transaction?'\n }]).then(function (answer) {\n if (answer.choice) {\n start();\n }\n else {\n console.log(chalk.redBright(\"===============================================\"));\n console.log(chalk.greenBright(\"Thank You So Much! \") + chalk.yellowBright(\"Wishing You \") + chalk.blueBright(\"A Wonderful Day!\"));\n console.log(chalk.magentaBright(\"===============================================\"));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n connection.end();\n }\n });\n }", "function sendTransaction(generateAccount, algodClient, kmdClient) {\n let note = '';\n let amount = 0;\n const from = { addr: '', sk: '' };\n let to = ''; // 'KI6TMKHUQOGJ7EDZLOWFOGHBBWBIMBMKONMS565X7NSOFMAM6S2EK4GBHQ';\n let walletName = '';\n let walletPassword = '';\n let walletId = null;\n let walletHandle = null;\n let txId = '';\n\n (async () => {\n if (generateAccount) {\n // Create an account\n const account = algosdk.generateAccount();\n console.log(`Address: ${account.addr}`);\n\n // Get backup phrase for account\n const mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n console.log(`Mnemonic: ${mnemonic}`);\n\n // Recover the account\n const recoveredAccount = algosdk.mnemonicToSecretKey(mnemonic);\n // console.log(recoveredAccount.addr);\n\n // Check to see if account is valid\n const isValid = algosdk.isValidAddress(recoveredAccount.addr);\n if (isValid) {\n from.addr = recoveredAccount.addr;\n from.sk = recoveredAccount.sk;\n }\n } else {\n const wallets = await kmdClient.listWallets();\n const walletsLength = wallets.wallets.length;\n if (typeof walletsLength === 'undefined' || walletsLength <= 0) {\n console.log(\"No wallets could be found in `kmd'.\");\n process.exit(1);\n }\n\n console.log('\\nGot wallets list:'); // + JSON.stringify(wallets));\n for (let i = 0; i < walletsLength; i++) {\n console.log(`[${i + 1}] ${wallets.wallets[i].name}`);\n }\n\n if (!walletName) {\n const walletIndex = readlineSync.keyIn(\n `Pick the wallet to use [1${walletsLength > 1 ? `-${walletsLength}` : ''}]: `,\n // eslint-disable-next-line comma-dangle\n { limit: `$<1-${walletsLength}>` }\n );\n walletName = wallets.wallets[walletIndex - 1].name;\n walletId = wallets.wallets[walletIndex - 1].id;\n }\n\n if (!walletPassword) {\n walletPassword = readlineSync.question(`\\nType the '${walletName}' wallet's password: `, {\n hideEchoBack: true,\n mask: '',\n });\n }\n\n walletHandle = (await kmdClient.initWalletHandle(walletId, walletPassword)).wallet_handle_token;\n\n const keys = await kmdClient.listKeys(walletHandle);\n const keysLength = keys.addresses.length;\n if (typeof keysLength === 'undefined' || keysLength <= 0) {\n console.log(`No keys could be found in \\`kmd' for '${walletName}'.`);\n process.exit(1);\n }\n console.log('\\nGot keys list:'); // + keys);\n for (let i = 0; i < keysLength; i++) {\n console.log(`[${i + 1}] ${keys.addresses[i]}`);\n }\n\n const keyIndex = readlineSync.keyIn(\n `Pick the account address to send from [1${keysLength > 1 ? `-${keysLength}` : ''}]: `,\n { limit: `$<1-${keysLength}>` },\n );\n from.addr = keys.addresses[keyIndex - 1];\n from.sk = (await kmdClient.exportKey(walletHandle, walletPassword, from.addr)).private_key;\n // console.log('sk', from.sk);\n }\n\n if (!to) {\n to = readlineSync.question('\\nSpecify the account address to send to: ');\n }\n\n if (!amount) {\n amount = readlineSync.questionInt('\\nSpecify the amount to be transferred: ');\n }\n\n if (!note) {\n note = readlineSync.question('\\nSpecify some note text (optional): ');\n }\n\n // Get the relevant params from the algod\n const params = await algodClient.getTransactionParams();\n const endRound = params.lastRound + parseInt(1000, 10);\n\n // Create a transaction\n const txn = {\n from: from.addr,\n to, // 'NJY27OQ2ZXK6OWBN44LE4K43TA2AV3DPILPYTHAJAMKIVZDWTEJKZJKO4A',\n fee: params.fee,\n amount,\n firstRound: params.lastRound,\n lastRound: endRound,\n genesisID: params.genesisID,\n note: note ? algosdk.encodeObj(note) : new Uint8Array(0),\n };\n\n // Sign the transaction\n console.log('\\nSigning transaction: \\n', txn);\n const signedTxn = algosdk.signTransaction(txn, from.sk);\n\n // Submit the transaction\n console.log('\\nSubmitting transaction...');\n const tx = await algodClient.sendRawTransaction(signedTxn.blob);\n txId = tx.txId; // eslint-disable-line prefer-destructuring\n console.log(`Transaction: tx-${txId}`);\n })().catch((e) => {\n console.log(e.error.text);\n process.exit(1);\n });\n}", "async createAccount(caller, amount = 0) {\n const iTx = invokeScript({\n dApp: address(this.dapp_account),\n call: {\n function: \"createAccount\",\n },\n payment: [{ assetId: this.asset_id, amount: amount }]\n }, caller);\n\n await broadcast(iTx)\n await waitForTx(iTx.id);\n this.dd('Account ' + caller + ' (' + address(caller) + ') has been created in dApp (' + address(this.dapp_account) + ') | tx_id: ' + iTx.id)\n }", "async function connect() {\n // uncomment to enable torus and walletconnect\n const providerOptions = {\n // torus: {\n // package: Torus,\n // },\n // walletconnect: {\n // package: window.WalletConnectProvider.default,\n // options: {\n // infuraId: \"00000000000000000000000000000000\",\n // },\n // },\n };\n\n const web3Modal = new window.Web3Modal.default({\n providerOptions,\n });\n\n web3Modal.clearCachedProvider();\n\n // set provider\n provider = await web3Modal.connect();\n web3 = new Web3(provider);\n\n // set current network id\n web3gl.networkId = parseInt(provider.chainId);\n\n // if current network id is not equal to network id, then switch\n if (web3gl.networkId != window.web3ChainId) {\n try {\n await window.ethereum.request({\n method: \"wallet_switchEthereumChain\",\n params: [{ chainId: `0x${window.web3ChainId.toString(16)}` }], // chainId must be in hexadecimal numbers\n });\n } catch {\n // if network isn't added, pop-up metamask to add\n await addEthereumChain();\n }\n }\n\n // set current account\n // provider.selectedAddress works for metamask and torus\n // provider.accounts[0] works for walletconnect\n web3gl.connectAccount = provider.selectedAddress || provider.accounts[0];\n\n // refresh page if player changes account\n provider.on(\"accountsChanged\", (accounts) => {\n window.location.reload();\n });\n\n // update if player changes network\n provider.on(\"chainChanged\", (chainId) => {\n web3gl.networkId = parseInt(chainId);\n });\n}", "async function onDisconnect() {\n\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if (provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n $(\"#eth-wallet-box\").addClass(\"invalid-box\").removeClass(\"valid-box\");\n}", "_configureUIWithTransaction () {\n const self = this\n let currentLocale\n self.context.locale.Locale(function (err, locale) {\n if (err) {\n console.error('Error obtaining the current locale.')\n currentLocale = 'en-US'\n } else {\n currentLocale = locale\n }\n })\n const wallet = self.wallet\n if (wallet.didFailToInitialize_flag === true || wallet.didFailToBoot_flag === true) {\n throw Error(self.constructor.name + ' opened while wallet failed to init or boot.')\n }\n const transaction = self.transaction\n if (transaction.isUnlocked !== true) {\n if (self.validationMessageLayer__isLocked.userHasClosedThisLayer !== true) {\n const lockedReason = self.wallet.TransactionLockedReason(self.transaction)\n const messageString = 'This transaction is currently locked. ' + lockedReason\n self.validationMessageLayer__isLocked.SetValidationError(\n messageString,\n true/* wantsXButtonHidden */\n ) // this shows the validation err msg\n }\n } else {\n self.validationMessageLayer__isLocked.style.display = 'none'\n }\n if (transaction.isFailed != true && (transaction.isJustSentTransaction === true || transaction.isConfirmed !== true)) {\n if (self.validationMessageLayer__onItsWay.userHasClosedThisLayer !== true) {\n self.validationMessageLayer__onItsWay.style.display = 'block'\n } else {\n // do not re-show since user has already closed it\n }\n } else {\n self.validationMessageLayer__onItsWay.style.display = 'none'\n }\n if (self.navigationController) {\n self.navigationController.SetNavigationBarTitleNeedsUpdate() // for the CONFIRMED/PENDING\n } else {\n // then it'll effectively be called for us after init\n }\n // Configuring table fields\n { // Date\n let date = self.transaction.timestamp\n if (typeof date === 'string') {\n date = new Date(date)\n }\n const dateString = date.toLocaleDateString(\n currentLocale,\n { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' }\n ).toUpperCase()\n const value = dateString\n self.tableFieldLayer__date.Component_SetValue(value)\n }\n if (typeof self.transaction.target_address !== 'undefined' && self.transaction.target_address) {\n self.valueLayer__to.Component_SetValue(self.transaction.target_address) // in case we have it\n self.valueLayer__to.style.display = 'block'\n } else {\n self.valueLayer__to.style.display = 'none'\n }\n const isOutgoing = self.transaction.approx_float_amount < 0\n { // Total\n const tx = self.transaction\n const received_JSBigInt = tx.total_received ? (typeof tx.total_received === 'string' ? new JSBigInt(tx.total_received) : tx.total_received) : new JSBigInt('0')\n const sent_JSBigInt = tx.total_sent ? (typeof tx.total_sent === 'string' ? new JSBigInt(tx.total_sent) : tx.total_sent) : new JSBigInt('0')\n const value = monero_amount_format_utils.formatMoney(received_JSBigInt.subtract(sent_JSBigInt))\n let color\n if (isOutgoing) {\n color = '#F97777'\n } else {\n color = '#FCFBFC'\n }\n self.tableFieldLayer__amountsFeesAndTotals.Component_SetValue(value)\n self.tableFieldLayer__amountsFeesAndTotals.Component_SetColor(color)\n }\n { // Ringsize\n const value = parseInt(self.transaction.mixin) + 1 // b/c ringsize = mixin + 1\n self.tableFieldLayer__ringsize.Component_SetValue(value)\n }\n { // TX hash\n const value = self.transaction.hash\n self.valueLayer__transactionHash.Component_SetValue(value)\n }\n if (typeof self.transaction.tx_key !== 'undefined' && self.transaction.tx_key) { // outgoing .. we might have own tx key\n const value = self.transaction.tx_key\n self.valueLayer__transactionKey.Component_SetValue(value)\n self.valueLayer__transactionKey.style.display = 'block'\n } else {\n self.valueLayer__transactionKey.style.display = 'none'\n }\n { // Payment ID\n const value = self.transaction.payment_id\n self.valueLayer__paymentID.Component_SetValue(value)\n }\n }", "handler(app, req, res) {\n wallet.addNewAddress(wallet.getDefaultActiveWallet())\n .then(address => {\n res.send(address);\n })\n .catch(e => res.send({\n api_status : 'fail',\n api_message: `unexpected generic api error: (${e})`\n }));\n }", "function claimButtonClicked() { \n console.log(\"ejecución 1\")\n web3.eth.getAccounts(function(error, accounts) { \n if (error) { \n console.log(error)\n return\n }\n //console.log(\"ejecución 2\")\n var account = web3.eth.defaultAccount;\n\n var starName = document.getElementById(\"star-name-input\").value;\n var starStory = document.getElementById(\"star-story-input\").value;\n var star_dec = document.getElementById(\"star-dec-input\").value;\n var star_mag = document.getElementById(\"star-mag-input\").value;\n var star_cent = document.getElementById(\"star-cent-input\").value;\n var star_token = document.getElementById(\"star-token-input\").value;\n\n\n\n starNotary.createStar(starName, starStory, star_dec, star_mag, star_cent, star_token, {from: account, gasLimit:\"5000000\"}, function (error, result) {\n if (!error) {\n document.getElementById(\"result\").innerHTML = \"Transaction: <a href='https://rinkeby.etherscan.io/tx/\"+result+\"' target='_blank'>\"+result+\"</a>\";\n document.getElementById(\"star-tx-input\").value = star_token = document.getElementById(\"star-token-input\").value;\n } else { \n console.log(error);\n console.log(\"errorrrr\");\n }\n });\n \n });\n \n}", "async function onDisconnect() {\n\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if(provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n}", "async function onDisconnect() {\n\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if(provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n}", "async _onPressButtonYes(){\n\t /*Importar cuenta a partir de la clave privada*/\n\t const {address, privateKey} = await this.props.drizzle.web3.eth.accounts.privateKeyToAccount(this.state.privKey);\n\n\t /*Actualizar variables de estado correspondientes*/\n\t this.props.cambiarDir(address);\n\t this.setState({direccion: address});\n\t this.setState({ready: true});\n\t \n\t /*Comprobar que el contrato Datos esta iniciado y crear una instancia del mismo*/\n\t const {Datos} = this.props.drizzleState.contracts;\n\t if (!Datos || !Datos.initialized) return; \n\t const instance = this.props.drizzle.contracts.Datos;\n\t \n\t /*Registrar la direccion existente en el contrato Datos*/\n\t instance.methods.autoregistro.cacheSend({from: address, gas: 300000});\n\t \n\t /*Actualizar las correspondientes variables de estado*/\n\t let x = true;\n\t let y = true;\n\t this.props.actualizarReg(x, y);\n\t \n\t /*Crear el fichero direccion.txt y escribir en el la nueva direccion*/\n\t await FileSystem.writeAsStringAsync(FileSystem.documentDirectory + \"direccion.txt\", address);\n}", "async function onDisconnect() {\r\n\r\n console.log(\"Killing the wallet connection\", provider);\r\n\r\n if(provider.close) {\r\n await provider.close();\r\n await web3Modal.clearCachedProvider();\r\n window.location.reload();\r\n provider = null;\r\n }\r\n\r\n selectedAccount = null;\r\n\r\n // Set the UI back to the initial state\r\n document.querySelector(\"#prepare\").style.display = \"block\";\r\n document.querySelector(\"#connected\").style.display = \"none\";\r\n}", "async function onDisconnect() {\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if (provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n}", "showApp() {\n this.signedOutContainer.style.display = 'none';\n this.signedInContainer.style.display = 'block';\n // From this point, you should be able to interact with web3 and contractInstance\n this.web3.eth.getAccounts().then(accounts => {\n this.currentAccount = accounts[0];\n if (accounts[0]) {\n this.walletAddressContainer.innerHTML = accounts[0];\n } else {\n console.log('no address found')\n }\n }).catch(error => {\n this.setError(error);\n });\n }", "function initWallet() {\n // do not override existing private keys\n if (fs.existsSync(privateKeyFile)) { return; }\n\n const newPrivateKey = generatePrivateKey();\n\n // mkdir, if necessary\n if (!fs.existsSync(\"wallet/\")) {\n fs.mkdirSync(\"wallet/\");\n }\n if (!fs.existsSync(privateKeyLocation)) {\n fs.mkdirSync(privateKeyLocation);\n }\n\n // write file\n fs.writeFileSync(privateKeyFile, newPrivateKey);\n\n console.log(\"New wallet with private key created to: %s\", privateKeyFile);\n}", "function newDepartment() {\n console.log(\"Create new department\");\n\nvar account = web3.personal.newAccount(\"BE1010be\");\n //web3.personal.newAccount(\"BE1010be\").then(function(account){\n\nif(account != null && account != ''){\n //var account = acc1.result;\n web3.personal.unlockAccount(accounts[0], \"BE1010be\");\n web3.eth.sendTransaction({from:accounts[0], to:account, value:20000000000000000000}, function(error, result){\n if(error){\n alert(\"Issue creating the account, please try after sometime\");\n }\n\n var transaction = web3.eth.getTransaction(result);\n\n\n while(transaction.blockNumber == null || transaction.blockNumber <= 0){\n transaction = web3.eth.getTransaction(result);\n console.log(\"waiting for transaction to mined...\");\n }\n Department.setProvider(web3.currentProvider);\n web3.personal.unlockAccount(account, \"BE1010be\");\n \tDepartment.new({from: account, gas: 4712386}).then(\n \tfunction(department) {\n \t\tconsole.log(department);\n \t\tmyDepartmentInstance = department;\n console.log(\"Department contract address....\" + myDepartmentInstance.address);\n console.log(\"Department account address....\" + account);\n\n $(\"#contractAddress\").val(myDepartmentInstance.address);\n $(\"#accountAddress\").val(account);\n $(\"#departmentName\").val(\"\");\n\n addToDepartments(account, myDepartmentInstance.address);\n\n\n \t\t//$(\"#patientContractAddress\").html(myPatientInstance.address);\n\n \t});\n });\n }else{\n alert(\"Issue creating the account, please try after sometime\");\n }\n //});\n\n\n}", "async _onPressButtonNo(){\n\t/*Comprobar que el contrato Datos esta iniciado y crear una instancia del mismo*/\n\tconst {Datos} = this.props.drizzleState.contracts;\n\tif (!Datos || !Datos.initialized) return; \n\tconst inst = this.props.drizzle.contracts.Datos;\n\t\n\t/*Crear una nueva cuenta y desbloquearla*/\n\tconst address = await this.props.drizzle.web3.eth.personal.newAccount('test');\n\tawait this.props.drizzle.web3.eth.personal.unlockAccount(address, 'test', 0);\n\t\n\t/*Actualizar la direccion del usuario*/\n\talert(\"Nueva dirección: \" + address);\n\tthis.props.cambiarDir(address);\n\t\n\t/*Enviar 10 ethers a la nueva cuenta*/\n\tconst accounts = await this.props.drizzle.web3.eth.getAccounts();\n\tawait this.props.drizzle.web3.eth.sendTransaction({to:address, from:accounts[9], value:this.props.drizzle.web3.utils.toWei(\"10\", \"ether\")});\n\t\n\t/*Crear una nueva instancia del contrato Datos*/\n\tif (!Datos || !Datos.initialized) return; \n\tconst instance = this.props.drizzle.contracts.Datos;\n\t\n\t/*Registrar la nueva direccion en el contrato Datos*/\n\tinstance.methods.autoregistro.cacheSend({from: address, gas: 300000});\n\t\n\t/*Actualizar las correspondientes variables de estado*/\n\tlet x = true;\n\tlet y = true;\n\tthis.props.actualizarReg(x, y);\n\t\n\t/*Crear el fichero direccion.txt y escribir en el la nueva direccion*/\n await FileSystem.writeAsStringAsync(FileSystem.documentDirectory + \"direccion.txt\", address);\n}", "startObserving_wallet () {\n const self = this\n if (!self.wallet) {\n return\n }\n if (typeof self.wallet === 'undefined' || self.wallet === null) {\n throw Error('wallet undefined in start observing')\n }\n // here, we're going to store a bunch of functions as instance properties\n // because if we need to stopObserving we need to have access to the listener fns\n //\n // login success/fail\n self.wallet_EventName_booted_listenerFunction = function () {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_booted(),\n self.wallet_EventName_booted_listenerFunction\n )\n //\n self.wallet_EventName_errorWhileBooting_listenerFunction = function (err) {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_errorWhileBooting(),\n self.wallet_EventName_errorWhileBooting_listenerFunction\n )\n //\n // wallet label\n self.wallet_EventName_walletLabelChanged_listenerFunction = function () {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_walletLabelChanged(),\n self.wallet_EventName_walletLabelChanged_listenerFunction\n )\n // wallet swatch\n self.wallet_EventName_walletSwatchChanged_listenerFunction = function () {\n self._configureUIWithWallet__color()\n }\n self.wallet.on(\n self.wallet.EventName_walletSwatchChanged(),\n self.wallet_EventName_walletSwatchChanged_listenerFunction\n )\n // balance\n self.wallet_EventName_balanceChanged_listenerFunction = function () {\n self._configureUIWithWallet__labels()\n }\n self.wallet.on(\n self.wallet.EventName_balanceChanged(),\n self.wallet_EventName_balanceChanged_listenerFunction\n )\n {\n const emitter = self.context.CcyConversionRates_Controller_shared\n self._CcyConversionRates_didUpdateAvailabilityOfRates_fn = function () {\n self._configureUIWithWallet__labels()\n }\n emitter.on(\n emitter.eventName_didUpdateAvailabilityOfRates(),\n self._CcyConversionRates_didUpdateAvailabilityOfRates_fn\n )\n }\n {\n const emitter = self.context.settingsController\n self._settingsController__EventName_settingsChanged_displayCcySymbol__fn = function () {\n self._configureUIWithWallet__labels()\n }\n emitter.on(\n emitter.EventName_settingsChanged_displayCcySymbol(),\n self._settingsController__EventName_settingsChanged_displayCcySymbol__fn\n )\n }\n }", "function onSetupContract() {\n var address = $(\"#setup-contract-address\").val();\n if(!address) {\n window.alert(\"Please enter contract address\");\n return;\n }\n setupContract(address);\n }", "function saveUserAddress(device, wallet) {\n db.query(`INSERT INTO xwf_obyfit_user_challenge (device, wallet)\n VALUES (?,?)`, [device, wallet]);\n device.sendMessageToDevice(device, 'text', 'Your address is saved');\n device.sendMessageToDevice(device, 'text', \"Please send me your google id\");\n //toPlay.stackGame(device_address, wallet_address); // ask user to play\n}", "function register() {\n\n //if (!uploaded) {\n //alert(\"Please upload your voting codes\");\n //return;\n //}\n\n if (!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n if (state != 1) {\n alert(\"You can only register during the SIGNUP Phase \");\n return;\n }\n\n if (!myvotingAddr.eligible(addr)) {\n alert(\"Your Ethereum Account is not eligible for this vote\");\n return;\n }\n\n\t\n // We prove knowledge of the voting key\n var single_zkp = cryptoAddr.createZKP.call(x.toString(), v.toString(), {\n from: web3.eth.accounts[accounts_index]\n });\n\n web3.personal.unlockAccount(addr, password);\n\n // Lets make sure the ZKP is valid!\n var verifyres = cryptoAddr.verifyZKP.call(xG.toString(), single_zkp[0], single_zkp[1], {\n from: web3.eth.accounts[accounts_index]\n });\n\n if (!verifyres) {\n alert(\"Problem with voting codes\");\n return;\n }\n\n var res = myvotingAddr.register.call(xG.toString(), single_zkp[1], single_zkp[0], {\n from: web3.eth.accounts[accounts_index],\n\t\t\tgas: 4200000\n });\n\n // Submit voting key to the network\n if (res) {\n myvotingAddr.register.sendTransaction(xG.toString(), single_zkp[1], single_zkp[0], {\n from: web3.eth.accounts[accounts_index],\n gas: 4200000\n });\n\n document.getElementById(\"registration\").innerHTML = \"Waiting for registration to end\";\n\t\tcreateRegistration();\n\n } else {\n alert(\"Registration failed... Problem could be your voting codes or that you have already registered\");\n }\n}", "onBalanceCompletePress() {\n const { transitionAddresses, selectedAccountName, password } = this.props;\n setTimeout(() => {\n getSeedFromKeychain(password, selectedAccountName)\n .then((seed) => {\n if (seed === null) {\n throw new Error('Error');\n } else {\n this.props.completeSnapshotTransition(\n seed,\n selectedAccountName,\n transitionAddresses,\n getPowFn(),\n );\n }\n })\n .catch((err) => console.error(err));\n }, 300);\n }", "setNewWallet(new_wallet) {\n this.setState({new_wallet})\n }", "async function onDisconnect() {\r\n\r\n // TODO: Which providers have close method?\r\n if(provider.close) {\r\n await provider.close();\r\n\r\n // If the cached provider is not cleared,\r\n // WalletConnect will default to the existing session\r\n // and does not allow to re-scan the QR code with a new wallet.\r\n // Depending on your use case you may want or want not his behavir.\r\n await web3Modal.clearCachedProvider();\r\n provider = null;\r\n }\r\n\r\n selectedAccount = null;\r\n\r\n // Set the UI back to the initial state\r\n document.querySelector(\"#prepare\").style.display = \"block\";\r\n document.querySelector(\"#connected\").style.display = \"none\";\r\n setdisable(true);\r\n}", "requirePassword() {\n this.navigateTo('walletResetRequirePassword');\n }", "function insertNew3TPAllowance() {\n var frm = document.frmAllow;\n if (frm.allowTPAddress.value.length < 41) {\n $(\"#statusFormAllow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormAllow\").html(\"You must inform appropriate information\");\n return\n }\n $(\"#statusFormAllow\").css(\"background-color\", \"lightblue\");\n $(\"#statusFormAllow\").html(\"Waiting for you to confirm the transaction in MetaMask or another Ethereum wallet software\");\n console.log(\"Sending... \" + frm.allowTPAddress.value);\n contract.allowIssuers(frm.allowTPAddress.value, {from: web3.eth.accounts[0], gas: 3000000, value: 0}, function (err, result) {\n if (!err) {\n $(\"#statusFormAllow\").css(\"background-color\", \"yellow\");\n $(\"#statusFormAllow\").text(\"Transaction sent. Wait until it is mined. Transaction hash: \" + result);\n waitForTxToBeMined(result, \"#statusFormAllow\");\n } else {\n console.error(err);\n $(\"#statusFormAllow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormAllow\").html(\"Error \" + JSON.stringify(err));\n }\n });\n $(\"#btnStartOverNew3TPAllowance\").show();\n $(\"#btnInsertNew3TPAllowance\").hide();\n}", "registerAccount(traderName, traderEmail, traderPassword) {\n var registration = new Registration(traderName, traderEmail, traderPassword);\n\n // Validate Credentials\n let obj = registration.validateCredentials(traderEmail, traderName, traderPassword);\n if (obj.Bool == false)\n return obj;\n\n // Complete Registration\n const words = Buffer.from(Registration.generateWords(), 'utf8').toString('hex'); // Store this, fuck aughttt\n let walletID = registration.createWalletID(words, traderPassword); // get the first hash (secret)\n console.log(\"Please keep this walletID secret \" + walletID + ' ' + words + ' ' + traderPassword);\n registration.storeCredentials(registration, words);\n const reg = (registration.createIdentity(traderName, \"50000\", walletID)) ? true : false;\n if (reg == true)\n return {\n Bool: true,\n Message: \"Registration Successful\"\n };\n\n return {\n Bool: false,\n Message: \"Registratiion Failed\"\n };\n }", "startNewGame() {\n if (this.lobyCorrect) {\n let bankerName = this.loby.bankerName;\n let password = this.loby.password;\n let process = this.bank.createTheBanker(bankerName, password);\n\n //Si el proceso de creacion fue sactifactorio se actualizan los datos\n if (process.result) {\n this.loby.bankerName = '';\n this.loby.password = '';\n this.loby.visibility = false;\n this.showView(this.views.dashboard.name)\n }\n\n this.saveBank();\n }//Fin de if\n }", "async function onlogin(mobile) {\n console.log('Call de window.onInit, provider = ', provider)\n let mobile_account = \"undefined\";\n let mobile_wallet = \"undefined\";\n let mobile_logo = \"undefined\";\n // init walletconnect with or whithout builtin QR code\n if (mobile == 'mobile') {\n console.log('Call from mobile device');\n provider = new WalletConnectProvider({\n rpc: {\n //1 : \"https://talao.co/rpc\",\n 50000 : \"https://talao.co/rpc\",\n },\n });\n }\n else {\n console.log('Call from Desktop');\n provider = new WalletConnectProvider({\n rpc: {\n //1 : \"https://talao.co/rpc\",\n 50000 : \"https://talao.co/rpc\",\n },\n qrcode: false,\n });\n // display custom QRcode\n provider.connector.on(\"display_uri\", (err, payload) => {\n const uri = payload.params[0];\n console.log('uri = ',uri);\n QRCode.toCanvas(canvas, uri,{width : 244}, function (error) {\n if (error) {console.error(error);\n }\n else \n {console.log('connexion success !');\n console.log('provider = ',provider);\n }\n })\n });\n }\n\n onSubscribe();\n\n await provider.enable()\n .then(value => {\n console.log('value = ',value, 'provider = ', provider, 'accounts =', provider.accounts);\n mobile_account = provider.accounts[0];\n mobile_wallet = provider.wc._peerMeta['name'];\n mobile_logo = provider.wc._peerMeta['icons'][0];\n document.getElementById(\"connected\").innerHTML = wc_on;\n })\n .catch(e => {\n console.log(e);\n });\n\n // create web3 object for future use\n web3 = new Web3(provider);\n\n if (!web3.utils.isAddress(mobile_account)) {\n console.log(`it s not an ethereum address`);\n await onend();\n }\n return [mobile_account, mobile_wallet, mobile_logo];\n}", "function test() {\r\n\r\n\r\n var seed = Wallet.generateMnemonic();\r\n\r\n // seed = 'dragon accuse transfer cash help couch olive idea rotate unveil divert odor'\r\n seed = 'copper siren differ use like egg sight where spoon learn swamp swarm'\r\n\r\n var coinNames = ['bitcoin', 'litecoin', 'dogecoin', 'dashcoin', 'ethereum'];\r\n var pwd = '1';\r\n\r\n // Wallet.createInstance(seed, pwd, coinNames, function (wallet) {\r\n // console.log('Create Wallet instance ok')\r\n // });\r\n\r\n\r\n Wallet.createInstance(seed, 'password', coinNames, function(wallet) {\r\n console.log('Test create Wallet instance ok');\r\n\r\n // for (var i = 0; i < coinNames.length; i++) {\r\n // var address = wallet.getAddress(coinNames[i], 0);\r\n // var privKey = wallet.exportPrivateKey(coinNames[i], address);\r\n // console.log('%s: %s', address, privKey)\r\n // }\r\n\r\n // Test serialize and deserialize\r\n var json = wallet.serialize();\r\n var wallet2 = new Wallet();\r\n wallet2.deserialize(json);\r\n\r\n var json2 = wallet2.serialize();\r\n\r\n // Compare 2 serialization\r\n console.log('Test serialize and deserialize: ' + (json2.toString() == json.toString()))\r\n\r\n var address = wallet2.getAddress(coinNames[0], 0);\r\n var privKey = wallet2.exportPrivateKey(coinNames[0], address);\r\n\r\n // Test encrypt and decrypt\r\n var msg = '123123';\r\n Wallet.encryptString(msg, 'password', function(data) {\r\n Wallet.decryptString(data, 'password2', function(data) {\r\n console.log('Test encrypt and decrypt(wrong password): ' + (data != msg))\r\n })\r\n Wallet.decryptString(data, 'password', function(data) {\r\n console.log('Test encrypt and decrypt(right password): ' + (data == msg))\r\n })\r\n })\r\n\r\n //Test change password\r\n var newPassword = '123';\r\n wallet.changePassword('password', newPassword, newPassword, function(newWallet) {\r\n var address2 = wallet2.getAddress(coinNames[0], 0);\r\n var privKey2 = wallet2.exportPrivateKey(coinNames[0], address);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var oldPrivateKey = Encrypt.decryptString(privKey, derivedKey);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var newPrivateKey = Encrypt.decryptString(privKey2, derivedKey);\r\n\r\n console.log('Test change password: ' + (oldPrivateKey == newPrivateKey));\r\n });\r\n })\r\n });\r\n\r\n });\r\n\r\n}", "constructor(notificationHandler) {\n this.notificationHandler = notificationHandler;\n var privateKey = this.getPrivateKey();\n if (privateKey) {\n //private key was found, there is already a wallet initialized\n //authentication\n var password = \"\";\n var decryptedPrivateKey = false;\n password = this.getPassword(false);\n decryptedPrivateKey = this.decryptPrivateKey(privateKey, password);\n while (!decryptedPrivateKey) {\n //repeat password prompt until the right password is given\n password = this.getPassword(true);\n decryptedPrivateKey = this.decryptPrivateKey(privateKey, password);\n }\n this.wallet = new SimpleWallet(decryptedPrivateKey); //create the simplewallet object from the decrypted private key\n return true;\n } else {\n //there is no private key initialized\n var password = this.setPassword(); //create and set password\n //generate private key and save it\n var privateKey = this.generatePrivateKey();\n this.savePrivateKey(this.encryptPrivateKey(privateKey, password));\n this.wallet = new SimpleWallet(privateKey);\n this.notificationHandler.message(\n \"Wallet created successfully. Please save your private key in a safe place: \" +\n privateKey,\n \"primary\"\n );\n return true;\n }\n }", "async beforeTransaction(ctx) {\n\t\t// Allow only the manufacturer peers to initiate any transaction on this contract\n\t}", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n $('#confirmation').modal({\n show: 'true'\n }); \n }", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', 'sherlocked123@gmail.com', 'sherlocked123@gmail.com', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', 'a12@gmail.com', 'a12@gmail.com', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', 'a@gmail.com', 'a@gmail.com', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, 'a@gmail.com','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', 'b012@gmail.com', 'b012@gmail.com', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', 'b123@gmail.com', 'b012@gmail.com', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', 'b012@gmail.com', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', 'a1234@gmail.com', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "function Wallet () {\n this.hdWallet = null\n this.numberOfFctAddresses = 0\n this.addresses = []\n this.mnemonic = ''\n}", "function accountNewCreate() {\n\tpopupAccErrorMsg.innerHTML = null;\n\tvar accNameToCreate = document.getElementById('txtAccountName').value;\n\tvar password = document.getElementById('txtPassword').value;\n\tvar rePassword = document.getElementById('txtRePassword').value;\n\tvar operation = \"create\";\n\tshowSpinner(\"modalSpinnerAcct\");\n\tif (Accvalidation(accNameToCreate, password, rePassword, operation)) {\n\t\tif (($('#checkBoxAccountCreate').is(':checked'))) {\n\t\t\tvar isValid = objCommon.validateDropDownValue('dropDownAcntCreate', '#selectRoleDropDownError', getUiProps().MSG0279);\n\t\t\tif (isValid == false) {\n\t\t\t\tremoveSpinner(\"modalSpinnerAcct\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tvar createAllowed = false;\n\t\tvar body = {\n\t\t\t\"Name\" : accNameToCreate\n\t\t};\n\t\tvar baseUrl = getClientStore().baseURL;\n\t\tvar cellname = sessionStorage.selectedcell.toString();\n\t\tvar accessor = objCommon.initializeAccessor(baseUrl, cellname, \"\", \"\");\n\t\tvar objAccount = new _pc.Account(accessor, body);\n\t\tvar objAccountManager = new _pc.AccountManager(accessor);\n\t\ttry {\n\t\t\tvar accountResponse = objAccountManager.retrieve(accNameToCreate);\n\t\t\tcreateAllowed = !(accountResponse instanceof _pc.Account);\n\t\t} catch (exception) {\n\t\t\tcreateAllowed = true;\n\t\t}\n\t\tif (createAllowed) {\n\t\t\tcreateAccount(accessor, objAccount, objAccountManager, password, accNameToCreate);\n\t\t} else {\n\t\t\tdisplayAccountExistMessage(\"create\");\n\t\t\tremoveSpinner(\"modalSpinnerAcct\");\n\t\t}\n\t}\n\tremoveSpinner(\"modalSpinnerAcct\");\n}", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\nhdPrivateKey.network = bitcore.Networks.get(\"openchain\");\nvar derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\nconsole.log(\"Passphrase is: \" + code.toString() + \"\\nWalletID: \" + derivedKey.privateKey.toAddress().toString());\n\n}", "async function connectToWallet() {\n const ethereum = checkConnection();\n\n if (checkAccount() == null) {\n try {\n await ethereum.send(\"eth_requestAccounts\");\n } catch (error) {\n console.log(error);\n }\n } else {\n console.log(\"account: \" + ethereum.selectedAddress);\n }\n}", "function _updateWallet() {\r\n if (!_isEmpty(output)) {\r\n address.value = output.address;\r\n publickey.value = output.publicKey;\r\n privatekey.value = output.privateKey;\r\n }\r\n }", "_configureUIWithWallet () {\n const self = this\n self._configureUIWithWallet__labels()\n self._configureUIWithWallet__color()\n }", "function createFirstBlankTransaction(self) {\n\t\tlet transParams = self.generateTransParams(self.wallet.publicKey, 0, 'The blank transaction to register address!');\n\t\tself.iota.api.sendTransfer(self.wallet.publicKey, 3, 9, transParams, (error, response) => {\n\t if (error) {\n\t \tconsole.log(error);\n\t } else {\n\t \tconsole.log('Register address transaction details:');\n\t console.log(response);\n\t }\n\t\t});\n\t}", "function checkAndFinalizeWallet(wallet, onDone) {\n\tdb.query(\"SELECT member_ready_date FROM wallets LEFT JOIN extended_pubkeys USING(wallet) WHERE wallets.wallet=?\", [wallet], function (rows) {\n\t\tif (rows.length === 0) { // wallet not created yet or already deleted\n\t\t\t//\tthrow Error(\"no wallet in checkAndFinalizeWallet\");\n\t\t\tconsole.log(\"no wallet in checkAndFinalizeWallet\");\n\t\t\treturn onDone ? onDone() : null;\n\t\t}\n\t\tif (rows.some(function (row) { return !row.member_ready_date; }))\n\t\t\treturn onDone ? onDone() : null;\n\t\tdb.query(\"UPDATE wallets SET ready_date=\" + db.getNow() + \" WHERE wallet=? AND ready_date IS NULL\", [wallet], function () {\n\t\t\tif (onDone)\n\t\t\t\tonDone();\n\t\t\teventBus.emit('wallet_completed', wallet);\n\t\t});\n\t});\n}", "function activateSignup() {\n activateNewAccount(true)\n\n }", "function callGuestOrAccCreationOrLogged() {\n\tif(intervalForServiceFee){\n\t\tclearIntervalApp(intervalForServiceFee);\n\t}\n\tdeActivateCheckoutPayButton(); \n var registerUser = parseBoolean(localStorage.getItem(\"registerUser\"));\n if (!registerUser) {\n if (!isGrtr) {\n updateUserProfileCheckout();\n } \n } else {\n \tif(isPromocodeJsonTypeAvailable()){\n \t\tif(!verifyPromocode()){\n \t \treturn;\n \t }\n \t}\n \tclearIntervalApp(timeIntevalOfAddCard);\n \tcallAddCardOrSubmitCard();\n }\n}", "removeWallet() {}", "function syncWallet (successcallback, errorcallback) {\n\n var panic = function(e) {\n console.log('Panic ' + e);\n window.location.replace(\"/\");\n throw 'Save disabled.';\n // kick out of the wallet in a inconsistent state to prevent save\n };\n\n if (MyWallet.wallet.isEncryptionConsistent === false) {\n panic(\"The wallet was not fully enc/decrypted\");\n }\n\n if (!MyWallet.wallet || !MyWallet.wallet.sharedKey\n || MyWallet.wallet.sharedKey.length === 0\n || MyWallet.wallet.sharedKey.length !== 36)\n { throw 'Cannot backup wallet now. Shared key is not set'; };\n\n WalletStore.disableLogout();\n\n var _errorcallback = function(e) {\n WalletStore.sendEvent('on_backup_wallet_error');\n WalletStore.sendEvent(\"msg\", {type: \"error\", message: 'Error Saving Wallet: ' + e});\n // Re-fetch the wallet from server\n MyWallet.getWallet();\n // try to save again:\n // syncWallet(successcallback, errorcallback);\n errorcallback && errorcallback(e);\n };\n try {\n var method = 'update';\n var data = JSON.stringify(MyWallet.wallet, null, 2);\n var crypted = WalletCrypto.encryptWallet( data\n , WalletStore.getPassword()\n , WalletStore.getPbkdf2Iterations()\n , MyWallet.wallet.isUpgradedToHD ? 3.0 : 2.0 );\n\n if (crypted.length == 0) {\n throw 'Error encrypting the JSON output';\n }\n\n //Now Decrypt the it again to double check for any possible corruption\n WalletCrypto.decryptWallet(crypted, WalletStore.getPassword(), function(obj) {\n try {\n var oldChecksum = WalletStore.getPayloadChecksum();\n WalletStore.sendEvent('on_backup_wallet_start');\n WalletStore.setEncryptedWalletData(crypted);\n var new_checksum = WalletStore.getPayloadChecksum();\n var data = {\n length: crypted.length,\n payload: crypted,\n checksum: new_checksum,\n method : method,\n format : 'plain',\n language : WalletStore.getLanguage()\n };\n\n if (Helpers.isHex(oldChecksum)) {\n data.old_checksum = oldChecksum;\n }\n\n if (WalletStore.isSyncPubKeys()) {\n // Include HD addresses unless in lame mode:\n var hdAddresses = (\n MyWallet.wallet.hdwallet != undefined &&\n MyWallet.wallet.hdwallet.accounts != undefined\n ) ? [].concat.apply([],\n MyWallet.wallet.hdwallet.accounts.map(function(account) {\n return account.labeledReceivingAddresses\n })) : [];\n data.active = [].concat.apply([],\n [\n MyWallet.wallet.activeAddresses,\n hdAddresses\n ]\n ).join('|');\n }\n\n MyWallet.securePost(\n \"wallet\"\n , data\n , function(data) {\n checkWalletChecksum(\n new_checksum\n , function() {\n WalletStore.setIsSynchronizedWithServer(true);\n WalletStore.enableLogout();\n WalletStore.resetLogoutTimeout();\n WalletStore.sendEvent('on_backup_wallet_success');\n successcallback && successcallback();\n }\n , function() {\n _errorcallback('Checksum Did Not Match Expected Value');\n WalletStore.enableLogout();\n }\n );\n }\n , function(e) {\n WalletStore.enableLogout();\n _errorcallback(e);\n }\n );\n\n } catch (e) {\n _errorcallback(e);\n WalletStore.enableLogout();\n };\n },\n function(e) {\n console.log(e);\n throw(\"Decryption failed\");\n });\n } catch (e) {\n _errorcallback(e);\n WalletStore.enableLogout();\n }\n\n}", "_updateWallet(transaction = this.transaction_update()) {\n let wallet = this.state.wallet;\n\n if (!wallet) {\n reject(\"missing wallet\");\n return;\n } //DEBUG console.log('... wallet',wallet)\n\n\n let wallet_clone = (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_17__[\"default\"])(wallet);\n\n wallet_clone.last_modified = new Date();\n (0,_tcomb_structs__WEBPACK_IMPORTED_MODULE_6__.WalletTcomb)(wallet_clone); // validate\n\n let wallet_store = transaction.objectStore(\"wallet\");\n let p = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_request_end(wallet_store.put(wallet_clone));\n let p2 = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_transaction_end(transaction).then(() => {\n this.state.wallet = wallet_clone;\n this.setState({\n wallet: wallet_clone\n });\n });\n return Promise.all([p, p2]);\n }", "async initAccounts() {\n if (window['ethereum']) {\n try {\n //returns the active address\n await window['ethereum'].enable()\n } catch (error) {}\n }\n\n\n }", "signUp() {\n\t\tipcRenderer.send('openSignUp', true);\n\t}", "function createSecondPassphrase (selectedAccount) {\n var bip39 = require('bip39')\n var data = { secondPassphrase: bip39.generateMnemonic() }\n\n if (selectedAccount.secondSignature) {\n return formatAndToastError(\n gettextCatalog.getString('This account already has a second passphrase: ' + selectedAccount.address)\n )\n }\n\n function next () {\n if (!$scope.createSecondPassphraseDialog.data.showRepassphrase) {\n $scope.createSecondPassphraseDialog.data.reSecondPassphrase = $scope.createSecondPassphraseDialog.data.secondPassphrase\n $scope.createSecondPassphraseDialog.data.secondPassphrase = ''\n $scope.createSecondPassphraseDialog.data.showRepassphrase = true\n } else if ($scope.createSecondPassphraseDialog.data.reSecondPassphrase !== $scope.createSecondPassphraseDialog.data.secondPassphrase) {\n $scope.createSecondPassphraseDialog.data.showWrongRepassphrase = true\n } else {\n accountService.createTransaction(1, {\n fromAddress: selectedAccount.address,\n masterpassphrase: $scope.createSecondPassphraseDialog.data.passphrase,\n secondpassphrase: $scope.createSecondPassphraseDialog.data.reSecondPassphrase\n }).then(\n function (transaction) {\n showValidateTransaction(selectedAccount, transaction)\n },\n formatAndToastError\n )\n $mdDialog.hide()\n }\n }\n\n function cancel () {\n $mdDialog.hide()\n }\n\n $scope.createSecondPassphraseDialog = {\n data: data,\n cancel: cancel,\n next: next\n }\n\n $mdDialog.show({\n parent: angular.element(document.getElementById('app')),\n templateUrl: './src/accounts/view/createSecondPassphrase.html',\n clickOutsideToClose: false,\n preserveScope: true,\n scope: $scope\n })\n }", "onBalanceIncompletePress() {\n const genFn = getMultiAddressGenFn();\n const { transitionAddresses, password, selectedAccountName } = this.props;\n const currentIndex = transitionAddresses.length;\n this.props.setBalanceCheckFlag(false);\n setTimeout(() => {\n getSeedFromKeychain(password, selectedAccountName).then((seed) => {\n if (seed === null) {\n throw new Error('Error');\n } else {\n this.props.generateAddressesAndGetBalance(seed, currentIndex, genFn);\n }\n });\n }, 300);\n }", "async function run() {\n const { AccountManager, StorageType, SignerType } = require('iota-wallet')\n const manager = new AccountManager({\n storagePath: './test-database',\n storageType: StorageType.Sqlite\n })\n \n const mnemonic = process.env.IOTA_WALLET_MNEMONIC\n \n const account = await manager.createAccount({\n mnemonic,\n alias: 'Test',\n clientOptions: { node: process.env.NODE_URL, localPow: false },\n signerType: SignerType.EnvMnemonic\n })\n\n console.log('alias', account.alias())\n console.log('balance', account.availableBalance())\n \n console.log('syncing account now')\n\n const synced = await account.sync()\n\n console.log('synced', synced)\n console.log('acc messages', account.listMessages())\n console.log('acc spent addresses', account.listAddresses(false))\n console.log('acc unspent addresses', account.listAddresses(true))\n}", "async function connectWallet() {\n\tfunction onConnect() {\n\t\tif (!isConnectedOneTime) {\n\t\t\twindow.isConnectedOneTime = true\n\t\t\twindow.oneTimeConnectionEvents.forEach(fn => fn())\n\t\t}\n\t}\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum)\n try {\n await window.ethereum.enable()\n console.log(\"Connected!\")\n\t\t\tonConnect()\n\t\t\tif ( window.ethereum.isCoin98 )\n\t\t\t\twindow.WALLET_TYPE = 'coin98'\n\t\t\tif ( window.ethereum.isMetaMask )\n\t\t\t\twindow.WALLET_TYPE = 'metamask'\n\t\t\tlet coinbase_address = await window.ethereum.request({method: 'eth_accounts'})\n\t\t\twindow.coinbase_address = coinbase_address.pop()\n return true;\n } catch (e) {\n console.error(e)\n throw new Error(\"User denied wallet connection!\")\n }\n } else if (window.web3) {\n window.web3 = new Web3(window.web3.currentProvider)\n console.log(\"connected to old web3\")\n\t\tonConnect()\n return true\n } else {\n throw new Error(\"No web3 detected!\")\n }\n}", "function createAccount () {\n var bip39 = require('bip39')\n var data = { passphrase: bip39.generateMnemonic() }\n\n function next () {\n if (!$scope.createAccountDialog.data.showRepassphrase) {\n $scope.createAccountDialog.data.repassphrase = $scope.createAccountDialog.data.passphrase\n $scope.createAccountDialog.data.passphrase = ''\n $scope.createAccountDialog.data.showRepassphrase = true\n } else {\n if (!$scope.createAccountForm.$valid) {\n return\n }\n\n var words = $scope.createAccountDialog.data.repassphrase.split(' ')\n if ($scope.createAccountDialog.data.word3 === words[2] && $scope.createAccountDialog.data.word6 === words[5] && $scope.createAccountDialog.data.word9 === words[8]) {\n accountService.createAccount($scope.createAccountDialog.data.repassphrase).then(function (account) {\n self.accounts.push(account)\n toastService.success(\n gettextCatalog.getString('Account successfully created: ') + account.address,\n null,\n true\n )\n selectAccount(account)\n })\n $mdDialog.hide()\n } else {\n $scope.createAccountDialog.data.showWrongRepassphrase = true\n }\n }\n }\n\n function querySearch (text) { // eslint-disable-line no-unused-vars\n text = text.toLowerCase()\n var filter = self.accounts.filter(function (account) {\n return (account.address.toLowerCase().indexOf(text) > -1) || (account.username && (account.username.toLowerCase().indexOf(text) > -1))\n })\n return filter\n }\n\n function cancel () {\n $mdDialog.hide()\n }\n\n $scope.createAccountDialog = {\n data: data,\n cancel: cancel,\n next: next\n }\n\n $mdDialog.show({\n parent: angular.element(document.getElementById('app')),\n templateUrl: './src/accounts/view/createAccount.html',\n clickOutsideToClose: false,\n preserveScope: true,\n scope: $scope\n })\n }", "createAccount () {\n AppDispatcher.dispatch({\n type: bankConstants.CREATED_ACCOUNT,\n ammount: 0\n });\n }", "handlePair(data) {\n // Hack to circumvent a weird screen artifact we are seeing in firmware\n // NOTHING TO SEE HERE\n if (data[0] === '_' || data[0] === '[') data = data.slice(1)\n\n // If we didn't timeout, submit the secret and hope for success!\n this.wait(\"Establishing connection with your Lattice\");\n this.state.session.pair(data, (err) => {\n this.unwait();\n if (err) {\n // If there was an error here, the user probably entered the wrong secret\n const pairErr = 'Failed to pair. You either entered the wrong code or have already connected to this app.'\n this.setError({ msg: pairErr, cb: this.connectSession });\n } else if (this.state.keyringOrigin === null) {\n // Success! Load our addresses from this wallet.\n this.fetchAddresses(this.fetchData);\n } else {\n this.returnKeyringData();\n }\n })\n }", "function generateWallet(type) {\n // Determine XMSS Tree Height\n let xmssHeight = parseInt(document.getElementById('xmssHeight').value)\n let passphrase = document.getElementById('passphrase').value\n let passphraseConfirm = document.getElementById('passphraseConfirm').value\n let hashFunctionSelection = document.getElementById('hashFunction').value\n\n // Set hash function to user selected hash function\n let hashFunction\n switch (hashFunctionSelection) {\n case 'SHAKE_128':\n hashFunction = QRLLIB.eHashFunction.SHAKE_128\n console.log('shake 128')\n break\n case 'SHAKE_256':\n hashFunction = QRLLIB.eHashFunction.SHAKE_256\n console.log('shake 256')\n break\n case 'SHA2_256':\n hashFunction = QRLLIB.eHashFunction.SHA2_256\n console.log('SHA2_256')\n break\n default:\n $('#generating').hide()\n $('#error').show()\n return false\n }\n\n // Check that each passphrase matches\n if(passphrase === passphraseConfirm) {\n // Check that passphrase matches the password policy\n if (passwordPolicyValid(passphrase)) {\n // Generate random seed for XMSS tree\n const randomSeed = toUint8Vector(require('crypto').randomBytes(48))\n\n // Generate XMSS object.\n // eslint-disable-next-line no-global-assign\n XMSS_OBJECT = new QRLLIB.Xmss.fromParameters(randomSeed, xmssHeight, hashFunction)\n const newAddress = XMSS_OBJECT.getAddress()\n\n // If it worked, send the user to the address page.\n if (newAddress !== '') {\n Session.set('passphrase', passphrase)\n Session.set('xmssHeight', xmssHeight)\n\n const params = { address: newAddress }\n const path = FlowRouter.path('/create/:address', params)\n FlowRouter.go(path)\n } else {\n // Error generating walled with QRLLIB.\n $('#generating').hide()\n $('#error').show()\n }\n } else {\n // Invalid passphrase policy\n $('#generating').hide()\n $('#passError').show()\n $('#generate').show()\n }\n } else {\n // Passphrases do not match\n $('#generating').hide()\n $('#passMismatchError').show()\n $('#generate').show()\n }\n}", "function insertWallet(guid, sharedKey, password, extra, successcallback, errorcallback, decryptWalletProgress) {\n assert(successcallback, \"Success callback missing\");\n assert(errorcallback, \"Success callback missing\");\n assert(guid, \"GUID missing\");\n assert(sharedKey, \"Shared Key missing\");\n\n try {\n // var data = MyWallet.makeCustomWalletJSON(null, guid, sharedKey);\n var data = JSON.stringify(MyWallet.wallet, null, 2);\n\n //Everything looks ok, Encrypt the JSON output\n var crypted = WalletCrypto.encryptWallet(data, password, MyWallet.wallet.defaultPbkdf2Iterations, MyWallet.wallet.isUpgradedToHD ? 3.0 : 2.0);\n\n if (crypted.length == 0) {\n throw 'Error encrypting the JSON output';\n }\n\n decryptWalletProgress && decryptWalletProgress();\n\n //Now Decrypt the it again to double check for any possible corruption\n WalletCrypto.decryptWallet(\n crypted,\n password,\n function success() { // success callback for decryptWallet\n\n //SHA256 new_checksum verified by server in case of corruption during transit\n var new_checksum = CryptoJS.SHA256(crypted, {asBytes: true}).toString();\n\n extra = extra || '';\n\n var post_data = {\n length: crypted.length,\n payload: crypted,\n checksum: new_checksum,\n method : 'insert',\n format : 'plain',\n sharedKey : sharedKey,\n guid : guid\n };\n\n Helpers.merge(post_data, extra);\n MyWallet.securePost(\n 'wallet',\n post_data,\n function(data) {\n successcallback(data);\n },\n function(e) {\n errorcallback(e);\n }\n );\n\n },\n function error() { // error callback for decryptWallet\n throw(\"Decrypting wallet failed\");\n }\n );\n } catch (e) {\n errorcallback(e);\n }\n}", "function loadAccount(){\n\n if (window.ethereum && window.ethereum.isMetaMask) {\n console.log('MetaMask detected');\n window.web3 = new Web3(window.ethereum);\n window.ethereum.send('eth_requestAccounts')\n .then(function(result){\n console.log(result.result[0]);\n setDefaultAccount(result.result[0]);\n\n // connection successful, connect wallet button will now display \"Connected\"\n setConnectionInd(\"Connected\");\n\n window.web3.eth.getBalance(contractAddress)\n .then(function(result){\n setContractBalance(window.web3.utils.fromWei(result));\n });\n\n setRPSContract(new window.web3.eth.Contract(contractABI, contractAddress));\n\n })\n } else {\n alert(\"You need to install MetaMask to interact with this app\");\n }\n }", "_connect(updateData) {\n return new Promise((resolve, reject) => {\n this.sdkSession.connect(this.creds.deviceID, (err) => {\n if (err)\n return reject(err);\n // Save the current wallet UID\n const activeWallet = this.sdkSession.getActiveWallet();\n if (!activeWallet || !activeWallet.uid)\n return reject(\"No active wallet\");\n const newUID = activeWallet.uid.toString('hex');\n // If we fetched a walletUID that does not match our current one,\n // reset accounts and update the known UID\n if (newUID != this.walletUID) {\n // If we don't want to update data, return an error\n if (updateData === false)\n return reject('Wallet has changed! Please reconnect.')\n \n // By default we should clear out accounts and update with\n // the new walletUID. We should NOT fill in the accounts yet,\n // as we reserve that functionality to `addAccounts`\n this.accounts = [];\n this.walletUID = newUID;\n }\n return resolve();\n });\n })\n }", "_connect(updateData) {\n return new Promise((resolve, reject) => {\n this.sdkSession.connect(this.creds.deviceID, (err) => {\n if (err)\n return reject(err);\n // Save the current wallet UID\n const activeWallet = this.sdkSession.getActiveWallet();\n if (!activeWallet || !activeWallet.uid)\n return reject(\"No active wallet\");\n const newUID = activeWallet.uid.toString('hex');\n // If we fetched a walletUID that does not match our current one,\n // reset accounts and update the known UID\n if (newUID != this.walletUID) {\n // If we don't want to update data, return an error\n if (updateData === false)\n return reject('Wallet has changed! Please reconnect.')\n \n // By default we should clear out accounts and update with\n // the new walletUID. We should NOT fill in the accounts yet,\n // as we reserve that functionality to `addAccounts`\n this.accounts = [];\n this.walletUID = newUID;\n }\n return resolve();\n });\n })\n }", "function onCreateTransactionSuccess(response) {\n var transaction = response.data.transaction;\n $rootScope.$broadcast('Transaction.createSuccess', transaction);\n $state.go('my.po.details', { guid: $scope.po.guid });\n }", "async stop() {\n this._clear();\n await this.config.rpc.sendJsonRequest(\"stop_wallet\");\n }", "async function main(){\n\nvar password=\"pengshu\";\n\nvar oneBranchAccount=await web3.eth.personal.newAccount(password);\nconsole.log(\"one branch\",oneBranchAccount);\n\n\nlet unlock;\n\ntry{\n unlock=await web3.eth.personal.unlockAccount(oneBranchAccount,password);}\ncatch(e){}\n console.log(\"one branch unlock\",unlock);\n \n\nvar message=\"I am the flash\";\nlet signature;\ntry{\n signature=await web3.eth.sign(message,oneBranchAccount);\n}catch(e){}\nconsole.log(\"signature one branch:\",signature);\n\nlet verfication;\ntry {\n verification= await web3.eth.personal.ecRecover(message,signature);\n}catch(e){console.log(e);}\nconsole.log(verfication);\n}", "function createSinglesigWallet(xPubKey, account, walletName, handleWallet) {\n\tvar arrDefinitionTemplate = [\"sig\", { pubkey: '$pubkey@' + device.getMyDeviceAddress() }];\n\tcreateWallet(xPubKey, account, arrDefinitionTemplate, walletName, null, handleWallet);\n}", "function WalletHeader() {\n const [provider, loadWeb3Modal, logoutOfWeb3Modal] = useWeb3Modal();\n const [address, setAddress] = useState('no address');\n const [addressString, setAddressString] = useState('Connect');\n const [balance, setBalance] = useState('no balance');\n const [balanceString, setBalanceString] = useState('no balance');\n const [network, setNetwork] = useState();\n\n useEffect(() => {\n if (provider) {\n getWalletInfo();\n }\n }, [provider]);\n\n const getWalletInfo = async () => {\n if (provider) {\n // get address\n let s = provider.getSigner();\n let a = await s.getAddress()\n setAddress(a);\n let as = a.toString();\n setAddressString(as.slice(0, 6) + '...' + as.slice(-4));\n let b = await s.getBalance();\n const network = await provider.getNetwork();\n setNetwork(network);\n // console.log(network);\n let balanceCurrency = CurrencyAmount.fromRawAmount(Ether.onChain(network.chainId), b);\n setBalance(balanceCurrency);\n setBalanceString(`${balanceCurrency.toSignificant(4)} Ξ`);\n }\n else {\n console.log('no provider')\n }\n };\n\n return (\n <div>\n <Button>{network?.name}</Button>\n <Button>{balanceString}</Button>\n <Button\n onClick={() => {\n if (!provider) {\n loadWeb3Modal();\n } else {\n logoutOfWeb3Modal();\n }\n }}\n >\n {!provider ? \"Connect Wallet\" : addressString}\n </Button>\n </div>\n );\n}", "function selectAccount (account) {\n // console.log(\"inside select account\")\n // console.log(account)\n var currentaddress = account.address\n self.selected = accountService.getAccount(currentaddress)\n self.selected.ledger = account.ledger\n\n $timeout(function () {\n // pluginLoader.triggerEvent(\"onSelectAccount\", self.selected)\n $scope.$broadcast('account:onSelect', self.selected)\n })\n\n self.showPublicKey = false\n\n loadSignedMessages()\n if (!self.selected.selectedVotes) {\n if (self.selected.delegates) {\n self.selected.selectedVotes = self.selected.delegates.slice(0)\n } else self.selected.selectedVotes = []\n }\n accountService\n .refreshAccount(self.selected)\n .then(function (account) {\n if (self.selected.address === currentaddress) {\n self.selected.balance = account.balance\n self.selected.secondSignature = account.secondSignature\n self.selected.cold = account.cold\n if (!self.selected.publicKey) self.selected.publicKey = account.publicKey\n\n if (!self.selected.virtual) self.selected.virtual = account.virtual\n }\n })\n accountService\n .getTransactions(currentaddress)\n .then(function (transactions) {\n if (self.selected.address === currentaddress) {\n if (!self.selected.transactions) {\n self.selected.transactions = transactions\n } else {\n transactions = transactions.sort(function (a, b) {\n return b.timestamp - a.timestamp\n })\n\n var previousTx = [...self.selected.transactions]\n self.selected.transactions = transactions\n\n var playSound = storageService.get('playFundsReceivedSound')\n if (playSound === true && transactions.length > previousTx.length && transactions[0].type === 0 && transactions[0].recipientId === self.selected.address) {\n var wavFile = require('path').resolve(__dirname, 'assets/audio/power-up.wav')\n var audio = new Audio(wavFile)\n audio.play()\n }\n\n // if the previous tx was unconfirmed, but it back at the top (for better UX)\n if (previousTx.length && !previousTx[0].confirmations && previousTx[0].id !== transactions[0].id) {\n networkService.broadcastTransaction(previousTx[0])\n self.selected.transactions.unshift(previousTx[0])\n }\n\n previousTx = null\n }\n $timeout(function () {\n $scope.$broadcast('account:onRefreshTransactions', self.selected.transactions)\n })\n }\n })\n accountService\n .getVotedDelegates(self.selected.address)\n .then(function (delegates) {\n if (self.selected.address === currentaddress) {\n self.selected.delegates = delegates\n self.selected.selectedVotes = delegates.slice(0)\n }\n })\n accountService\n .getDelegate(self.selected.publicKey)\n .then(function (delegate) {\n if (self.selected.address === currentaddress) {\n self.selected.delegate = delegate\n }\n })\n }", "function airdropDeposit() {\n\t//First check that the erc20Instance is defined. \n\tif(erc20InstanceDefined()) {\n\t\t//Next take the user's input to see how many tokens the user wants to deposit. \n\t\tvar tokensToDeposit = $(\"#value-of-airdrop-deposit\").val();\n\t\t//Now check if the user's input is a positive number. \n\t\tif(isPositiveNumber(\"#value-of-airdrop-deposit\")) {\n\t\t\t//If it is a positive number then multiply it by (10**erc20Decimals) to give the number\n\t\t\t//the correct number of zeros at the end.\n\t\t\ttokensToDeposit = tokensToDeposit * (10**erc20Decimals);\n\t\t} else {\n\t\t\t//If the input is not a positive number, then warn the user and exit the funciton. \n\t\t\talert(\"PLEASE ENTER THE TOTAL AMOUNT OF TOKENS YOU WANT TO DEPOSIT ON THE AIRDROP CONTRACT\");\n\t\t\treturn;\n\t\t}\n\t\t//Now check that the user has enough tokens in his or her MetaMask wallet to fascilitate the \n\t\t//deposit. \n\t\tif(tokensToDeposit > erc20Balance) {\n\t\t\t//If the user does not have enough tokens then alert the user and exit the function. \n\t\t\talert(\"YOU DO NOT HAVE ENOUGH TOKENS IN YOUR WALLET FOR THIS DEPOSIT\");\n\t\t\treturn;\n\t\t}\n\t\t//Now invoke the transfer() function of the erc20 token and have the user sign the transaction \n\t\t//to have the tokens transferred from his or her MetaMask to the airdrop contract address. \n\t\terc20Instance.transfer(airdropAddress, tokensToDeposit, {from: web3.eth.accounts[0], gasPrice: 5e10}, (error, result)=>{\n\t\t\tif(!error) {\n\t\t\t\t$(\"#tx-msg\").html(\"Check the status of your token deposit \");\n\t\t\t\t$(\"a.tx-link\").attr(\"href\", \"https://ropsten.etherscan.io/tx/\"+result);\n\t\t\t\t$(\"#txModal\").modal('show');\n\t\t\t} else {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t})\n\t} \n}", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "function loadWallet() {\n if (!localStorage.getItem(\"currentWallet\")) {\n return;\n }\n currentWallet = JSON.parse(localStorage.getItem(\"currentWallet\"));\n}" ]
[ "0.68957555", "0.67932266", "0.6651633", "0.65637904", "0.63823557", "0.6373131", "0.6356969", "0.62372476", "0.621725", "0.6212654", "0.6204557", "0.62029", "0.6188136", "0.61433065", "0.6130359", "0.60820746", "0.6046302", "0.6030047", "0.601154", "0.5984836", "0.597262", "0.59656996", "0.596398", "0.59566176", "0.5950867", "0.5950658", "0.59422076", "0.59091336", "0.5904978", "0.59015536", "0.58918583", "0.5884318", "0.5872096", "0.5865509", "0.5865408", "0.5844143", "0.584264", "0.5835758", "0.58123285", "0.58123285", "0.581223", "0.5797405", "0.5791776", "0.57778144", "0.57746416", "0.57696486", "0.57521266", "0.5748913", "0.5745496", "0.57339716", "0.5728185", "0.57245827", "0.5722789", "0.5703941", "0.5702899", "0.56955165", "0.568557", "0.5680244", "0.5676443", "0.5672681", "0.5671387", "0.5669537", "0.56682706", "0.56675744", "0.5666606", "0.5662979", "0.5662253", "0.5659686", "0.56555635", "0.5647987", "0.56418467", "0.56359977", "0.56326044", "0.56321335", "0.56319064", "0.56207436", "0.5619624", "0.560181", "0.55814147", "0.5559307", "0.5554383", "0.5554278", "0.55498505", "0.5542943", "0.55387837", "0.552871", "0.5517525", "0.55056894", "0.5502501", "0.54933196", "0.54933196", "0.547635", "0.54734516", "0.5463793", "0.54597074", "0.54546916", "0.54523224", "0.5448658", "0.5448384", "0.54455715" ]
0.578535
43
called from network, without user interaction One of the proposed cosigners declined wallet creation
function deleteWallet(wallet, rejector_device_address, onDone) { db.query("SELECT approval_date FROM extended_pubkeys WHERE wallet=? AND device_address=?", [wallet, rejector_device_address], function (rows) { if (rows.length === 0) // you are not a member device return onDone(); if (rows[0].approval_date) // you've already approved this wallet, you can't change your mind return onDone(); db.query("SELECT device_address FROM extended_pubkeys WHERE wallet=?", [wallet], function (rows) { var arrMemberAddresses = rows.map(function (row) { return row.device_address; }); var arrQueries = []; db.addQuery(arrQueries, "DELETE FROM extended_pubkeys WHERE wallet=?", [wallet]); db.addQuery(arrQueries, "DELETE FROM wallet_signing_paths WHERE wallet=?", [wallet]); db.addQuery(arrQueries, "DELETE FROM wallets WHERE wallet=?", [wallet]); // delete unused indirect correspondents db.addQuery( arrQueries, "DELETE FROM correspondent_devices WHERE is_indirect=1 AND device_address IN(?) AND NOT EXISTS ( \n\ SELECT * FROM extended_pubkeys WHERE extended_pubkeys.device_address=correspondent_devices.device_address \n\ )", [arrMemberAddresses] ); async.series(arrQueries, function () { eventBus.emit('wallet_declined', wallet, rejector_device_address); onDone(); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addWallet() {}", "removeWallet() {}", "if (wallets.hasActiveWallet) {\n runInAction(() => {\n this.disableTransferFunds = false;\n });\n }", "async addWallet() {\n // Validate and format address\n let newAddress = this.validateAddress();\n // Deactivate addressInput button\n this.addressInput.changeToDeactive();\n // Check if wallet already exists in list of wallets\n if (wallets.findWallet(this.name, newAddress) !== undefined) {\n communication.message('Address already included in database for this blockchain. Please try again.');\n } else {\n // Get financial data to check existence of account\n let walletFinancialData = await this.getWalletsFinancialData(this.name, [newAddress]);\n // Invalid address for blockchain\n if (walletFinancialData[newAddress].valid === false) {\n communication.message(\"Not a valid address on \" + this.name + \" blockchain. Please try again.\");\n // Valid address\n } else {\n communication.message('Verified.<br> Generating new wallet info for ' + this.name + ' blockchain.');\n // Generate a new Wallet instance based on the new address\n // - saves in wallets and also stores the summaryRange in the database\n await wallets.generateNewWallet(this, newAddress, true);\n // Set current wallet to new wallet\n wallets.processWalletSelection(this.name, newAddress);\n // Update wallets table\n wallets.updateWalletsTable();\n wallets.scrollToBottomOfTable();\n communication.message('Verified.<br> Click on LOAD DATA to obtain transactions from ' + this.name + ' blockchain.');\n }\n }\n }", "static generateWallet() {\n const wallet = EthereumJsWallet.generate();\n\n AnalyticsUtils.trackEvent('Generate wallet', {\n walletAddress: wallet.getAddressString(),\n });\n\n this.storeWallet(wallet);\n }", "function createWallet(walletRPC, walletName, chain) {\n\twalletRPC.create_wallet(walletName, '')\n\t\t.then(new_wallet => {\n\t\t\tconsole.log(\"createWallet \" + walletName + \".key success\");\n\t\t\tchain(walletRPC, walletName)\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "function thridPartyDisallowance() {\n var frm = document.frmDisallow;\n if (frm.disallowTPAddress.value.length < 41) {\n $(\"#statusFormDisallow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormDisallow\").html(\"You must inform appropriate information\");\n return\n }\n $(\"#statusFormDisallow\").css(\"background-color\", \"lightblue\");\n $(\"#statusFormDisallow\").html(\"Waiting for you to confirm the transaction in MetaMask or another Ethereum wallet software\");\n console.log(\"Sending... \" + frm.disallowTPAddress.value);\n contract.removeIssuers(frm.disallowTPAddress.value, {from: web3.eth.accounts[0], gas: 3000000, value: 0}, function (err, result) {\n if (!err) {\n $(\"#statusFormDisallow\").css(\"background-color\", \"yellow\");\n $(\"#statusFormDisallow\").text(\"Transaction sent. Wait until it is mined. Transaction hash: \" + result);\n waitForTxToBeMined(result, \"#statusFormDisallow\");\n } else {\n console.error(err);\n $(\"#statusFormDisallow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormDisallow\").html(\"Error \" + JSON.stringify(err));\n }\n });\n $(\"#btnStartOverDisallowance\").show();\n $(\"#btn3TPDisallowance\").hide();\n}", "function createWallet(xPubKey, account, arrWalletDefinitionTemplate, walletName, isSingleAddress, handleWallet) {\n\tvar wallet = crypto.createHash(\"sha256\").update(xPubKey, \"utf8\").digest(\"base64\");\n\tconsole.log('will create wallet ' + wallet);\n\tvar arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate);\n\tsetTimeout(function () {\n addWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () {\n handleWallet(wallet);\n if (arrDeviceAddresses.length === 1) // single sig\n return;\n console.log(\"will send offers\");\n // this continues in parallel while the callback handleWallet was already called\n // We need arrOtherCosigners to make sure all cosigners know the pubkeys of all other cosigners, even when they were not paired.\n // For example, there are 3 cosigners: A (me), B, and C. A is paired with B, A is paired with C, but B is not paired with C.\n device.readCorrespondentsByDeviceAddresses(arrDeviceAddresses, function (arrOtherCosigners) {\n if (arrOtherCosigners.length !== arrDeviceAddresses.length - 1)\n throw Error(\"incorrect length of other cosigners\");\n arrDeviceAddresses.forEach(function (device_address) {\n if (device_address === device.getMyDeviceAddress())\n return;\n console.log(\"sending offer to \" + device_address);\n sendOfferToCreateNewWallet(device_address, wallet, arrWalletDefinitionTemplate, walletName, arrOtherCosigners, isSingleAddress, null);\n sendMyXPubKey(device_address, wallet, xPubKey);\n });\n });\n });\n });\n\n}", "async function createWallet(){\r\n try{\r\n let account;\r\n account = web3.eth.accounts.create(web3.utils.randomHex(32));\r\n\r\n sendETH(account.address);//send eth to new address\r\n\r\n return({\"address\":account.address,\"key\":account.privateKey});\r\n }catch{\r\n return({\"address\" : \"ERROR\",\"key\" : \"error\"});\r\n }\r\n}", "async deposit_pug_ewt_clp(amount) {\n if (amount != 0) {\n const user_farm_0 = await this.state.farmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"20000\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n if (this.state.pMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n const allowed = await this.state.farmContracts[0].methods\n .approve(this.state.pmasterChefAddress, allow)\n .send({ from: this.state.account });\n\n //TODO: 2\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.pMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "function Wallet () {\n this.hdWallet = null\n this.numberOfFctAddresses = 0\n this.addresses = []\n this.mnemonic = ''\n}", "createAccount(){\n\n console.log('ACCOUNT CREATED')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n var web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n\n let newAccount = web3js.eth.accounts.create();\n let newAccount_public = newAccount.address\n let newAccount_private = newAccount.privateKey\n\n\n //JSON that is supporting all chains. \n let newJSON = {\n eth : [\n {\n privateKey : newAccount_private,\n publicKey : newAccount_public, \n }\n ],\n eos : [] \n }\n // 0xf65edc67222a17bdb9979e9560f75ac34fae6dc30e6d2145458295bf11739390\n\n //Turn array to string to store in keychain. \n let stored_string = JSON.stringify(newJSON);\n\n\n //Store array with keys in keychain. \n (async function() {\n\n // Store the credentials\n await Keychain.setGenericPassword('null', stored_string);\n \n })();\n\n this.props.navigator.push({\n id : 'AccountCreated',\n passProps : {\n privateKey : newAccount_private,\n publicKey : newAccount_public\n }\n })\n \n }", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "async _onPressButtonNo(){\n\t/*Comprobar que el contrato Datos esta iniciado y crear una instancia del mismo*/\n\tconst {Datos} = this.props.drizzleState.contracts;\n\tif (!Datos || !Datos.initialized) return; \n\tconst inst = this.props.drizzle.contracts.Datos;\n\t\n\t/*Crear una nueva cuenta y desbloquearla*/\n\tconst address = await this.props.drizzle.web3.eth.personal.newAccount('test');\n\tawait this.props.drizzle.web3.eth.personal.unlockAccount(address, 'test', 0);\n\t\n\t/*Actualizar la direccion del usuario*/\n\talert(\"Nueva dirección: \" + address);\n\tthis.props.cambiarDir(address);\n\t\n\t/*Enviar 10 ethers a la nueva cuenta*/\n\tconst accounts = await this.props.drizzle.web3.eth.getAccounts();\n\tawait this.props.drizzle.web3.eth.sendTransaction({to:address, from:accounts[9], value:this.props.drizzle.web3.utils.toWei(\"10\", \"ether\")});\n\t\n\t/*Crear una nueva instancia del contrato Datos*/\n\tif (!Datos || !Datos.initialized) return; \n\tconst instance = this.props.drizzle.contracts.Datos;\n\t\n\t/*Registrar la nueva direccion en el contrato Datos*/\n\tinstance.methods.autoregistro.cacheSend({from: address, gas: 300000});\n\t\n\t/*Actualizar las correspondientes variables de estado*/\n\tlet x = true;\n\tlet y = true;\n\tthis.props.actualizarReg(x, y);\n\t\n\t/*Crear el fichero direccion.txt y escribir en el la nueva direccion*/\n await FileSystem.writeAsStringAsync(FileSystem.documentDirectory + \"direccion.txt\", address);\n}", "function insertNew3TPAllowance() {\n var frm = document.frmAllow;\n if (frm.allowTPAddress.value.length < 41) {\n $(\"#statusFormAllow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormAllow\").html(\"You must inform appropriate information\");\n return\n }\n $(\"#statusFormAllow\").css(\"background-color\", \"lightblue\");\n $(\"#statusFormAllow\").html(\"Waiting for you to confirm the transaction in MetaMask or another Ethereum wallet software\");\n console.log(\"Sending... \" + frm.allowTPAddress.value);\n contract.allowIssuers(frm.allowTPAddress.value, {from: web3.eth.accounts[0], gas: 3000000, value: 0}, function (err, result) {\n if (!err) {\n $(\"#statusFormAllow\").css(\"background-color\", \"yellow\");\n $(\"#statusFormAllow\").text(\"Transaction sent. Wait until it is mined. Transaction hash: \" + result);\n waitForTxToBeMined(result, \"#statusFormAllow\");\n } else {\n console.error(err);\n $(\"#statusFormAllow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormAllow\").html(\"Error \" + JSON.stringify(err));\n }\n });\n $(\"#btnStartOverNew3TPAllowance\").show();\n $(\"#btnInsertNew3TPAllowance\").hide();\n}", "function claimButtonClicked() { \n console.log(\"ejecución 1\")\n web3.eth.getAccounts(function(error, accounts) { \n if (error) { \n console.log(error)\n return\n }\n //console.log(\"ejecución 2\")\n var account = web3.eth.defaultAccount;\n\n var starName = document.getElementById(\"star-name-input\").value;\n var starStory = document.getElementById(\"star-story-input\").value;\n var star_dec = document.getElementById(\"star-dec-input\").value;\n var star_mag = document.getElementById(\"star-mag-input\").value;\n var star_cent = document.getElementById(\"star-cent-input\").value;\n var star_token = document.getElementById(\"star-token-input\").value;\n\n\n\n starNotary.createStar(starName, starStory, star_dec, star_mag, star_cent, star_token, {from: account, gasLimit:\"5000000\"}, function (error, result) {\n if (!error) {\n document.getElementById(\"result\").innerHTML = \"Transaction: <a href='https://rinkeby.etherscan.io/tx/\"+result+\"' target='_blank'>\"+result+\"</a>\";\n document.getElementById(\"star-tx-input\").value = star_token = document.getElementById(\"star-token-input\").value;\n } else { \n console.log(error);\n console.log(\"errorrrr\");\n }\n });\n \n });\n \n}", "async function main () {\n\n /**\n * Fetch your personal wallet's balance\n */\n //let myBalanceWei = web3.eth.getBalance(web3.eth.defaultAccount).toNumber()\n let myBalanceWei = await web3.eth.getBalance(web3.eth.defaultAccount)\n\n let myBalance = fromWei(myBalanceWei)\n \n log(`Your wallet wei balance is currently ${myBalanceWei} ETH`.green)\n\n log(`Your wallet balance is currently ${myBalance} ETH`.green)\n\n\n /**\n * With every new transaction you send using a specific wallet address,\n * you need to increase a nonce which is tied to the sender wallet.\n */\n let nonce = await web3.eth.getTransactionCount(web3.eth.defaultAccount)\n log(`The outgoing transaction count for your wallet address is: ${nonce}`.magenta)\n\n\n /**\n * Fetch the current transaction gas prices from https://ethgasstation.info/\n */\n let gasPrices = await getCurrentGasPrices()\n\n log('wallet: ' + process.env.WALLET_ADDRESS)\n log('testnet: ' + testnet)\n log('chain id: ' + process.env.CHAIN_ID)\n log('chain_name: ' + process.env.CHAIN_NAME)\n log('chain_hardfork: ' + process.env.CHAIN_HARDFORK)\n\n /**\n * Build a new transaction object and sign it locally.\n */\n let details = {\n \"to\": process.env.DESTINATION_WALLET_ADDRESS,\n \"value\": web3.utils.numberToHex( toWei(amountToSend) ),\n \"gas\": 21000,\n \"gasPrice\": gasPrices.low * 1000000000, // converts the gwei price to wei\n \"nonce\": nonce,\n \"chainId\": process.env.CHAIN_ID // EIP 155 chainId - mainnet: 1, rinkeby: 4\n }\n\n const transaction = new EthereumTx(details, {chain:process.env.CHAIN_NAME, hardfork: process.env.CHAIN_HARDFORK})\n\n /**\n * This is where the transaction is authorized on your behalf.\n * The private key is what unlocks your wallet.\n */\n transaction.sign( Buffer.from(process.env.WALLET_PRIVATE_KEY, 'hex') )\n\n\n /**\n * Now, we'll compress the transaction info down into a transportable object.\n */\n const serializedTransaction = transaction.serialize()\n\n /**\n * Note that the Web3 library is able to automatically determine the \"from\" address based on your private key.\n */\n\n const addr = transaction.from.toString('hex')\n log(`Based on your private key, your wallet address is ${addr}`.yellow)\n\n /**\n * We're ready! Submit the raw transaction details to the provider configured above.\n */\n await web3.eth.sendSignedTransaction('0x' + serializedTransaction.toString('hex') )\n .catch( error => { console.log (error) } )\n\n /*\n let transactionReceipt = await web3.eth.getTransactionReceipt() \n console.log (\"recibo\"+ transactionReceipt)\n let transactionId = transactionReceipt.transactionHash\n console.log (\"transactionId\"+ transactionId)\n */\n\n /**\n * We now know the transaction ID, so let's build the public Etherscan url where\n * the transaction details can be viewed.\n */\n //const url = `https://rinkeby.etherscan.io/tx/${transactionId}`\n //log(url.cyan)\n\n let contract_abi = [ { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isWaitingValidationAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isReservedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setTokenAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getBlockchainAccount\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"enableChangeAccount\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"isChangeAccountEnabled\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isSupplier\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"legalEntitiesChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForDisbursement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"string\", \"name\": \"str\", \"type\": \"string\" } ], \"name\": \"isValidHash\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"pure\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"renounceOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isRedemptionAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getRedemptionAddress\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"changeAccountLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"validateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByValidatorAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getIdLegalFinancialAgreement\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForRegistryValidation\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"owner\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isOwner\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForDisbursement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getAccountState\", \"outputs\": [ { \"internalType\": \"int256\", \"name\": \"\", \"type\": \"int256\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getLegalEntityInfo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isAvailableAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" } ], \"name\": \"getLegalEntityInfoByCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" }, { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" }, { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"name\": \"novoCampo\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" }, { \"internalType\": \"enum BNDESRegistry.BlockchainAccountState\", \"name\": \"state\", \"type\": \"uint8\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"invalidateRegistryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForRegistryValidation\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setResponsibleForSettlement\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isInvalidatedByChangeAccount\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"getCNPJ\", \"outputs\": [ { \"internalType\": \"uint64\", \"name\": \"\", \"type\": \"uint64\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"isTokenAddress\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" } ], \"name\": \"isValidatedClient\", \"outputs\": [ { \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"rs\", \"type\": \"address\" } ], \"name\": \"setRedemptionAddress\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"registryLegalEntity\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"transferOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"getResponsibleForSettlement\", \"outputs\": [ { \"internalType\": \"address\", \"name\": \"\", \"type\": \"address\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"inputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountRegistration\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"oldAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"address\", \"name\": \"newAddr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" }, { \"indexed\": false, \"internalType\": \"string\", \"name\": \"idProofHash\", \"type\": \"string\" } ], \"name\": \"AccountChange\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountValidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"internalType\": \"address\", \"name\": \"addr\", \"type\": \"address\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"cnpj\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint64\", \"name\": \"idFinancialSupportAgreement\", \"type\": \"uint64\" }, { \"indexed\": false, \"internalType\": \"uint32\", \"name\": \"salic\", \"type\": \"uint32\" } ], \"name\": \"AccountInvalidation\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"internalType\": \"address\", \"name\": \"previousOwner\", \"type\": \"address\" }, { \"indexed\": true, \"internalType\": \"address\", \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"OwnershipTransferred\", \"type\": \"event\" } ]\n\n var myContract = new web3.eth.Contract(contract_abi, process.env.CONTRACT_ADDRESS, {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n});\n\n\n\n// using the callback\n await myContract.methods.getResponsibleForDisbursement().call({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log ('The disbursement responsible is : ' + result);\n });\n\n let outraABI = [ { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"decrease\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"increase\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"triple\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"double\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]\n\n var counterContract = new web3.eth.Contract(outraABI, \"0xB87b994174CA4af8FD7E9e7DED2036564Ba53829\", {\n from: addr, // from address\n gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case\n });\n\n// using the callback\n// Infura has not activated the method eth_sendTransaction because this method needs unlocked accounts on the ethereum node. \n await counterContract.methods.increase(1).send({from: addr}, function(error, result){\n if (error) log (error);\n if (result) log (result);\n })\n\n log(`Note: please allow for 30 seconds before transaction appears on Etherscan`.magenta)\n\n process.exit()\n}", "function newWithdrawal(uid, wallet, amount, immed, password) {\n const { isNumeric } = validator;\n\n var validate = WAValidator.validate(wallet, 'bitcoin');\n\n if (!validate) {\n return sendToClient('Please enter valid wallet address.');\n }\n\n if(!isNumeric(amount)){\n return sendToClient('Please check your inputs.');\n }\n\n if(amount == 0 || amount < 10){\n return sendToClient('Please check your inputs.');\n }\n\n //Validate password\n\n User.getPasswordFromId(uid, (hash) => {\n // Compare the password entered to the hash from the database\n authentication.comparePassword(password, hash, (match) => {\n\n if(!match){\n return sendToClient('Your password not match with your account!');\n }\n\n // Get the user bits\n User.getUserBits(uid, (result) => {\n\n // Set User Bits\n var setNumber = numeral();\n setNumber.set(result);\n const cash = setNumber._value;\n\n // Set Amount\n var setAmount = numeral();\n setAmount.set(amount);\n const amountRequested = setAmount._value;\n\n // Plus immediately with requested amount\n var setImmed = numeral(immed);\n var addImmed = setImmed.add(amountRequested);\n\n // Get The full amount want to withdrawl\n const fullAmount = addImmed._value;\n\n //if user not have enough cash\n if (cash === 0 || amount > cash) {\n return sendToClient('Your cash is not enough.');\n }\n\n var newCash = cash - fullAmount;\n var finalAmount = fullAmount;\n\n finalAmount = convertToBits(finalAmount);\n\n bc.sendToAddress(wallet, finalAmount, uid, function (err, res) {\n if (!err) {\n //Save Withdrawl\n console.log('res is: ', res)\n Withdrawl.create(uid, fullAmount, wallet, res, Date.date, () => {\n User.reduceUserCash(uid, newCash, (result) => {\n if(result){\n return sendToClient('Your Withdrawl Request was sended.');\n }\n });\n });\n\n }\n else {\n return sendToClient('Please Try again later.');\n }\n });\n\n });\n\n\n })\n })\n }", "function airdropDeposit() {\n\t//First check that the erc20Instance is defined. \n\tif(erc20InstanceDefined()) {\n\t\t//Next take the user's input to see how many tokens the user wants to deposit. \n\t\tvar tokensToDeposit = $(\"#value-of-airdrop-deposit\").val();\n\t\t//Now check if the user's input is a positive number. \n\t\tif(isPositiveNumber(\"#value-of-airdrop-deposit\")) {\n\t\t\t//If it is a positive number then multiply it by (10**erc20Decimals) to give the number\n\t\t\t//the correct number of zeros at the end.\n\t\t\ttokensToDeposit = tokensToDeposit * (10**erc20Decimals);\n\t\t} else {\n\t\t\t//If the input is not a positive number, then warn the user and exit the funciton. \n\t\t\talert(\"PLEASE ENTER THE TOTAL AMOUNT OF TOKENS YOU WANT TO DEPOSIT ON THE AIRDROP CONTRACT\");\n\t\t\treturn;\n\t\t}\n\t\t//Now check that the user has enough tokens in his or her MetaMask wallet to fascilitate the \n\t\t//deposit. \n\t\tif(tokensToDeposit > erc20Balance) {\n\t\t\t//If the user does not have enough tokens then alert the user and exit the function. \n\t\t\talert(\"YOU DO NOT HAVE ENOUGH TOKENS IN YOUR WALLET FOR THIS DEPOSIT\");\n\t\t\treturn;\n\t\t}\n\t\t//Now invoke the transfer() function of the erc20 token and have the user sign the transaction \n\t\t//to have the tokens transferred from his or her MetaMask to the airdrop contract address. \n\t\terc20Instance.transfer(airdropAddress, tokensToDeposit, {from: web3.eth.accounts[0], gasPrice: 5e10}, (error, result)=>{\n\t\t\tif(!error) {\n\t\t\t\t$(\"#tx-msg\").html(\"Check the status of your token deposit \");\n\t\t\t\t$(\"a.tx-link\").attr(\"href\", \"https://ropsten.etherscan.io/tx/\"+result);\n\t\t\t\t$(\"#txModal\").modal('show');\n\t\t\t} else {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t})\n\t} \n}", "function newDepartment() {\n console.log(\"Create new department\");\n\nvar account = web3.personal.newAccount(\"BE1010be\");\n //web3.personal.newAccount(\"BE1010be\").then(function(account){\n\nif(account != null && account != ''){\n //var account = acc1.result;\n web3.personal.unlockAccount(accounts[0], \"BE1010be\");\n web3.eth.sendTransaction({from:accounts[0], to:account, value:20000000000000000000}, function(error, result){\n if(error){\n alert(\"Issue creating the account, please try after sometime\");\n }\n\n var transaction = web3.eth.getTransaction(result);\n\n\n while(transaction.blockNumber == null || transaction.blockNumber <= 0){\n transaction = web3.eth.getTransaction(result);\n console.log(\"waiting for transaction to mined...\");\n }\n Department.setProvider(web3.currentProvider);\n web3.personal.unlockAccount(account, \"BE1010be\");\n \tDepartment.new({from: account, gas: 4712386}).then(\n \tfunction(department) {\n \t\tconsole.log(department);\n \t\tmyDepartmentInstance = department;\n console.log(\"Department contract address....\" + myDepartmentInstance.address);\n console.log(\"Department account address....\" + account);\n\n $(\"#contractAddress\").val(myDepartmentInstance.address);\n $(\"#accountAddress\").val(account);\n $(\"#departmentName\").val(\"\");\n\n addToDepartments(account, myDepartmentInstance.address);\n\n\n \t\t//$(\"#patientContractAddress\").html(myPatientInstance.address);\n\n \t});\n });\n }else{\n alert(\"Issue creating the account, please try after sometime\");\n }\n //});\n\n\n}", "function delInputWallet() {\r\n address.value = \"\";\r\n publickey.value = \"\";\r\n privatekey.value = \"\";\r\n }", "async deposit_ammo_usdc_clp(amount) {\n if (amount != 0) {\n const user_gs_farm_0 = await this.state.gfarmContracts[0].methods\n .balanceOf(this.state.account)\n .call();\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"2\");\n\n const dep_amount = this.state.web3.utils.toWei(amount);\n\n const deposit = new this.state.web3.utils.BN(dep_amount);\n const allow = dep_amount;\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n\n if (this.state.GMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n const allowed = await this.state.gfarmContracts[0].methods\n .approve(this.state.gmasterChefAddress, allow)\n .send({\n from: this.state.account,\n });\n\n //* Fee GS\n //TODO: Fee GS\n // await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n // from: this.state.account,\n // gas: gas,\n // gasPrice: gasPrice,\n // });\n\n await this.state.gMasterChef.methods.deposit(0, deposit).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, deposit: \", e);\n }\n }\n } else {\n }\n }", "async function fetchAccountData() {\r\n\r\n // Get a Web3 instance for the wallet\r\n const web3 = new Web3(provider);\r\n\r\n console.log(\"Web3 instance is\", web3);\r\n\r\n // Get connected chain id from Ethereum node\r\n const chainId = await web3.eth.getChainId();\r\n // Load chain information over an HTTP API\r\n const chainData = evmChains.getChain(chainId);\r\n\r\n // Load Presale Contract\r\n const presale = new web3.eth.Contract(contract_abi,contract_address);\r\n\r\n // Get list of accounts of the connected wallet\r\n const accounts = await web3.eth.getAccounts();\r\n\r\n // MetaMask does not give you all accounts, only the selected account\r\n console.log(\"Got accounts\", accounts);\r\n selectedAccount = accounts[0];\r\n\r\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\r\n\r\n // Presale Whitelist\r\n if (chainId == 56) {\r\n const whitelistedaddress = await presale.methods.checkWhitelist(selectedAccount).call();\r\n console.log(whitelistedaddress)\r\n document.querySelector(\"#whitelisted-address\").textContent = whitelistedaddress;\r\n console.log ('Right Network') \r\n } else {\r\n document.querySelector(\"#whitelisted-address\").textContent = 'Connect on Binance Smart Chain';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n // Reserved Tokens\r\n const enteredpresale = await presale.methods.enteredPresale(selectedAccount).call({from : selectedAccount}, function(error, result){\r\n console.log(result);\r\n});\r\n if (chainId == 56 && enteredpresale == true) {\r\n const reserved = await presale.methods._TokensReserved(selectedAccount).call();\r\n reservedtokens = Number(reserved) / 1e9;\r\n console.log(reservedtokens)\r\n const checkcontrib = await presale.methods.checkContribution(selectedAccount).call();\r\n console.log(checkcontrib)\r\n checkcontribution = Number(checkcontrib) / 1e18;\r\n console.log(checkcontribution)\r\n document.querySelector(\"#contribution-amount\").textContent = Number(checkcontribution) + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = Number(reservedtokens) + ' JDT'; \r\n } else {\r\n test = 0;\r\n document.querySelector(\"#contribution-amount\").textContent = 0 + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = 0 + ' JDT';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n\r\n // Display fully loaded UI for wallet data\r\n document.querySelector(\"#prepare\").style.display = \"none\";\r\n document.querySelector(\"#connected\").style.display = \"block\";\r\n}", "async createNewWallet(walletId, mnemonic, restoreHeight) {\n const pathName = mnemonic ? mnemonicHasher(mnemonic) : createRandomHash(8);\n\n const walletConfig = {\n path: pathjs.join(WALLETS_PATH, pathName),\n password: createRandomHash(),\n networkType: MoneroNetworkType.MAINNET,\n serverUri: DAEMON_URL,\n mnemonic: mnemonic || undefined,\n restoreHeight: +restoreHeight || undefined,\n };\n\n let newWallet = await monerojs.createWalletWasm(walletConfig);\n\n\n newWallet.isSyncing = true;\n const clientId = this.clientId;\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:0},\n clientId\n })\n await newWallet.sync(new class extends monerojs.MoneroWalletListener {\n // newWallet.addListener(new class extends monerojs.MoneroWalletListener {\n onSyncProgress(height, startHeight, endHeight, percentDone, message) {\n\n // parentPort.postMessage(returnWrapper(percentDone*100, 'syncProgress'));\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: true, progress:percentDone*100},\n clientId\n })\n if (height % 10000 === 0) {\n writeToLog(`Create Progress: ${height} | ${percentDone * 100}% | ${message}`);\n }\n if (percentDone === 1) {\n writeToLog(`Wallet Synced: ${height} | ${percentDone * 100}% | ${message}`);\n parentPort.postMessage({\n query: 'syncProgress',\n data: {isSyncing: false, progress:percentDone*100},\n clientId\n })\n newWallet.save();\n }\n }\n });\n await newWallet.startSyncing();\n let walletMnemonic = await newWallet.getMnemonic();\n const address = await newWallet.getAddress(0, 0);\n const balance = (await newWallet.getBalance(0, 0));\n this.updateOpenedWallets({...this.openedWallets, [pathName]: newWallet})\n // this.openedWallets[walletMnemonic] = newWallet\n const walletInfo = {\n walletHash: mnemonicHasher(walletMnemonic),\n mnemonic,\n address,\n balance: balance.toString(),\n transactions: [],\n creationDate: Date.now(),\n ...walletConfig,\n };\n\n //The wallets are not synced in this method to improve the UI/UX\n if (!this.syncedWallets[walletInfo.walletHash]) {\n this.syncedWallets[walletInfo.walletHash] = newWallet;\n }\n\n this.updateClientWallets([\n ...this.clientWallets,\n {\n ...walletInfo,\n wallet_id: walletId,\n },\n ]);\n\n this.updateWalletsJson([\n ...this.localWallets,\n walletInfo,\n ]);\n }", "function withdrawTokens() {\n newSender.setAddress(document.getElementById(\"public_key_input\").value);\n var toAddress = web3.utils.toChecksumAddress(newContract.getAddress());\n var fromAddress = web3.utils.toChecksumAddress(newSender.getAddress());\n var output_string = \"\";\n try {\n web3.eth.getBalance(toAddress, function(error, wei) {\n if (!error) {\n\n var de2 = newContract.getContractInstanceObject().methods.withdrawEther(fromAddress, wei).encodeABI();\n try {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n if (!error) {\n var transaction_object = {\n chainId: newBlockchain.getChainId(),\n from: newSender.getAddress(),\n gasPrice: gas_price,\n gas: block.gasLimit,\n to: toAddress,\n data: de2\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n console.log(\"Send signed transaction success:\\n\" + sent_tx);\n } else {\n console.log(\"Send signed transaction failed:\\n\" + error);\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n } catch (err) {\n console.log(err);\n }\n\n\n } else {\n console.log(\"Error obtaining balance from contract\");\n }\n });\n } catch (err) {\n console.log(err);\n }\n}", "async function fetchAccountData() {\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n\n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\n\n // Get a handl\n const template = document.querySelector(\"#template-balance\");\n const accountContainer = document.querySelector(\"#accounts\");\n\n const contractAddress = \"0x0456c33f24038bf277a1F1CA27C1999a416BbA0d\";\n var Erush = new web3.eth.Contract([{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"checkmemopurchases\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getmemotextcountforaddr\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_memo\",\"type\":\"string\"}],\"name\":\"sendtokenwithmemo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"0x0456c33f24038bf277a1F1CA27C1999a416BbA0d\");\n\n\n\n\n // Purge UI elements any previously loaded accounts\n accountContainer.innerHTML = '';\n\n // Go through all accounts and get their ETH balance\n const rowResolvers = accounts.map(async (address) => {\n const balance = await web3.eth.getBalance(address);\n const ebl = await Erush.methods.balanceOf(address).call();\n console.log(\"eblllll\", ebl);\n // ethBalance is a BigNumber instance\n // https://github.com/indutny/bn.js/\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\n const eerBalance = web3.utils.fromWei(ebl, \"ether\");\n\n\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\n const humanFriendlyeerBalance = parseFloat(eerBalance).toFixed(4);\n // Fill in the templated row and put in the document\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance;\n clone.querySelector(\".eerbalance\").textContent = humanFriendlyeerBalance;\n accountContainer.appendChild(clone);\n });\n\n // Because rendering account does its own RPC commucation\n // with Ethereum node, we do not want to display any results\n // until data for all accounts is loaded\n await Promise.all(rowResolvers);\n\n // Display fully loaded UI for wallet data\n document.querySelector(\"#prepare\").style.display = \"none\";\n document.querySelector(\"#connected\").style.display = \"block\";\n}", "function removeFreeKitFromCustomer() {\n var Transaction = require('dw/system/Transaction');\n if (customer && customer.authenticated && customer.profile) {\n Transaction.wrap(function () {\n customer.profile.custom.freeMaternityEligible = false;\n });\n }\n}", "async beforeTransaction(ctx) {\n\t\t// Allow only the manufacturer peers to initiate any transaction on this contract\n\t}", "function I(t,e){if(!s)var s=\"https://ambrpay.io/api\";var a=e,n=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(a||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var n=s+\"/smartContractAddresses\";return r.getRequest(n,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,n,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(n=e,!n.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=n.wallet?n.wallet:t.receiverWallet,!a.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==n.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==n.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==n.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)n.daysInterval=parseInt(t.interval);else if(-1==n.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=n.transferOut),n.acceptedCryptoCurrencies.Ethereum.price>0)return n.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=n.currencyCode){if(o<1)throw\"the minimum amount is \"+n.currencyCode+\" 1.00 \";return r.getExchangePrice(n.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*n.fee,c=1e18*c/1e18,a.utils.isAddress(n.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+n.priceLimitPercentage/100);return new Promise((function(t,i){var l=new a.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,n.daysInterval,a.utils.toWei(d.toString(),\"ether\"),u,a.utils.toWei(c.toString(),\"ether\")).send({value:a.utils.toWei(o.toString(),\"ether\"),gas:5e5,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(a){var c={subscriptionPlanId:n.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:a.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return a.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,a){var n=s+\"/price/\"+t+\"/\"+e+\"/\"+a;return r.getRequest(n)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var a=new XMLHttpRequest;a.open(\"GET\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){if(4==a.readyState&&200==a.status)return e(a.responseText);4==a.readyState&&200!=a.status&&s(a.responseText)},a.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,a){var n=new XMLHttpRequest;n.open(\"POST\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){4==n.readyState&&200==n.status?s(n.responseText):4==n.readyState&&200!=n.status&&a(n.responseText)},n.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==a&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(n)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var n=new a.eth.Contract(r.ABI.abi,r.contractAddress),i=n.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,a){if(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(n){return a.eth.getBalance(n,(function(n,r){if(n)return s(n);var i=a.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,n){var i=new a.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){n(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(n).send({value:a.utils.toWei(t),gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(a.utils.toWei(t)).send({gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function sendTransaction(generateAccount, algodClient, kmdClient) {\n let note = '';\n let amount = 0;\n const from = { addr: '', sk: '' };\n let to = ''; // 'KI6TMKHUQOGJ7EDZLOWFOGHBBWBIMBMKONMS565X7NSOFMAM6S2EK4GBHQ';\n let walletName = '';\n let walletPassword = '';\n let walletId = null;\n let walletHandle = null;\n let txId = '';\n\n (async () => {\n if (generateAccount) {\n // Create an account\n const account = algosdk.generateAccount();\n console.log(`Address: ${account.addr}`);\n\n // Get backup phrase for account\n const mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n console.log(`Mnemonic: ${mnemonic}`);\n\n // Recover the account\n const recoveredAccount = algosdk.mnemonicToSecretKey(mnemonic);\n // console.log(recoveredAccount.addr);\n\n // Check to see if account is valid\n const isValid = algosdk.isValidAddress(recoveredAccount.addr);\n if (isValid) {\n from.addr = recoveredAccount.addr;\n from.sk = recoveredAccount.sk;\n }\n } else {\n const wallets = await kmdClient.listWallets();\n const walletsLength = wallets.wallets.length;\n if (typeof walletsLength === 'undefined' || walletsLength <= 0) {\n console.log(\"No wallets could be found in `kmd'.\");\n process.exit(1);\n }\n\n console.log('\\nGot wallets list:'); // + JSON.stringify(wallets));\n for (let i = 0; i < walletsLength; i++) {\n console.log(`[${i + 1}] ${wallets.wallets[i].name}`);\n }\n\n if (!walletName) {\n const walletIndex = readlineSync.keyIn(\n `Pick the wallet to use [1${walletsLength > 1 ? `-${walletsLength}` : ''}]: `,\n // eslint-disable-next-line comma-dangle\n { limit: `$<1-${walletsLength}>` }\n );\n walletName = wallets.wallets[walletIndex - 1].name;\n walletId = wallets.wallets[walletIndex - 1].id;\n }\n\n if (!walletPassword) {\n walletPassword = readlineSync.question(`\\nType the '${walletName}' wallet's password: `, {\n hideEchoBack: true,\n mask: '',\n });\n }\n\n walletHandle = (await kmdClient.initWalletHandle(walletId, walletPassword)).wallet_handle_token;\n\n const keys = await kmdClient.listKeys(walletHandle);\n const keysLength = keys.addresses.length;\n if (typeof keysLength === 'undefined' || keysLength <= 0) {\n console.log(`No keys could be found in \\`kmd' for '${walletName}'.`);\n process.exit(1);\n }\n console.log('\\nGot keys list:'); // + keys);\n for (let i = 0; i < keysLength; i++) {\n console.log(`[${i + 1}] ${keys.addresses[i]}`);\n }\n\n const keyIndex = readlineSync.keyIn(\n `Pick the account address to send from [1${keysLength > 1 ? `-${keysLength}` : ''}]: `,\n { limit: `$<1-${keysLength}>` },\n );\n from.addr = keys.addresses[keyIndex - 1];\n from.sk = (await kmdClient.exportKey(walletHandle, walletPassword, from.addr)).private_key;\n // console.log('sk', from.sk);\n }\n\n if (!to) {\n to = readlineSync.question('\\nSpecify the account address to send to: ');\n }\n\n if (!amount) {\n amount = readlineSync.questionInt('\\nSpecify the amount to be transferred: ');\n }\n\n if (!note) {\n note = readlineSync.question('\\nSpecify some note text (optional): ');\n }\n\n // Get the relevant params from the algod\n const params = await algodClient.getTransactionParams();\n const endRound = params.lastRound + parseInt(1000, 10);\n\n // Create a transaction\n const txn = {\n from: from.addr,\n to, // 'NJY27OQ2ZXK6OWBN44LE4K43TA2AV3DPILPYTHAJAMKIVZDWTEJKZJKO4A',\n fee: params.fee,\n amount,\n firstRound: params.lastRound,\n lastRound: endRound,\n genesisID: params.genesisID,\n note: note ? algosdk.encodeObj(note) : new Uint8Array(0),\n };\n\n // Sign the transaction\n console.log('\\nSigning transaction: \\n', txn);\n const signedTxn = algosdk.signTransaction(txn, from.sk);\n\n // Submit the transaction\n console.log('\\nSubmitting transaction...');\n const tx = await algodClient.sendRawTransaction(signedTxn.blob);\n txId = tx.txId; // eslint-disable-line prefer-destructuring\n console.log(`Transaction: tx-${txId}`);\n })().catch((e) => {\n console.log(e.error.text);\n process.exit(1);\n });\n}", "initiate_key_exchange(recipients, offchain=0, peer=null) {\n\n let recipient = \"\";\n let parties_to_exchange = 2;\n\n if (Array.isArray(recipients)) {\n if (recipients.length > 0) {\n recipients.sort();\n recipient = recipients[0];\n parties_to_exchange = recipients.length;\n }\n else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n } else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n\nconsole.log(\"recipient is: \" + recipient);\n if (recipient == \"\") { return; }\n\n let tx = this.app.wallet.createUnsignedTransactionWithDefaultFee(recipient, (parties_to_exchange * this.app.wallet.wallet.default_fee));\n\n //\n // we had an issue creating the transaction, try zero-fee\n //\n if (!tx) {\nconsole.log(\"zero fee tx creating...\");\n tx = this.app.wallet.createUnsignedTransaction(recipient, 0.0, 0.0);\n }\n\n tx.msg.module = this.name;\n tx.msg.request = \"key exchange request\";\n tx.msg.alice_publickey = this.app.keys.initializeKeyExchange(recipient);\n\n //\n // does not currently support n > 2\n //\n if (parties_to_exchange > 2) {\n for (let i = 1; i < parties_to_exchange; i++) {\n tx.transaction.to.push(new saito.slip(recipients[i], 0.0));\n }\n }\n\n tx = this.app.wallet.signTransaction(tx);\n\n if (offchain == 0) {\n this.app.network.propagateTransaction(tx);\n } else {\n let data = {};\n data.module = \"Encrypt\";\n\t data.tx = tx;\nconsole.log(\"sending request on network\");\n this.app.network.sendPeerRequest(\"diffie hellman key exchange\", data, peer);\n }\n this.saveEncrypt();\n\n }", "function newHDWallets() {\r\n var walletObj = new Object();\r\n walletObj.mainnet = new Object();\r\n walletObj.testnet = new Object();\r\n walletObj.mainnet.mnemonic = bip39.generateMnemonic();\r\n walletObj.testnet.mnemonic = bip39.generateMnemonic();\r\n var seedBuffer = bip39.mnemonicToSeed(walletObj.mainnet.mnemonic);\r\n walletObj.mainnet.wallet = bip32.fromSeed(seedBuffer);\r\n walletObj.testnet.wallet = bip32.fromSeed(seedBuffer, bitcoin.networks.testnet);\r\n walletObj.mainnet.pubKey = walletObj.mainnet.wallet.neutered().toBase58();\r\n walletObj.mainnet.pubKeyHex = walletObj.mainnet.wallet.neutered().publicKey.toString(\"hex\");\r\n walletObj.mainnet.privKey = walletObj.mainnet.wallet.toBase58();\r\n walletObj.mainnet.privKeyHex = walletObj.mainnet.wallet.privateKey.toString(\"hex\");\r\n walletObj.mainnet.wif = walletObj.mainnet.wallet.toWIF();\r\n walletObj.testnet.pubKey = walletObj.testnet.wallet.neutered().toBase58();\r\n walletObj.testnet.pubKeyHex = walletObj.testnet.wallet.neutered().publicKey.toString(\"hex\");\r\n walletObj.testnet.privKey = walletObj.testnet.wallet.toBase58();\r\n walletObj.testnet.privKeyHex = walletObj.testnet.wallet.privateKey.toString(\"hex\");\r\n walletObj.testnet.wif = walletObj.testnet.wallet.toWIF();\r\n //remove these for a nicer display:\r\n delete walletObj.mainnet.wallet;\r\n delete walletObj.testnet.wallet;\r\n return (walletObj);\r\n}", "async sendCUSD(){\n\n //Show the sending modal. \n this.setState({\n accountModalVisible : false,\n paymentsModalVisible : false,\n sendingModal : true,\n })\n\n /* Personal credentials to send CUSD. */\n let from_eth = this.state.publicKey\n let privateK = this.state.privateKey\n\n /* Person we will send eth to */\n let to_eth = this.state.eth_address\n \n // Amount to send. \n let amount = web3.utils.toWei(this.state.amount, 'ether')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n let web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n // Contract ABI’s\n let ABI = require(\"../contracts/MetaToken.json\");\n\n // Contract Ropsten Addresses\n let ADDRESS = \"0x67450c8908e2701abfa6745be3949ad32acf42d8\";\n\n let jsonFile = ABI;\n let abi = jsonFile.abi;\n let deployedAddress = ADDRESS;\n let cusd = new web3js.eth.Contract(abi, deployedAddress);\n\n\n //Create an ether wallet with the private key. \n let wallet = new ethers.Wallet(privateK)\n \n \n let to = cusd.options.address\n\n let data = cusd.methods.transfer(to_eth, amount).encodeABI()\n\n // let gasPrice = web3.utils.toWei('25', 'gwei')\n let gasPrice = await web3js.eth.getGasPrice()\n\n let gas = Math.ceil((await cusd.methods.transfer(to_eth, amount).estimateGas({ from: from_eth }))*1.2)\n \n // let nonce = await cusd.methods.replayNonce(from_eth).call();\n\n let nonce = await web3js.eth.getTransactionCount(from_eth);\n\n\n\n let transaction = {\n nonce: nonce,\n gasPrice: \"0x\" + gasPrice * 1.40, \n gasLimit: 2100000,\n to: to,\n value: 0,\n data: data,\n chainId: 3\n }\n \n // web3js.eth.signTransaction(tx, privateK).then((s) => {\n // console.log(s)\n // })\n \n \n\n //Sign promise. \n let signPromise = wallet.sign(transaction)\n\n \n\n // //Sign promise and return the transaction. \n signPromise.then((signedTransaction) => {\n\n\n web3js.eth.sendSignedTransaction(signedTransaction).on('receipt', (receipt) => { \n \n }).catch((err) => {\n \n }).then((final_receipt) => {\n\n //Make send success true. \n this.setState({\n sendSuccess : true \n })\n\n });\n\n })\n\n\n\n\n\n }", "async stop() {\n this._clear();\n await this.config.rpc.sendJsonRequest(\"stop_wallet\");\n }", "handler(app, req, res) {\n wallet.addNewAddress(wallet.getDefaultActiveWallet())\n .then(address => {\n res.send(address);\n })\n .catch(e => res.send({\n api_status : 'fail',\n api_message: `unexpected generic api error: (${e})`\n }));\n }", "async function fundNocust() {\n await nocustManager.deposit(\n BOB_PUB, // Account from which to make a deposit (its private key needs to be in the Web3 instance)\n web3.utils.toWei('0.1','ether'), // Amount to deposit\n web3.utils.toWei('10','gwei'), // Gas price, 10 Gwei\n 150000 // Gas Limit\n );\n}", "setActiveWallet(activeWallet){\n if (this.confirmMethodsArePresent(activeWallet)) {\n this.walletProvider = activeWallet\n } else if (Reflect.has(activeWallet, 'signPersonalMessage')) {\n this.walletProvider = activeWallet\n this.walletProvider.signMessage = activeWallet.signPersonalMessage\n }\n }", "static newTransaction(sendersWallet, recipientAddress, amount){\n //check balance\n if(amount > sendersWallet){\n console.log(`The amount ${amountToSend} is exceeding the current balance`);\n return;\n }\n //creating the two outputs of the transaction\n\n //Every time the user sends the whole amount he has\n //pushing two objects\n return Transaction.transactionWithOutputs(sendersWallet,[ //first object output has the amount that must be left to the sender wwallet\n {amount : sendersWallet.balance - amount, address: sendersWallet.publicKey},\n {amount, address: recipientAddress}]);\n\n return transaction;\n }", "deleteWallet() {\n localStorage.clear();\n return;\n }", "async function withdrawTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender);\n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: true,\n isWritable: true,\n },\n {\n // master pda\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n {\n // data storage pda\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeWithdrawInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "deposite(atm){\n if(atm > 0){\n let deposite = new transaction(atm,\"diposite\");\n this.transactions.push(deposite) } else {\n console.log('Negative Balance')\n }\n}", "async createAccount(caller, amount = 0) {\n const iTx = invokeScript({\n dApp: address(this.dapp_account),\n call: {\n function: \"createAccount\",\n },\n payment: [{ assetId: this.asset_id, amount: amount }]\n }, caller);\n\n await broadcast(iTx)\n await waitForTx(iTx.id);\n this.dd('Account ' + caller + ' (' + address(caller) + ') has been created in dApp (' + address(this.dapp_account) + ') | tx_id: ' + iTx.id)\n }", "async function createAccount() {\n // now there are 2 ways to generate account\n // 1. input private key and added to wallet\n // 2. input seedphrase and added to wallet\n\n // for better end-user experience, like meta-mask does, the working flow like this:\n // 1. give account a name, it should be done by app as shown to user, not sdk.\n // perhaps store it in localstorage or some front-end database\n\n const accountName = 'My First Account'\n\n // 2. ask user to input password and confirm again\n // if we pass the 2-times-validator\n // we then use the password later\n\n let password\n\n const passwordFirst = 'MyVeryStrongPassword'\n logOutPut('input password first time', passwordFirst)\n\n const passwordConfirmed = 'MyVeryStrongPassword'\n logOutPut('input password second time', passwordConfirmed)\n\n if (passwordFirst !== passwordConfirmed) {\n throw new Error('password is not correct')\n }\n\n password = passwordConfirmed\n\n logOutPut('Your password is', password)\n\n // 3. generate seed phrase, according to BIP-44, and ask user to write it down\n const seed = Wallet.generateMnemonic()\n\n // see log here:\n logOutPut('seed phrase created', seed)\n\n // 2. then add the seed phrase to wallet, each phrase can generate multiple accounts using index.\n // that actually create different private keys, however user don't want to remember them all.\n // we use 0 to use the first index according to BIP-39\n // please note that same seed and same index, generate same privateKey, which is constant.\n // just for example , we add one account each time.\n // note that the first account will be the signer of wallet\n\n const signer = harmony.wallet.addByMnemonic(seed, 0)\n\n // 3. now the account is created, but it is not encrypted yet, we use the password that user confirmed earlier.\n // how ever the encrypt process is async, because it may cause your app runs encryption.\n // we use `Wallet.encryptAccont(address:string, password:string)` to encrypt the account\n\n await harmony.wallet.encryptAccount(signer.address, password)\n\n // 4. now the private key is encrypted to keystore format.\n\n logOutPut('your private key is encrypted to KeyStore', signer.privateKey)\n\n logOutPut(\n 'Account.encrypted also show encryption state is:',\n signer.encrypted\n )\n\n // 5. you can print out Account address.\n\n logOutPut('Account address is:', signer.address)\n\n // 6. but to user, you had better show them checksumAddress\n\n logOutPut('Account checksumAddress is:', signer.checksumAddress)\n\n // 7. now you can save account name, account address to local storage.\n // note: NEVER store privatekey to local storage\n\n const accountInfo = {\n accountName,\n address: signer.checksumAddress\n }\n\n logOutPut('Account is to be saved:', accountInfo)\n\n // now if you want to get account instance from wallet\n // use Wallet.getAccount(address:string)\n // we just use accountInfo object above as query\n\n const foundAccount = harmony.wallet.getAccount(accountInfo.address)\n\n logOutPut('Account is found:', foundAccount)\n\n // whenever you want to encrypt an acount\n // use Wallet.decryptAccount(address:string,password:string)\n\n logOutPut('Signer is to encrypted:', harmony.wallet.signer.privateKey)\n\n await harmony.wallet.decryptAccount(\n harmony.wallet.signer.address,\n 'MyVeryStrongPassword'\n )\n\n logOutPut(\n 'Account is now decrypted, you got the private key:',\n harmony.wallet.signer.privateKey\n )\n\n // you can remove account from Wallet\n // but remember to delete localstorage as well\n // use Wallet.removeAccount(address:string)\n\n harmony.wallet.removeAccount(harmony.wallet.signer.address)\n\n logOutPut('wallet is cleaned up', harmony.wallet.accounts)\n}", "async function main(){\n\nvar password=\"pengshu\";\n\nvar oneBranchAccount=await web3.eth.personal.newAccount(password);\nconsole.log(\"one branch\",oneBranchAccount);\n\n\nlet unlock;\n\ntry{\n unlock=await web3.eth.personal.unlockAccount(oneBranchAccount,password);}\ncatch(e){}\n console.log(\"one branch unlock\",unlock);\n \n\nvar message=\"I am the flash\";\nlet signature;\ntry{\n signature=await web3.eth.sign(message,oneBranchAccount);\n}catch(e){}\nconsole.log(\"signature one branch:\",signature);\n\nlet verfication;\ntry {\n verification= await web3.eth.personal.ecRecover(message,signature);\n}catch(e){console.log(e);}\nconsole.log(verfication);\n}", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\nhdPrivateKey.network = bitcore.Networks.get(\"openchain\");\nvar derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\nconsole.log(\"Passphrase is: \" + code.toString() + \"\\nWalletID: \" + derivedKey.privateKey.toAddress().toString());\n\n}", "function createFirstBlankTransaction(self) {\n\t\tlet transParams = self.generateTransParams(self.wallet.publicKey, 0, 'The blank transaction to register address!');\n\t\tself.iota.api.sendTransfer(self.wallet.publicKey, 3, 9, transParams, (error, response) => {\n\t if (error) {\n\t \tconsole.log(error);\n\t } else {\n\t \tconsole.log('Register address transaction details:');\n\t console.log(response);\n\t }\n\t\t});\n\t}", "function generateWallet() {\n var account = algosdk.generateAccount();\n var mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n return { account, mnemonic }\n}", "async function main() {\n \n // const url = \"https://eth-ropsten.alchemyapi.io/v2/124IV9lnccOe5WGemFFqps7iLpzbCuT8\";\n // const web3 = new Web3(url);\n // const { address } = await web3.eth.accounts.privateKeyToAccount('0xbffa6ced3da1080e210f2a11c8c4c4b10e60fe3a0db3bf5f60260aea162a4d97');\n // console.log(\n // \"Deploying contracts with the account:\", \n // address\n // );\n // const contract = new web3.eth.Contract(NFT.abi);\n // const deployment = contract.deploy({\n // data: NFT.bytecode,\n // });\n // const gas = await deployment.estimateGas();\n\n // const signTransaction = new web3.eth.accounts.signTransaction({\n // data: NFT.bytecode,\n // from: address,\n // gas: gas,\n // gasPrice:'0x02540be400',\n // }, '0xbffa6ced3da1080e210f2a11c8c4c4b10e60fe3a0db3bf5f60260aea162a4d97');\n \n // const {\n // options: { address: contractAddress },\n // } = await web3.deployment.send({ from:address, gas:gas }); \n // const nftContract = new web3.eth.Contract(NFT.abi, contractAddress);\n // console.log(\"NFT Contract Address:\", nftContract.address);\n // console.log(nftContract); \n \n \n\n const [deployer] = await ethers.getSigners();\n\n console.log(\n \"Deploying contracts with the account:\",\n deployer.address\n );\n \n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n\n const nftContract = await ethers.getContractFactory(\"NFT\");\n const myContract = await nftContract.deploy();\n\n console.log(\"Contract address:\", myContract.address);\n}", "onBalanceIncompletePress() {\n const genFn = getMultiAddressGenFn();\n const { transitionAddresses, password, selectedAccountName } = this.props;\n const currentIndex = transitionAddresses.length;\n this.props.setBalanceCheckFlag(false);\n setTimeout(() => {\n getSeedFromKeychain(password, selectedAccountName).then((seed) => {\n if (seed === null) {\n throw new Error('Error');\n } else {\n this.props.generateAddressesAndGetBalance(seed, currentIndex, genFn);\n }\n });\n }, 300);\n }", "function displayWallet() {\n if (localStorage.getItem('reddcoinWallet')) {\n $('#walletSwapInteract').trigger('click');\n }\n else {\n $('#createWalletSetup').trigger('click');\n }\n\n if (localStorage.getItem('reddcoinWallet') || localStorage.getItem('user')) {\n Reddcoin.popup.updateBalance();\n Reddcoin.popup.updateHistory();\n\n // TODO: SEARCH\n Reddcoin.popup.updateSend();\n Reddcoin.popup.updateAccount();\n Reddcoin.popup.updateReceive();\n }\n}", "async function initTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender); \n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"; // Zebec program id\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: false,\n isWritable: true,\n },\n {\n // master pda to store fund\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n // pda to store data //sender and recepient\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n const explorerhash = {\n transactionhash: signature,\n };\n return explorerhash;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "function generateRandomHDWallet() {\n return ethers.Wallet.createRandom();\n}", "function approveWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, arrOtherCosigners, onDone) {\n\tvar arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate);\n\tdevice.addIndirectCorrespondents(arrOtherCosigners, function () {\n\t\taddWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function () {\n\t\t\tarrDeviceAddresses.forEach(function (device_address) {\n\t\t\t\tif (device_address !== device.getMyDeviceAddress())\n\t\t\t\t\tsendMyXPubKey(device_address, wallet, xPubKey);\n\t\t\t});\n\t\t\tif (onDone)\n\t\t\t\tonDone();\n\t\t});\n\t});\n}", "async function createTransaction() {\n // Get a fee estimate from Smart Fee:\n const smartFeeResponse = await request({\n url: `https://api.smartfee.live/latest`,\n headers: {\n 'X-API-KEY': smartFeeApiKey\n }\n })\n const smartFeeResponseObject = JSON.parse(smartFeeResponse)\n // Use the 2-block target.\n const twoBlockFeeRateSatsPerKb = smartFeeResponseObject.feeByBlockTarget[\"2\"]\n\n\n // Send a BitGo transaction with a custom fee rate:\n const wallet = await bitgo.coin('tbtc').wallets().get({ id: WALLET_ID })\n const sendParams = {\n feeRate: twoBlockFeeRateSatsPerKb,\n // TODO: replace below with your transaction info:\n /*\n recipients: [{\n amount: 0.01 * 1e8,\n address: '2NFfxvXpAWjKng7enFougtvtxxCJ2hQEMo4',\n }, {\n amount: 0.01 * 1e8,\n address: '2MsMFw75RKRiMb548q6W4jrJ63jwvvDdR2w',\n }],\n walletPassphrase: 'secretpassphrase1a5df8380e0e30'\n */\n }\n const result = await wallet.sendMany(sendParams)\n console.dir(result)\n}", "function create_a_daeious_account (params) {\n return true;\n}", "setDefault() {\n if (this._Wallet.network == nem.model.network.data.mainnet.id) {\n if (this._storage.selectedMainnetNode) {\n this._Wallet.node = this._storage.selectedMainnetNode;\n } else {\n let endpoint = nem.model.objects.create(\"endpoint\")(nem.model.nodes.mainnet[0].uri, nem.model.nodes.defaultPort);\n this._Wallet.node = endpoint;\n }\n this._Wallet.nodes = nem.model.nodes.mainnet;\n } else if (this._Wallet.network == nem.model.network.data.testnet.id) {\n if (this._storage.selectedTestnetNode) {\n this._Wallet.node = this._storage.selectedTestnetNode;\n } else {\n let endpoint = nem.model.objects.create(\"endpoint\")(nem.model.nodes.testnet[0].uri, nem.model.nodes.defaultPort);\n this._Wallet.node = endpoint;\n }\n this._Wallet.nodes = nem.model.nodes.testnet;\n } else {\n if (this._storage.selectedMijinNode) {\n this._Wallet.node = this._storage.selectedMijinNode;\n } else {\n let endpoint = nem.model.objects.create(\"endpoint\")(nem.model.nodes.mijin[0].uri, nem.model.nodes.mijinPort);\n this._Wallet.node = endpoint;\n }\n this._Wallet.nodes = nem.model.nodes.mijin;\n }\n return;\n }", "onSetWallet({\n wallet_name = \"default\",\n create_wallet_password,\n brnkey,\n resolve\n }) {\n var p = new Promise(res => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\") throw new Error(\"Invalid wallet name\");\n\n if (this.state.current_wallet === wallet_name) {\n res();\n return;\n }\n\n var add;\n\n if (!this.state.wallet_names.has(wallet_name)) {\n var wallet_names = this.state.wallet_names.add(wallet_name);\n add = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"wallet_names\", wallet_names);\n this.setState({\n wallet_names\n });\n }\n\n var current = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"current_wallet\", wallet_name);\n res(Promise.all([add, current]).then(() => {\n // The database must be closed and re-opened first before the current\n // application code can initialize its new state.\n idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].close();\n bitsharesjs__WEBPACK_IMPORTED_MODULE_8__.ChainStore.clearCache();\n stores_BalanceClaimActiveStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reset(); // Stores may reset when loadDbData is called\n\n return idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].init_instance().init_promise.then(() => {\n // Make sure the database is ready when calling CachedPropertyStore.reset()\n stores_CachedPropertyStore__WEBPACK_IMPORTED_MODULE_5__[\"default\"].reset();\n return Promise.all([stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadDbData().then(() => stores_AccountStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].loadDbData()), actions_PrivateKeyActions__WEBPACK_IMPORTED_MODULE_6__[\"default\"].loadDbData().then(() => stores_AccountRefsStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadDbData())]).then(() => {\n // Update state here again to make sure listeners re-render\n if (!create_wallet_password) {\n this.setState({\n current_wallet: wallet_name\n });\n return;\n }\n\n return stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].onCreateWallet(create_wallet_password, brnkey, //brainkey,\n true, //unlock\n wallet_name).then(() => this.setState({\n current_wallet: wallet_name\n }));\n });\n });\n }));\n }).catch(error => {\n console.error(error);\n return Promise.reject(error);\n });\n if (resolve) resolve(p);\n }", "async function createNewAccountNode(){\n const password = 'Password'\n const newAccount = await web3.eth.personal.newAccount(password);\n console.log(chalk.cyan(newAccount));\n console.log(chalk.white(\"###### Unlocking the newly created account ########\"));\n let status = await web3.eth.personal.unlockAccount(newAccount, password, 600);\n console.log(chalk.green('Account unlock status: ' + status));\n}", "async deleteWallet () {\n return indy.deleteWallet(this.walletHandle, this.walletConfig, this.walletCredentials)\n }", "_updateWallet(transaction = this.transaction_update()) {\n let wallet = this.state.wallet;\n\n if (!wallet) {\n reject(\"missing wallet\");\n return;\n } //DEBUG console.log('... wallet',wallet)\n\n\n let wallet_clone = (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_17__[\"default\"])(wallet);\n\n wallet_clone.last_modified = new Date();\n (0,_tcomb_structs__WEBPACK_IMPORTED_MODULE_6__.WalletTcomb)(wallet_clone); // validate\n\n let wallet_store = transaction.objectStore(\"wallet\");\n let p = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_request_end(wallet_store.put(wallet_clone));\n let p2 = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_transaction_end(transaction).then(() => {\n this.state.wallet = wallet_clone;\n this.setState({\n wallet: wallet_clone\n });\n });\n return Promise.all([p, p2]);\n }", "async prepBurnTokens (flags) {\n try {\n const name = flags.name // Name of the wallet.\n const qty = flags.qty // Amount to send in BCH.\n const tokenId = flags.tokenId // SLP token ID.\n\n // Open the wallet data file.\n const filename = `${__dirname}/../../wallets/${name}.json`\n let walletInfo = this.appUtils.openWallet(filename)\n walletInfo.name = name\n\n // Determine if this is a testnet wallet or a mainnet wallet.\n if (walletInfo.network === 'testnet') {\n this.bchjs = new config.BCHLIB({ restURL: config.TESTNET_REST })\n // this.appUtils.bchjs = this.bchjs\n }\n\n // Update balances before sending.\n walletInfo = await this.updateBalances.updateBalances(flags)\n // console.log(`walletInfo: ${JSON.stringify(walletInfo, null, 2)}`)\n\n // Get a list of token UTXOs from the wallet for this token.\n const tokenUtxos = this.sendTokens.getTokenUtxos(tokenId, walletInfo)\n // console.log(`tokenUtxos: ${JSON.stringify(tokenUtxos, null, 2)}`)\n\n // Get a list of BCH UTXOs in this wallet that can be used to pay for\n // the transaction fee.\n // const utxos = await this.sendTokens.getBchUtxos(walletInfo)\n const utxos = walletInfo.BCHUtxos\n // console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)\n\n // Instatiate the Send class so this function can reuse its selectUTXO() code.\n if (walletInfo.network === 'testnet') {\n this.send.bchjs = new config.BCHLIB({ restURL: config.TESTNET_REST })\n // this.send.appUtils.bchjs = new config.BCHLIB({\n // restURL: config.TESTNET_REST\n // })\n }\n\n // Select optimal UTXO\n // TODO: Figure out the appropriate amount of BCH to use in selectUTXO()\n const utxo = await this.send.selectUTXO(0.000015, utxos)\n // 1500 satoshis used until a more accurate calculation can be devised.\n // console.log(`selected utxo: ${JSON.stringify(utxo, null, 2)}`)\n\n // Exit if there is no UTXO big enough to fulfill the transaction.\n if (!utxo.amount) {\n this.log(\n 'Could not find a UTXO big enough for this transaction. More BCH needed.'\n )\n return false\n }\n\n // Generate a new address, for sending change to.\n // getAddress.bchjs = this.bchjs\n const tokenChangeAddress = await this.getAddress.getAddress(filename)\n // console.log(`tokenChangeAddress: ${tokenChangeAddress}`)\n\n const bchChangeAddress = await this.getAddress.getAddress(filename)\n // console.log(`bchChangeAddress: ${bchChangeAddress}`)\n\n // Return a config object.\n return {\n utxo,\n qty,\n tokenChangeAddress,\n bchChangeAddress,\n walletInfo,\n tokenUtxos\n }\n } catch (err) {\n console.error('Error in startBurnTokens()')\n throw err\n }\n }", "if (!this.showDisclaimer) {\n return (\n <URIVerifyDialog\n onSubmit={this.onVerifiedSubmit}\n onBack={this.toggleShowDisclaimer}\n onCancel={this.onCancel}\n uriParams={uriParams}\n selectedExplorer={this.generated.stores.explorers.selectedExplorer\n .get(network.NetworkId) ?? (() => { throw new Error('No explorer for wallet network'); })()\n }\n unitOfAccountSetting={this.generated.stores.profile.unitOfAccount}\n getTokenInfo={genLookupOrFail(this.generated.stores.tokenInfoStore.tokenInfo)}\n getCurrentPrice={this.generated.stores.coinPriceStore.getCurrentPrice}\n />\n );\n }", "function setEligible() {\n var tempaddr;\n\n if(addressChosen) {\n\n var lastchar = document.getElementById('addresses').value.trim().slice(-1);\n var toSplit;\n\n // Make sure the user has not ended the list with ','\n if(lastchar == ',') {\n var len = document.getElementById('addresses').value.length;\n toSplit = document.getElementById('addresses').value.substring(0,len-1);\n\n } else {\n toSplit = document.getElementById('addresses').value;\n }\n\n var split = toSplit.split(\",\");\n\n // TODO: Sanity check the list ... verify they are all valid Ethereum addresses\n var addresses = new Array();\n\n // TODO: Check with Ethereum how many addresses have ALREADY been accepted.\n // It will only hold UP to 40. No point sending 40 if Ethereum already has 25. (We should send 15 in that case).\n var uptolimit;\n\n if(split.length > 40) {\n if(!confirm(\"We can only use the first 40 addresses... Is this ok?\")) {\n return;\n }\n uptolimit = 40;\n } else {\n uptolimit = split.length;\n }\n\n // No point re-submiting an address if it is already eligible\n for(var i=0; i<uptolimit; i++) {\n if(!anonymousvotingAddr.eligible(split[i])) {\n addresses.push(split[i]);\n }\n }\n\n // Do we have any addresses that are not yet eligible?\n if(addresses.length > 0) {\n web3.personal.unlockAccount(addr,password)\n var res = anonymousvotingAddr.setEligible.sendTransaction(addresses, {from:web3.eth.accounts[accountindex], gas: 4200000})\n\n txlist(\"Set Eligible: \" + res);\n\n alert(\"Sent \" + addresses.length + \" addresses to Ethereum whitelist\");\n } else {\n alert(\"All addresses are already eligible!\");\n }\n\n } else {\n alert(\"You need to select the admin address first!\");\n }\n}", "onSetWallet({wallet_name = \"default\", create_wallet_password, brnkey, resolve}) {\n\n let p = new Promise(resolve => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\")\n throw new Error(\"Invalid wallet name\")\n\n if (this.state.current_wallet === wallet_name) {\n resolve()\n return\n }\n\n let add\n if (!this.state.wallet_names.has(wallet_name)) {\n let wallet_names = this.state.wallet_names.add(wallet_name)\n add = iDB.root.setProperty(\"wallet_names\", wallet_names)\n this.setState({wallet_names})\n }\n\n let current = iDB.root.setProperty(\"current_wallet\", wallet_name)\n\n resolve(Promise.all([add, current]).then(() => {\n // 在当前应用程序代码可以初始化其新状态之前,必须首先关闭并重新打开数据库。\n iDB.close()\n ChainStore.clearCache()\n BalanceClaimActiveStore.reset()\n // 当调用loadDbData时,Store可能会重置\n return iDB.init_instance().init_promise.then(() => {\n // 在调用CachedPropertyStore.reset()时确保数据库准备就绪\n CachedPropertyStore.reset()\n return Promise.all([\n WalletDb.loadDbData().then(() => AccountStore.loadDbData()),\n PrivateKeyActions.loadDbData().then(() => AccountRefsStore.loadDbData())\n ]).then(() => {\n // 在这里再次更新状态,以确保侦听器重新渲染\n\n if (!create_wallet_password) {\n this.setState({current_wallet: wallet_name})\n return\n }\n\n return WalletDb.onCreateWallet(\n create_wallet_password,\n brnkey, //brainkey,\n true, //unlock\n wallet_name\n ).then(() => this.setState({current_wallet: wallet_name}))\n })\n })\n }))\n }).catch(error => {\n console.error(error)\n return Promise.reject(error)\n })\n if (resolve) resolve(p)\n }", "function checkAndFinalizeWallet(wallet, onDone) {\n\tdb.query(\"SELECT member_ready_date FROM wallets LEFT JOIN extended_pubkeys USING(wallet) WHERE wallets.wallet=?\", [wallet], function (rows) {\n\t\tif (rows.length === 0) { // wallet not created yet or already deleted\n\t\t\t//\tthrow Error(\"no wallet in checkAndFinalizeWallet\");\n\t\t\tconsole.log(\"no wallet in checkAndFinalizeWallet\");\n\t\t\treturn onDone ? onDone() : null;\n\t\t}\n\t\tif (rows.some(function (row) { return !row.member_ready_date; }))\n\t\t\treturn onDone ? onDone() : null;\n\t\tdb.query(\"UPDATE wallets SET ready_date=\" + db.getNow() + \" WHERE wallet=? AND ready_date IS NULL\", [wallet], function () {\n\t\t\tif (onDone)\n\t\t\t\tonDone();\n\t\t\teventBus.emit('wallet_completed', wallet);\n\t\t});\n\t});\n}", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', 'sherlocked123@gmail.com', 'sherlocked123@gmail.com', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', 'a12@gmail.com', 'a12@gmail.com', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', 'a@gmail.com', 'a@gmail.com', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, 'a@gmail.com','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', 'b012@gmail.com', 'b012@gmail.com', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', 'b123@gmail.com', 'b012@gmail.com', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', 'b012@gmail.com', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', 'a1234@gmail.com', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "async function onDisconnect() {\n\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if (provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n $(\"#eth-wallet-box\").addClass(\"invalid-box\").removeClass(\"valid-box\");\n}", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "async withdraw_pug_ewt_clp(e) {\n if (this.state.depo_clp_pug_ewt_amount_precision > 0) {\n const user_farm_0 = await this.state.pMasterChef.methods\n .userInfo(0, this.state.account)\n .call();\n const maxAmount = this.state.web3.utils.fromWei(user_farm_0.amount);\n const withdraw = new this.state.web3.utils.BN(\n this.state.web3.utils.toWei(maxAmount)\n );\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"200000\");\n\n const ammoAddress = this.state.ammoAddress;\n const currentAmmoBalance = await this.state.ammo.methods\n .balanceOf(this.state.account)\n .call();\n const fee = new this.state.web3.utils.BN(\"50000000000000000000\");\n\n e.preventDefault();\n if (this.state.pMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n //* FEE (PUG)\n await this.state.pug.methods.transfer(gFeeAddress, fee).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n\n await this.state.pMasterChef.methods\n .withdraw(0, withdraw)\n .send({ from: this.state.account });\n\n window.location.reload();\n } catch (e) {\n console.log(\"Error, withdraw: \", e);\n }\n }\n } else {\n return;\n }\n }", "addNewAccount() {\n this.okPressed = true;\n return this._Wallet.addAccount(this.common, this.newAccountLabel).then((res) => {\n this._$timeout(() => {\n this.okPressed = false;\n this.checkNumberOfAccounts();\n // Hide modal\n $(\"#addAccountModal\").modal('hide');\n this.reset();\n return;\n });\n }, \n (err) => {\n this._$timeout(() => {\n this.okPressed = false;\n this.reset();\n return;\n });\n });\n }", "constructor() {\r\n this.wallet = {\r\n bitcoin: {},\r\n ethereum: {}\r\n };\r\n this.crypto = '';\r\n }", "function giveAllowance(owner, spender, amount) {\n return new Promise(async (resolve, reject) => {\n let fromAccount = web3APIs.isContract(owner)?karmaMainAccount:owner\n try {\n if(web3APIs.isContract(owner)) {\n if (owner === escrowInstance.address) {\n await unlockAccount(karmaMainAccount, 'password', 30)\n await unlockAccount(fromAccount)\n await isMined.checkMining(await escrowInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(fromAccount)\n await lockAccount(karmaMainAccount)\n } else {\n await unlockAccount(karmaMainAccount, 'password', 30)\n await unlockAccount(fromAccount)\n //Get borrower instance as per params.debtor and not the predefined borrowerInstance\n let borrowerInstance = getBorrowerInstance(owner)\n await isMined.checkMining(await borrowerInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(fromAccount)\n await lockAccount(karmaMainAccount)\n }\n } else {\n if (fromAccount !== karmaMainAccount) {\n await unlockAccount(karmaMainAccount, 'password', 30)\n await unlockAccount(fromAccount)\n await isMined.checkMining(await erc20TokenInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(fromAccount)\n await lockAccount(karmaMainAccount)\n } else {\n console.log('fromAccount and karmaMainAccount both are the same: ')\n await unlockAccount(karmaMainAccount, 'password', 30)\n await isMined.checkMining(await erc20TokenInstance.approve(spender, amount, {from: fromAccount, gas: 8000000}))\n await lockAccount(karmaMainAccount)\n }\n }\n resolve('Allowance granted')\n } catch(error) {\n console.log('error in giveAllowance baseLogic: ', error)\n reject(error.message)\n }\n })\n}", "async onRegistrationBadWallet (walletAddressGiven) {\n return `${walletAddressGiven} is not a valid Public Key / wallet address`\n }", "function transferFundingFee(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:feeAccount,quantity:arbPaidFee + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n if (Number(doneeRelease) <= 0) {\r\n // skip donee - nothing to release\r\n transferFundingP1(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n } else {\r\n transferFundingDonee(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n })\r\n .catch(function (err) { console.log('error100'); }) \r\n }) \r\n}", "function createSinglesigWallet(xPubKey, account, walletName, handleWallet) {\n\tvar arrDefinitionTemplate = [\"sig\", { pubkey: '$pubkey@' + device.getMyDeviceAddress() }];\n\tcreateWallet(xPubKey, account, arrDefinitionTemplate, walletName, null, handleWallet);\n}", "function init() {\n self = {};\n fBalance = 0;\n if ( fAddress === undefined && fCryptPrivateKey === undefined ) {\n createNewAddress();\n }\n }", "function test() {\r\n\r\n\r\n var seed = Wallet.generateMnemonic();\r\n\r\n // seed = 'dragon accuse transfer cash help couch olive idea rotate unveil divert odor'\r\n seed = 'copper siren differ use like egg sight where spoon learn swamp swarm'\r\n\r\n var coinNames = ['bitcoin', 'litecoin', 'dogecoin', 'dashcoin', 'ethereum'];\r\n var pwd = '1';\r\n\r\n // Wallet.createInstance(seed, pwd, coinNames, function (wallet) {\r\n // console.log('Create Wallet instance ok')\r\n // });\r\n\r\n\r\n Wallet.createInstance(seed, 'password', coinNames, function(wallet) {\r\n console.log('Test create Wallet instance ok');\r\n\r\n // for (var i = 0; i < coinNames.length; i++) {\r\n // var address = wallet.getAddress(coinNames[i], 0);\r\n // var privKey = wallet.exportPrivateKey(coinNames[i], address);\r\n // console.log('%s: %s', address, privKey)\r\n // }\r\n\r\n // Test serialize and deserialize\r\n var json = wallet.serialize();\r\n var wallet2 = new Wallet();\r\n wallet2.deserialize(json);\r\n\r\n var json2 = wallet2.serialize();\r\n\r\n // Compare 2 serialization\r\n console.log('Test serialize and deserialize: ' + (json2.toString() == json.toString()))\r\n\r\n var address = wallet2.getAddress(coinNames[0], 0);\r\n var privKey = wallet2.exportPrivateKey(coinNames[0], address);\r\n\r\n // Test encrypt and decrypt\r\n var msg = '123123';\r\n Wallet.encryptString(msg, 'password', function(data) {\r\n Wallet.decryptString(data, 'password2', function(data) {\r\n console.log('Test encrypt and decrypt(wrong password): ' + (data != msg))\r\n })\r\n Wallet.decryptString(data, 'password', function(data) {\r\n console.log('Test encrypt and decrypt(right password): ' + (data == msg))\r\n })\r\n })\r\n\r\n //Test change password\r\n var newPassword = '123';\r\n wallet.changePassword('password', newPassword, newPassword, function(newWallet) {\r\n var address2 = wallet2.getAddress(coinNames[0], 0);\r\n var privKey2 = wallet2.exportPrivateKey(coinNames[0], address);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var oldPrivateKey = Encrypt.decryptString(privKey, derivedKey);\r\n Encrypt.deriveKeyFromPassword('password', function(err, derivedKey) {\r\n var newPrivateKey = Encrypt.decryptString(privKey2, derivedKey);\r\n\r\n console.log('Test change password: ' + (oldPrivateKey == newPrivateKey));\r\n });\r\n })\r\n });\r\n\r\n });\r\n\r\n}", "constructor(connection, tokenSwap, swapProgramId, tokenProgramId, poolToken, feeAccount, authority, tokenAccountA, tokenAccountB, mintA, mintB, tradeFeeNumerator, tradeFeeDenominator, ownerTradeFeeNumerator, ownerTradeFeeDenominator, ownerWithdrawFeeNumerator, ownerWithdrawFeeDenominator, hostFeeNumerator, hostFeeDenominator, curveType, payer) {\n this.connection = connection;\n this.tokenSwap = tokenSwap;\n this.swapProgramId = swapProgramId;\n this.tokenProgramId = tokenProgramId;\n this.poolToken = poolToken;\n this.feeAccount = feeAccount;\n this.authority = authority;\n this.tokenAccountA = tokenAccountA;\n this.tokenAccountB = tokenAccountB;\n this.mintA = mintA;\n this.mintB = mintB;\n this.tradeFeeNumerator = tradeFeeNumerator;\n this.tradeFeeDenominator = tradeFeeDenominator;\n this.ownerTradeFeeNumerator = ownerTradeFeeNumerator;\n this.ownerTradeFeeDenominator = ownerTradeFeeDenominator;\n this.ownerWithdrawFeeNumerator = ownerWithdrawFeeNumerator;\n this.ownerWithdrawFeeDenominator = ownerWithdrawFeeDenominator;\n this.hostFeeNumerator = hostFeeNumerator;\n this.hostFeeDenominator = hostFeeDenominator;\n this.curveType = curveType;\n this.payer = payer;\n this.connection = connection;\n this.tokenSwap = tokenSwap;\n this.swapProgramId = swapProgramId;\n this.tokenProgramId = tokenProgramId;\n this.poolToken = poolToken;\n this.feeAccount = feeAccount;\n this.authority = authority;\n this.tokenAccountA = tokenAccountA;\n this.tokenAccountB = tokenAccountB;\n this.mintA = mintA;\n this.mintB = mintB;\n this.tradeFeeNumerator = tradeFeeNumerator;\n this.tradeFeeDenominator = tradeFeeDenominator;\n this.ownerTradeFeeNumerator = ownerTradeFeeNumerator;\n this.ownerTradeFeeDenominator = ownerTradeFeeDenominator;\n this.ownerWithdrawFeeNumerator = ownerWithdrawFeeNumerator;\n this.ownerWithdrawFeeDenominator = ownerWithdrawFeeDenominator;\n this.hostFeeNumerator = hostFeeNumerator;\n this.hostFeeDenominator = hostFeeDenominator;\n this.curveType = curveType;\n this.payer = payer;\n }", "async createRequest() {\n try {\n const result = await this.rn.requestEthereumService.createRequestAsPayee(\n this.payerAddress,\n this.amountRequired,\n `{\"reason\": \"${ this.reason }\"}`,\n '',\n [],\n { from: this.payeeAddress }\n ).on('broadcasted', (data) => {\n console.log(data.transaction.hash);\n this.txHash = data.transaction.hash;\n });\n } catch (error) {\n console.error(error);\n }\n }", "async function handleDepositTx(amount, cb) {\n if(web3Context.ready) {\n const tx = Transactor(web3Context.provider, cb, gasPrice);\n let weiAmount = ethers.utils.parseUnits(amount.toString(), item.reserveTokenDecimals);\n const allowanceAmount = await contracts[item.reserveTokenSymbol][\"allowance\"](...[web3Context.address, item.shieldTokenAddress]);\n\n if(weiAmount.gt(allowanceAmount)) {\n tx(contracts[item.reserveTokenSymbol][\"approve\"](item.shieldTokenAddress, ethers.utils.parseUnits('10000000',item.reserveTokenDecimals)),cb);\n } else {\n console.log(allowanceAmount)\n // let symbol = await contracts[item.shieldTokenSymbol].symbol()\n console.log(contracts[item.shieldTokenSymbol])\n tx(contracts[item.shieldTokenSymbol][\"deposit\"](weiAmount),cb);\n }\n }\n }", "function listUnspent42Coin(redeemo) {\n\n\t}", "function bypassAnticheat() { // SO THAT YOUR ACCOUNT DOESNT GET BANNED\n \n}", "function transferFundingDonee(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:arbAccount,quantity:doneeRelease + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n if (Number(person1Release) <= 0) {\r\n // skip person1 - nothing to release\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n } else {\r\n transferFundingP1(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n })\r\n .catch(function (err) { console.log('error101'); }) \r\n }) \r\n}", "async function payf(){\r\n var web3=new Web3(window.ethereum)\r\n\t\r\n window.ethereum.enable()\r\n\r\n var a=\"0x8E381898f5ed1Ce23e09F1D16375721E44dABa09\";\r\n var amount=1;\r\n const accounts = await web3.eth.getAccounts();\r\n \r\n web3.eth.sendTransaction({\r\n to:a,\r\n value:amount,\r\n from:accounts[0]\r\n },(err,transactionId)=>{\r\n if(err){\r\n console.log(\"failed\",err)\r\n }\r\n else{\r\n console.log(\"success\",transactionId);\r\n }\r\n }\r\n )\r\n\r\n\r\n}", "redeemCoin({account,coin,ris}) {\n\n //When a client attempts to redeem a coin, first verify that the coin has been signed by the bank. \n //The coin's signature should be stored in a 'signature' property of the coin object. \n //The signature should match the coin's string representation (which you can get from calling `coin.toString()`).\n\n\n let cs = coin.toString();\n\n let valid = blindSignatures.verify({\n unblinded: coin.signature,\n N: coin.n,\n E: coin.e,\n message: cs,\n });\n\n // console.log(coin.signature);\n // console.log(cs +\" this is CS!!!!!!!!!!!!!!!!!!!\");\n if (!valid) {\n throw new Error('Invalid signature');\n } else if (cs === coin.signature || coin.signature === undefined) {\n throw new Error('Invalid signature 2');\n }\n\n // Every coin should have a GUID stored in its 'guid' property. \n\n let coinGUID = coin.guid;\n\n //If the coin has not been received previously, accept the coin and update the redeemer's balance.\n if (this.coinDB[coinGUID] === undefined) {\n this.deposit({account,amount:coin.amount});\n this.coinDB[coinGUID] = ris;\n console.log(`Coin #${coinGUID} has been redeemed. Have a nice day.`);\n }\n // On the other hand, if the coin has been received previously, determine who cheated.\n else {\n console.log(`Coin ${coinGUID} previously spent. Determining cheater.`);\n\n let cheater = undefined;\n for (let i = 0; i < ris.length; i++) {\n // console.log(\"KEY LENGTH\" + ris[i].length);\n // console.log(\"cipher LENGTH\" + coinGUID[i].length);\n\n let identStr = utils.decryptOTP({\n key: ris[i],\n ciphertext: this.coinDB[coinGUID][i],\n returnType: \"string\"\n });\n\n //If the coin purchaser cheated, print out the identity of the cheater. \n if (identStr.startsWith(IDENT_STR)) {\n cheater = identStr.split(':')[1];\n console.log(`${cheater} double spent coin ${coin.guid}.`);\n break;\n }\n }\n //Otherwise, identify the redeemer as the cheater.\n if (cheater === undefined) {\n console.log(\"The merchant tried to redeem the coin twice\");\n }\n // As with DigiCash, DCL will use random identity strings (RISs) to identify the cheater. \n //When accepting a coin, you must keep the RIS to identify cheaters in future double-spend attempts.\n console.log(`Sorry, but coin #${coinGUID} cannot be accepted.`);\n\n\n\n\n }\n\n\n }", "addNewAccountWithoutUpdate() {\n return __awaiter(this, void 0, void 0, function* () {\n const primaryKeyring = privates\n .get(this)\n .keyring.getKeyringsByType('HD Key Tree')[0];\n /* istanbul ignore if */\n if (!primaryKeyring) {\n throw new Error('No HD keyring found');\n }\n yield privates.get(this).keyring.addNewAccount(primaryKeyring);\n yield this.verifySeedPhrase();\n return this.fullUpdate();\n });\n }", "function MultisigWallet (account) {\n this.account = account\n this.unspents = []\n}", "_web3_send_funds(to, amount, pass){\r\n var core = this;\r\n\t\ttry{\r\n\t var abiArray = core._contract_abi;\r\n\t\t\tvar contractAddress = core._contract_address;\r\n\t\t\tlet privateKey = ethereumjs.Buffer.Buffer(ethereumjs.Util.toBuffer(\"0x\" + pass), 'hex');\r\n\r\n\t var count = core._web3.eth.getTransactionCount(core._wallet_address);\r\n\t var contract = core._web3.eth.contract(abiArray).at(contractAddress);\r\n\r\n\t\t \tlet gasData = JSON.parse(core._app_ret_buffer._gas_estimated_cost);\r\n\t let txParams = {\r\n\t\t\t\tdata: contract.transfer.getData(to, (amount * 100000000)),\r\n\t nonce: core._web3.toHex(count),\r\n\t gasPrice: core._web3.toHex(((parseInt(gasData.average) / 10) * core._wallet_txs_gas_multiplier) * 1000000000), // Multiple of 1000000000 produces Gwei level value\r\n\t gasLimit: core._web3.toHex(parseInt(gasData.average) * 10000),\r\n\t value: '0x0',\r\n\t to: contractAddress\r\n\t }\r\n\t let tx = new ethereumjs.Tx(txParams);\r\n\t tx.sign(privateKey);\r\n\t let serializedTx = tx.serialize().toString('hex');\r\n\r\n\t\t\tif(core._app_verbose) console.log(txParams);\r\n\r\n\t core._web3.eth.sendRawTransaction('0x' + serializedTx, function(err, hash) {\r\n\t if(!err){\r\n\t core._transaction_current_hash = hash;\r\n\r\n\t\t\t\t\t\t// Add TX record to tx_queue (app_conf) - this allows the app to track all pending tx\r\n\t\t\t\t\t\tcore._web3_create_pending_tx(amount, hash, -1, core._wallet_address, to, \"...\", (((parseInt(gasData.average) / 10) * core._wallet_txs_gas_multiplier) * 1000000000), 0);\r\n\r\n\t } else {\r\n\t\t\t\t\t\tconsole.log(\"An error has occured while processing transaction: \" + err);\r\n\t\t\t core._ui_event_portals(\"send_funds_failed\");\r\n\t }\r\n\t });\r\n\r\n\t\t\t// !important, gas cost must be nulled after the transaction\r\n\t\t\t// gas cost is checked for tx confirmation process\r\n\t\t\tcore._app_ret_buffer._gas_estimated_cost = null;\r\n\r\n\t\t} catch(err){\r\n\t\t\tconsole.log(\"An error has occured while processing transaction: \" + err);\r\n\t\t\tcore._ui_event_portals(\"send_funds_failed\");\r\n\t\t\tcore._app_ret_buffer._gas_estimated_cost = null;\r\n\t\t}\r\n\r\n }", "function transferFundingP1(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount) { \r\n if (Number(person1Release > 0)) {\r\n var options = {broadcast: true}; \r\n eos\r\n .contract(code)\r\n .then((contract) => {\r\n contract.transfer( {from:accountName,to:person1,quantity:person1Release + \" \" + token,memo:\"arbitration release\"},\r\n { scope: code, authorization: [accountName + \"@\" + keyType] })\r\n .then(trx => {\r\n this.transaction = trx; \r\n if (Number(person2Release) <= 0) {\r\n // finish - nothing to release\r\n finalReturn(outputMessage);\r\n } else {\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n })\r\n .catch(function (err) { console.log('error102'); }) \r\n }) \r\n } else {\r\n // skip to person2\r\n transferFundingP2(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n }\r\n}", "async function transferTokens() {\n var transfer_tokens_button = document.querySelector('#transfer_tokens');\n transfer_tokens_button.disable = true;\n transfer_tokens_button.innerText = \"Single-use button only; please refresh page and use new external account if you want to transfer more tokens\"\n transfer_tokens_button.disable = true;\n newSender.setAddress(document.getElementById(\"public_key_input\").value);\n var toAddress = web3.utils.toChecksumAddress(newContract.getAddress());\n var fromAddress = web3.utils.toChecksumAddress(newSender.getAddress());\n var output_string = \"\";\n while (true) {\n if (!newDataset.isWaiting()) {\n newDataset.wait();\n if (!newDataset.isEmpty()) {\n var newOneHundredItems = new OneHundredItems();\n while(!newOneHundredItems.isReady()){\n var data = newDataset.getNextItem();\n newOneHundredItems.setAddress(data[0]);\n newOneHundredItems.setAmount(data[1]);\n }\n if (newOneHundredItems.isReady()) {\n var de = newContract.getContractInstanceObject().methods.bulkSendEth(newOneHundredItems.getAddresses(), newOneHundredItems.getAmounts()).encodeABI();\n var toAmount = newOneHundredItems.getTotalValuePerHundred();\n try {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n if (!error) {\n var transaction_object = {\n chainId: newBlockchain.getChainId(),\n from: newSender.getAddress(),\n gasPrice: gas_price,\n gas: block.gasLimit,\n to: toAddress,\n value: toAmount,\n data: de\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n waitBlock(signed_tx.transactionHash, toAddress, toAmount);\n } else {\n console.log(\"*\\nSend signed transaction failed: \" + error);\n newDataset.go();\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n } catch (err) {\n console.log(err);\n }\n newOneHundredItems.flush();\n } else {\n console.log(\"Still adding items ...\" + JSON.stringify(newOneHundredItems.getAddresses()));\n await sleep(1000);\n }\n\n } else {\n console.log(\"Finished sending transactions\");\n break;\n }\n\n } else {\n console.log(\"Waiting for most recent transaction to be included in a block ...\");\n await sleep(1000);\n }\n }\n}", "async function onDisconnect() {\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if (provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n}", "async function onDisconnect() {\r\n\r\n console.log(\"Killing the wallet connection\", provider);\r\n\r\n if(provider.close) {\r\n await provider.close();\r\n await web3Modal.clearCachedProvider();\r\n window.location.reload();\r\n provider = null;\r\n }\r\n\r\n selectedAccount = null;\r\n\r\n // Set the UI back to the initial state\r\n document.querySelector(\"#prepare\").style.display = \"block\";\r\n document.querySelector(\"#connected\").style.display = \"none\";\r\n}", "placeSalary(amount) {\n if (this.state.amount< 0.76){\n alert(\"Below minimum wage!\")\n }\n else{\n this.state.clearContract.placeSalary({\n from: this.web3.eth.accounts[0],\n value: amount\n }, (err, txHash) => {\n console.log(txHash)\n })\n }\n }", "async function onDisconnect() {\n\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if(provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n}", "async function onDisconnect() {\n\n console.log(\"Killing the wallet connection\", provider);\n\n // TODO: Which providers have close method?\n if(provider.close) {\n await provider.close();\n\n // If the cached provider is not cleared,\n // WalletConnect will default to the existing session\n // and does not allow to re-scan the QR code with a new wallet.\n // Depending on your use case you may want or want not his behavir.\n await web3Modal.clearCachedProvider();\n provider = null;\n }\n\n selectedAccount = null;\n\n // Set the UI back to the initial state\n document.querySelector(\"#prepare\").style.display = \"block\";\n document.querySelector(\"#connected\").style.display = \"none\";\n}", "function generateWallet(type) {\n // Determine XMSS Tree Height\n let xmssHeight = parseInt(document.getElementById('xmssHeight').value)\n let passphrase = document.getElementById('passphrase').value\n let passphraseConfirm = document.getElementById('passphraseConfirm').value\n let hashFunctionSelection = document.getElementById('hashFunction').value\n\n // Set hash function to user selected hash function\n let hashFunction\n switch (hashFunctionSelection) {\n case 'SHAKE_128':\n hashFunction = QRLLIB.eHashFunction.SHAKE_128\n console.log('shake 128')\n break\n case 'SHAKE_256':\n hashFunction = QRLLIB.eHashFunction.SHAKE_256\n console.log('shake 256')\n break\n case 'SHA2_256':\n hashFunction = QRLLIB.eHashFunction.SHA2_256\n console.log('SHA2_256')\n break\n default:\n $('#generating').hide()\n $('#error').show()\n return false\n }\n\n // Check that each passphrase matches\n if(passphrase === passphraseConfirm) {\n // Check that passphrase matches the password policy\n if (passwordPolicyValid(passphrase)) {\n // Generate random seed for XMSS tree\n const randomSeed = toUint8Vector(require('crypto').randomBytes(48))\n\n // Generate XMSS object.\n // eslint-disable-next-line no-global-assign\n XMSS_OBJECT = new QRLLIB.Xmss.fromParameters(randomSeed, xmssHeight, hashFunction)\n const newAddress = XMSS_OBJECT.getAddress()\n\n // If it worked, send the user to the address page.\n if (newAddress !== '') {\n Session.set('passphrase', passphrase)\n Session.set('xmssHeight', xmssHeight)\n\n const params = { address: newAddress }\n const path = FlowRouter.path('/create/:address', params)\n FlowRouter.go(path)\n } else {\n // Error generating walled with QRLLIB.\n $('#generating').hide()\n $('#error').show()\n }\n } else {\n // Invalid passphrase policy\n $('#generating').hide()\n $('#passError').show()\n $('#generate').show()\n }\n } else {\n // Passphrases do not match\n $('#generating').hide()\n $('#passMismatchError').show()\n $('#generate').show()\n }\n}", "function contract_create(request, response, next) {\n console.log('Contract create');\n}", "async function depositAccount(address, amount, client) {\n await walletSend(await ensureGiver(client), address, amount);\n}", "function deploy_contract() {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n console.log(\"The gas block limit is: \" + block.gasLimit.toString());\n if (!error) {\n var transaction_object = {\n chainId: web3.utils.toHex(newBlockchain.getChainId()),\n from: document.getElementById(\"public_key_input\").value,\n gasPrice: web3.utils.toHex(gas_price),\n gas: web3.utils.toHex(block.gasLimit.toString()),\n data: bytecode\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Please wait for about 10 seconds for transaction to be confirmed ...\";\n setTimeout(function() {\n web3.eth.getTransactionReceipt(sent_tx, function(err, res_rec) {\n if (!err) {\n if (res_rec != null && res_rec != undefined) {\n //console.log(\"Success, we now have a transaction receipt: \" + JSON.stringify(res_rec));\n document.getElementById(\"deploy_contract_output\").innerHTML = \"Contract address: \" + res_rec[\"contractAddress\"];\n newContract.setAddress(res_rec[\"contractAddress\"]);\n console.log(\"New contract at: \" + newContract.getAddress());\n var multiswapContractInstance = new web3.eth.Contract(abi, res_rec[\"contractAddress\"]);\n newContract.setContractInstanceObject(multiswapContractInstance);\n }\n } else {\n console.log(\"Unable to get transaction receipt \" + err);\n }\n });\n }, 60000);\n\n } else {\n console.log(\"*\\nSend signed transaction failed: \" + error);\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n}", "function buyBitCoinsWithINR(){\n var el = document.getElementById( 'main' );\n el.parentNode.removeChild( el );\n //document.getElementById(\"main\").style.visibility = 'hidden'; \n getCredentials();\n \n}" ]
[ "0.67413193", "0.6667065", "0.6565684", "0.6286294", "0.61377686", "0.60939074", "0.604016", "0.60349756", "0.6025271", "0.60119087", "0.5966179", "0.5861924", "0.58335984", "0.58123046", "0.5742271", "0.5716277", "0.57004464", "0.5681153", "0.56799626", "0.56536573", "0.5652797", "0.5648486", "0.56409043", "0.5613449", "0.5605165", "0.5602803", "0.5602429", "0.5601294", "0.5577976", "0.5577702", "0.5572757", "0.5569631", "0.5564556", "0.55642813", "0.55403584", "0.5533875", "0.55090475", "0.55073017", "0.5490371", "0.54882044", "0.54779124", "0.5476805", "0.5476092", "0.5455431", "0.54538757", "0.54396063", "0.5436878", "0.5432478", "0.54239637", "0.54111284", "0.5409637", "0.53991866", "0.5393943", "0.5389294", "0.5388272", "0.53842014", "0.5381008", "0.53762174", "0.5368326", "0.5367842", "0.53617996", "0.53598213", "0.5352524", "0.5351329", "0.5347827", "0.5345845", "0.5339008", "0.53334916", "0.5327219", "0.5322557", "0.53163546", "0.5314343", "0.5310283", "0.53070706", "0.53016806", "0.5297218", "0.5294973", "0.529214", "0.5291062", "0.52809584", "0.5275056", "0.52742505", "0.5268634", "0.5258216", "0.525738", "0.5256495", "0.52484214", "0.52474004", "0.52441275", "0.5243776", "0.5242992", "0.523882", "0.52371734", "0.52337694", "0.52337694", "0.5233258", "0.5230159", "0.52246964", "0.5221331", "0.5219258" ]
0.60137016
9
called from network, without user interaction
function readCosigners(wallet, handleCosigners) { db.query( "SELECT extended_pubkeys.device_address, name, approval_date, extended_pubkey \n\ FROM extended_pubkeys LEFT JOIN correspondent_devices USING(device_address) WHERE wallet=?", [wallet], function (rows) { rows.forEach(function (row) { if (row.device_address === device.uPMyHotDeviceAddress()) { if (row.name !== null) throw Error("found self in correspondents"); row.me = true; } //else if (row.name === null) //throw Error("cosigner not found among correspondents, cosigner=" + row.device_address + ", my=" + device.getMyDeviceAddress()); }); handleCosigners(rows); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Network() {}", "function Network() {}", "function Network() {}", "function Network() {}", "function Network() {}", "networkQueryOffersCollected() {\n this.socket.emit('networkQueryOffersCollected');\n }", "sending () {\n }", "function noNetworkDetected(){\n //We have no network and the current network status in the app is network, meaning we have to switch to local load and load local tiles\n if(networkMode == \"network\"){\n onOffline();\n }\n else{\n console.log(\"No network change or unknown error\");\n } \n}", "function doOnline() {\n console.log('Event: online\\n' + 'Network Type: ' + navigator.network.connection.type + '\\n');\n //setNetworkType();\n }", "function networkMessage(evt){\n\t\n\tMinima.log(\"Network event \"+JSON.stringify(evt.detail.info));\n\t\n\t//What's happening'\n\tvar action = evt.detail.info.action;\n\t\t \t\n \tif(action == \"client_new\"){\n\t \tif(evt.detail.info.outbound == true){\n\t\t \t//Connect ed to server\n\t\t\tnetuid = evt.detail.info.uid;\n\t\n\t\t\tMinima.log(\"NETUID set : \"+netuid);\n\t\t}\n \t\n\t}else if(action == \"server_start\"){ \n\t\n \t}else if(action == \"client_shut\"){ \n\t\tnetuid = 0;\n\t\talert(\"Client Connection Shut..\");\n\t\n\t}else if(action == \"message\"){ \n\t\t//From the server.. ?\n\t\tif(evt.detail.info.message.server){\n\t\t\t//Message Received\n\t\t\tvar msg = evt.detail.info.message.name+\":\"+evt.detail.info.message.message; \n\t\t\tchatwindow.value = chatwindow.value+msg+\"\\n\";\t\n\t\t}else{\n\t\t\t//Else..\n\t\t\tbraodcastMessage(evt.detail.info.message)\t\n\t\t}\n\t}\n}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "_sendData() {\n\n }", "onModelOnline(cb){\n cb = cb || angular.noop;\n socket.on('model-online', cb);\n\n }", "function doOffline() {\n console.log('Event: offline\\n' + 'Network Type: ' + navigator.network.connection.type + '\\n');\n //setNetworkType();\n }", "function do_reqveto() {\n socket.emit(\"do_reqveto\", $(\"#chanc1\").attr(\"policy\"), $(\"#chanc2\").attr(\"policy\"))\n $(\"#messages\").text(\"AWAITING PRESIDENTIAL AGREEEMENT...\")\n $(\"#chanc1\").attr(\"hidden\", true)\n $(\"#chanc2\").attr(\"hidden\", true)\n $(\"#chanc1\").removeAttr(\"policy\")\n $(\"#chanc2\").removeAttr(\"policy\")\n $(\"#submit\").attr(\"hidden\", true)\n}", "onCurrentModelOnline(cb){\n cb = cb || angular.noop;\n socket.on('current-model-online', cb);\n\n }", "function connection_online() {\n // Unblock.\n }", "disconnected() {}", "function networkDetected(){\n //We have a network and the current network status in the app is local, meaning we have to switch to network load and load network tiles\n if(networkMode == \"local\"){\n onOnline();\n }\n else{\n console.log(\"No network change or unknown error\");\n } \n}", "onping() {\n this.emitReserved(\"ping\");\n }", "onping() {\n this.emitReserved(\"ping\");\n }", "function XHRSyncLayer() {\n\n}", "onAfterSend()\n {\n }", "function BLOCKIND() {return true;}", "onping() {\n super.emit(\"ping\");\n }", "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function call_server() {\n console.log(\"Calling the server\");\n if (self.vue.chosen_magic_word === null) {\n console.log(\"No magic word.\");\n setTimeout(call_server, call_interval);\n } else {\n // We can do a server call.\n // Add a bit of random delay to avoid synchronizations.\n var extra_delay = Math.floor(Math.random() * 1000);\n $.ajax({\n dataType: 'json',\n url: server_url +'read',\n data: {key: self.vue.chosen_magic_word},\n success: self.process_server_data,\n complete: setTimeout(call_server, call_interval + extra_delay) // Here we go again.\n });\n }\n }", "onping() {\n this.emitReserved(\"ping\");\n }", "_mining(){\n return false;\n }", "function _noconn()\n\t{\n\t\tUTILS.msgbox(\"You do not have a good enough signal to complete the request. Please try again later.\", \"No Connection\");\n\t}", "verifyNetwork() {\n if (this.isNetworkLoading()) this.lookupNetwork()\n }", "function Main_Ping()\n{\n\t//do nothing\n}", "function call_server() {\n if (self.vue.chosen_magic_word === null) { \n console.log(\"No Magic Word\");\n setTimeout(call_server, call_interval);\n } else {\n //removed random delay to avoid synchronizations cause fuck that. &edit&\n //var extra_delay = Math.floor(Math.random() * 1000);\n console.log(\"Yo server what's good? | call_server()\");\n $.ajax({ //server call via ajax\n dataType: 'json',\n url: server_url +'read',\n //added BRAINBLAST to key so I don't run into your games.\n data: {key: \"BRAINBLAST\"+ self.vue.chosen_magic_word},\n success: self.process_server_data,\n complete: setTimeout(call_server, call_interval) // rm extra delay\n });\n }\n }", "connectedCallback(){}", "onSelectedNetworkConnected_() {\n this.networkLastSelectedGuid_ = '';\n this.dispatchEvent(new CustomEvent(\n 'selected-network-connected', {bubbles: true, composed: true}));\n }", "onMessage() {}", "onMessage() {}", "function networkOnly(event) {\n event.respondWith(fetch(event.request));\n}", "function grabData() {\r\n if(document.URL.indexOf('https://auth.ucla.edu/index.php') > -1\r\n || document.URL.indexOf('https://netaccess.logon.ucla.edu/cgi-bin/login') > -1\r\n || document.URL.indexOf('https://wlanc.resnet.ucla.edu/cgi-bin/login') > -1) {\r\n self.port.emit(\"grabData\",\"x\");\r\n }\r\n}", "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "function noop(){} // ping callback", "setNetworkCallbacks() {\n try {\n this.network.on('afterDrawing', () => this.network.fit());\n this.network.on('doubleClick', () => this.network.fit());\n this.network.on('zoom', () => this.network.off('afterDrawing'));\n this.network.on('dragStart', () => this.network.off('afterDrawing'));\n } catch (err) {\n console.log(err);\n }\n }", "_requestComputerVisionData() {\n window.webkit.messageHandlers.requestComputerVisionData.postMessage({})\n\t}", "function doNothing() {\n //do nothing\n }", "function doSomethingAfterRendering(){\n displayLoading() // 로딩화면 보여주기\n fetchServer(); // 서버에서 데이터 가져오기\n }", "onping() {\n super.emit(\"ping\");\n }", "onping() {\n super.emit(\"ping\");\n }", "function NetworkUtil(){ \n}", "function output() {\n authButton.addEventListener('click', function(){\n ipc.once('actionReply', function(event, response){\n processResponse(response)\n })\n ipc.send('invokeAction', 'someData');\n });\n}", "_initializeProperties(){}// prevent user code in connected from running", "function priv () {\n\t\t\t\n\t\t}", "function onOnline(){\n console.log(\"entering network mode\");\n map.removeLayer(baseLayer);\n baseLayer = L.tileLayer(networkURL, {maxZoom: 19}).addTo(map).redraw();\n networkMode = \"network\";\n}", "function NetworkUtil(){}", "function noop() {\n\t\t // No operation performed.\n\t\t}", "handleInput() {\n // hello from the other side\n }", "onMessageReceive() {}", "function connection_offline() {\n // Block.\n }", "_doFetch() {\n\t\tthis.emit(\"needs_data\", this);\n\t}", "function executeClient() {\n\t\trequest('BrixApi.newPlayer', [], function(response) {\n\t\t\tplayer = new Player(response.value, 400, 400, randomColor());\n\t\t\tmap.addPlayer(player, function() {\n\t\t\t\tplayer.takeControl(map);\n\t\t\t});\n\t\n\t\t\t/*\n\t\t\tstreamRequest('BrixApi.getHitPoints', [], function(response) {\n\t\t\t\tplayer_hitpoints.set(response, 100);\n\t\t\t}, 150);\n\t\t\t*/\n\t\t\tsubscriptionRequest('BrixApi.getPlayers', [], function(response) {\n\t\t\t\tfor(var i in response.value) {\n\t\t\t\t\tvar found = false;\n\t\t\t\t\tfor(var j in playerManager.list) {\n\t\t\t\t\t\tif(response.value[i].state == 4) {\n\t\t\t\t\t\t\t// Player has disconnected\n\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.fadeOut('slow', function() {\n\t\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.remove();\n\t\t\t\t\t\t\t\tplayerManager.remove(playerManager.list[j].id);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else \tif(response.value[i].id == playerManager.list[j].id) {\n\t\t\t\t\t\t\t// Player has data to change\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tif(response.value[i].id != player.id && playerManager.list[j].state > PLAYER_STATES.ETHEREAL) {\n\t\t\t\t\t\t\t\t// Player is not you\n\t\t\t\t\t\t\t\tplayerManager.list[j].dom.animate({\n\t\t\t\t\t\t\t\t\tleft: response.value[i].x,\n\t\t\t\t\t\t\t\t\ttop: response.value[i].y\n\t\t\t\t\t\t\t\t}, 150);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!found) {\n\t\t\t\t\t\tif(response.value[i].x == 0) {\n\t\t\t\t\t\t\tvar x = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar x = response.value[i].x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(response.value[i].y == 0) {\n\t\t\t\t\t\t\tvar y = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar y = response.value[i].y;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar newPlayer = new Player(response.value[i].id, x, y, randomColor()); \n\t\t\t\t\t\tplayerManager.add(newPlayer);\n\t\t\t\t\t\tmap.addPlayer(newPlayer, function() {\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}, 150);\n\t\t});\n\t}", "constructor() {\n this.network = null;\n }", "fetchMwi() {\r\n kandy.fetchMwi();\r\n }", "async connectCurrent(req,res){\n // web3 item should still have no value\n console.log(web3);\n this.isConnected()\n res.render('connectOverview');\n }", "ServerCallback() {\n\n }", "clearNetworkCache() {\n\t\t\twindow.SUI.slideModal( 'ccnw-slide-two', 'slide-next', 'next' );\n\t\t\tthis.scanner.start();\n\t\t}", "async processRequest(_operationResponse) {\n /* no_op */\n }", "requestSongDetails(){\n this.setState({buttonLoading : true}, () => {\n ipcRenderer.send('song:requestDetails');\n });\n\n ipcRenderer.on('song:details', (event, details) => {\n console.log(details);\n })\n }", "static receive() {}", "loadDrawing(){\n submitCanvas(this.sendToNeuralNet);\n }", "onMessageReceived(msg, msgInfo) {\n if (msgInfo.address === ip.address()) {\n // if the source address is the own ip address return\n return;\n } else {\n // else forward the message the the app\n this.mainWindow.webContents.send(\"receivedMessage\", msg.toString());\n }\n }", "function cb_call_remote(p_liveElement) {\n\t\t\tself.liveElementReceived(p_liveElement, p_readyfunc);\n\t\t}", "function process(){\n\t\t// Deselect all networks\n\t\tgm$(\"#network_selection_select_none\").trigger('click');\n\t\twait(function(){\n\t\t\tvar current_org_id = gm$(\"#species_select\").val();\n\t\t\tvar all_checkboxes = gm$(\".query_network input[default=false][organism=\"+ current_org_id +\"]\");\n\t\t\tvar random_index = Math.floor(Math.random() * all_checkboxes.size());\n\t\t\t\n\t\t\tvar network_checkbox = all_checkboxes.eq(random_index);\n\t\t\tvar random_network_name = network_checkbox.parent().children('label').text(); \n\t\t\tvar network_id = network_checkbox.val();\n\t\t\t\n\t\t\tvar network_group = network_checkbox.attr(\"group\");\n\t\t\tnetwork_checkbox.click();\n\n\t\t\tok(true, \"Random network chosen is: \" + random_network_name);\n\t\t\t\n\t\t\tif(callback){\n\t\t\t\twait(function(){\n\t\t\t\t\tcallback(network_id);\n\t\t\t\t});\n\t\t\t}\n\t\t}, 2000);\n\t}", "initiateNewGame() {\n this.socket.emit('get_new_game', true);\n return false;\n }", "initNetwork() {\n\n // Cached variable for this object\n var self = this;\n\n // initialize your network!\n this.network = new vis.Network(this.container, this.data, this.options);\n\n this.network.on('selectNode', function(e) {\n self.OnSelectNode(e);\n });\n\n this.network.on('release', function(e) {\n self.OnSelectNode(e);\n });\n }", "connectedCallback() {\n \n }", "function theClick() {\r\n console.log('inicia')\r\n dataNodes()\r\n dataElements()\r\n backEnd()\r\n}", "function onOffline() {\n\tdeviceIsOnLine = false;\n}", "function noop() {\n // No operation performed.\n }", "function noop() {\n // No operation performed.\n }", "function noop() {\n // No operation performed.\n }", "function mouseClicked() {\n \n\nsendChannel1();\n\n}", "static async sendFromStack() {\n if (!this.stack) return;\n const tmp = [];\n for (const req of this.stack) {\n if (__WEBPACK_IMPORTED_MODULE_2__Client__[\"a\" /* client */].isOnlineEnabled()) {\n try { \n await __WEBPACK_IMPORTED_MODULE_2__Client__[\"a\" /* client */].fetch(req.url, req.method, req.params, req.body, req.headers);\n } catch(e) {\n console.error(\"Could not be able to send the request to \" + req.url);\n }\n } else {\n // keep the request for later\n tmp.push(req);\n }\n }\n this.cleanStack();\n this.stack = tmp;\n this.saveStackIntoCache();\n }", "function onNetworkStatusChanged()\n {\n setInternetConnectivity();\n }", "onReceiveTip(cb){\n cb = cb || angular.noop;\n socket.on('send-tip', cb);\n }", "afterConnect() {}", "afterConnect() {}", "function trackNetworkStatisticsClicked() {\n\n\t// Test\n\t// sdnControllerURL = 'http://192.168.0.100:8181';\n\t// sdnControllerUserName = 'admin';\n\t// sdnControllerPassword = 'admin';\n\n\tsdnControllerURL = $(\"#url\").val();\n\tsdnControllerUserName = $(\"#username\").val();\n\tsdnControllerPassword = $(\"#password\").val();\n\tbase64EncodedPassword = \"Basic \" + btoa(sdnControllerUserName + \":\" + sdnControllerPassword);\n\n\t// console.log(sdnControllerURL);\n\t// console.log(sdnControllerUserName);\n\t// console.log(sdnControllerPassword);\n\t// console.log(base64EncodedPassword);\n\n\tif (ifCredentialsNotNull(sdnControllerUserName, sdnControllerPassword)) {\n\t\tpopulateNetworkNodes();\n\t} else {\n\t\talert(\"Trying error cases huhh..? Please enter createndials.\");\n\t}\n}", "run() {\n this.reset();\n this.socket = net.createConnection({\n 'host': this.host.address, \n 'port': this.port,\n }).setKeepAlive(true); // .setNoDelay(true)\n this.socket.on('connect', this.onConnect);\n this.socket.on('error', this.onError);\n this.socket.on('data', this.onData);\n this.socket.on('close', this.onClose);\n }", "function process()\n{\n\t/*continue if valid xmlHttp object*/\n\tif (xmlHttp)\n\t{\n\t\t/*try connect to server*/\n\t\ttry{\n\t\t\t/*script that handles notifications for views, likes, unlikes and msgs*/\n\t\t\txmlHttp.open(\"GET\", \"//php script to handle server queries\", true);\n\t\t\txmlHttp.onreadystatechange = handleRequestStateChange;\n\t\t\txmlHttp.send(null);\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\talert(\"can't connect to server: \\n\" + e.toString());\n\t\t}\n\t}\n}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "connected() {}" ]
[ "0.59743446", "0.59743446", "0.59743446", "0.59743446", "0.59743446", "0.57886153", "0.57811815", "0.5754062", "0.57035315", "0.57022405", "0.5689081", "0.5689081", "0.5689081", "0.5689081", "0.5689081", "0.5689081", "0.56524056", "0.5562783", "0.5557042", "0.5527577", "0.5504245", "0.5500917", "0.5497307", "0.5488331", "0.5484106", "0.5484106", "0.5472207", "0.54682904", "0.5459765", "0.5415901", "0.5409884", "0.540655", "0.5401282", "0.5381486", "0.5381089", "0.53724235", "0.53546065", "0.53501517", "0.5349084", "0.5338069", "0.53372604", "0.53372604", "0.53244406", "0.5309951", "0.5308018", "0.5300398", "0.5282915", "0.52808154", "0.52737856", "0.52716935", "0.52624416", "0.52624416", "0.52564514", "0.52560633", "0.52551484", "0.5253642", "0.5249061", "0.52390426", "0.5235841", "0.5233794", "0.52291334", "0.5227336", "0.5215691", "0.5213203", "0.52056444", "0.52054477", "0.52006775", "0.5197686", "0.5195671", "0.51877505", "0.51803917", "0.5179208", "0.51678956", "0.5165065", "0.5158968", "0.5158677", "0.5152079", "0.51507616", "0.51499546", "0.514894", "0.5146776", "0.51452714", "0.51452714", "0.51449406", "0.5139026", "0.5138348", "0.51319295", "0.5129359", "0.5128035", "0.5128035", "0.51221955", "0.51202744", "0.51166314", "0.51154137", "0.51154137", "0.51154137", "0.51154137", "0.51154137", "0.51154137", "0.51154137", "0.5112207" ]
0.0
-1
selects one of recent addresses if the gap is too large, otherwise issues a new address
function issueOrSelectNextAddress(wallet, is_change, handleAddress) { readNextAddressIndex(wallet, is_change, function (next_index) { if (next_index < MAX_BIP44_GAP) return issueAddress(wallet, is_change, next_index, handleAddress); readLastUsedAddressIndex(wallet, is_change, function (last_used_index) { if (last_used_index === null || next_index - last_used_index >= MAX_BIP44_GAP) selectRandomAddress(wallet, is_change, last_used_index, handleAddress); else issueAddress(wallet, is_change, next_index, handleAddress); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBestAddress(addresses) {\n // Keep only the addresses with the best match code\n /**\n * I haven't found any test data with duplicate addresses that have\n * different match codes. Until I find any such data, there's no need\n * to compare match codes\n */\n\n // Keep only the addresses with the most granular match level\n /**\n * I haven't found any test data with duplicate addresses that have\n * different match levels. Until I find any such data, there's no\n * need to compare match levels\n */\n\n /**\n * If there are still multiple addresses left, then they're\n * equal-enough; return the first one\n */\n return addresses[0];\n }", "mapAddressesToLastSync(addresses, defaultLastSync) {\n return this.alarmModel\n .findAll({\n include: [\n {\n model: this.syncStateModel,\n // Automagically handles the deleted at flag :)\n },\n ],\n where: {\n address: {\n [Op.in]: addresses,\n },\n },\n })\n .reduce(function (result, alarm) {\n let lastSyncBlock = defaultLastSync;\n if (alarm.AlarmSyncState !== null)\n lastSyncBlock = alarm.AlarmSyncState.dataValues.lastSyncBlock;\n\n // Only return the greatest lastBlockSync for specified address\n if (\n result[alarm.dataValues.address] === undefined ||\n lastSyncBlock > result[alarm.dataValues.address]\n )\n result[alarm.dataValues.address] = lastSyncBlock;\n\n return result;\n }, {});\n }", "function preCheckForDuplicateAddresses() {\n // Flush out deduper before we start\n newDeduper.clearAll();\n var arr = newDataset.getDataset();\n var amountToProcess = arr.length;\n for (let i = 0; i < arr.length; i++) {\n if (newDeduper.addressExists(arr[i][0])) {\n var amount = new web3.utils.BN(newDeduper.getItemAmount(arr[i][0]));\n var amount_to_add = web3.utils.toBN(arr[i][1]);\n var new_amount = amount.add(amount_to_add);\n newDeduper.addItem(arr[i][0], new_amount.toString());\n } else {\n newDeduper.addItem(arr[i][0], arr[i][1]);\n }\n }\n newDataset.overrideData(newDeduper.dumpAsList());\n console.log(\"Total items reduced from \" + amountToProcess + \" to \" + newDataset.getDataset().length);\n document.getElementById(\"pre_check_output_for_duplicate_addresses\").innerHTML = JSON.stringify(newDataset.getDataset(), 2, 2);\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 findNextUnassignedAddress() {\n\treturn new Promise(function(resolve, reject) {\n\t\ttempquery = 'SELECT index, address FROM users WHERE userid IS NULL ORDER BY index ASC LIMIT 1;';\n\t\tclient.query(tempquery, (err, res) => {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err.stack);\n\t\t\t\treject(err);\n\t\t\t} else if (res.rowCount == 0) {\n\t\t\t\tconsole.log('Ack! All addresses are assigned!');\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\tconsole.log('Got next address: ' + res.rows[0]['address']);\n\t\t\t\tresolve(res.rows[0]['index']);\n\t\t\t}\n\t\t})\n\t})\n}", "function loadMoreAddresses(){\n\tvar currNum = PUBLIC_WALLET.addresses.length;\n\tvar numAddr = currNum + 3;\n\t\n\t// generate addresses\n\tfor (var i = currNum; i < numAddr; i++){\n\t\tvar thisAddr = {};\n\t\tthisAddr.address = bitcore.Address.fromPubKey( PUBLIC_WALLET.HK.derive('m/' + i).eckey.public ).toString();\n\t\tPUBLIC_WALLET.addresses.push(thisAddr);\n\t}\n\t\n\t// get address information via BLOCKSCAN API\n\t$.post('blockscan.php', \n\t\t\t{addrs: PUBLIC_WALLET.addresses},\n\t\t\tfunction(response){\n\t\t\t\t$.each(response, function(i,v){\n\t\t\t\t\t// Counterparty asset info array from blockscan\n\t\t\t\t\tPUBLIC_WALLET.addresses[i].info = JSON.parse(v.XCP);\t\t\t\t\n\t\t\t\t\t// BTC info from blockchain\n\t\t\t\t\tPUBLIC_WALLET.addresses[i].BTC = v.BTC;\t\t\t\t\n\t\t\t\t});\n\t\t\t},\n\t\t\t'json'\n\t).done(function(){refreshDisplay()});\n}", "function fixAddresses(oldAddress){\n var newAddress = oldAddress.substring(0,oldAddress.indexOf(',')) + ' New York, NY';\n return newAddress;\n}", "firstAddress(event) {\n this.addressIndex = 0;\n\n const beginningAddress = getByIndex(this.addressIndex);\n\n this.setState({\n address: beginningAddress\n });\n event.preventDefault();\n }", "minAddress() {\n const div = this.networkAddress % this.networkSize;\n return this.networkAddress - div;\n }", "function fillGaps(path, searchPoints, maxDist) {\n var repeat = false, addedSearchPoints = [];\n for(i=0; i<searchPoints.length-1; i++) {\n var distance = google.maps.geometry.spherical.computeDistanceBetween(path[searchPoints[i]], path[searchPoints[i+1]]);\n console.log(i+'->'+(i+1)+' distance: '+distance);\n if(distance > maxDist && searchPoints[i+1]-searchPoints[i] > 1) {\n repeat = true;\n var bestFiller = 0, bestDiff = distance, lb = searchPoints[i], ub = searchPoints[i+1];\n for(j=lb; j<ub; j++) {\n var d1 = google.maps.geometry.spherical.computeDistanceBetween(path[lb], path[j]);\n var d2 = google.maps.geometry.spherical.computeDistanceBetween(path[j], path[ub]);\n if(Math.abs(d1-d2) < bestDiff) {\n bestDiff = Math.abs(d1-d2);\n bestFiller = j;\n }\n }\n addedSearchPoints.push(bestFiller);\n console.log(bestFiller+' added to fill gap');\n }\n }\n searchPoints = searchPoints.concat(addedSearchPoints).sort(function(x, y) { return x-y; });\n if(repeat) {\n console.log('Need to rescan...')\n searchPoints = fillGaps(path, searchPoints, maxDist);\n }\n return searchPoints;\n }", "function _findNewHighestIndex(\n newFetchedAddressesInfo: Array<AddressInfo>,\n offset: number,\n highestUsedIndex: number,\n scanSize: number,\n): number {\n // get all addresses added in this scan\n const newlyAddedAddresses = newFetchedAddressesInfo.slice(\n highestUsedIndex - offset + 1,\n highestUsedIndex - offset + 1 + scanSize // note: not `requestSize`\n );\n\n // find new highest used\n const newHighestUsedIndex = newlyAddedAddresses.reduce(\n (currentHighestIndex, addressInfo) => {\n if (addressInfo.index > currentHighestIndex && addressInfo.isUsed) {\n return addressInfo.index;\n }\n return currentHighestIndex;\n },\n highestUsedIndex\n );\n\n return newHighestUsedIndex;\n}", "function createAddresses() {\n deleted = created = updated = 0;\n // eslint-disable-next-line no-unused-vars\n predefAddresses.forEach(function (predef, index, array) {\n predef.houses.forEach(function (hseNum) {\n\n var addr = Object.assign({}, predef.addr);\n addr.addrLine1 = hseNum + ' ' + addr.addrLine1;\n\n var findParam = {'addrLine1': addr.addrLine1};\n var cursor = addressCollect.find(findParam);\n if (cursor.hasNext()) {\n // exists in database\n var dbObj = cursor.next();\n addressCollect.findOneAndUpdate(findParam, {$set: addr});\n ++updated;\n } else {\n // create\n addressCollect.insert(addr);\n ++created;\n }\n });\n });\n print('Addresses: updated ' + updated + ', created ' + created + ', deleted ' + deleted);\n}", "function findAddress(address, addresses)\n{\n\taddress = address.toLowerCase()\n\taddress = address.replaceAll(\",\", \"\").replaceAll(\"street\", \"st\").replaceAll(\"road\", \"rd\").replaceAll(\"avenue\", \"ave\")\n\t//console.log(\"Checking: \" + address)\n\tvar longestSubstringIndex = 0\n\tvar longestSubstring = \"\"\n\n\tfor (var i = 0; i < addresses.length; i++)\n\t{\n\t\tvar a = addresses[i].toLowerCase()\n\t\ta = a.replaceAll(\",\", \"\").replaceAll(\"street\", \"st\").replaceAll(\"road\", \"rd\").replaceAll(\"avenue\", \"ave\")\n\n\t\t//console.log(\"Comparing: \" + a)\n\n\t\tvar substring = longestCommonSubstring(a, address)\n\n\t\t//console.log(\"subString: \" + substring)\n\n\t\tif (substring.length > longestSubstring.length)\n\t\t{\n\t\t\tlongestSubstring = substring\n\t\t\tlongestSubstringIndex = i\n\t\t}\n\t}\n\n\t//console.log(\"Returning: \" + longestSubstringIndex + \"\\n\\n\\n\")\n\n\treturn [address, addresses[longestSubstringIndex]]\n}", "function addressFill(no_mymap = false) {\n var fullAddress = '';\n\n opcion = $('#spaceAddress').val();\n\n previous = '';\n if ($('#spaceAddress').val() != '' && ($(\"#spaceCountry option:selected\").val() != '' || $(\"#spaceState option:selected\").text() != '' || $(\"#spaceCities option:selected\").text() != '' || $(\"#selectedZipcode\").text() != '')) {\n previous = ', ';\n }\n if (opcion == '') {\n opcion = '';\n }\n //console.log('Address: ' + opcion+ ' Previous: ' + previous);\n fullAddress += opcion + previous;\n $(\"#selectedAddress\").text(opcion + previous);\n\n opcion = $('#spaceZipcode').val();\n\n previous = '';\n if ($('#spaceZipcode').val() != '' && ($(\"#spaceCountry option:selected\").val() != '' || $(\"#spaceState option:selected\").text() != '' || $(\"#spaceCities option:selected\").text() != '')) {\n previous = ', ';\n }\n if (opcion == '') {\n opcion = '';\n }\n //console.log('Zipcode: ' + opcion+ ' Previous: ' + previous);\n fullAddress += opcion + previous;\n $(\"#selectedZipcode\").text(opcion + previous);\n\n opcion = $(\"#spaceCities option:selected\").text();\n\n previous = '';\n if (opcion != 'Seleccione una Ciudad' && opcion != '' && ($(\"#spaceCountry option:selected\").val() != '' || $(\"#spaceState option:selected\").text() != '')) {\n previous = ', ';\n }\n if (opcion == 'Seleccione una Ciudad') {\n opcion = '';\n }\n //console.log('City: ' + opcion+ ' Previous: ' + previous);\n fullAddress += opcion + previous;\n $(\"#selectedCity\").text(opcion + previous);\n\n opcion = $(\"#spaceState option:selected\").text();\n\n previous = '';\n if (opcion != 'Seleccione un Estado' && opcion != '' && ($(\"#spaceCountry option:selected\").val() != '')) {\n previous = ', ';\n }\n if (opcion == 'Seleccione un Estado') {\n opcion = '';\n }\n //console.log('Estado: ' + opcion + ' Previous: ' + previous);\n fullAddress += opcion + previous;\n $(\"#selectedState\").text(opcion + previous);\n\n\n opcion = $('#spaceCountry option:selected').text();\n //alert(opcion);\n if (opcion == 'Selecciona un Pais') {\n opcion = '';\n //alert(opcion);\n }\n //console.log('Pais: ' + opcion);\n fullAddress += opcion;\n $(\"#selectedCountry\").text(opcion);\n\n console.log(fullAddress);\n if (no_mymap) {\n\n } else {\n myMap(fullAddress);\n }\n\n }", "function codeAddress() {\n var numberOfResults = 25;\n //Currently set to default of 'driving'//\n //Controls number of results displayed after search//\n var numberOfDrivingResults = 6;\n var address = document.getElementById('address').value;\n geocoder.geocode({\n 'address': address\n }, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n map.setCenter(results[0].geometry.location);\n if (customerMarker) customerMarker.setMap(null);\n customerMarker = new google.maps.Marker({\n map: map,\n position: results[0].geometry.location\n });\n closest = findClosestN(results[0].geometry.location, numberOfResults);\n closest = closest.splice(0, numberOfResults);\n calculateDistances(results[0].geometry.location, closest, numberOfDrivingResults);\n } else {\n alert('Geocoder failed for the following reason: ' + status);\n }\n });\n}", "function getCurrentAddress() {\n var address = [], \n addressKeys = Maptimize.AddressChooser.AddressKeys;\n\n for (var i = addressKeys.length-1; i>=0; --i) {\n var k = addressKeys[i];\n if (this[k]) {\n var value = valueForElement(this[k]);\n // Strip string\n value = value.replace(/^\\s+/, '').replace(/\\s+$/, '');\n if (value.length > 0) address.unshift(value);\n }\n }\n return address;\n }", "_addOneToAddress() {\n this._transportParameters.targetAddress = intToAddress(addressToInt(this._transportParameters.targetAddress) + 1);\n this._debug(`New address for DFU target: ${this._transportParameters.targetAddress}`);\n return this._transportParameters.targetAddress;\n }", "function AddAddress()\n{\n\t// Remove the title message\n\tClearTitle();\n\t\n\t// Remove the box colors\n\tClearAllInputForms()\n\t\n\t// Remove the address warning title (if it exists)\n\tvar address_warning = document.getElementById(\"address-warning\");\n\t\n\tif(address_warning != null)\n\t{\n\t\tvar address_title = document.getElementById(\"address-title\");\n\t\taddress_title.removeChild(address_warning);\n\t}\n\t\n // First check to see if any of the previous address boxes are empty. If they\n // are, don't do anything.\n var i = 0;\n var success = true;\n \n // Check all of the address boxes to make sure that they're all occupied\n\t// Each address has the following fields:\n\t// - Username: id = number-i\n\t// * number-input-box-i\n\t// - Street Name: id = street-i\n\t// * street-input-box-i\n\t// - City: id = city-i\n\t// * city-input-box-i\n\t// - Zip Code: id = zip-i\n\t// * zip-input-box-i\n\t// - State: id = state-i\n\t// * state-input-box-i\n\t// - isGreenhouse: id = isGreenhouse-i\n\t// * isGreenhouse-input-box-1\n\t// - isResidence: id = isResidence-i\n\t// * isGreenhouse-input-box-1\n\tlist_of_forms = [[\"number-\", \"number-input-box-\"],\n\t\t[\"street-\", \"street-input-box-\"],\n\t\t[\"city-\", \"city-input-box-\"],\n\t\t[\"zip-\", \"zip-input-box-\"],\n\t\t[\"state-\", \"state-input-box-\"],\n\t\t[\"isGreenhouse-\", \"isGreenhouse-input-box-\"],\n\t\t[\"isResidence-\", \"isResidence-input-box-\"]];\n \n for(i = 1; i<=num_address_fields; i++)\n {\n var current_address = document.getElementById(\"address-\" + String(i));\n \n\t\tvar j = 0;\n\t\tfor(j = 1; j<=list_of_forms.length; j++)\n\t\t{\n\t\t\tif(InputFormSetError(list_of_forms[j - 1][0] + String(i), \n\t\t\t\tlist_of_forms[j - 1][1] + String(i)) == false)\n\t\t\t{\n\t\t\t\tsuccess = false;\n\t\t\t}\n\t\t}\n\t}\n\n // If one of the addresses has empty fields, don't add a new one\n if(success == false)\n {\n // Add a warning message next to the address field\n var address_warning = document.createElement(\"h4\");\n address_warning.id = \"address-warning\";\n address_warning.className = \"text-danger\";\n address_warning.innerHTML = \"Marked fields cannot be blank\";\n\n var address_tag = document.getElementById(\"address-title\");\n address_tag.appendChild(address_warning);\n\n return;\n }\n else\n {\n // Remove the warning message if necessary.\n var parent = document.getElementById(\"address-title\");\n var to_remove = document.getElementById(\"address-warning\");\n\n if(to_remove !== null)\n {\n parent.removeChild(to_remove);\n }\n }\n\n // Create a new address and then add it in\n var parent_address = document.getElementById(\"address-list\");\n\n // Since we're definitely adding a new address, increment the address counter\n num_address_fields = num_address_fields + 1;\n\n // Outer div which will contain the entire address element\n var new_address = document.createElement(\"div\");\n new_address.id = \"address-\" + String(num_address_fields);\n\n\n // Add the address number field\n var new_row = document.createElement(\"div\");\n new_row.className = \"row\";\n\n var left_div = document.createElement(\"div\");\n left_div.className = \"col-md-4\";\n\n var title_div = document.createElement(\"div\");\n title_div.className = \"col-md-4\";\n title_div.innerHTML = \"<h4>Address \" + String(num_address_fields) + \":</h4>\";\n\n var right_div = document.createElement(\"div\");\n right_div.className = \"col-md-4\";\n\n new_row.appendChild(left_div);\n new_row.appendChild(title_div);\n new_row.appendChild(right_div);\n\n new_address.appendChild(new_row);\n\n\n // Add the number and street name fields\n new_row = document.createElement(\"div\");\n new_row.className = \"row\";\n\n left_div = document.createElement(\"div\");\n left_div.className = \"col-md-4\";\n\n number_div = document.createElement(\"div\");\n number_div.className = \"col-md-1 form-group\";\n number_div.id = \"number-input-box-\" + String(num_address_fields);\n\n number_div.innerHTML = \"<label for='number-\" + String(num_address_fields) + \"' id='number-overtext-\"\n + String(num_address_fields) + \"'>Number:</label>\\n\"\n + \"<input type='text' class='form-control' id='number-\" + String(num_address_fields) + \"'>\";\n\n\n var street_div = document.createElement(\"div\");\n street_div.className = \"col-md-3 form-group\";\n street_div.id = \"street-input-box-\" + String(num_address_fields);\n\n street_div.innerHTML = \"<label for='street-\" + String(num_address_fields) + \"' id='street-overtext-\"\n + String(num_address_fields) + \"'>Street Name:</label>\\n\"\n + \"<input type='text' class='form-control' id='street-\" + String(num_address_fields) + \"'>\";\n\n right_div = document.createElement(\"div\");\n right_div.className = \"col-md-4\";\n\n new_row.appendChild(left_div);\n new_row.appendChild(number_div);\n new_row.appendChild(street_div);\n new_row.appendChild(right_div);\n\n // Add the new number + street data to the new address\n new_address.appendChild(new_row)\n\n\n // Add the city and zip fields\n new_row = document.createElement(\"div\");\n new_row.className = \"row\";\n\n left_div = document.createElement(\"div\");\n left_div.className = \"col-md-4\";\n\n var city_div = document.createElement(\"div\");\n city_div.className = \"col-md-2 form-group\";\n city_div.id = \"city-input-box-\" + String(num_address_fields);\n\n city_div.innerHTML = \"<label for='city-\" + String(num_address_fields) + \"' id='city-overtext-\"\n + String(num_address_fields) + \"'>City:</label>\\n\"\n + \"<input type='text' class='form-control' id='city-\" + String(num_address_fields) + \"'>\";\n\n var zip_div = document.createElement(\"div\");\n zip_div.className = \"col-md-2 form-group\";\n zip_div.id = \"zip-input-box-\" + String(num_address_fields);\n\n zip_div.innerHTML = \"<label for='zip-\" + String(num_address_fields) + \"' id='zip-overtext-\"\n + String(num_address_fields) + \"'>Zip:</label>\\n\"\n + \"<input type='text' class='form-control' id='zip-\" + String(num_address_fields) + \"'>\";\n\n right_div = document.createElement(\"div\");\n right_div.className = \"col-md-4\";\n\n new_row.appendChild(left_div);\n new_row.appendChild(city_div);\n new_row.appendChild(zip_div);\n new_row.appendChild(right_div);\n\n // Add the new city + zip data to the new address\n new_address.appendChild(new_row);\n\n // Add the state, isGreenhouse, and isResidence fields\n new_row = document.createElement(\"div\");\n new_row.className = \"row\";\n\n left_div = document.createElement(\"div\");\n left_div.className = \"col-md-4\";\n\n var state_div = document.createElement(\"div\");\n state_div.className = \"col-md-2 form-group\";\n state_div.id=\"state-input-box-\" + String(num_address_fields);\n\n state_div.innerHTML = '<label for=\"state-' + String(num_address_fields) + '\" id=\"state-overtext-'\n + String(num_address_fields) + '\">State:</label>\\n'\n + '<select class=\"form-control\" id=\"state-' + String(num_address_fields) + '\" name=\"state-'\n + String(num_address_fields) + '\">'\n + '<option value=\"\">Select One</option>'\n + '<option value=\"AK\">Alaska</option>'\n + '<option value=\"AL\">Alabama</option>'\n + '<option value=\"AR\">Arkansas</option>'\n + '<option value=\"AZ\">Arizona</option>'\n + '<option value=\"CA\">California</option>'\n + '<option value=\"CO\">Colorado</option>'\n + '<option value=\"CT\">Connecticut</option>'\n + '<option value=\"DC\">District of Columbia</option>'\n + '<option value=\"DE\">Delaware</option>'\n + '<option value=\"FL\">Florida</option>'\n + '<option value=\"GA\">Georgia</option>'\n + '<option value=\"HI\">Hawaii</option>'\n + '<option value=\"IA\">Iowa</option>'\n + '<option value=\"ID\">Idaho</option>'\n + '<option value=\"IL\">Illinois</option>'\n + '<option value=\"IN\">Indiana</option>'\n + '<option value=\"KS\">Kansas</option>'\n + '<option value=\"KY\">Kentucky</option>'\n + '<option value=\"LA\">Louisiana</option>'\n + '<option value=\"MA\">Massachusetts</option>'\n + '<option value=\"MD\">Maryland</option>'\n + '<option value=\"ME\">Maine</option>'\n + '<option value=\"MI\">Michigan</option>'\n + '<option value=\"MN\">Minnesota</option>'\n + '<option value=\"MO\">Missouri</option>'\n + '<option value=\"MS\">Mississippi</option>'\n + '<option value=\"MT\">Montana</option>'\n + '<option value=\"NC\">North Carolina</option>'\n + '<option value=\"ND\">North Dakota</option>'\n + '<option value=\"NE\">Nebraska</option>'\n + '<option value=\"NH\">New Hampshire</option>'\n + '<option value=\"NJ\">New Jersey</option>'\n + '<option value=\"NM\">New Mexico</option>'\n + '<option value=\"NV\">Nevada</option>'\n + '<option value=\"NY\">New York</option>'\n + '<option value=\"OH\">Ohio</option>'\n + '<option value=\"OK\">Oklahoma</option>'\n + '<option value=\"OR\">Oregon</option>'\n + '<option value=\"PA\">Pennsylvania</option>'\n + '<option value=\"PR\">Puerto Rico</option>'\n + '<option value=\"RI\">Rhode Island</option>'\n + '<option value=\"SC\">South Carolina</option>'\n + '<option value=\"SD\">South Dakota</option>'\n + '<option value=\"TN\">Tennessee</option>'\n + '<option value=\"TX\">Texas</option>'\n + '<option value=\"UT\">Utah</option>'\n + '<option value=\"VA\">Virginia</option>'\n + '<option value=\"VT\">Vermont</option>'\n + '<option value=\"WA\">Washington</option>'\n + '<option value=\"WI\">Wisconsin</option>'\n + '<option value=\"WV\">West Virginia</option>'\n + '<option value=\"WY\">Wyoming</option>'\n + '</select>';\n\n\n var isGreenhouse_div = document.createElement(\"div\");\n isGreenhouse_div.className = \"col-md-1 form-group\";\n isGreenhouse_div.id = \"isGreenhouse-input-box-\" + String(num_address_fields);\n\n isGreenhouse_div.innerHTML = '<label for=\"isGreenhouse-' + String(num_address_fields)\n + '\" id=\"isGreenhouse-overtext-' + String(num_address_fields) + '\">isGreenhouse:</label>'\n + '<select class=\"form-control\" id=\"isGreenhouse-' + String(num_address_fields) + '\" name=\"isGreenhouse-'\n + String(num_address_fields) + '\">'\n + '<option value=\"\">Select One</option>'\n + '<option value=\"yes\">Yes</option>'\n + '<option value=\"no\">No</option>'\n + '</select>';\n\n var isResidence_div = document.createElement(\"div\");\n isResidence_div.className = \"col-md-1 form-group\";\n isResidence_div.id = \"isResidence-input-box-\" + String(num_address_fields);\n\n isResidence_div.innerHTML = '<label for=\"isResidence-' + String(num_address_fields)\n + '\" id=\"isResidence-overtext-' + String(num_address_fields) + '\">isResidence:</label>'\n + '<select class=\"form-control\" id=\"isResidence-' + String(num_address_fields) + '\" name=\"isResidence-'\n + String(num_address_fields) + '\">'\n + '<option value=\"\">Select One</option>'\n + '<option value=\"yes\">Yes</option>'\n + '<option value=\"no\">No</option>'\n + '</select>';\n\n right_div = document.createElement(\"div\");\n right_div.className = \"col-md-4\";\n\n new_row.appendChild(left_div);\n new_row.appendChild(state_div);\n new_row.appendChild(isGreenhouse_div);\n new_row.appendChild(isResidence_div);\n new_row.appendChild(right_div);\n\n // Add the rest of the data to the document\n new_address.appendChild(new_row);\n\n // Append the final element onto the document\n parent_address.appendChild(new_address);\n\n // Enable the remove phone button\n if(num_address_fields == 2)\n {\n enableRemoveAddressButton();\n }\n}", "function removeDuplicates(allAddressData) {\n const uniqueAddressData = [];\n for(const addressData of allAddressData) {\n /**\n * Check if an equivalent address option already exists in the\n * filtered array\n */\n const existingDataIndex = uniqueAddressData.findIndex((data) => {\n return _.isEqual(data.addressComponents.common, addressData.addressComponents.common);\n });\n\n // Found a duplicate address\n if (existingDataIndex > -1) {\n const existingData = uniqueAddressData[existingDataIndex];\n console.log(`Address ${addressData.placeID} has an identical match: address ${existingData.placeID}`);\n\n // Keep the better of the two addresses\n const bestAddress = getBestAddress([addressData, existingData]);\n console.log(`----Keeping address ${bestAddress.placeID} and removing address ${existingData.placeID}`);\n uniqueAddressData[existingDataIndex] = bestAddress;\n } else {\n // Not a duplicate address\n uniqueAddressData.push(addressData);\n }\n }\n\n return uniqueAddressData;\n }", "isAddressExists() {\n const splitEntries = [];\n this.existingSavedAddresses = [];\n this.allEntries.map((entry) => {\n if (entry.splitEntries && entry.splitEntries.length === 0) {\n this.isNewProductAdded = true;\n this.isEditable = true;\n }\n });\n for (let i = 0; i < this.visibleEntries.length; i += 1) {\n if (\n this.isNewProductAdded &&\n this.visibleEntries[0] &&\n this.visibleEntries[0].splitEntries &&\n this.visibleEntries[0].splitEntries.length !== 0 &&\n this.visibleEntries[0].splitEntries[0] &&\n this.visibleEntries[0].splitEntries[0].deliveryAddress\n ) {\n const addressToBePopulated = {\n label: this.$refs.singleShipping.formAddressString(\n this.visibleEntries[0].splitEntries[0].deliveryAddress,\n ),\n value: this.visibleEntries[0].splitEntries[0].deliveryAddress,\n };\n this.$refs.singleShipping.selectedAddress(addressToBePopulated);\n this.$refs.singleShipping.populateStoredAddress();\n break;\n }\n for (\n let k = 0; k < this.visibleEntries[i].splitEntries.length; k += 1\n ) {\n splitEntries.push(this.visibleEntries[i].splitEntries[k]);\n }\n }\n if (splitEntries.length === 0) {\n this.isEditable = true;\n } else if (!this.isNewProductAdded) {\n for (let j = 0; j < splitEntries.length; j += 1) {\n this.existingSavedAddresses.push(splitEntries[j].deliveryAddress);\n }\n this.existingSavedAddresses = _.uniqBy(\n this.existingSavedAddresses,\n 'id',\n );\n this.$refs.singleShipping.showExistingAddresses(\n this.existingSavedAddresses,\n );\n }\n this.loadedflag = false;\n }", "function same(address1, address2) {\n return (address1 === address2) \n}", "function address(loc, i = 0, found = new Set()) {\n // reached the end of the address\n if (i >= mask.length) {\n // add the new address\n return found.add(loc.join(''))\n }\n // if I have already seen this address ending\n let key = loc.slice(i).join('')\n if (memo.has(key)) {\n // add all the addresses that result from this ending\n let prefix = loc.slice(0,i).join('');\n [...memo.get(key)].forEach(suffix => {found.add(prefix+suffix)});\n return found\n }\n // apply the mask from point i and get all possibilities into the array rem\n let rem = []\n switch (mask[i]) {\n case '1':\n loc[i] = '1'\n case '0':\n rem = [...address([...loc],i+1,found)]\n break;\n case 'X':\n loc[i] = '0';\n rem = [...address([...loc],i+1,found)]\n loc[i] = '1';\n rem.push(...[...address([...loc],i+1,found)])\n break;\n default:\n console.log('oops, bad mask at index', i)\n }\n // store the possibilities in the memo in case we come across this pattern again.\n memo.set(key, new Set(rem.map(o => o.slice(i))))\n return found\n}", "async newAddress (multiple, addressType, label = '') { \n const addressTypes = [\n 'legacy',\n 'p2sh-segwit',\n 'bech32'\n ]\n\n if (multiple == null) {\n if (addressType == null) {\n addressType = randomType()\n }\n checkType(addressType)\n return this.client.getNewAddress(label, addressType)\n }\n\n // if multiple addresses requested, can all \n // be specific type or each randomly assigned\n const addressList = new Array(multiple)\n\n if (addressType) {\n checkType(addressType)\n addressList.fill(addressType)\n } else {\n for (let i = 0; i < multiple; i++) {\n addressList[i] = randomType()\n }\n }\n\n return pMap(addressList, async type => {\n return this.client.getNewAddress(label, type)\n }, { concurrency: 8 })\n\n function checkType (addressType) {\n if (!addressTypes.includes(addressType)) throw new Error(`unrecognised address types`)\n }\n }", "function CheckForAddressChange(fldNbr)\n{\n\t// EMP-ADDR1, EMP-ADDR2, EMP-ADDR3, EMP-ADDR4, EMP-CITY, EMP-STATE, EMP-ZIP, EMP-COUNTY, EMP-COUNTRY-CODE\n\tif (fldNbr == 5 || fldNbr == 6 || fldNbr == 157 || fldNbr == 158 || fldNbr == 7 || fldNbr == 8 || fldNbr == 9 || fldNbr == 568 || fldNbr == 10)\n\t{\n\t\tRules[_RULESINDEX].AddressChange = true;\n\t}\n\t// EMP-SUPP-ADDR1, EMP-SUPP-ADDR2, EMP-SUPP-ADDR3, EMP-SUPP-ADDR4, EMP-SUPP-CITY, EMP-SUPP-STATE, EMP-SUPP-ZIP, EMP-SUPP-COUNTRY-CODE\n\tif (fldNbr == 39 || fldNbr == 40 || fldNbr == 148 || fldNbr == 149 || fldNbr == 41 || fldNbr == 42 || fldNbr == 43 || fldNbr == 44)\n\t{\n\t\tRules[_RULESINDEX].AddressChange = true;\n\t\tRules[_RULESINDEX].SuppAddrChange = true;\n\t}\n}", "processNearMisses () {\n this.tree.all().forEach((treeObj) => {\n const feature = treeObj[4].feature;\n\n // if there are no hits, and only one near hit, place the point on the\n // building and call it a hit\n if (feature.properties._hits.length === 0 && feature.properties._nearHits.length === 1) {\n let pt = feature.properties._nearHits[0];\n if (pt.geometry.type !== 'Point') {\n return;\n }\n\n // remove this point from the set of misses since this is no longer a miss\n const idx = _.findIndex(this.misses, (obj) => {\n return obj.geometry.coordinates[0] === pt.geometry.coordinates[0] && obj.geometry.coordinates[1] === pt.geometry.coordinates[1];\n });\n this.misses.splice(idx, 1);\n\n // pick a point somewhere on the feature to be the new address pt\n // representation - this is okay because the point will be merged into\n // the building later\n let ptOnFeature = turf.pointOnSurface(feature);\n ptOnFeature.properties = pt.properties;\n feature.properties._hits = [ptOnFeature];\n feature.properties._nearHits = [];\n }\n\n // invalidate a hit if there are any near misses close by\n if (feature.properties._hits.length === 1 && feature.properties._nearHits.length !== 0 ) {\n this.misses.push(feature.properties._hits[0]);\n feature.properties._hits = [];\n };\n });\n }", "function GeoQuery(q)\n{\n\tvar addnew = true;\n\n\tfor(var i in geoquery) //eliminate redundancy\n\t{\n\t\tif(geoquery[i].place == q.place)\n\t\t{\n\t\t\tgeoquery[i].addresses.push(q.addresses[0]);\n\t\t\taddnew = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif(addnew) geoquery.push(q);\n}", "geocodeNewAddress(address) {\n\n\t\tymaps.geocode(address, {results: 1}).then((result) => {\n\n\t\t\t// Get first result\n\t\t\tlet coordinates = result.geoObjects.get(0).geometry.getCoordinates();\n\n\t\t\t// Transfer map view to geocoded coordinates\n\t\t\tthis.myMap.panTo(coordinates, {flying: true});\n\n\t\t\t// Set placemark from geocoded coordinates\n\t\t\tthis.setPlacemark(coordinates);\n\n\t\t\tthis.$timeout(() => this.$rootScope.$broadcast(\"geocoded:coordinates\", coordinates));\n\t\t});\n\n\t}", "autoFillSuburb(place, c) {\n if(c >0 && c%2 != 0) {\n let data = {\n venue: \"\",\n address_lane_1: \"\",\n address_lane_2: \"\",\n lane: \"\",\n city: \"\",\n state: \"\",\n country: \"\",\n pin: \"\"\n };\n for( var i = 0; i < place.address_components.length; i++ ){\n for( var j = 0; j < place.address_components[i].types.length; j++ ){\n switch (place.address_components[i].types[j]) {\n case \"street_number\":\n data.lane = place.address_components[i].long_name;\n break;\n case \"route\":\n if(!data.lane){\n data.lane = place.address_components[i].long_name\n }else {\n data.lane = data.lane.concat(\", \",place.address_components[i].long_name);\n }\n break;\n case \"sublocality_level_3\":\n data.address_lane_1 = place.address_components[i].long_name;\n break;\n case \"sublocality_level_2\":\n if(!data.address_lane_1){\n data.address_lane_1 = place.address_components[i].long_name\n }else {\n data.address_lane_1 = data.address_lane_1.concat(\", \",place.address_components[i].long_name);\n }\n break;\n case \"sublocality_level_1\":\n data.address_lane_2 = place.address_components[i].long_name;\n break;\n case \"administrative_area_level_2\":\n data.city = place.address_components[i].long_name;\n break;\n case \"administrative_area_level_1\":\n data.state = place.address_components[i].long_name;\n break;\n case \"country\":\n data.country = place.address_components[i].long_name;\n break;\n case \"postal_code\":\n data.pin = place.address_components[i].long_name;\n break;\n }\n }\n }\n this.state.event_loc_store.push(data);\n\n this.setState({location: place});\n let temp = this.state.location.formatted_address;\n this.setState({event_multiple_location: this.state.event_multiple_location.concat(temp)});\n }\n }", "function highlight_address(address) {\n\tclear_markers([address]);\n\tadd_address_to_map(address);\n}", "function checkExtrapolatedSnake1(newSnake)\r\n\t{\r\n //Variables for finding distance\r\n\t var a = newSnake[0].x - snake1[0].x;\r\n\t var b = newSnake[0].y - snake1[0].y;\r\n\t var c = Math.sqrt(a * a + b * b);\r\n\t //Checks to see if snake goes into itself\r\n\t //If snake is going to bite itself then extrapolated position = actual position\r\n\t //Otherwise this is an old packet\r\n\t if (c < 1 && snake1.indexOf(newSnake[0]) > -1)\r\n\t snake1 = newSnake;\r\n\t //Checks to see if new position is >= 3 steps away\r\n\t //This implies an odd packet has been received.\r\n\t //Either we have diverged greatly from the authoritative state\r\n\t //Or the packet was a fluke and out of order.\t \r\n\t}", "function uniqueRecord(record, responseSorted, offset){\n // this is a new and unique record, but also the first time that a businessname appears in the response\n if (!record.violations){\n record.zip = responseSorted.zip;\n record.address = responseSorted.address;\n record.offset = offset;\n record.violations = 1; // new and unique record\n }\n else {\n // this is a new and unique record, but the businessname has appeared before, which is why there is a match above\n // however, the current record passed in as a parameter has the address assigned in the first condition, and the current\n // response object has an address that is different, that is, a different establishment requiring a new record\n if (!(record.address === responseSorted.address)){\n var record = Object.create(indexRecord);\n record.name = responseSorted.businessname;\n record.zip = responseSorted.zip\n record.address = responseSorted.address;\n record.offset = offset;\n record.violations = 1; // new and unique\n }\n // if otherwise, the address matches, the establishment matches that in the response, and only the violations count\n // is incremented for that establishment.\n else {\n record.violations += 1;\n }\n }\n return record;\n}", "maxAddress() {\n // min + (2^(32-mask)) - 1 [zero needs to count]\n return this.minAddress() + this.networkSize - 1;\n }", "function geocodeAddress(geocoder, resultsMap) {\n var address = document.getElementById('address').value;\n geocoder.geocode({address:address}, function (results,status)\n {\n if (status == google.maps.GeocoderStatus.OK) {\n resultsMap.setCenter(results[0].geometry.location);\n resultsMap.setZoom(12);\n var p = results[0].geometry.location;\n var lat=p.lat();\n var lng=p.lng();\n // createMarker(address,lat,lng);\n\n }\n //using the delay to sapce timing for set markers\n else {\n if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {\n nextAddress--;\n delay++;\n } else {\n }\n }\n }\n );\n }", "onSubmitAddress() {\n let selectedAddress = null;\n const index = this.state.selectedAddress;\n if (index === 0) {\n selectedAddress = this.props.formStates;\n } else {\n selectedAddress = this.props.validateBillingAddress.data.avsErrors.altAddresList[index - 1];\n }\n this.props.onSubmitSuggestHandler(selectedAddress);\n }", "function topFreeRangePerStreet(x) {\n arr = freeHourRangeArr()\n arr2 = []\n for (var i = 0; i < x; i++) {\n arr2.push(arr[i])\n }\n return arr2\n}", "function fixAddress(address) {\n if (!address) {\n return;\n }\n\n if (Array.isArray(address.street) && address.street.length == 0) {\n address.street = ['', ''];\n }\n }", "function moveCoordsSlightlyIfDuplicate(newCoords, existingCoordsArray) {\n \n let lat = newCoords[0];\n let long = newCoords[1];\n\n let numberMatchingCoords = existingCoordsArray.filter(function (coord) { return coord[0] == lat && coord[1] == long; }).length\n \n if (numberMatchingCoords > 0) {\n let movedCoords = [lat, long + numberMatchingCoords * 0.001]\n return movedCoords;\n }\n return newCoords;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function appendAddress(address) {\n\tif (eID(address)) {\n\t\treturn;\n\t}\n\tvar entry = eID('addressbp').cloneNode(true);\n\tentry.id = address;\n\tentry.querySelector('.address').innerHTML = address;\n\tshow(entry);\n\teID('address-list').appendChild(entry);\n}", "lruReplacement({ address }) {\n let { index, offset } = this.extractBits(address);\n let maxIndices = { setIndex: 0, index: index, offset: offset };\n let maxTime = Number.MIN_VALUE;\n for (let i = 0; i < this.cache.length; i++) // for every set\n if (this.cache[i][index][offset].data[0] == 0) { // if valid bit == 0, nothing at this index\n maxIndices.setIndex = i;\n this.recordMiss();\n return maxIndices;\n } else if (maxTime < this.cache[i][index][offset].time) {\n maxTime = this.cache[i][index][offset].time;\n maxIndices.setIndex = i;\n }\n // if replacing write replaced one to memory\n this.recordReplacement();\n return maxIndices;\n }", "validateAddress() {\n // Remove white space from start and end\n let newAddress = this.addressInput.node.textContent.trim();\n // Remove initial @ sign if necessary\n const atStringNumber = newAddress.search(\"@\");\n if (atStringNumber === 0) {\n newAddress = newAddress.substring(1);\n }\n return newAddress;\n }", "function formatAddresses() {\n var output = ss.getSheetByName(\"Formatted Addresses\");\n var values = input.getDataRange().getValues();\n var name = values[0].indexOf(\"NAME\");\n var street1 = values[0].indexOf(\"Street\");\n var street2 = values[0].indexOf(\"Street #2\");\n var city = values[0].indexOf(\"CITY\");\n var state = values[0].indexOf(\"STATE\");\n var zip = values[0].indexOf(\"ZIP\");\n var destRange = output.getDataRange();\n destRange.clear();\n var nameArr = [];\n var stArr = [];\n var cityArr = [];\n var stackedAddress = [];\n\n values.filter (function (row) {\n return (row[name] !== \"\");\n })\n .forEach(function (row) {\n nameArr.push(row[name]);\n if(row[street2] !== \"\") {\n stArr.push(row[street1] + \" \" + row[street2]);\n }\n else {\n stArr.push(row[street1]);\n };\n cityArr.push(row[city] + \", \" + row[state] + \" \" + row[zip]);\n });\n stackedAddress.push([nameArr],[stArr], [cityArr]);\n var nameRange = output.getRange(1, 1, 1, stackedAddress[0][0].length);\n var stRange = output.getRange(2, 1, 1, stackedAddress[0][0].length);\n var cityRange = output.getRange(3, 1, 1, stackedAddress[0][0].length);\n nameRange.setValues(stackedAddress[0]);\n stRange.setValues(stackedAddress[1]);\n cityRange.setValues(stackedAddress[2]);\n}", "function setAddress(geocoding) {\n geocoding.geocode({'latLng': latLng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n if (results[0]) {\n if(results[0].formatted_address.length>64){\n $(\"#snapspot_address\").val(results[0].formatted_address.substring(0,64)+'...')\n }\n else {\n $(\"#snapspot_address\").val(results[0].formatted_address.substring(0,64)+'...')\n }\n }\n }\n });\n }", "function cleanupAddress(text) {\n text2 = text.trim();\n // without modification, strings will look like this:\n // '\\n\\t\\t\\t\\t\\t\\t351 East 74th Street, 2nd Floor Front Room, \\n\\t\\t\\t\\t\\t\\t',\n // '(Betw. 1st & 2nd Avenues) 10021\\n\\t\\t\\t\\t\\t\\t',\n // so remove\n console.log(\"Calling cleanup with: \" + text2 );\n text2 = text2.replace(/\\n/g, \"\");\n text2 = text2.replace(/\\t/g, \"\");\n text2 = text2.replace(/E /g, \"East \");\n text2 = text2.replace(/W /g, \"West \");\n text2 = text2.replace(/E\\. /g, \"East \");\n text2 = text2.replace(/W\\. /g, \"East \");\n text2 = text2.replace(/Rm 306/g, \"\");\n text2 = text2.replace(/502 West165th Street/g, \"502 West 165th Street\");\n text2 = text2.replace('\\. Meeting in the gym\\.',\"\");\n text2 = text2.replace('@ Fort Washington Avenue',\"\");\n\n if (text.trim() == '80 St. Mark\\'s Place, 2nd Floor,'){\n text2 = text2;\n }\n else { \n text2 = text2.replace(/St\\./g, \"Street\");\n }\n\n text2 = text2.replace(/\\(Basement\\)/g, \"\");\n text2 = text2.replace(/\\(Red Door/g, \"\");\n text2 = text2.replace(/Strert/g, \"Street\");\n text2 = text2.split(',')[0];\n\n if (text.trim() == '206-208 East 11th Street,'){\n text2 = text2;\n }\n else if (text.trim() == '58-66 West 135th Street,') {\n }\n else {\n text2 = text2.split('-')[0];\n }\n if (text2 == 'Church of the Good Shepard') {\n text2 = '543 Main Street'\n }\n if (text.trim() == '189th Street & Bennett Avenue, Kitchen,') {\n text2 = '178 Bennett Avenue'\n //second floor\n }\n if (text.trim() == '502 West165th Street, Basement,') {\n text2 = '502 West 165th Street'\n //basement\n }\nreturn text2.trim();\n}", "function compareAddress(address1, address2){\n var addrArray1 = address1.split('.');\n var addrArray2 = address2.split('.');\n for(var i = 0; i < 4; i++){\n if(parseInt(addrArray1[i]) > parseInt(addrArray2[i])){\n return true;\n }\n }\n return false;\n }", "function nextPlace() {\n var place = businesses[step];\n geocode(place);\n}", "function compareAddress(address1, address2){\n var addrArray1 = address1.split('.');\n var addrArray2 = address2.split('.');\n for(var i = 0; i < 4; i++){\n if(parseInt(addrArray1[i]) > parseInt(addrArray2[i])){\n return true;\n }\n }\n return false\n }", "function maintainCommonVirtualAddresses(diffs, desired, virtualAddressList) {\n for (let i = 0; i < diffs.length; i += 1) {\n // handle incrementing the ref count\n if (diffs[i].kind === 'N' && diffs[i].rhs.command === 'ltm virtual-address'\n && diffs[i].path[0].startsWith('/Common/Service_Address-')) {\n diffs[i].rhs.properties.metadata.references.value += 1;\n\n // if more than one tenant is referencing it, we need to change\n // the new to an edit.\n if (diffs[i].rhs.properties.metadata.references.value > 1) {\n // have to completely replace the diff because the fields are read only\n const replacementDiff = {\n kind: 'E',\n path: diffs[i].path,\n rhs: diffs[i].rhs,\n lhsCommand: 'ltm virtual-address'\n };\n\n diffs[i] = replacementDiff;\n }\n // update the virtualAddressList in case another tenant we are processing also uses\n // this virtual address\n const virtualAddress = virtualAddressList.find(\n (vAddr) => getCommonVirtualAddressName(vAddr) === diffs[i].path[0]\n );\n if (virtualAddress) {\n virtualAddress.metadata.forEach((data) => {\n if (data.name === 'references') {\n data.value = parseInt(data.value, 10) + 1;\n } else if (typeof data.value === 'undefined') {\n data.value = 'none';\n }\n });\n }\n }\n // TODO: Decrement ref count\n }\n}", "function findAddress(address, callback) {\n if (markerAux) {\n markerAux.setMap(null);\n }\n geocoder.geocode({'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n map.setCenter(results[0].geometry.location);\n map.setZoom(30);\n var marker = new google.maps.Marker({\n map: map,\n position: results[0].geometry.location\n });\n MAP.animateMarker(marker);\n markerAux = marker;\n markers.push(markerAux);//para borrar marcador en el render \n callback(markerAux.position);\n } else {\n callback(false);\n }\n });\n }", "function DrawAdjustLine(index, selectedIsArriveBefore, selectedLegNumber)\n{\n\n\tvar cellTop = document.getElementById(TagPrefixTop_Segment + index);\n\tif (cellTop != null)\n\t\tcellTop.className = HighlightedSegmentTagClass;\n\n\tvar cellMiddle = document.getElementById(TagPrefixMiddle_Segment + index);\n\tif (cellMiddle != null)\n\t\tcellMiddle.className = HighlightedSegmentTagClass;\n\t\n\tvar cellBottom = document.getElementById(TagPrefixBottom_Segment + index);\n\tif (cellBottom != null)\n\t\tcellBottom.className = HighlightedSegmentBottomTagClass;\n\t\n\t\n\t// Mark any interchanges (have different ID and rarely present, so check for null)\n\t// If arriveBefore, highlight all interchanges with value less than selected leg and if\n\t// the selected location is an interchange highlight that too. Opposite for leaveAfter.\n\tvar interchangeElement = null;\n\n\tvar intIndex = parseInt(index);\n\n\tif (selectedIsArriveBefore == \"False\")\t// leave after\n\t{\n\t\tif (SelectedLocationIsInterchange == true)\n\t\t{\n\t\t\tinterchangeElement = document.getElementById(TagPrefixTop_Segment + index + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentTagClass;\n\n\t\t\tinterchangeElement = document.getElementById(TagPrefixBottom_Segment + index + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentBottomTagClass;\n\t\t\t}\n\t}\n\telse\n\t{\n\n\t\t// Highlight the selected interchange (labelled a number higher than the selected leg)\n\t\tif ((SelectedLocationIsInterchange == true) && (i == (selectedLegNumber - 1)))\n\t\t{\n\t\t\tintIndex++;\n\t\t\t\n\t\t\tinterchangeElement = document.getElementById(TagPrefixTop_Segment + intIndex + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentTagClass;\n\n\t\t\tinterchangeElement = document.getElementById(TagPrefixBottom_Segment + intIndex + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentBottomTagClass;\n\t\t}\n\n\t\t// Highlight any interchange during the selected part of the journey\n\t\tinterchangeElement = document.getElementById(TagPrefixTop_Segment + index + InterchangeIndicator);\n\t\tif (interchangeElement != null)\n\t\t\tinterchangeElement.className = HighlightedSegmentTagClass;\n\n\t\tinterchangeElement = document.getElementById(TagPrefixBottom_Segment + index + InterchangeIndicator);\n\t\tif (interchangeElement != null)\n\t\t\tinterchangeElement.className = HighlightedSegmentBottomTagClass;\n\t}\n\t\n}", "function appendAddress(address)\n{\n\tvar div = d3.select(this);\n\tif (address && address.getValueID())\n\t{\n\t\tcrp.pushCheckCells(address, undefined, function()\n\t\t{\n\t\t\tvar streetCell = address.getCell(\"Street\");\n\t\t\tvar city = address.getDatum(\"City\");\n\t\t\tvar stateCell = address.getCell(\"State\");\n\t\t\tvar zip = address.getDatum(\"Zip Code\");\n\t\t\tif (streetCell)\n\t\t\t\t$(streetCell.data).each(function() {\n\t\t\t\t\tif (this.text && this.text.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdiv.append('div')\n\t\t\t\t\t\t\t.classed(\"address-line\", true)\n\t\t\t\t\t\t\t.text(this.text);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tline = \"\";\n\t\t\tif (city && city.length)\n\t\t\t\tline += city;\n\t\t\tif (stateCell && stateCell.data.length)\n\t\t\t\tline += \", \" + stateCell.data[0].getDescription();\n\t\t\tif (zip && zip.length)\n\t\t\t\tline += \" \" + zip;\n\t\t\tif (line.trim())\n\t\t\t\tdiv.append('div')\n\t\t\t\t\t.classed('address-line', true)\n\t\t\t\t\t.text(line.trim());\n\t\t},\n\t\tfunction() {\n\t\t});\n\t}\n}", "function fixAddresses(oldAddress) {\n // want to get rid of anything in () before the comma\n var newAddress = oldAddress.substring(0, oldAddress.indexOf(',')) + ' New York, NY';\n // console.log(newAddress);\n return newAddress; \n}", "function handleSearchAddressFailure() {\n\t\t\tsearchAddress.requestCounter--;\n\t\t\tif (searchAddress.requestCounter == 0) {\n\t\t\t\tui.searchAddressChangeToSearchingState(false);\n\t\t\t\tui.showSearchAddressError();\n\t\t\t}\n\t\t}", "function chooseAddr(lat1, lng1, event, current_place) {\r\n containerId = event.target.closest('.leaflet-main').getAttribute('id');\r\n var i = event.target.closest('.leaflet-main').getElementsByClassName('mapframe')[0].getAttribute('id');\r\n markers[i].closePopup();\r\n var zoom = 15;\r\n maps[i].setView([lat1, lng1, zoom]);\r\n maps[i].setZoom(zoom);\r\n markers[i].setLatLng([lat1, lng1]);\r\n lat = lat1.toFixed(8);\r\n lon = lng1.toFixed(8);\r\n maps[i].invalidateSize();\r\n formatted_address = event.target.getAttribute(\"data-formatted\");\r\n event.target.closest('.leaflet-main').getElementsByClassName('latitude')[0].value = lat;\r\n event.target.closest('.leaflet-main').getElementsByClassName('longitude')[0].value = lon;\r\n event.target.closest('.leaflet-main').getElementsByClassName('formatted_address')[0].value = formatted_address;\r\n current_place = event.target.closest('.leaflet-main').getElementsByClassName('address')[0].value;\r\n\r\n markers[i].bindPopup(\"<i><b>\" + current_place + \" ligger här!</b><br>Lat: </i>\" + \"<b>\" + lat + \r\n \"</b>\" + \"<i><br />Lon: </i>\" + \"<b>\" + lon + \"</b>\").openPopup();\r\n}", "function checkExtrapolatedSnake2(newSnake) {\r\n\t //Variables for finding distance\r\n\t var a = newSnake[0].x - snake2[0].x;\r\n\t var b = newSnake[0].y - snake2[0].y;\r\n\t var c = Math.sqrt(a * a + b * b);\r\n\t //Checks to see if snake goes into itself\r\n\t //If snake is going to bite itself then extrapolated position = actual position\r\n\t //Otherwise this is an old packet\r\n\t if (c < 1 && snake2.indexOf(newSnake[0]) > -1)\r\n\t snake2 = newSnake;\r\n\t}", "function callSearchLocation(){\n\tif(\"undefined\" != address && null != address && 0 < address.length && currentlyEmittedAddressIndex < address.length-1){\n\t\taddressString = address.slice(currentlyEmittedAddressIndex + 1,address.length).join(\" \");\n\t\tcurrentlyEmittedAddressIndex ++;\n\t\tsearchLocationOnMapAddressArray(addressString);\n\t}\n}", "function fetchAddress(addressCallback) {\n\tsetTimeout(() => {\n\t\taddressCallback(null, { id: 422, street: 'First Avenue, 1500' });\n\t}, 500);\n}", "function markerAdjust(){\n\n var mapbounds = mapnav.map.getBounds();\n var ne = mapbounds.getNorthEast();\n var sw = mapbounds.getSouthWest();\n var markedloc = current_position_marker.getPosition();\n if(markedloc.lat() > ne.lat() || markedloc.lat() < sw.lat() ||\n markedloc.lng() > ne.lng() || markedloc.lng() < sw.lng() ){\n\n var newlocation = mapnav.map.getCenter();\n \n current_position_marker.setOptions({\n position: newlocation\n });\n \n var thishash = geohash(newlocation.lat(), newlocation.lng());\n\n updateConsole(newlocation.lat(), newlocation.lng(), '', thishash); \n //getPosts(thishash);\n }\n}", "function registerAddress() {\n\t\tisAddressExists(function(isExists) {\n \t\tif(!isExists.success) {\n \t\t\tcreateFirstBlankTransaction(self);\n \t\t}\n \t});\n\t}", "function address() {\r\n var line1 = document.getElementById('venue-L1').value;\r\n var line2 = document.getElementById('venue-L2').value;\r\n var line3 = document.getElementById('venue-L3').value;\r\n if((line1 + line2).length <= 39) {\r\n document.getElementById('addLine1').innerHTML = line1 + line2 + line3 + \"<br>\";\r\n }\r\n //breaks and joins 3 lines if length is < 39 characters//\r\n else if((line1 + line2).length >= 39) {\r\n document.getElementById('addLine1').innerHTML = line1 + \"<br>\";\r\n document.getElementById('addLine2').innerHTML = line2 + line3 + \"<br>\";\r\n }\r\n //breaks line 1 and joins lines 2 & 3 if length is > 39 characters//\r\n}", "function codeAddress(address, first) {\n var geocoder = new google.maps.Geocoder();\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n removeMessage();\n var location = results[0].geometry.location;\n retrieveTime(location.lat() + \",\" + location.lng(), first);\n } else {\n setErrorMessage(status);\n }\n });\n}", "function oneLineAddress( address ) {\r\n\tif( ! address )\r\n\t\treturn '';\r\n\t//if( typeof address == 'string' )\r\n\t//\treturn H(address).replace( /, USA$/, '' );\r\n\treturn H( S(\r\n\t\taddress.line1 ? address.line1 + ', ' : '',\r\n\t\taddress.line2 ? address.line2 + ', ' : '',\r\n\t\taddress.city, ', ', address.state,\r\n\t\taddress.zip ? ' ' + address.zip : ''\r\n\t) );\r\n}", "function seen(self, to)\n{\n if(typeof to === \"string\") to = parseAddress(to);\n if(typeof to !== \"object\" || !to.hashname) return {}; // could be bad data, empty object allows for .X checks\n if(to.hashname === self.hashname) return self; // so we can check === self\n var ret = self.seen[to.hashname];\n if(!ret) {\n ret = self.seen[to.hashname] = to;\n ret.at = Date.now();\n bucketize(self, ret);\n }else if(!ret.ip){\n // add ip/port if not set\n ret.ip = to.ip;\n ret.port = to.port;\n }\n return ret;\n}", "function addNeighbor(x,y) {\n if (checkBounds(x,y)) {\n with (cellArray[arrayIndexOf(x,y)]) {\n ++neighborBombs; } } }", "function cityLimit() {\n if (cities.length > 8) {\n cities.pop();\n }\n}", "function check_for_dups(){\n var ss = SpreadsheetApp.openById(BERTHA_ID)\n var backend_sh = SpreadsheetApp.openById(BACKEND_ID)\n\n var tracking_db = backend_sh.getSheetByName(\"Tracking Number DB\")\n var main_sheet = ss.getSheetByName(\"1 - Main Page\")\n var main_sheet_data = main_sheet.getDataRange().getValues()\n var db_data = tracking_db.getDataRange().getValues()\n \n var indexes = get_main_indexes()\n \n var index_facility = indexes.indexFacilityName\n var index_action = indexes.indexPend\n var index_shipped = indexes.indexShippedEmail\n var indexRowID = indexes.indexRowID\n var index_notes = indexes.indexActualIssues\n var indexColemanTracking = indexes.indexColemanTracking\n \n for(var i = 0; i < main_sheet_data.length; i++){\n if(main_sheet_data[i][index_shipped].toString().length == 0){ //if reused, then this would never fill\n var tracking_nums = main_sheet_data[i][indexColemanTracking].toString().split(\",\") //get all tracking nums\n if(tracking_nums.length > 0){\n for(var j = 0; j < db_data.length; j++){\n if(db_data[j][0].toString() == main_sheet_data[i].toString().trim()){ //find the row\n for(var n = 0; n < tracking_nums.length; n++){\n if(db_data[j][1].toString().split(\";\").indexOf(\"971424215\" + tracking_nums[n]) > -1){\n //then it's a duplicate\n debugEmail(\"DUPLICATE TRACKING NUMBER\", \"Found one:\\n\\n\" + tracking_nums[n] + \"\\n\\nRow ID: \" + main_sheet_data[i][indexRowID])\n }\n }\n\n }\n }\n }\n }\n }\n}", "function addMarkerByAddress(house) {\n\tvar geocoder = new AMap.Geocoder({\n city: \"北京\",\n radius: 1000\n });\n address = house.house_location;\n geocoder.getLocation(address, function(status, result) {\n \tif (status === \"complete\" && result.info === 'OK') {\n var geocode = result.geocodes[0];\n rentMarker = new AMap.Marker({\n map: map,\n title: house.house_title,\n icon: 'http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png',\n position: [geocode.location.getLng(), geocode.location.getLat()]\n });\n rentMarkerArray.push(rentMarker);\n\n rentMarker.content = \"<div>source:<a target = '_blank' href='\"\n + house.house_url + \"'>\" + house.house_title + ', ' + house.house_price + \" RMB</a><div>\"\n rentMarker.on('click', function(e) {\n \t// marker content will show whenever click on marker\n infoWindow.setContent(e.target.content);\n // open the window in marker position\n infoWindow.open(map, e.target.getPosition());\n if (amapTransfer) amapTransfer.clear();\n amapTransfer = new AMap.Transfer({\n map: map,\n policy: AMap.TransferPolicy.LEAST_TIME,\n city: \"北京市\",\n panel: 'transfer-panel'\n });\n // inquery bus transfer routes according to start and end destination coordinates\n amapTransfer.search([{\n keyword: workAddress\n }, {\n keyword: address\n }], function(status, result) {})\n });\n }\n });\n}", "function PlotMarkerWithAddress(marker,point,vehiclename,datetime) {\r\n\r\n var accuracy;\r\n var largest_accuracy;\t \r\n var delay = 100;\r\n\r\n var geocoder = new GClientGeocoder();\r\n\r\n geocoder.getLocations(point, function (result) {\r\n\r\n\t if (result.Status.code == G_GEO_SUCCESS) // OR !=200\r\n {\r\n\t\tvar j;\r\n\t //j=0;\r\n // Loop through the results, looking for the one with Accuracy = 1\r\n\r\n\t for (var i=0; i<result.Placemark.length; i++)\r\n {\r\n\t\t accuracy = result.Placemark[i].AddressDetails.Accuracy;\r\n\r\n\t\t // alert(\" accuracy=\"+accuracy+\" i=\"+i); \r\n\t\t\tif(i==0)\r\n\t\t\t{\r\n\t\t\t\tlargest_accuracy = accuracy; \r\n\t\t\t\tj = i;\r\n\t\t\t}\r\n\r\n\t\t\telse \r\n\t\t {\t\r\n\t\t\t // alert(\" largest accuracy=\"+largest_accuracy+\" accuracy=\"+accuracy+\" i=\"+i);\r\n\t\t\t\tif(largest_accuracy < accuracy)\r\n\t\t\t\t{\r\n\t\t\t\t\tlargest_accuracy = accuracy;\r\n\t\t\t\t\t//alert(\"i=\"+i);\r\n\t\t\t\t\tj = i;\r\n\t\t\t\t\t///alert(\"j1=========\"+j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n\t //i=i-1;\r\n\t \r\n\t\t// alert(\"j2=\"+j);\r\n\t\t// alert(\"largest_accuracy=\"+largest_accuracy+ \" j=\"+j+\" result=\"+result);\r\n\r\n\t\tvar address = result.Placemark[j];\r\n\t\taddress1 = address.address;\t \r\n\t\t//alert(\"addddddddd==\"+address1);\r\n\r\n\t\t// setTimeout('wait()',10000);\r\n\t\tvar google_point = new GLatLng(address.Point.coordinates[1],address.Point.coordinates[0]); \r\n\r\n\t\t//Spliting the latitude \r\n\t\t//alert(\"latlng.y=======\"+latlng.y+\" latlng.x=\"+latlng.x);\r\n\t\t//alert(\"google_point.y=======\"+google_point.y+\" google_point.x=\"+google_point.x);\r\n\r\n\t\tvar distance = calculate_distance(point.y, google_point.y, point.x, google_point.x); \r\n\t\t//alert(\"dist=\"+distance);\r\n\t\tvar address2 = distance+\" km from \"+address1;\t\t\r\n\t\tvar place;\r\n\t\t\r\n\t\t///////////////////////////// SELECT LANDMARK OR GOOGLE PLACE CODE /////////////////////////////////////////////////////\r\n\t\t/// IF DISTANCE CALCULATED THROUGH FILE IS LESS THAN 1 KM THEN DISPLAY LANDMARK OTHERWISE DISPLAY GOOGLE PLACE /////////\r\n\t\t\r\n\t\tvar lt_original = point.y;\r\n\t\tvar lng_original = point.x;\r\n\t\tvar str = lt_original+\",\"+lng_original;\r\n\t\t\t\t\r\n\t\tvar access = document.forms[0].access.value;\r\n\t\t//alert('access='+access);\r\n\t\t\r\n\t\tif(access==\"Zone\")\r\n\t\t{\r\n\t\t\tvar strURL=\"select_mining_landmark.php?content=\"+str;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar strURL=\"select_landmark_marker.php?content=\"+str;\r\n\t\t}\r\n\r\n\t\tvar req = getXMLHTTP();\r\n\t\treq.open(\"GET\", strURL, false); //third parameter is set to false here\r\n\t\treq.send(null);\r\n\t\tvar landmark = req.responseText;\r\n\t\t\r\n\t\t//alert(\"landmark=\"+landmark);\r\n\t\t//return req.responseText;\r\n\t\tif(landmark!=\"\")\r\n\t\t\tplace = landmark;\r\n\t\telse\r\n\t\t\tplace = address2;\r\n\t\t\t\r\n\t\t\r\n\t\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\t\t\r\n\t\t//alert(place);\r\n\r\n\t\t/*alert(\"[Original latlng=\"+latlng+\"] <br> [Google PT=\"+point+\"] largest_accuracy\"+largest_accuracy+\"\t\t\taddress1=\"+address1);*/\r\n\t\t//alert(\"add before=\"+address1);\r\n\r\n\t\t//alert(\"Icon=\"+Icon+\" map=\"+map+\" marker=\"+marker+ \" actionmrkr=\"+action_marker+\" vname=\"+vehiclename+\" spd=\"+speed+\" dt=\"+datetime+\" dist=\"+dist+\" fuelltr=\"+fuel_litres+\" fuel_level=\"+fuel_level);\r\n\r\n\t\tvar myHtml = '<br><div id=\"tab1\" class=\"bubble\" align=left><table cellpadding=0 cellspacing=0 class=\"text\" ><tr><td><font size=1 color=#000000>Vehicle</font></td><td>&nbsp;:&nbsp;</td><td><font color=blue size=1>'+vehiclename + '</font></td><td></td></tr><tr><td><font size=1 color=#000000>DateTime</font></td><td>&nbsp;:&nbsp;</td><td><font color=blue size=1>'+datetime+' '+'&nbsp;&nbsp;</font></td></tr> <tr><td><font size=1 color=#000000>Place</font></td><td>&nbsp;:&nbsp;</td><td><font color=red size=1>'+place+'</font></td></tr><tr><td colspan=3><font color=blue size=1>( '+point.y+', '+point.x+' )</font></td></tr></table></div>';\r\n\r\n\t\t//var tab1 = new GInfoWindowTab(\"Info\", '<div id=\"tab1\" class=\"bubble\" align=left><table cellpadding=0 cellspacing=0><tr><td><font size=2 color=#000000>Vehicle</font></td><td>&nbsp;:&nbsp;</td><td><font color=blue size=2>'+vehiclename + '</font></td><td></td></tr><tr><td><font size=2 color=#000000>DateTime</font></td><td>&nbsp;:&nbsp;</td><td><font color=blue size=2>'+datetime+' '+'&nbsp;&nbsp;</font></td></tr> <tr><td><font size=2 color=#000000>Place</font></td><td>&nbsp;:&nbsp;</td><td><font color=blue size=2>'+place+'</font></td></tr><tr><td colspan=3><font color=blue size=2>( '+point.y+', '+point.x+' )</font></td></tr></table></div>');\r\n\r\n\t\t//var html = new GInfoWindowTab(\"Info\", '<div id=\"tab1\" class=\"bubble\">Click the \"Location\" tab to see the minimap</div>');\r\n\t\t//var tab2 = new GInfoWindowTab(\"Location\", '<div id=\"detailmap\" style=\"height:50px;\"></div>');\r\n\r\n\t\t//alert(\" tab1=\"+tab1+\" tab2=\"+tab2);\r\n\t\t//var infoTabs = [tab1,tab2];\r\n\r\n\t\t//alert(\" marker=\"+marker+\" infoTabs=\"+infoTabs);\r\n\t\t//marker.openInfoWindowTabsHtml(infoTabs);\r\n\t\t\r\n\t\tmarker.openInfoWindow(myHtml);\r\n\r\n\t\t/*var dMapDiv = document.getElementById(\"detailmap\");\r\n\t\tvar detailMap = new GMap2(dMapDiv);\r\n\t\tdetailMap.setCenter(point , 12);\r\n\r\n\t\tdetailMap.removeMapType(G_SATELLITE_MAP);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\tvar topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(0,0));\t\r\n\t\tdetailMap.addMapType(G_SATELLITE_MAP);\r\n\t\tvar mapControl = new GMapTypeControl();\r\n\t\tdetailMap.addControl(mapControl, topRight);\r\n\r\n\t\tvar topLeft = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(5,35));\r\n\t\tvar mapControl2 = new GSmallMapControl();\r\n\t\t//detailMap.addControl(new GSmallMapControl());\r\n\t\tGEvent.addListener(detailMap, \"zoomend\", miniMapZoomEnd);\r\n\t\tGEvent.addListener(detailMap, \"moveend\", miniMapMoveEnd);\r\n\t\tdetailMap.addControl(mapControl2, topLeft);\r\n\r\n\t\tvar CopyrightDiv = dMapDiv.firstChild.nextSibling;\r\n\t\tvar CopyrightImg = dMapDiv.firstChild.nextSibling.nextSibling;\r\n\t\tCopyrightDiv.style.display = \"none\"; \r\n\t\tCopyrightImg.style.display = \"none\";\r\n\t\tvar marker3 = new GMarker(point,Icon);\r\n\t\t//alert(\"point =\"+point+\" mrk3=\"+marker3);\r\n\t\tdetailMap.addOverlay(marker3);\r\n\r\n\t\tshowMinimapRect(detailMap,marker3);*/\r\n }\r\n });\r\n}", "function selectPreviousAddress(){\n function setCurrentChoice(result) {\n if(result !== undefined && result.address !== undefined && result.address !== \"\"){\n var select = document.getElementById('sel1').value = result.address;\n }\n else{\n console.log(\"No Saved Address Found\");\n return null;\n }\n }\n\n chrome.storage.local.get(\"address\",setCurrentChoice);\n}", "selectAddress(marker) {\n this.setState({error: ''});\n\n // Check if address already exists\n const found = this.props.markers.find(mark => marker.address === mark.address);\n if (found) {\n this.setState({error: 'This address already exists.', searching: false});\n } else {\n MerkerService.saveMarker(marker).then(data => {\n this.props.loadMarkers();\n this.setState({results: [], address: '', searching: false});\n }, err => {\n this.setState({error: 'Failed to save address, please try again.', searching: false});\n });\n\n }\n }", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED || line.state == States.OWNED) {\t\t\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID)\r\n return lineNum\r\n }", "function formatAddress(address) {\n address = address.trim();\n if (address === \"\" || address.startsWith(\"LOT:\"))\n return \"\";\n // Pop tokens from the end of the array until a valid suburb name is encountered (allowing\n // for a few spelling errors).\n let tokens = address.split(\" \");\n let suburbName = null;\n for (let index = 1; index <= 4; index++) {\n let suburbNameMatch = didyoumean2_1.default(tokens.slice(-index).join(\" \"), Object.keys(SuburbNames), { caseSensitive: false, returnType: didyoumean.ReturnTypeEnums.FIRST_CLOSEST_MATCH, thresholdType: didyoumean.ThresholdTypeEnums.EDIT_DISTANCE, threshold: 2, trimSpaces: true });\n if (suburbNameMatch !== null) {\n suburbName = SuburbNames[suburbNameMatch];\n tokens.splice(-index, index); // remove elements from the end of the array\n break;\n }\n }\n if (suburbName === null) { // suburb name not found (or not recognised)\n console.log(`The development application will be ignored because the suburb was not recognised: ${address}`);\n return \"\";\n }\n // Add the suburb name with its state and post code to the street name.\n let streetName = tokens.join(\" \").trim();\n address = (streetName + ((streetName === \"\") ? \"\" : \", \") + suburbName).trim();\n if (/^\\d,\\d\\d\\d/.test(address))\n address = address.substring(0, 1) + address.substring(2); // remove the comma\n return address;\n}", "function offsetError() {\n var rng = SpreadsheetApp.getActiveSpreadsheet()\n .getActiveSheet()\n .getRange('A1');\n rng.offset(-1, 0)\n .setValue('bad offset argument.');\n}", "function neighboring(a, b) {\n console.log(a);\n console.log(b);\n console.log(linkedByIndex);\n return linkedByIndex[a.id + \",\" + b.id] || linkedByIndex[b.id + \",\" + a.id] || a.id == b.id;\n}", "function addNewAddress(nAddresses) {\r\n if (nAddresses == 0) {\r\n nAddresses = 1;\r\n }\r\n\r\n $('#addAddress').click(function () {\r\n nAddresses++;\r\n $('input:hidden[name=nAddresses]').attr(\"value\", nAddresses);\r\n $('<label for=\"addr' + nAddresses + '\">Dirección ' + nAddresses + '</label><input type=\"text\" name=\"Address' + nAddresses + '\" id=\"addr' + nAddresses + '\" />').insertBefore('input:hidden[name=nAddresses]');\r\n $('<label for=\"phn' + nAddresses + '\">Teléfono ' + nAddresses + '</label><input type=\"text\" name=\"Phone' + nAddresses + '\" id=\"phn' + nAddresses + '\" />').appendTo('#Phones');\r\n });\r\n}", "function onchangeAddress() {\n\tgetGeoByAddress();\t\n}", "function topLinkFinder(visits, url) {\n for (var i = 0; i < 5; i++) {\n if (visits > topVisits[i]){\n if (url == topLink[i]){\n topVisits[i] = visits;\n break;\n } else {\n topVisits.splice(i, 0, visits); //These two arrays are always modified\n topLink.splice(i, 0, url); //together to keep them linked\n for (var k = i + 1; k < 5; k++) {\n if (topLink[i] == topLink[k]) { //inserts value where it should be\n topVisits.splice(k, 1);\n topLink.splice(k, 1);\n break;\n };\n };\n topVisits.splice(6, 1);\n topLink.splice(6, 1);\n break;\n };\n };\n };\n}", "function handleAddress(address) {\n setAddress(address)\n\n if(address.length < 3) {\n setIsAddressValid(false)\n } else {\n setIsAddressValid(true)\n }\n }", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED) {\t\t\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID)\r\n return lineNum\r\n }", "function fill_in_gaps(a,b){\n // a = prices[graph][exchange][trace]\n // b = open_interest[exchange][graph][trace]\n\n var a_times = return_keys(a);\n var last_time = a_times[0];\n if (a.length != 0){\n for (var time in b){\n if (!a_times.includes(time)){\n a[time] = a[last_time];\n }\n last_time = time;\n }\n}\n\n if (b.length !=0){\n var b_times = return_keys(b);\n var last_time = b_times[0];\n for (var time in a){\n if (!b_times.includes(time)){\n b[time] = b[last_time];\n }\n last_time = time;\n }\n}\n}", "setOtherAddress(value) {\n this.otherAddress = value;\n return this;\n }", "function add_empty_trips_v2(trips, threshold){\n\tconsole.log(\"making combined trips...\");\n\ttrips.forEach(function(trip,i) {\n\t\ttrip.end_date=new Date(+trip.start_date+trip.duration * 1000);\n\t\tresult.push(trip);\n\t\tfor (var j=i+1; j<trips.length-1; j++){\n\t\t\tvar ntrip = trips[j];\n\t\t\tif(ntrip.bikeid==trip.bikeid){ //find the next trip of the same taxi\n\t\t\t\tif(ntrip.start_station!=trip.end_station){ // Only consider as empty, trips that connect different locations. Otherwise the vehicle remains idle in the same location\n\t\t\t\t\tif(ntrip.start_date<trip.end_date){\n\t\t\t\t\t\tntrip.start_date=trip.end_date;\n\t\t\t\t\t}\n\t\t\t\t\tvar etrip={};\n\t\t\t\t\tetrip.id = tripsCounter++;\n\t\t\t\t\tetrip.duration = (+ntrip.start_date - trip.end_date)/1000 <= threshold? (+ntrip.start_date - trip.end_date)/1000 : threshold\n\t\t\t\t\tetrip.start_date = trip.end_date;\n\t\t\t\t\tetrip.end_date = new Date(+trip.end_date+etrip.duration * 1000);\n\t\t\t\t\tetrip.start_station = trip.end_station;\n\t\t\t\t\tetrip.start_station_name = trip.end_station_name;\n\t\t\t\t\tetrip.start_station_lat = trip.end_station_lat;\n\t\t\t\t\tetrip.start_station_lng = trip.end_station_lng;\n\t\t\t\t\tetrip.end_station = ntrip.start_station;\n\t\t\t\t\tetrip.end_station_name = ntrip.start_station_name;\n\t\t\t\t\tetrip.end_station_lat = ntrip.start_station_lat;\n\t\t\t\t\tetrip.end_station_lng = ntrip.start_station_lng;\n\t\t\t\t\tetrip.bikeid = trip.bikeid;\n\t\t\t\t\tetrip.trip_id = trip.trip_id + \"_\" + ntrip.trip_id;\n\t\t\t\t\tetrip.type = \"empty\";\n\t\t\t\t\ttrips.push(etrip);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tbreak; // if the next trip of the same taxi has origin same as current trip's destination, do not consider any other trips from the same taxi\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\ttrips.sort(function(a,b){return a.start_date-b.start_date});\n\treturn trips;\n}", "function onNextButtonClick() {\n var address = selectedAddress.toJSON();\n logger.info(addressType + ' onNextButtonClick');\n logger.secureLog('selectedAddress ' + JSON.stringify(address, null, 4));\n $.trigger('addressEntered', {\n address : address,\n email : currentCustomer.getEmail(),\n isDifferentStorePickup : differentStorePickup\n });\n\n}", "function extend() {\n var chainPointer = chain.prev,\n xTotalOffset = chain.head.width,\n haha = chain.head.height + chain.head.y,\n blah = chainPointer.head.height + chainPointer.head.y;\n // Search x in chain\n while (haha >= blah) {\n xTotalOffset += chainPointer.head.width;\n chainPointer = chainPointer.prev;\n blah = chainPointer.head.height + chainPointer.head.y;\n }\n gap.x -= xTotalOffset;\n gap.width += xTotalOffset;\n gap.y = chain.head.height + chain.head.y;\n chain = chainPointer;\n }", "function genAddress() {\n\n console.log(\"Generating an address\");\n\n // Deterministically Generates a new address with checksum for the specified seed\n iota.api.getNewAddress(seed, {'checksum': true}, function(e,address) {\n\n if (!e) {\n\n console.log(\"NEW ADDRESS GENERATED: \", address)\n\n address = address;\n // Update the HTML on the site\n updateAddressHTML(address)\n }\n })\n }", "function initGeoAddress(){\n\t\t$('#locationText').blur(function(){\n var location = $(this);\n var term = location.val();\n if(term == '') return;\n EB_Common.Ajax.get('/settings/iv/twitterThreshold/listGeoAddress',{term:term},function(data){\n if(!data || !data.data){\n twitterthreshold.locationText.geoAddress = [];\n }else{\n twitterthreshold.locationText.geoAddress =[];\n twitterthreshold.locationText.selectGeoAddress = undefined;\n var selector = location.closest('div').next().show().find('select');\n selector.find('option[value!=\"\"]').remove();\n var addresses = data.data, len = addresses.length;\n for(var i = 0; i < len; i++){\n var address = addresses[i];\n var label = address.addressLine + ',' + address.country;\n selector.append('<option value=\"'+i +'\">'+label+'</option>');\n twitterthreshold.locationText.geoAddress[i]=address;\n }\n selector.change(function(){\n var index = $(this).val();\n twitterthreshold.locationText.selectGeoAddress = twitterthreshold.locationText.geoAddress[index];\n });\n }\n },'json')\n });\n\t\t$('#locationTextPercentage').blur(function(){\n var location = $(this);\n var term = location.val();\n if(term == '') return;\n EB_Common.Ajax.get('/settings/iv/twitterThreshold/listGeoAddress',{term:term},function(data){\n if(!data || !data.data){\n twitterthreshold.locationTextPercentage.geoAddress = [];\n }else{\n twitterthreshold.locationTextPercentage.geoAddress =[];\n twitterthreshold.locationTextPercentage.selectGeoAddress = undefined;\n var selector = location.closest('div').next().show().find('select');\n selector.find('option[value!=\"\"]').remove();\n var addresses = data.data, len = addresses.length;\n for(var i = 0; i < len; i++){\n var address = addresses[i];\n var label = address.addressLine + ',' + address.country;\n selector.append('<option value=\"'+i +'\">'+label+'</option>');\n twitterthreshold.locationTextPercentage.geoAddress[i]=address;\n }\n selector.change(function(){\n var index = $(this).val();\n twitterthreshold.locationTextPercentage.selectGeoAddress = twitterthreshold.locationTextPercentage.geoAddress[index];\n });\n }\n },'json')\n });\n }", "function add_empty_trips_v3(trips, threshold){\n\tconsole.log(\"making combined trips...\");\n\ttrips.forEach(function(trip,i) {\n\t\ttrip.start_date = new Date((+trip.start_date+ +trip.end_date-trip.duration*1000)/2);\n\t\ttrip.end_date = new Date(+trip.start_date+trip.duration*1000);\n\t\tif (i>1){\n\t\t\tfor (var j=i-1; j>=0; j--){\n\t\t\t\tvar ptrip = trips[j];\n\t\t\t\tif(ptrip.bikeid==trip.bikeid){\n\t\t\t\t\tif(ptrip.end_station!=trip.start_station){ // Only consider as empty, trips that connect different locations. Otherwise the vehicle remains idle in the same location\n\t\t\t\t\t\tif(ptrip.end_date>trip.start_date){\n\t\t\t\t\t\t\ttrip.start_date=ptrip.end_date;\n\t\t\t\t\t\t\ttrip.end_date= new Date(+trip.start_date+trip.duration * 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar etrip={};\n\t\t\t\t\t\tetrip.id = tripsCounter++;\n\t\t\t\t\t\tetrip.duration = (+trip.start_date - ptrip.end_date)/1000 <= threshold? (+trip.start_date - ptrip.end_date)/1000 : threshold;\n\t\t\t\t\t\tetrip.start_date = ptrip.end_date;\n\t\t\t\t\t\tetrip.end_date = new Date(+ptrip.end_date+etrip.duration * 1000);\n\t\t\t\t\t\tetrip.start_station = ptrip.end_station;\n\t\t\t\t\t\tetrip.start_station_name = ptrip.end_station_name;\n\t\t\t\t\t\tetrip.start_station_lat = ptrip.end_station_lat;\n\t\t\t\t\t\tetrip.start_station_lng = ptrip.end_station_lng;\n\t\t\t\t\t\tetrip.end_station = trip.start_station;\n\t\t\t\t\t\tetrip.end_station_name = trip.start_station_name;\n\t\t\t\t\t\tetrip.end_station_lat = trip.start_station_lat;\n\t\t\t\t\t\tetrip.end_station_lng = trip.start_station_lng;\n\t\t\t\t\t\tetrip.bikeid = trip.bikeid;\n\t\t\t\t\t\tetrip.trip_id = ptrip.trip_id + \"_\" + trip.trip_id;\n\t\t\t\t\t\tetrip.type = \"empty\";\n\t\t\t\t\t\ttrips.push(etrip);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak; // if the next trip of the same taxi has origin same as current trip's destination, do not consider any other trips from the same taxi\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\ttrips.sort(function(a,b){return a.start_date-b.start_date});\n\treturn trips;\n}", "_pickAllAliveCellsByAGOrder(callback) {\n this.cells.forEach(c=>c.done=false);\n let nextCell;\n while (nextCell = this.checkSequence.reduce((ret, cellid)=>{\n const tgt = this.cells[cellid];\n return (!(tgt.done || tgt.isDead) && (!ret || (ret.ag < tgt.ag))) ? tgt : ret;\n }, null)) {\n if (!nextCell) break;\n callback(nextCell);\n nextCell.done = true;\n }\n }", "function createNewAddress(){\n \n let current_date = (new Date()).valueOf().toString();\n let random = Math.random().toString();\n let newAddress = crypto.createHash('sha1').update(current_date + random).digest('hex');\n \n return newAddress;\n}", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED || line.state == States.OWNED) {\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID) // will be changed short after anyway\r\n return lineNum\r\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}", "async function generateAddress() {\n const addresses = await client.getAddresses(SEED)\n .accountIndex(0)\n .range(0, 1)\n .get();\n\n console.log(\"address for user X:\", addresses[0]);\n}", "function set_return_shipbilladdress(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country, bill_pobox, ship_pobox) {\n\tif (typeof(window.opener.document.EditView) == 'undefined') {\n\t\tvtlib_setvalue_from_popup(account_id, account_name, 'account_id', 'EditView');\n\t\twindow.close();\n\t\treturn;\n\t}\n\tjQuery.ajax({\n\t\turl : 'index.php?module=Accounts&action=AccountsAjax&file=SelectAccountAddress',\n\t\tcontext : document.body\n\t}).done(function (response) {\n\t\tjQuery('#setaddressaccountdiv').html(response);\n\t\tjQuery('#account_id').val(account_id);\n\t\tjQuery('#account_name').val(account_name);\n\t\tjQuery('#bill_street').val(bill_street);\n\t\tjQuery('#bill_city').val(bill_city);\n\t\tjQuery('#bill_state').val(bill_state);\n\t\tjQuery('#bill_code').val(bill_code);\n\t\tjQuery('#bill_country').val(bill_country);\n\t\tjQuery('#bill_pobox').val(bill_pobox);\n\t\tjQuery('#ship_street').val(ship_street);\n\t\tjQuery('#ship_city').val(ship_city);\n\t\tjQuery('#ship_state').val(ship_state);\n\t\tjQuery('#ship_code').val(ship_code);\n\t\tjQuery('#ship_country').val(ship_country);\n\t\tjQuery('#ship_pobox').val(ship_pobox);\n\t\tif (Application_Popup_Address_Selection == 0) { // set value from application\n\t\t\tsaa_fillinvalues();\n\t\t} else {\n\t\t\tjQuery('#setaddressaccountdiv').show();\n\t\t\tfnvshNrm('setaddressaccountdiv');\n\t\t}\n\t});\n}", "function goto(address){\n document.getElementById('query').value = '';\n mapnav.gotoAddress(address, function(results) {\n var lat = results[0].geometry.location.lat();\n var lng = results[0].geometry.location.lng();\n map.setCenter(results[0].geometry.location);\n\n var thishash = geohash(lat, lng);\n current_position_marker.setOptions({\n position: results[0].geometry.location\n });\n\n updateConsole(lat, lng, results[0].formatted_addres, thishash);\n getPosts(thishash);\n \n });\n}", "function getAddressForDisplayedCode() {\n if (codePendingGeocoding === null) {\n return;\n }\n if (Date.now() - codePendingGeocoding.timestamp_millis < 1000) {\n return;\n }\n code = codePendingGeocoding;\n codePendingGeocoding = null;\n try {\n var recoveryLocation = getRecoveryLocation();\n // Get an address for the neighbourhood, geocode it, and use the location\n // to shorten the code.\n $.when(\n Geocoder.lookupLatLng(\n code.neighbourhoodArea.latitudeCenter,\n code.neighbourhoodArea.longitudeCenter)\n ).then(\n function(lat, lng, address) {\n return Geocoder.geocodeAddress(\n address, recoveryLocation[0], recoveryLocation[1]);\n },\n function(error) {\n InfoBox.fadeToPanel(\n '<span><p class=\"areacode\">' + displayedCode.area_code + '</p>' +\n '<p class=\"shortcode\">' + displayedCode.place_code + '</p></span>');\n }\n ).then(\n function(address, lat, lng) {\n if (address != '' && lat != null && lng != null) {\n var shortCode = shortenDisplayedCode(code, address, lat, lng);\n if (shortCode != null) {\n InfoBox.fadeToPanel(\n '<span><p class=\"address\">' + shortCode + ' ' + address +\n '</p><p class=\"fullcode\">' + code.code + '</p></span>');\n }\n }\n },\n function(error) {\n // If there was an error in the geocodeAddress section, it will be\n // logged there but cause another error here.\n if (typeof error != 'undefined') {\n InfoBox.fadeToPanel(\n '<span><p class=\"areacode\">' + displayedCode.area_code + '</p>' +\n '<p class=\"shortcode\">' + displayedCode.place_code + '</p></span>');\n }\n }\n );\n } catch (e) {\n // This really should not happen.\n }\n}", "function getAddressForDisplayedCode() {\n if (codePendingGeocoding === null) {\n return;\n }\n if (Date.now() - codePendingGeocoding.timestamp_millis < 1000) {\n return;\n }\n code = codePendingGeocoding;\n codePendingGeocoding = null;\n try {\n var recoveryLocation = getRecoveryLocation();\n // Get an address for the neighbourhood, geocode it, and use the location\n // to shorten the code.\n $.when(\n Geocoder.lookupLatLng(\n code.neighbourhoodArea.latitudeCenter,\n code.neighbourhoodArea.longitudeCenter)\n ).then(\n function(lat, lng, address) {\n return Geocoder.geocodeAddress(\n address, recoveryLocation[0], recoveryLocation[1]);\n },\n function(error) {\n InfoBox.fadeToPanel(\n '<span><p class=\"areacode\">' + displayedCode.area_code + '</p>' +\n '<p class=\"shortcode\">' + displayedCode.place_code + '</p></span>');\n }\n ).then(\n function(address, lat, lng) {\n if (address != '' && lat != null && lng != null) {\n var shortCode = shortenDisplayedCode(code, address, lat, lng);\n if (shortCode != null) {\n InfoBox.fadeToPanel(\n '<span><p class=\"address\">' + shortCode + ' ' + address +\n '</p><p class=\"fullcode\">' + code.code + '</p></span>');\n }\n }\n },\n function(error) {\n // If there was an error in the geocodeAddress section, it will be\n // logged there but cause another error here.\n if (typeof error != 'undefined') {\n InfoBox.fadeToPanel(\n '<span><p class=\"areacode\">' + displayedCode.area_code + '</p>' +\n '<p class=\"shortcode\">' + displayedCode.place_code + '</p></span>');\n }\n }\n );\n } catch (e) {\n // This really should not happen.\n }\n}", "static getDerivedStateFromProps (nextProps, prevState) {\n if (nextProps.address !== prevState.address) {\n if (Object.keys(nextProps.address).length > 0) {\n const addressObject = nextProps.address.shipTo;\n const fullAddress = addressObject.address + ' ' + addressObject.city + ', ' + addressObject.state + ' ' + addressObject.zip;\n return { address: fullAddress };\n } else return null;\n }\n else return null;\n }" ]
[ "0.53035456", "0.5300804", "0.5250905", "0.52014977", "0.51555926", "0.514475", "0.51274574", "0.50708115", "0.49832755", "0.49712998", "0.48785564", "0.4850904", "0.48318028", "0.4829284", "0.4823226", "0.47610778", "0.47494188", "0.470453", "0.46989533", "0.46976852", "0.46857646", "0.4684305", "0.46775588", "0.46752214", "0.46470165", "0.46427402", "0.46375763", "0.46358362", "0.4635023", "0.46094894", "0.4608791", "0.4583078", "0.4582057", "0.45660138", "0.4565716", "0.45572814", "0.45558882", "0.45558158", "0.45558158", "0.45558158", "0.45558158", "0.45553625", "0.4551068", "0.45344248", "0.45334864", "0.45246756", "0.4516851", "0.45146286", "0.44987687", "0.44967562", "0.4490152", "0.4489888", "0.4488811", "0.4484255", "0.44762862", "0.44692624", "0.44666994", "0.44640127", "0.4462945", "0.44535834", "0.44485915", "0.44458464", "0.4440999", "0.44409943", "0.44395092", "0.44372436", "0.44133934", "0.44024375", "0.43964216", "0.43962136", "0.43953964", "0.43937254", "0.43930218", "0.43896353", "0.43883595", "0.43836457", "0.43811", "0.4381076", "0.4372879", "0.43713936", "0.43668228", "0.43637562", "0.4361587", "0.43561202", "0.4354216", "0.43476903", "0.43475008", "0.43428874", "0.43391287", "0.4338912", "0.43371183", "0.43367317", "0.4334087", "0.43301216", "0.43252516", "0.43238908", "0.43201414", "0.43198213", "0.43198213", "0.43128443" ]
0.6008617
0
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n // Array of this user's Contacts.\n Contact.belongsTo(models.User, {\n foreignKey: 'user_id'\n });\n Contact.belongsTo(models.User, {\n foreignKey: 'contact_id'\n });\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n // define association here\n Ronda.hasMany(models.Partida,{foreignKey:'IdRonda',as:'partidas'})\n Ronda.belongsTo(models.Torneo,{foreignKey:'IdTorneo',as:'torneos'})\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate(models) {\n Course.belongsTo(models.Category, {\n as: 'category',\n foreignKey: 'id_cat'\n });\n Course.belongsTo(models.User, {\n as: 'author',\n foreignKey: 'author_id'\n });\n Course.belongsToMany(models.User, {\n through: 'FollowedCourses',\n as: 'followers'\n });\n Course.hasMany(models.Article, {\n as: 'exercices',\n foreignKey: 'id_course'\n })\n // define association here\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.deal);\n }" ]
[ "0.7640944", "0.7507814", "0.73126423", "0.7306951", "0.7306951", "0.7306951", "0.72936827", "0.7284587", "0.7278498" ]
0.0
-1
ordinate Capture the position, again depending on client's browser
function captureMousePosition(e) { if(document.layers) { xMousePos = e.pageX; yMousePos = e.pageY; } else if(document.all) { xMousePos = window.event.x + document.body.scrollLeft; yMousePos = window.event.y + document.body.scrollTop; } else if(document.getElementById) { xMousePos = e.pageX; yMousePos = e.pageY; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMousePosition(event) {\n let CTM = damier.getScreenCTM();\n //Si sur mobile\n if(event != undefined && event.touches){\n event = event.touches[0];\n }\n //on transforme la position de la souris (en px, obtenue via CTM) en position en % sur notre damier (car la position d'une case est en %)\n if(event != undefined ) {\n return {\n x: ((event.clientX - CTM.e)*10 / CTM.a)/(parseInt(document.getElementById(\"damier\").style.height)/this.tailleCase),\n y: ((event.clientY - CTM.f)*10 / CTM.d)/(parseInt(document.getElementById(\"damier\").style.height)/this.tailleCase)\n };\n }\n }", "_positionFromMouseEvent(event, element, mouseService) {\n const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return;\n }\n return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };\n }", "function mouseposition (e, dom) {\n var mx, my;\n //if(e.offsetX) {\n // Chrome\n // mx = e.offsetX;\n // my = e.offsetY;\n //} else {\n // Firefox, Safari\n mx = e.pageX - $(dom).offset().left;\n my = e.pageY - $(dom).offset().top;\n //}\n return {'x': parseInt(mx, 10) , 'y': parseInt(my, 10) };\n}", "trackToCoords(_c) {\r\n\t\t\t\tthis.x = _c.x - (SCREEN_WIDTH*0.5)|0;\r\n\t\t\t\tthis.y = _c.y - (SCREEN_HEIGHT*0.5)|0;\r\n\t\t\t}", "function GetCoordinates(e)\n{\n var PosX = 0;\n var PosY = 0;\n var ImgPos;\n var myImg = document.getElementById(\"frame_image\");\n ImgPos = FindPosition(myImg);\n if (!e) var e = window.event;\n if (e.pageX || e.pageY)\n {\n PosX = e.pageX;\n PosY = e.pageY;\n }\n else if (e.clientX || e.clientY)\n {\n PosX = e.clientX + document.body.scrollLeft\n + document.documentElement.scrollLeft;\n PosY = e.clientY + document.body.scrollTop\n + document.documentElement.scrollTop;\n }\n PosX = PosX - ImgPos[0];\n PosY = PosY - ImgPos[1];\n\n document.getElementById(\"x_hori\").innerHTML = \" \" + ((PosX / myImg.width) * 100).toFixed(2);\n document.getElementById(\"y_hori\").innerHTML = \" \" + ((PosY / myImg.height) * 100).toFixed(2);\n \n}", "function getRealPosition( index ) {\n var stage = app.getDrawStage();\n return { 'x': stage.offset().x + index.x / stage.scale().x,\n 'y': stage.offset().y + index.y / stage.scale().y };\n }", "_computePositionOnScreen(position, result) {\n return SceneTransforms.wgs84ToWindowCoordinates(this.scene, position, result);\n }", "function getRelativePosition(e, el) {\n div = document.getElementById(\"scene\");\n dim = div.getBoundingClientRect();\n x = Math.floor( ((e.clientX - dim.left) / pw) / level);\n y = Math.floor(((e.clientY - dim.top) / pw) / level);\n}", "function coordinates(){\n $('.info-top').html(posY);\n $('.info-left').html(posX);\n }", "function controllo_posizione(loc)\n{\n\t/*var body = document.body;\n\tvar width = body.offsetWidth;\n\tvar heigth = body.offsetHeight;\t/*\n\ty -> 0 e 981\n\tx -> 0 e 910\n\t*/\n\t//console.log( \"Altezza: \" + heigth + \"; Larghezza: \" + width+\";\");\n\tvar body = $(\"body\");\n\tvar width = body.width();\n\tvar heigth = body.height();\n\t//console.log(width+\"-\"+heigth);\n\n\tif(loc==\"x\")\n\t{\n\t\tif(x<1)\n\t\t\treturn x=1;\n\t\tif(x>width)\n\t\t{\n\t\t\tx=width-1;\n\t\t\treturn x;\n\t\t}\n\t}\n\n\tif(loc==\"y\")\n\t{\t\n\t\tif(y<1)\n\t\t\treturn y=1;\n\t\tif(y>heigth)\n\t\t{\n\t\t\ty=heigth-1;\n\t\t\treturn y;\n\t\t}\n\t}\n\n}", "function trackPosition(e) {\n mouse.x = e.pageX;\n mouse.y = e.pageY;\n}", "function setPosition ( e ) {\n // pos.x = e.clientX;\n // pos.y = e.clientY;\n pos.x = e.offsetX;\n pos.y = e.offsetY;\n }", "getElementOffset() {\n const rect = this.boardRef.getBoundingClientRect();\n const doc = document.documentElement;\n\n return {\n x: rect.left + window.pageXOffset - doc.clientLeft,\n y: rect.top + window.pageYOffset - doc.clientTop\n };\n }", "function trackPosition(e) {\n\tmouse.x = e.pageX;//-225; 559\n\tmouse.y = e.pageY;\n\t// if( usuario_id !== -1 && over == 0)\n\t// \tsocket.emit('sendPositionCursor',{usuario:usuario_id,x:mouse.x});\n\tif( usuario_id !== -1 && over == 0){\n\t\tp = paddles[usuario_id]; //1\n\t\tp.x = mouse.x - p.w/2;\t\t\n\t\tsocket.emit('sendPositionCursor',{usuario:usuario_id,x:p.x});\n\t}\n}", "function pos() {\r\n var p = _pfa(arguments);\r\n\r\n if (p) {\r\n self.moveTo(p.x, p.y);\r\n }\r\n\r\n return new Pos(ie ? self.screenLeft : self.screenX,\r\n ie ? self.screenTop : self.screenY);\r\n}", "function getMousePosition(e)\r\n{\r\n // Recherche de la position\r\n if (nava)\r\n {\r\n mouseX = e.pageX ;\r\n mouseY = e.pageY ;\r\n }\r\n else if (iex)\r\n {\r\n mouseX = window.event.x + document.body.scrollLeft;\r\n mouseY = window.event.y + document.body.scrollTop;\r\n }\r\n else if (dom)\r\n {\r\n mouseX = e.pageX ;\r\n mouseY = e.pageY ;\r\n }\r\n // FIN Recherche de la position\r\n\r\n // Leger decalage pour ne pas rester sous le pointeur de la souris\r\n mouseX += 20;\r\n \r\n\r\n // Car on ne sait jamais...\r\n if (mouseX < 0) mouseX = 0;\r\n if (mouseY < 0) mouseY = 0;\r\n\r\n // Deplacement du DIV d'information\r\n //var style = $('info_div').getStyle();\r\n //style.left = mouseX+\"px\";\r\n //style.top = mouseY+\"px\";\r\n $('info_div').setStyle({left:mouseX+\"px\",top:mouseY+\"px\"});\r\n\r\n return true;\r\n}", "function getPosition(_ref3) {\n var width = _ref3.width,\n height = _ref3.height;\n\n\n var x = 0;\n var y = 0;\n\n if (width) {\n if (window.outerWidth) {\n x = Math.round((window.outerWidth - width) / 2) + window.screenX;\n } else if (window.screen.width) {\n x = Math.round((window.screen.width - width) / 2);\n }\n }\n\n if (height) {\n if (window.outerHeight) {\n y = Math.round((window.outerHeight - height) / 2) + window.screenY;\n } else if (window.screen.height) {\n y = Math.round((window.screen.height - height) / 2);\n }\n }\n\n return { x: x, y: y };\n}", "function trackPosition(e) {\n\tmouse.x = e.pageX;\n\tmouse.y = e.pageY;\n}", "function ia(e,t,a){if(\"div\"==a)return t;var n=t.left,r=t.top;\n // First move into \"page\" coordinate system\n if(\"page\"==a)n-=na(),r-=ra();else if(\"local\"==a||!a){var f=e.display.sizer.getBoundingClientRect();n+=f.left,r+=f.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:n-o.left,top:r-o.top}}", "function getPosition(e) { \n restbound = 0.03;\n restime = 6500;\n fire =true;\n mouseX = e.x - canvas.offsetLeft;\n mouseY = e.y - canvas.offsetTop;\n chat.server.send(mouseX / W, mouseY / H);\n push = true; \n }", "function setPosition(e) {\n var rect = canvas.getBoundingClientRect();\n pos.x = e.clientX - rect.left;\n pos.y = e.clientY - rect.top;\n }", "function getCurPos() {\n let xPos = event.offsetX;\n let yPos = event.offsetY;\n //for each selected==true ? card chang its position : nothing\n player.cards.onHand.forEach(element => {\n if (element.selected) {\n element.speaking = false;\n let distanceX = element.width / 2;\n let distanceY = element.height / 2;\n element.x = xPos - distanceX;\n element.y = yPos - distanceY;\n }\n });\n}", "function showCoords(event) {\n var x = event.screenX; //Applies to the entire screen\n var y = event.screenY; //Applies to the entire screen\n // var x = event.clientX; //Applies to a Div or HTML element\n // var y = event.clientY; //Applies to a Div or HTML element\n console.log(x,y);\n return x,y;\n}", "function adapt_mouse_pos_for_trackball(evt) {\n var canvas_pos = viewport_offset_for_element(canvas);\n return {\n x: evt.clientX - canvas_pos.x - CANVAS_SIZE / 2,\n y: evt.clientY - canvas_pos.y - CANVAS_SIZE / 2\n };\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "function tellPos(p) {\n // console.log(\"Position X : \" + p.pageX + \"<br />Position Y : \" + p.pageY);\n send_http_data({\n url: \"https://genesis-ai-test.herokuapp.com/data_post_test/\",\n data: {\n timestamp: find_timestamp(),\n session_id : session_id,\n mouse_x: p.pageX,\n mouse_y: p.pageY,\n mouse_button : p.button,\n mouse_region : p.region,\n mouse_rel_x : p.clientX,\n mouse_rel_y : p.clientY, \n },\n });\n}", "getAbsolutePosition(size) {\n if (this.position !== undefined) {\n if (this.unitMode === 'Absolute') {\n return this.position;\n }\n else {\n return {\n x: this.position.x * size.width, y: this.position.y * size.height\n };\n }\n }\n return undefined;\n }", "function getPosition(ev) {\n\tev = ev || window.event;\n\tev.preventDefault();\n\tpos3 = ev.clientX;\n\tpos4 = ev.clientY;\n\tdocument.onmouseup = resetPosition;\n\tdocument.onmousemove = updatePosition;\n}", "function Position_GetPosition(html)\n{\n\t//done!\n\treturn new Position_Rect(Browser_GetLeft(html), Browser_GetTop(html), Browser_GetOffsetWidth(html), Browser_GetOffsetHeight(html));\n}", "getElementsOffset() {\n const rect = this.boardRef.getBoudingClientRect();\n const doc = document.documentElement;\n\n return {\n x: (rect.left + window.pageXOffset) - doc.clientLeft,\n y: (rect.top + window.pageYOffset) - doc.clientTop,\n };\n }", "function getPosition() {\n let position = document.getElementById(getyx(y,x));\n\treturn position;\n}", "function $RHc5$export$getPosition(evt) {\n var data = $z4uS$export$getPointerData(evt);\n return {\n x: data.clientX,\n y: data.clientY\n };\n}", "function getCoords(elem){\n let box = elem.getBoundingClientRect();\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset,\n width: box.width\n }\n }", "function getCoords(elem){\n let box = elem.getBoundingClientRect();\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset,\n width: box.width\n }\n }", "function getPosition(_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n var x = 0;\n var y = 0;\n\n if (width) {\n if (window.outerWidth) {\n x = Math.round((window.outerWidth - width) / 2) + window.screenX;\n } else if (window.screen.width) {\n x = Math.round((window.screen.width - width) / 2);\n }\n }\n\n if (height) {\n if (window.outerHeight) {\n y = Math.round((window.outerHeight - height) / 2) + window.screenY;\n } else if (window.screen.height) {\n y = Math.round((window.screen.height - height) / 2);\n }\n }\n\n return {\n x: x,\n y: y\n };\n}", "function showPosition() {\n var s = 'X=' + window.event.clientX + ' Y=' + window.event.clientY;\n\n alert(s);\n\n\n}", "function getMousePos(event) {\n var e = event || window.event;\n var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\n var scrollY = document.documentElement.scrollTop || document.body.scrollTop;\n var x = e.pageX || e.clientX + scrollX;\n var y = e.pageY || e.clientY + scrollY;\n //alert('x: ' + x + '\\ny: ' + y);\n var intElemClientWidth = document.body.clientWidth;\n var intElemClientHeight = document.body.clientHeight;\n console.log(intElemClientWidth,intElemClientHeight,x,y);\n\n\n player.selectCharacter(intElemClientWidth,intElemClientHeight,x,y);\n return { 'x': x, 'y': y };\n}", "function mousePos(e) {\n const rect = canvas.getBoundingClientRect();\n return new mapboxgl.Point(\n e.clientX - rect.left - canvas.clientLeft,\n e.clientY - rect.top - canvas.clientTop\n );\n }", "calculateMousePos(evt) {\n let rect = this.canvasEl.getBoundingClientRect();\n let root = document.documentElement;\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n return {\n x: mouseX,\n y: mouseY\n };\n }", "currentPointerPosition(e) {\n const [x, y] = Mouse.rel(e);\n return this.positionToSequence({\n xPos: x,\n yPos: y,\n });\n }", "_mousePosition(event)\n {\n // Used to get the absolute size\n let rect = this.parent.getBoundingClientRect();\n \n /* relationship bitmap vs element for X/Y */\n \n // Gets the x scale\n let scaleX = this.parent.width / rect.width;\n \n // Gets the y scale\n let scaleY = this.parent.height / rect.height;\n \n \n // Returns two possible values\n return {\n // Mouse x position after taking into account the size/position of canvas and scale\n x: (event.clientX - rect.left) * scaleX,\n \n // Mouse y position after taking into account the size/position of canvas and scale\n y: (event.clientY - rect.top) * scaleY\n \n };\n \n }", "function setPosition(e) {\n pos.x = e.clientX + 10 ;\n pos.y = e.clientY + 50;\n}", "toScreen() \t{return new Point(gMap.mapToScreenX(this._x,this._y),gMap.mapToScreenY(this._x,this._y));}", "function getCoordinate(e, $obj){\n var e = e || window.event;\n // get X relative to dom\n var positionX = e.pageX - $obj.offset().left;\n // get X relative to dom\n var positionY = e.pageY - $obj.offset().top;\n // console.info(positionX + ' ' + positionY);\n return {x: positionX, y: positionY};\n }", "function convertToRenderedPosition(modelPosition) {\n var pan = cy.pan();\n var zoom = cy.zoom();\n\n var x = modelPosition.x * zoom + pan.x;\n var y = modelPosition.y * zoom + pan.y;\n\n return {\n x: x,\n y: y\n };\n }", "function mousePos(event){\r\n //sets mouse coords in relation to the html page\r\n var x, y;\r\n\r\n if (event.pageX || event.pageY){\r\n x = event.pageX;\r\n y = event.pageY;\r\n } else if (event.clientX || event.clientY) { //supports firefox browser\r\n x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\r\n y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;\r\n }\r\n var offset = $(\"#grid\").offset();\r\n\r\n x = Math.floor((x - offset.left) / 10);\r\n y = Math.floor((y - offset.top) / 10);\r\n\r\n return [x, y];\r\n }", "function windowToCavasCoordinates(canvas, x, y) {\n var boundingBox = canvas.getBoundingClientRect();\n\n return {x: x - boundingBox.left * (canvas.width / boundingBox.width),\n y: y - boundingBox.top * (canvas.height / boundingBox.height)};\n}", "function setPosition(e) {\r\n pos.x = e.clientX;\r\n pos.y = e.clientY;\r\n}", "function getCoords(ev) {\n var x, y, w, h, el;\n // ignore browsers without pageX for now\n if (ev.pageX == null)\n return;\n x = ev.pageX;\n y = ev.pageY;\n el = self.element;\n // should probably check offsetParent\n // but this is more portable\n while (el && el !== self.document.documentElement) {\n x -= el.offsetLeft;\n y -= el.offsetTop;\n el = 'offsetParent' in el\n ? el.offsetParent\n : el.parentNode;\n }\n // convert to cols/rows\n w = self.element.clientWidth;\n h = self.element.clientHeight;\n x = Math.ceil((x / w) * self.cols);\n y = Math.ceil((y / h) * self.rows);\n // be sure to avoid sending\n // bad positions to the program\n if (x < 0)\n x = 0;\n if (x > self.cols)\n x = self.cols;\n if (y < 0)\n y = 0;\n if (y > self.rows)\n y = self.rows;\n // xterm sends raw bytes and\n // starts at 32 (SP) for each.\n x += 32;\n y += 32;\n return {\n x: x,\n y: y,\n type: 'wheel'\n };\n }", "function getPos(e) {\n var r = canvas.getBoundingClientRect();\n return { x: e.clientX - r.left, y: e.clientY - r.top };\n }", "function getPosition(e) {\n var rect = e.target.getBoundingClientRect();\n var x = e.clientX - rect.left;\n var y = e.clientY - rect.top;\n console.log(x, y);\n return {\n x,\n y,\n };\n}", "function getPosition( evt, canvas ) {\n\n\t\tvar rect = canvas.getBoundingClientRect();\n\n\t\tvar scaleX = canvas.width / rect.width;\n\t\tvar scaleY = canvas.height / rect.height;\n\n\t\treturn {\n\t\t\tx: ( evt.clientX - rect.left ) * scaleX,\n\t\t\ty: ( evt.clientY - rect.top ) * scaleY\n\t\t};\n\t}", "function getMousePosition(evt) {\n let CTM = svgPlace.getScreenCTM();\n //for mobile, if multiple touches take the first one only\n if (evt.touches) { evt = evt.touches[0]; }\n return {\n x: (evt.clientX - CTM.e) / CTM.a,\n y: (evt.clientY - CTM.f) / CTM.d\n };\n}", "function getCoords(e) {\t\t\n\t\treturn { x: e.pageX - theCanvas.offsetLeft, y: e.pageY - theCanvas.offsetTop };\n\t }", "function getPointForPosition(xscreen, yscreen) {\n // figure out the ratio of mouse position to the canvas, for x and y\n var xratio = xscreen / targetWidth;\n var yratio = yscreen / targetHeight;\n var x,y;\n if (fractalType==BURNING_SHIP) {\n // this is rendered so that x and y axis are mirrored\n x = xmax - (xmax - xmin) * xratio;\n y = ymin + (ymax - ymin) * yratio;\n } else {\n x = xmin + (xmax - xmin) * xratio;\n y = ymax - (ymax - ymin) * yratio;\n }\n return new Point(x, y);\n}", "function getCoords(elem) {\r\n var box = elem.getBoundingClientRect();\r\n return {\r\n top: box.top + pageYOffset,\r\n left: box.left + pageXOffset\r\n };\r\n }", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "getCursorPosition(event=window.event) {\n let x = event.clientX - this.containerDomElement.offsetLeft;\n let y = event.clientY - this.containerDomElement.offsetTop;\n return new Point(x, y);\n }", "function getMousePosition(){\n\t\t\t$(\"canvas\").mousemove(function(event){\n\t\t\t\tvar canvasOffsetX = $(this).position().left;\n\t\t\t\tvar canvasOffsetY = $(this).position().top;\n\n\n\n\t\t\t\tvar posX = Math.floor(event.pageX - canvasOffsetX);\n\t\t\t\tvar posY = Math.floor(event.pageY - canvasOffsetY);\n\n\t\t\t\t//TODO: every 0.5 - 1.0s, push this into a data structure to prep for time-series graph\n\t\t\t\t//NOTE: here would be a potentially good location to add plotly functionality \n\t\t\t\t// console.log(posX, posY);\n\t\t\t\tpositionTracker.pos_x = posX;\n\t\t\t\tpositionTracker.pos_y = posY;\n\t\t\t\t// console.log(res, canvasOffsetX, canvasOffsetY);\n\n\t\t\t});\n\t\t}", "function fromCoordSystem(cm, coords, context) {\n\t\t if (context == \"div\") return coords;\n\t\t var left = coords.left, top = coords.top;\n\t\t // First move into \"page\" coordinate system\n\t\t if (context == \"page\") {\n\t\t left -= pageScrollX();\n\t\t top -= pageScrollY();\n\t\t } else if (context == \"local\" || !context) {\n\t\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t\t left += localBox.left;\n\t\t top += localBox.top;\n\t\t }\n\t\t\n\t\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n\t\t }", "initializeViewerPosition() {\n this.viewportFollow = this.gameClient.playerInfo.playerID;\n const coord = this.gameState.getPlayer(this.viewportFollow).mapCoord;\n this.setViewerPosition(coord, 0.5, 0.5);\n }", "function Browser_GetClientCoordinates(event)\n{\n\t//create and return a point\n\tvar point = { x: 0, y: 0 };\n\t//has touch?\n\tif (window.__BROWSER_IS_TOUCH_ENABLED && event.targetTouches && event.targetTouches.length > 0)\n\t{\n\t\t//set points as per touch\n\t\tpoint.x = event.targetTouches[0].clientX;\n\t\tpoint.y = event.targetTouches[0].clientY;\n\t}\n\telse\n\t{\n\t\t//set directly\n\t\tpoint.x = event.clientX;\n\t\tpoint.y = event.clientY;\n\t}\n\n\tvar target = Browser_GetEventSourceElement(event);\n\tif (target)\n\t{\n\t\tvar iFrame = Get_FrameElement(target);\n\t\tif (iFrame)\n\t\t{\n\t\t\tvar rect = Position_GetDisplayRect(iFrame);\n\t\t\tpoint.x = point.x * __SIMULATOR.Scale + rect.left;\n\t\t\tpoint.y = point.y * __SIMULATOR.Scale + rect.top;\n\t\t}\n\t}\n\n\t//return our point\n\treturn point;\n}", "function getCursorPosition(e) {\n\tvar x, y;\n\tif ( event.offsetX == null ) {\t// Firefox\n\t x = event.originalEvent.layerX;\n\t y = event.originalEvent.layerY;\n\t}\n\telse {\t// Other browsers\n\t x = event.offsetX;\n\t y = event.offsetY;\n\t}\n\treturn [x, y];\n}", "function getGPS(event) {\r\n var x = event.clientX - canvas.getBoundingClientRect().left,\r\n y = event.clientY - canvas.getBoundingClientRect().top;\r\n\r\n return { x: x, y: y };\r\n}", "function getXBrowserMouseOrigin(jqelement, event) {\r\n var offsetX;\r\n ///if (!event.offsetX)\r\n offsetX = event.pageX - jqelement[0].offsetLeft;\r\n //else\r\n // offsetX = event.offsetX;\r\n\r\n var offsetY;\r\n //if (!event.offsetY)\r\n offsetY = event.pageY - jqelement[0].offsetTop;\r\n //else\r\n // offsetY = event.offsetY;\r\n\r\n return {\r\n x: offsetX,\r\n y: offsetY\r\n };\r\n}", "function Jt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ge(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*n,bottom:t.bottom*n}}", "function drawGps() {\r\n var posX = dragStartLoc.x;\r\n var posY = dragStartLoc.y;\r\n document.getElementById('x-value').innerHTML = Math.floor(posX);\r\n document.getElementById('y-value').innerHTML = Math.floor(posY);\r\n\r\n}", "function pixelCoordinate(body){\n var result = {};\n result.x = body.state.pos.x + Globals.translation.x;\n result.y = body.state.pos.y - Globals.translation.y;\n return result;\n}", "function mouseCoordinates(e){\n\n var horizontalPosition = windowWidth - e.clientX - 26;\n var verticalPosition = windowHeight - e.clientY - 26;\n\n CIRCLE.style.left = horizontalPosition + 'px';\n CIRCLE.style.top = verticalPosition + 'px';\n\n}", "function Browser_GetScreenCoordinates(event)\n{\n\t//create and return a point\n\tvar point = { x: 0, y: 0 };\n\t//has touch?\n\tif (window.__BROWSER_IS_TOUCH_ENABLED && event.targetTouches && event.targetTouches.length > 0)\n\t{\n\t\t//set points as per touch\n\t\tpoint.x = event.targetTouches[0].screenX;\n\t\tpoint.y = event.targetTouches[0].screenY;\n\t}\n\telse\n\t{\n\t\t//set directly\n\t\tpoint.x = event.screenX;\n\t\tpoint.y = event.screenY;\n\t}\n\t//return our point\n\treturn point;\n}", "function getMouseXY(e) {\n if (IE) { // grab the x-y pos.s if IE\n mouse_x = event.clientX + document.body.scrollLeft;\n mouse_y = event.clientY + document.body.scrollTop;\n } else { // grab the x-y pos.s if NS\n mouse_x = e.pageX;\n mouse_y = e.pageY - miraObject.clientHeight/2;\n } \n // catch possiblpixelsScrollede negative values in NS4\n if (mouse_x < 0){mouse_x = 0}\n if (mouse_y < 0){ mouse_y = 0}\n \n if(!isScrolling && !isTouch){\n miraObject.style.top = mouse_y + miraObject.clientHeight/2 + \"px\";\n miraObject.style.left = mouse_x + \"px\";\n }\n $(\"#miraDentro\").addClass(\"miraCenterAnim\");\n $(\"#xCoordInfo\").html(mouse_x);\n $(\"#yCoordInfo\").html(mouse_y-pixelsScrolled+miraObject.clientHeight/2);\n \n setTimeout(function(){$(\"#miraDentro\").removeClass(\"miraCenterAnim\")},1700)\n\n return true;\n }", "getOffsetMousePosition(e) {\n const trackerRect = this.map;\n const offset = getElementOffset(trackerRect);\n const x = e.pageX - offset.left;\n const y = e.pageY - offset.top;\n return { x: Math.round(x), y: Math.round(y) };\n }", "get_position() {\r\n return {\r\n x_pos: this.sprite.x_pos,\r\n y_pos: this.sprite.y_pos\r\n };\r\n }", "function ubicar(event){\n var posicion = {\n x : event.clientX,\n y : event.clientY\n };\n return posicion;\n }", "function getCoords(el) {\n\t \tvar box = el.getBoundingClientRect(),\n\t \tdoc = el.ownerDocument,\n\t \tbody = doc.body,\n\t \thtml = doc.documentElement,\n\t \tclientTop = html.clientTop || body.clientTop || 0,\n\t \tclientLeft = html.clientLeft || body.clientLeft || 0,\n\t \ttop = box.top + (self.pageYOffset || html.scrollTop || body.scrollTop) - clientTop,\n\t \tleft = box.left + (self.pageXOffset || html.scrollLeft || body.scrollLeft) - clientLeft\n\t \t\treturn {\n\t \t\t'top' : top,\n\t \t\t'left' : left\n\t \t};\n\t }", "getLocalCoords(elem, ev) {\n let ox = 0, oy = 0;\n let first;\n let pageX, pageY;\n\n // Walk back up the tree to calculate the total page offset of the\n // currentTarget element. I can't tell you how happy this makes me.\n // Really.\n while (elem !== null) {\n ox += elem.offsetLeft;\n oy += elem.offsetTop;\n elem = elem.offsetParent;\n }\n\n if ('changedTouches' in ev) {\n first = ev.changedTouches[0];\n pageX = first.pageX;\n pageY = first.pageY;\n } else {\n pageX = ev.pageX;\n pageY = ev.pageY;\n }\n\n return { 'x': pageX - ox, 'y': pageY - oy };\n }", "function getMousePosition(evt) {\n\t\tvar CTM=svg.getScreenCTM();\n\t\t/*no multi-touch weirdness*/ if (evt.touches) {evt = evt.touches[0];}\n\t\treturn {\n\t\t\tx: (evt.clientX - CTM.e) / CTM.a,\n\t\t\t/*y: (evt.clientY - CTM.f) / CTM.d*/\n\t\t};\n\t}", "static getPageCoords(e) {\n const coords = {}\n if (e.touches) {\n coords.x = e.touches[0].pageX\n coords.y = e.touches[0].pageY\n } else {\n coords.x = e.clientX\n coords.y = e.clientY\n }\n return coords\n }", "function getCoords(event){\n // size is where the canvas is in the page\n var size = canvas.getBoundingClientRect();\n /* clientX/Y are the pixel positions of mouse in page\n For horizontal/x, minus the left offset to get back to 0\n e.g. mouse pos in page is 10,0 while in top left corner of canvas\n We want it at 0,0 (pos in canvas, not page),\n so we minus the gap between page left and canvas start\n which here would be 10 */\n x = (event.clientX - size.left);\n y = (event.clientY - size.top);\n}", "function getCoordinates(el) {\n\txCor = (el.getBoundingClientRect()).x;\n\tyCor = (el.getBoundingClientRect()).y;\n\tCoor = [(xCor + window.scrollX), (yCor + window.scrollY)];\n\tconsole.log(Coor);\n\tconsole.log(el.getBoundingClientRect());\n\treturn Coor;\n}", "function DIF_getEventPosition(evt) {\n var pos = new Object();\n pos.x = 0;\n pos.y = 0;\n if (!evt) {\n evt = window.event;\n }\n if (typeof (evt.pageX) == 'number') {\n pos.x = evt.pageX;\n pos.y = evt.pageY;\n }\n else {\n pos.x = evt.clientX;\n pos.y = evt.clientY;\n if (!top.opera) {\n if ((!window.document.compatMode) || (window.document.compatMode == 'BackCompat')) {\n pos.x += window.document.body.scrollLeft;\n pos.y += window.document.body.scrollTop;\n }\n else {\n pos.x += window.document.documentElement.scrollLeft;\n pos.y += window.document.documentElement.scrollTop;\n }\n }\n }\n return pos;\n}", "function getMouseXY(e) {\r\ntry\r\n{\r\n if (IE) { // grab the x-y pos.s if browser is IE\r\n tempX = event.clientX + document.body.scrollLeft\r\n tempY = event.clientY + document.body.scrollTop\r\n } else { // grab the x-y pos.s if browser is NS\r\n tempX = e.pageX\r\n tempY = e.pageY\r\n } \r\n // catch possible negative values in NS4\r\n if (tempX < 0){tempX = 0}\r\n if (tempY < 0){tempY = 0} \r\n }\r\n catch(e){}\r\n // show the position values in the form named Show\r\n // in the text fields named MouseX and MouseY\r\n if (el('left') && el('top'))\r\n {\r\n \tel('left').value = tempX;\r\n \tel('top').value = tempY;\t\r\n }\r\n \r\n return true;\r\n}", "function getCoords(e) {\n if (e.offsetX) {\n // Works in Chrome / Safari (except on iPad/iPhone)\n return { x: e.offsetX, y: e.offsetY };\n }\n else if (e.layerX) {\n // Works in Firefox\n return { x: e.layerX, y: e.layerY };\n }\n else {\n // Works in Safari on iPad/iPhone\n return { x: e.pageX - findPos(_c.canvasElement).left, y: e.pageY - findPos(_c.canvasElement).top };\n }\n }", "function MousePos(event) {\n\t\tvar p = svg.createSVGPoint();\n\t\tp.x = event.clientX;\n\t\tp.y = event.clientY;\n\t\tvar matrix = svg.getScreenCTM();\n\t\tp = p.matrixTransform(matrix.inverse());\n\t\treturn {\n\t\t\tx: p.x,\n\t\t\ty: p.y\n\t\t}\n}", "function viewPositionMetrics(){\n\t\t\t\t$(\"canvas\").mousedown(function(event){\n\t\t\t\t\tvar canvasOffsetX = $(this).position().left;\n\t\t\t\t\tvar canvasOffsetY = $(this).position().top;\n\n\t\t\t\t\tvar clickedX = Math.floor(event.pageX - canvasOffsetX);\n\t\t\t\t\tvar clickedY = Math.floor(event.pageY - canvasOffsetY);\n\t\t\t\t\tconsole.log(clickedX, clickedY);\n\t\t\t\t\tswitch (event.which){\n\t\t\t\t\t\tcase 1: \n\t\t\t\t\t\t\t//co-ords from click listener are able to progress the game\n\t\t\t\t\t\t\tif(!isGameOver){\n\t\t\t\t\t\t\t\tstartRound(clickedX, clickedY); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\tcase 3: \n\t\t\t\t\t\t\tif(!isGameOver){\n\t\t\t\t\t\t\t\tplaceFlag(clickedX, clickedY);\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\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\talert(\"error, something seems to be wrong..\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}", "getPosition(pos) {\n //getBoundingClientRect() renvoie la taille du canvas et sa position par rapport au viewport.\n const canvas = this.canvas.getBoundingClientRect();\n const x = (pos.x - canvas.left) / (canvas.right - canvas.left) * this.canvas.width; //récupère la position exacte de la souris (position X)\n const y = (pos.y - canvas.top) / (canvas.bottom - canvas.top) * this.canvas.height;\n return {\n x,\n y\n };\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function getPosition(e) {\r\n\tvar left = 0;\r\n\tvar top = 0;\r\n\r\n\twhile (e.offsetParent){\r\n\t\tleft += e.offsetLeft;\r\n\t\ttop += e.offsetTop;\r\n\t\te = e.offsetParent;\r\n\t}\r\n\r\n\tleft += e.offsetLeft;\r\n\ttop += e.offsetTop;\r\n\r\n\treturn {x:left, y:top};\r\n}", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "function mouse_coords(evt) {\r\n\tlet t = evt.currentTarget;\r\n\tlet x = evt.clientX - t.clientLeft - t.getBoundingClientRect().left + t.scrollLeft;\r\n\tlet y = evt.clientY - t.clientTop - t.getBoundingClientRect().top + t.scrollTop;\r\n\tx = 2*(x/t.width) - 1;\r\n\ty = 1 - 2*(y/t.height);\r\n\treturn vec2(x, y);\r\n}", "getCanvasRelativePosition(event) {\n const rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n };\n }" ]
[ "0.708026", "0.67051363", "0.6700206", "0.66628206", "0.663844", "0.6632078", "0.66249824", "0.66219914", "0.66059685", "0.6593351", "0.6574394", "0.6571737", "0.6571329", "0.650686", "0.6501473", "0.648355", "0.6469135", "0.64642197", "0.6462404", "0.64610213", "0.6459249", "0.64375556", "0.64330876", "0.6422142", "0.6416998", "0.6401626", "0.6377905", "0.6374637", "0.63739383", "0.6364555", "0.6352782", "0.6349833", "0.63442415", "0.63442415", "0.63355637", "0.6333115", "0.63322407", "0.63298243", "0.6328153", "0.6322148", "0.6317576", "0.631457", "0.63110435", "0.63032615", "0.62947285", "0.6293869", "0.62924093", "0.6288842", "0.6285312", "0.6283946", "0.62816554", "0.6281599", "0.62780154", "0.62755895", "0.62623084", "0.6262283", "0.62502116", "0.62502116", "0.62502116", "0.62455654", "0.62454814", "0.62349916", "0.6234826", "0.62291515", "0.6219373", "0.62161916", "0.6211996", "0.6207424", "0.6203282", "0.6194303", "0.6193359", "0.6190525", "0.61898327", "0.6188792", "0.61804074", "0.6180133", "0.6180091", "0.6179874", "0.61780894", "0.6176994", "0.61760235", "0.61744857", "0.61691874", "0.61667395", "0.61600125", "0.6151595", "0.61481094", "0.614795", "0.6140925", "0.6140925", "0.6140925", "0.6140925", "0.6140925", "0.6140925", "0.6140925", "0.6140925", "0.6136586", "0.61335456", "0.6131437", "0.61186355" ]
0.65903556
10